%@page import="com.plumtree.remote.prc.IRemoteSession, com.plumtree.remote.prc.RemoteSessionFactory, com.plumtree.remote.prc.collaboration.*,com.plumtree.remote.prc.collaboration.project.*, com.plumtree.remote.portlet.*,java.util.*,java.text.*" %> <%! //gets the project manager private IProjectManager getProjectManager(HttpServletRequest req, HttpServletResponse res, JspWriter pout) throws Exception { IProjectManager projectManager = null; IPortletContext portletContext = PortletContextFactory.createPortletContext(req, res); IPortletRequest portletRequest = portletContext.getRequest(); String loginToken = portletRequest.getLoginToken(); if (null == loginToken) { pout.println("Unable to retrieve the login token. Confirm that the login token has been checked in the Advanced Settings page of the Web Service."); } //get the remote session com.plumtree.remote.prc.IRemoteSession portalSession = portletContext.getRemotePortalSession(); //get a collab factory and a project manager ICollaborationFactory collabFactory = portalSession.getCollaborationFactory(); projectManager = collabFactory.getProjectManager(); return projectManager; } %> <% //booleans for create, remove and search boolean create = false; boolean remove = false; boolean search = false; //optional name and description for create String name = request.getParameter("name"); String description = request.getParameter("description"); //project id required for remove int projectID = -1; //search text required for search String searchText = request.getParameter("searchText"); //determine which option we are using- create, remove, or search. String select = request.getParameter("projectMethod"); if (null != select) { if (select.equals("create")) { create = true; } else if (select.equals("remove")) { remove = true; } else if (select.equals("search")) { search = true; } } //if any of these is true, set hosted display mode if (create || remove || search) { IPortletContext portletContext = PortletContextFactory.createPortletContext(request, response); IPortletResponse portletResponse = portletContext.getResponse(); portletResponse.setHostedDisplayMode(HostedDisplayMode.Hosted); } //see if we have a project id- if so, convert it to an int. String strProjectID = request.getParameter("projectID"); if (null != strProjectID) { try { projectID = Integer.parseInt(strProjectID); } catch (Exception e) { out.println("Unable to parse projectID of " + strProjectID); } } %>