From: SourceForge.net <no...@so...> - 2007-09-19 07:35:37
|
Patches item #1690520, was opened at 2007-03-29 10:46 Message generated for change (Comment added) made by cgyg9330 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=531527&aid=1690520&group_id=71505 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Closed Resolution: None Priority: 5 Private: No Submitted By: chris gilbert (cgyg9330) Assigned to: Nobody/Anonymous (nobody) Summary: Final Version of categorised forum - pre merge Initial Comment: Here is the categorised forum plug in - loading this application on top of the new forum means that forums can be assigned to navigation categories and so accessed from different parts of your site. TO implement this addition, there are a few things to do: in a development environment - untar attached file and apply patches to ccm-ldn-aplaws and ccm-ldn-navigation (after applying apaws patch in final version of new forum) in project.xml, add <ccm:application name="ccm-categorised-forum"/> to the <ccm:build> element ccm-configure ant deploy-ccm-categorised-forum ccm load ccm-categorised-forum Again there are example xsl files in Aplaws package - to look at the new forum using these, copy them to your theme cdweb cp webapps/ROOT/__ccm__/themes/aplaws/forum-example/categorised-forum/forum-index.xsl webapps/ccm-ldn-theme/__ccm__/themes-dev/{my-theme} cp webapps/ROOT/__ccm__/themes/aplaws/forum-example/categorised-forum/forum-categories.xsl webapps/ccm-ldn-theme/__ccm__/themes-dev/{my-theme} and if not already done: mkdir webapps/ccm-ldn-theme/__ccm__/themes-dev/{my-theme}/images/forum cp webapps/ROOT/__ccm__/themes/aplaws/forum-example/images/forum/* webapps/ccm-ldn-theme/__ccm__/themes-dev/{my-theme}/images/forum Those changes add a categorisation tab to the forum for forum administrators. Clicking the tab should allow assignment of the forum to navigation terms. If you wanted to assign forums to other domains, just add those forums to the domains in terms admin. I *think* that if you add portal to a domain then any child applications will also be assigned and so all forums created as children of portal can be assigned to terms within that domain. Next, to display any assigned forums on a navigation page. I have updated the default navigation template to output applications in the xml. If you don’t use the default navigation template (ccm-ldn-navigation/web/packages/navigation/templates/default.jsp) then you need to update your custom navigation template: 1. add the component definition: <define:component name="applicationList" classname="com.arsdigita.london.navigation.ui.object.SimpleObjectList"/> within the define:page element of your jsp page 2. and the scriptlet lines: ((com.arsdigita.london.navigation.ui.object.SimpleObjectList) applicationList).setDefinition(new DataCollectionDefinition()); ((com.arsdigita.london.navigation.ui.object.SimpleObjectList) applicationList).setRenderer(new DataCollectionRenderer()); ((com.arsdigita.london.navigation.ui.object.SimpleObjectList) applicationList).getDefinition().setObjectType("com.arsdigita.web.Application"); ((com.arsdigita.london.navigation.ui.object.SimpleObjectList) applicationList).getDefinition().setDescendCategories(false); ((com.arsdigita.london.navigation.ui.object.SimpleObjectList) applicationList).getDefinition().addOrder("categories.link.sortKey"); ((com.arsdigita.london.navigation.ui.object.SimpleObjectList) applicationList).getRenderer().setPageSize(30); ((com.arsdigita.london.navigation.ui.object.SimpleObjectList) applicationList).getRenderer().addAttribute("displayName"); within the existing scriptlet tag 3. add the imports <jsp:directive.page import="com.arsdigita.london.navigation.DataCollectionDefinition"/> <jsp:directive.page import="com.arsdigita.london.navigation.DataCollectionRenderer"/> within jsp:root 4. Currently, the cms item list defined in the navigation jsp outputs the title attribute, which is transformed in xsl. Applications do not have a title attribute, but all acs objects have a displayName attribute, the format of which is defined by the specific object. Fortunately, in the case of cms items the title is used as a display name, and for web applications, the name entered when creating the application is used so in both cases displayName is suitable for displaying on a navigation page. If you are not using default files, and you are intending to add forums to navigation pages, you should add the line ((com.arsdigita.london.navigation.ui.object.SimpleObjectList) itemList).getRenderer().addAttribute("displayName"); to your navigation jsp page within the existing scriptlet tag. This ensures the xml is correct, but the existing theme files may not display the aditional items. In your theme file, where you output items on a page, change references to nav:attribute[@name='title'] to nav:attribute[@name='displayName']. I have updated the default xsl in ccm-ldn-navigation and the aplaws theme to include applications. These are output in a separate list – I think it is nicer to use one merged list, in which case you would need to edit lib/lib.xsl as follows: change <xsl:template name="undatedContentLinks"> <xsl:for-each select="nav:simpleObjectList/nav:objectList"> <div id="contentLinks"> <xsl:for-each select="nav:item"> <a> <xsl:attribute name="href"><xsl:value-of select="nav:path" /></xsl:attribute> <xsl:attribute name="displayName"><xsl:value-of select="nav:attribute[@name='displayName']" /></xsl:attribute> <xsl:value-of select="nav:attribute[@name='displayName']" /> </a> <span class="hide">|</span> </xsl:for-each> </div> </xsl:for-each> </xsl:template> to <xsl:template name="undatedContentLinks"> <xsl:if test="nav:simpleObjectList/nav:objectList”> <div id="contentLinks"> <xsl:for-each select="nav:simpleObjectList/nav:objectList/nav:item"> <xsl:sort select="nav:attribute[@name='displayName']"/> <a> <xsl:attribute name="href"><xsl:value-of select="nav:path" /></xsl:attribute> <xsl:attribute name="displayName"><xsl:value-of select="nav:attribute[@name='displayName']" /></xsl:attribute> <xsl:value-of select="nav:attribute[@name='displayName']" /> </a> <span class="hide">|</span> </xsl:for-each> </div> </xsl:if> </xsl:template> The only meaningful sort is alphabetically if lists are merged. By default, each separate list is sorted in the java by sort key, but it is not easily possible to output the sortkey as an attribute in xsl for a merged sort, because it is a link attribute. Note, if you are not using categorised forums, you do not need to amend any theme files – the title attribute is still output in xml for cms items. ---------------------------------------------------------------------- >Comment By: chris gilbert (cgyg9330) Date: 2007-09-19 07:35 Message: Logged In: YES user_id=1069385 Originator: YES Additional changes to default navigation jsp page and aplaws theme added at r 1661 - ensure forums (and other applications) are listed on navigation pages ---------------------------------------------------------------------- Comment By: chris gilbert (cgyg9330) Date: 2007-09-17 15:11 Message: Logged In: YES user_id=1069385 Originator: YES Merged with contrib/wsx at r1644 ---------------------------------------------------------------------- Comment By: chris gilbert (cgyg9330) Date: 2007-03-29 10:47 Message: Logged In: YES user_id=1069385 Originator: YES File Added: cat-forum-navigation.diff ---------------------------------------------------------------------- Comment By: chris gilbert (cgyg9330) Date: 2007-03-29 10:47 Message: Logged In: YES user_id=1069385 Originator: YES File Added: cat-forum-aplaws.diff ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=531527&aid=1690520&group_id=71505 |