To search for collaboration projects by name from a remote application, use the IProjectManager interface in the IDK.
Search Text (Name) | Sets the string that will be used to search project names. If you do not set a search string, all projects will be returned. The name search string is case-insensitive by default; all projects will be returned that contain the text using the form *text*. |
Maximum Results | Sets the maximum number of results returned. The default is to return all results. |
Order-By Fields and Sort Order | Sets the fields to be displayed with an order-by functionality (name or last modified date) and sets the sort order (ascending or descending). |
Security | Enables or disables the security filter that applies security to the result set with respect to the user that submitted the query. If the filter is enabled, the query result will only include objects for which the querying user has appropriate permission. The default is false (disabled); all objects matching the query criteria will be returned. |
Result Filter: Project Type | Limits the query to those projects for which the current user is a project leader, or extend the search to all projects. For details on project roles, see Managing Collaboration Project Roles Using the IDK Remote API. |
Java
... //perform the search IProjectManager projectManager = getProjectManager(request, response, out); IProjectFilter projectFilter = projectManager.createProjectFilter(); //hard-code the max results to 10 projectFilter.setMaximumResults(10); //set the query projectFilter.setNameSearchText(searchText); //execute the search and print out the results IProject[] projects = projectManager.queryProjects(projectFilter); if (projects.length > 0) { %> <table> <tr> <td> Search Results </td> </tr> <tr> <td> Project Name </td> <td> Project ID </td> </tr> <% for (int i = 0; i < projects.length; i++) { IProject project = projects[i]; %> <tr> <td> <%out.println(project.getName());%> </td> <td> <%out.println(project.getID());%> </td> </tr> <% } } else { %> <tr> <td colspan="2"> <%out.println("No projects found using search query of " + searchText);%> </td> </tr> </table> ...
.NET (C#)
... //perform the search Plumtree.Remote.PRC.Collaboration.Project.IProjectManager projectManager = GetProjectManager(Request, Response); Plumtree.Remote.PRC.Collaboration.Project.IProjectFilter projectFilter = projectManager.CreateProjectFilter(); //hard-code the max results to 10 projectFilter.MaximumResults = 10; //set the query projectFilter.NameSearchText = searchText; //execute the search and print out the results Plumtree.Remote.PRC.Collaboration.Project.IProject[] projects = projectManager.QueryProjects(projectFilter); if (projects.Length > 0) { %> <table> <tr> <td> Search Results </td> </tr> <tr> <td> Project Name </td> <td> Project ID </td> </tr> <% for (int i = 0; i < projects.Length; i++) { Plumtree.Remote.PRC.Collaboration.Project.IProject project = projects[i]; %> <tr> <td> <%Response.Write(project.Name);%> </td> <td> <%Response.Write(project.ID);%> </td> </tr> <% } } else { Response.Write("No projects found using search query of " + searchText); } ...
.NET (VB)
... 'perform the search dim projectManager as Plumtree.Remote.PRC.Collaboration.Project.IProjectManager = GetProjectManager(Request, Response) dim projectFilter as Plumtree.Remote.PRC.Collaboration.Project.IProjectFilter = projectManager.CreateProjectFilter() 'hard-code the max results to 10 projectFilter.MaximumResults = 10 'set the query projectFilter.NameSearchText = searchText 'execute the search and print out the results dim projects() as Plumtree.Remote.PRC.Collaboration.Project.IProject = projectManager.QueryProjects(projectFilter) if projects.Length > 0 then %> <tr> <td> Search Results </td> </tr> <tr> <td> Project Name </td> <td> Project ID </td> </tr> <% dim i as Integer for i = 0 to projects.Length -1 dim project as Plumtree.Remote.PRC.Collaboration.Project.IProject = projects(i) %> <tr> <td> <%Response.Write(project.Name) %> </td> <td> <%Response.Write(Cstr(project.ID)) %> </td> </tr> <% next else Response.Write("No projects found using search query of " + searchText) ...