ATG Portal includes a Nucleus component, /atg/portal/process/CommunityProposalHome
, that can be used to create, edit, and delete community proposals. It includes getItem
, createItem
, addItem
, and removeItem
methods that work on CommunityProposal
objects. The CommunityProposalHome.addItem
method creates a CommunityProposalMessage
, which can be used by scenarios or other components as a starting point for creating new communities based on the CommunityProposal
object.
You can use the CommunityProposalHome
component as a basis for form handlers, portlets, JSP pages or other interfaces that allow users to create, edit, and delete community proposals.
The following example creates a CommunityProposal
, setting its name
, url
, and creator
properties to joe
:
import javax.servlet.http.* import atg.portal.process.* import atg.userdirectory.* import atg.userprofiling.* CommunityProposalHome home = (CommunityProposalHome)request.resolveName ("/atg/portal/process/CommunityProposalHome"); CommunityProposal cp = home.createItem(); cp.setName("joe"); cp.setUrl("joe"); UserDirectory ud = (UserDirectory) request.resolveName("/atg/userprofiling/ProfileUserDirectory"); Profile profile = (Profile)request.resolveName("/atg/userprofiling/Profile"); User user = ud.findUserByPrimaryKey(profile.getRepositoryId()); System.out.println("user = " + user); cp.setCreator(user); home.addItem(cp);
You could create a form page for creating community proposals that allows users to input the properties of the proposal.