The OSP Portal - components.xml
Edit the osp-portal components.xml file
This one is pretty easy too.
To the org.theospi.portfolio.portal.intf.PortalManager bean (the first bean in the file), just add an entry element for each new site type.
sakai/osp/portal/component/src/webapp/WEB-INF/components.xml : org.theospi.portfolio.portal.intf.PortalManager bean
<bean id="org.theospi.portfolio.portal.intf.PortalManager" class="org.theospi.portfolio.portal.impl.PortalManagerImpl" singleton="true"> <property name="userDirectoryService" ref="org.sakaiproject.user.api.UserDirectoryService"/> <property name="siteService" ref="org.sakaiproject.site.api.SiteService"/> <property name="idManager" ref="idManager"/> <property name="ospAuthzManager" ref="authzManager"/> <property name="sakaiAuthzManager" ref="org.sakaiproject.metaobj.security.AuthorizationFacade"/> <property name="siteTypes"> <map> <entry key="course" value-ref="org.theospi.portfolio.portal.model.SiteType.course"/> <entry key="project" value-ref="org.theospi.portfolio.portal.model.SiteType.project"/> <entry key="portfolioAdmin" value-ref="org.theospi.portfolio.portal.model.SiteType.portfolioAdmin"/> <!-- lets add ours --> <entry key="portfolio" value-ref="org.theospi.portfolio.portal.model.SiteType.portfolio"/> <entry key="goal" value-ref="org.theospi.portfolio.portal.model.SiteType.goal"/> <entry key="program" value-ref="org.theospi.portfolio.portal.model.SiteType.program"/> <!-- all done --> </map> </property> </bean>
Next we add a bean for each of our new site types that describes all sorts of things about that site like:
- the order in which each site type appears in the osp-portal navigation
- how to group tools by their category ("Collect and Reflect" for example)
For this example, we will duplicate the bean used for a "project" site type and modify it.
Note that the portfolio bean is already in there, so we only need to add beans for "program" and "goal".
sakai/osp/portal/component/src/webapp/WEB-INF/components.xml : Site beans
<bean id="org.theospi.portfolio.portal.model.SiteType.project" class="org.theospi.portfolio.portal.model.SiteType" > <!-- title will come from a messages.properties so that i18n can be supported --> <property name="key" value="org.theospi.portfolio.portal.project"/> <property name="name" value="project"/> <property name="order" value="3"/> <property name="firstCategory" value="1"/> <property name="toolCategories"> <list> </list> </property> </bean> <bean id="org.theospi.portfolio.portal.model.SiteType.portfolio" class="org.theospi.portfolio.portal.model.SiteType" > <!-- title will come from a messages.properties so that i18n can be supported --> <property name="key" value="org.theospi.portfolio.portal.portfolio"/> <property name="name" value="portfolio"/> <property name="order" value="2"/> <property name="firstCategory" value="1"/> <property name="lastCategory" value="5"/> <property name="toolCategories"> <list> <ref bean="org.theospi.portfolio.portal.model.ToolCategory.collectReflect"/> <ref bean="org.theospi.portfolio.portal.model.ToolCategory.designPublish"/> <ref bean="org.theospi.portfolio.portal.model.ToolCategory.guide"/> <ref bean="org.theospi.portfolio.portal.model.ToolCategory.reviewEvaluate"/> <ref bean="org.theospi.portfolio.portal.model.ToolCategory.analyzeReport"/> </list> </property> </bean> <bean id="org.theospi.portfolio.portal.model.SiteType.course" class="org.theospi.portfolio.portal.model.SiteType" > <!-- title will come from a messages.properties so that i18n can be supported --> <property name="key" value="org.theospi.portfolio.portal.course"/> <property name="name" value="course"/> <property name="order" value="4"/> <property name="toolCategories"> <list> </list> </property> </bean> <!-- let's add ours -->Â <bean id="org.theospi.portfolio.portal.model.SiteType.program" class="org.theospi.portfolio.portal.model.SiteType" > <!-- title will come from a messages.properties so that i18n can be supported --> <property name="key" value="org.theospi.portfolio.portal.program"/> <property name="name" value="program"/> <property name="order" value="5"/> <property name="toolCategories"> <list> </list> </property> </bean> <bean id="org.theospi.portfolio.portal.model.SiteType.goal" class="org.theospi.portfolio.portal.model.SiteType" > <!-- title will come from a messages.properties so that i18n can be supported --> <property name="key" value="org.theospi.portfolio.portal.goal"/> <property name="name" value="goal"/> <property name="order" value="6"/> <property name="toolCategories"> <list> </list> </property> </bean> <!-- all done -->