<%@ Page Language="vb" AutoEventWireup="false" Codebehind="ProjectSample.aspx.vb" Inherits="TestProjectVB.ProjectSample"%> WebForm1 <% if create then 'if no name or description, show text boxes for name and description, and a submit button if name is nothing or description is nothing then 'set default values if name is nothing then name = "" end if if description is nothing then description = "" end if %> <% else 'create a project and print out the project id if name is nothing then name = "ExampleProject" end if if description is nothing then description = "ExampleProjectDescription" end if 'create the project dim projectManager as Plumtree.Remote.PRC.Collaboration.Project.IProjectManager = GetProjectManager(Request, Response) dim project as Plumtree.Remote.PRC.Collaboration.Project.IProject = projectManager.CreateProject(name, description) 'if you want to set additional properties, make sure that store() is called or the changes will not be persisted. 'for example: 'project.setStatus(ProjectStatus.NOT_STARTED) 'project.setStartDate(new Date()) ' 'call store before asking for the id. project.Store() %> <% end if end if if remove then 'if no project ID, add a text box for projectID, and a submit button if projectID = -1 then if strProjectID is nothing then strProjectID = "" end if %> <% else 'remove the project dim projectManager as Plumtree.Remote.PRC.Collaboration.Project.IProjectManager = GetProjectManager(Request, Response) dim project as Plumtree.Remote.PRC.Collaboration.Project.IProject = projectManager.GetProject(projectID) 'squawk if the project could not be retrieved if project is nothing then %> <% else 'remove projectManager.RemoveProject(project) %> <% end if end if end if if search then 'if no search text, add a text box for search text, and a submit button if searchText is nothing then %> <% else '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 %> <% dim i as Integer for i = 0 to projects.Length -1 dim project as Plumtree.Remote.PRC.Collaboration.Project.IProject = projects(i) %> <% next else Response.Write("No projects found using search query of " + searchText) end if end if end if %>
Project Name:
Project Description:
<% Response.Write("ID of newly created project is " + Cstr(project.ID)) %>
Project ID:
<%Response.Write("Unable to retrieve project with ID of " + Cstr(projectID))%>
<%Response.Write("Project with id of " + Cstr(projectID) + " removed.") %>
Search Text:
Search Results
Project Name Project ID
<%Response.Write(project.Name) %> <%Response.Write(Cstr(project.ID)) %>