- Formatting

- Added more entities to the PDLEntities UML diagram


git-svn-id: https://svn.libreccm.org/ccm/trunk@2584 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-03-24 18:04:10 +00:00
parent 8f786439e6
commit d1057f7475
9 changed files with 293 additions and 189 deletions

View File

@ -0,0 +1,50 @@
/*
* Copyright (c) 2014 Jens Pelzetter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package com.arsdigita.cms.portletdataprovider;
import com.arsdigita.db.DbHelper;
import com.arsdigita.persistence.pdl.ManifestSource;
import com.arsdigita.persistence.pdl.NameFilter;
import com.arsdigita.runtime.CompoundInitializer;
import com.arsdigita.runtime.DomainInitEvent;
import com.arsdigita.runtime.PDLInitializer;
import com.arsdigita.runtime.RuntimeConfig;
/**
*
* @author Jens Pelzetter <jens@jp-digital.de>
* @version $Id$
*/
public class Initalizer extends CompoundInitializer {
public Initalizer() {
final String jdbcUrl = RuntimeConfig.getConfig().getJDBCURL();
final int database = DbHelper.getDatabaseFromURL(jdbcUrl);
add(new PDLInitializer(new ManifestSource("empty.pdl.mf",
new NameFilter(DbHelper.
getDatabaseSuffix(database), "pdl"))));
}
@Override
public void init(final DomainInitEvent event) {
super.init(event);
}
}

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<xrd:adapters xmlns:xrd="http://xmlns.redhat.com/schemas/waf/xml-renderer-rules" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://rhea.redhat.com/schemas/waf/xml-renderer-rules xml-renderer-rules.xsd">
<!-- No need to list all the content types here. Only
need to list a type if is adds associations that
were not in the parent type, or to remove attributes
-->
need to list a type if is adds associations that
were not in the parent type, or to remove attributes
-->
<!-- First off the adapters for ContentItemPanel -->
<!-- First off the adapters for ContentItemPanel -->
<xrd:context name="com.arsdigita.cms.dispatcher.SimpleXMLGenerator">
<!-- Content item is the simplest type -->
@ -54,27 +54,22 @@
</xrd:adapter>
<xrd:adapter objectType="com.arsdigita.cms.ContentPage"
extends="com.arsdigita.cms.ContentItem"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
extends="com.arsdigita.cms.ContentItem"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:attributes rule="exclude">
</xrd:attributes>
<xrd:associations rule="include">
<xrd:property name="/object/masterVersion"/>
<xrd:property name="/object/masterVersion/auditing"/>
<xrd:property name="/object/masterVersion/auditing/creationUser"/>
<xrd:property name="/object/masterVersion/auditing/lastModifiedUser"/>
</xrd:associations>
</xrd:adapter>
<!-- Adds a text asset -->
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.GenericArticle"
extends="com.arsdigita.cms.ContentPage"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
extends="com.arsdigita.cms.ContentPage"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:attributes rule="exclude">
<xrd:property name="/object/textAsset/id"/>
<xrd:property name="/object/textAsset/defaultDomainClass"/>
@ -93,43 +88,43 @@
<!-- Adds several image assets -->
<!-- Quasimodo: Ich denke, das ist jetzt unnötig -->
<!--
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.GenericArticle" extends="com.arsdigita.cms.contenttypes.GenericArticle" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:attributes rule="exclude">
<xrd:property name="/object/imageCaptions/id"/>
<xrd:property name="/object/imageCaptions/defaultDomainClass"/>
<xrd:property name="/object/imageCaptions/objectType"/>
<xrd:property name="/object/imageCaptions/displayName"/>
<xrd:property name="/object/imageCaptions/isDeleted"/>
<xrd:property name="/object/imageCaptions/ancestors"/>
<xrd:property name="/object/imageCaptions/version"/>
<xrd:property name="/object/imageCaptions/name"/>
<xrd:property name="/object/imageCaptions/language"/>
<xrd:property name="/object/imageCaptions/imageId"/>
<xrd:property name="/object/imageCaptions/articleId"/>
-->
<!-- XXX change /cms-service to take OID -->
<!--
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.GenericArticle" extends="com.arsdigita.cms.contenttypes.GenericArticle" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:attributes rule="exclude">
<xrd:property name="/object/imageCaptions/id"/>
<xrd:property name="/object/imageCaptions/defaultDomainClass"/>
<xrd:property name="/object/imageCaptions/objectType"/>
<xrd:property name="/object/imageCaptions/displayName"/>
<xrd:property name="/object/imageCaptions/isDeleted"/>
<xrd:property name="/object/imageCaptions/ancestors"/>
<xrd:property name="/object/imageCaptions/version"/>
<xrd:property name="/object/imageCaptions/name"/>
<xrd:property name="/object/imageCaptions/language"/>
<xrd:property name="/object/imageCaptions/imageId"/>
<xrd:property name="/object/imageCaptions/articleId"/>
-->
<!-- XXX change /cms-service to take OID -->
<!--<xrd:property name="/object/imageCaptions/imageAsset/id"/>-->
<!--
<xrd:property name="/object/imageCaptions/imageAsset/defaultDomainClass"/>
<xrd:property name="/object/imageCaptions/imageAsset/objectType"/>
<xrd:property name="/object/imageCaptions/imageAsset/displayName"/>
<xrd:property name="/object/imageCaptions/imageAsset/isDeleted"/>
<xrd:property name="/object/imageCaptions/imageAsset/ancestors"/>
<xrd:property name="/object/imageCaptions/imageAsset/version"/>
<xrd:property name="/object/imageCaptions/imageAsset/name"/>
<xrd:property name="/object/imageCaptions/imageAsset/language"/>
<xrd:property name="/object/imageCaptions/imageAsset/content"/>
<xrd:property name="/object/imageCaptions/imageAsset/mimeType/javaClass"/>
<xrd:property name="/object/imageCaptions/imageAsset/mimeType/objectType"/>
</xrd:attributes>
<xrd:associations rule="include">
<xrd:property name="/object/imageCaptions"/>
<xrd:property name="/object/imageCaptions/imageAsset"/>
<xrd:property name="/object/imageCaptions/imageAsset/mimeType"/>
</xrd:associations>
</xrd:adapter>
-->
<!--
<xrd:property name="/object/imageCaptions/imageAsset/defaultDomainClass"/>
<xrd:property name="/object/imageCaptions/imageAsset/objectType"/>
<xrd:property name="/object/imageCaptions/imageAsset/displayName"/>
<xrd:property name="/object/imageCaptions/imageAsset/isDeleted"/>
<xrd:property name="/object/imageCaptions/imageAsset/ancestors"/>
<xrd:property name="/object/imageCaptions/imageAsset/version"/>
<xrd:property name="/object/imageCaptions/imageAsset/name"/>
<xrd:property name="/object/imageCaptions/imageAsset/language"/>
<xrd:property name="/object/imageCaptions/imageAsset/content"/>
<xrd:property name="/object/imageCaptions/imageAsset/mimeType/javaClass"/>
<xrd:property name="/object/imageCaptions/imageAsset/mimeType/objectType"/>
</xrd:attributes>
<xrd:associations rule="include">
<xrd:property name="/object/imageCaptions"/>
<xrd:property name="/object/imageCaptions/imageAsset"/>
<xrd:property name="/object/imageCaptions/imageAsset/mimeType"/>
</xrd:associations>
</xrd:adapter>
-->
</xrd:context>
@ -137,7 +132,7 @@
<xrd:context name="com.arsdigita.cms.search.ContentPageMetadataProvider">
<!-- Content item is the simplest type -->
<xrd:adapter objectType="com.arsdigita.cms.ContentItem"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:attributes rule="exclude">
<xrd:property name="/object/id"/>
<xrd:property name="/object/defaultDomainClass"/>
@ -162,8 +157,8 @@
<!-- Adds a text asset -->
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.GenericArticle"
extends="com.arsdigita.cms.ContentItem"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
extends="com.arsdigita.cms.ContentItem"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:attributes rule="exclude">
<xrd:property name="/object/textAsset/id"/>
<xrd:property name="/object/textAsset/defaultDomainClass"/>
@ -181,51 +176,51 @@
</xrd:adapter>
<!-- Adds several image assets -->
<!-- Quasimodo: Ich denke, das ist jetzt unnötig -->
<!--
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.GenericArticle" extends="com.arsdigita.cms.contenttypes.GenericArticle" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:attributes rule="exclude">
<xrd:property name="/object/imageCaptions/id"/>
<xrd:property name="/object/imageCaptions/defaultDomainClass"/>
<xrd:property name="/object/imageCaptions/objectType"/>
<xrd:property name="/object/imageCaptions/displayName"/>
<xrd:property name="/object/imageCaptions/isDeleted"/>
<xrd:property name="/object/imageCaptions/ancestors"/>
<xrd:property name="/object/imageCaptions/version"/>
<xrd:property name="/object/imageCaptions/name"/>
<xrd:property name="/object/imageCaptions/language"/>
<xrd:property name="/object/imageCaptions/imageId"/>
<xrd:property name="/object/imageCaptions/articleId"/>
-->
<!-- XXX change /cms-service to take OID -->
<!-- Quasimodo: Ich denke, das ist jetzt unnötig -->
<!--
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.GenericArticle" extends="com.arsdigita.cms.contenttypes.GenericArticle" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:attributes rule="exclude">
<xrd:property name="/object/imageCaptions/id"/>
<xrd:property name="/object/imageCaptions/defaultDomainClass"/>
<xrd:property name="/object/imageCaptions/objectType"/>
<xrd:property name="/object/imageCaptions/displayName"/>
<xrd:property name="/object/imageCaptions/isDeleted"/>
<xrd:property name="/object/imageCaptions/ancestors"/>
<xrd:property name="/object/imageCaptions/version"/>
<xrd:property name="/object/imageCaptions/name"/>
<xrd:property name="/object/imageCaptions/language"/>
<xrd:property name="/object/imageCaptions/imageId"/>
<xrd:property name="/object/imageCaptions/articleId"/>
-->
<!-- XXX change /cms-service to take OID -->
<!--<xrd:property name="/object/imageCaptions/imageAsset/id"/>-->
<!--
<xrd:property name="/object/imageCaptions/imageAsset/defaultDomainClass"/>
<xrd:property name="/object/imageCaptions/imageAsset/objectType"/>
<xrd:property name="/object/imageCaptions/imageAsset/displayName"/>
<xrd:property name="/object/imageCaptions/imageAsset/isDeleted"/>
<xrd:property name="/object/imageCaptions/imageAsset/ancestors"/>
<xrd:property name="/object/imageCaptions/imageAsset/version"/>
<xrd:property name="/object/imageCaptions/imageAsset/name"/>
<xrd:property name="/object/imageCaptions/imageAsset/language"/>
<xrd:property name="/object/imageCaptions/imageAsset/content"/>
<xrd:property name="/object/imageCaptions/imageAsset/mimeType/javaClass"/>
<xrd:property name="/object/imageCaptions/imageAsset/mimeType/objectType"/>
</xrd:attributes>
<xrd:associations rule="include">
<xrd:property name="/object/imageCaptions"/>
<xrd:property name="/object/imageCaptions/imageAsset"/>
<xrd:property name="/object/imageCaptions/imageAsset/mimeType"/>
</xrd:associations>
</xrd:adapter>
-->
<!--
<xrd:property name="/object/imageCaptions/imageAsset/defaultDomainClass"/>
<xrd:property name="/object/imageCaptions/imageAsset/objectType"/>
<xrd:property name="/object/imageCaptions/imageAsset/displayName"/>
<xrd:property name="/object/imageCaptions/imageAsset/isDeleted"/>
<xrd:property name="/object/imageCaptions/imageAsset/ancestors"/>
<xrd:property name="/object/imageCaptions/imageAsset/version"/>
<xrd:property name="/object/imageCaptions/imageAsset/name"/>
<xrd:property name="/object/imageCaptions/imageAsset/language"/>
<xrd:property name="/object/imageCaptions/imageAsset/content"/>
<xrd:property name="/object/imageCaptions/imageAsset/mimeType/javaClass"/>
<xrd:property name="/object/imageCaptions/imageAsset/mimeType/objectType"/>
</xrd:attributes>
<xrd:associations rule="include">
<xrd:property name="/object/imageCaptions"/>
<xrd:property name="/object/imageCaptions/imageAsset"/>
<xrd:property name="/object/imageCaptions/imageAsset/mimeType"/>
</xrd:associations>
</xrd:adapter>
-->
<!-- Article in several sections -->
</xrd:context>
<!-- Search metadata for file assets -->
<xrd:context name="com.arsdigita.cms.search.AssetMetadataProvider">
<xrd:adapter objectType="com.arsdigita.cms.FileAsset"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:attributes rule="exclude">
<xrd:property name="/object/id"/>
<xrd:property name="/object/content"/>
@ -242,14 +237,14 @@
<xrd:context name="com.arsdigita.cms.search.AssetExtractor">
<!-- Content item is the simplest type -->
<xrd:adapter objectType="com.arsdigita.cms.ContentItem"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:associations rule="include"/>
</xrd:adapter>
<!-- Adds a text asset -->
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.GenericArticle"
extends="com.arsdigita.cms.ContentItem"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
extends="com.arsdigita.cms.ContentItem"
traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
<xrd:associations rule="include">
<xrd:property name="/object/textAsset"/>
</xrd:associations>

View File

@ -26,29 +26,25 @@ import com.arsdigita.domain.DomainObjectTraversalAdapter;
import com.arsdigita.domain.SimpleDomainObjectTraversalAdapter;
import com.arsdigita.domain.DomainObject;
/**
* An adapter for content items allowing pluggable
* assets to extend the traversal.
* An adapter for content items allowing pluggable assets to extend the traversal.
*/
public class ContentItemTraversalAdapter
extends SimpleDomainObjectTraversalAdapter {
extends SimpleDomainObjectTraversalAdapter {
private static final Logger s_log =
Logger.getLogger(ContentItemTraversalAdapter.class);
Logger.getLogger(ContentItemTraversalAdapter.class);
private static final Map s_assetAdapters = new HashMap();
public static void registerAssetAdapter(String path,
DomainObjectTraversalAdapter adapter,
String context) {
if (s_log.isDebugEnabled()) {
s_log.debug("Registering asset adapter " + path +
" adapter " + adapter.getClass() +
" in context " + context);
s_log.debug("Registering asset adapter " + path + " adapter " + adapter.getClass()
+ " in context " + context);
}
Map adapters = (Map)s_assetAdapters.get(context);
Map adapters = (Map) s_assetAdapters.get(context);
if (adapters == null) {
adapters = new HashMap();
s_assetAdapters.put(context, adapters);
@ -65,9 +61,8 @@ public class ContentItemTraversalAdapter
}
/**
* If the path references an asset, then delegates
* to the asset's adapter, otherwise delegates to
* the content item's primary adapter
* If the path references an asset, then delegates to the asset's adapter, otherwise delegates
* to the content item's primary adapter
*/
@Override
public boolean processProperty(DomainObject obj,
@ -75,15 +70,14 @@ public class ContentItemTraversalAdapter
Property prop,
String context) {
if (s_log.isDebugEnabled()) {
s_log.debug("Process property " + path + " in context " + context );
s_log.debug("Process property " + path + " in context " + context);
}
String prefix = "/object/";
int offset = path.indexOf("/", prefix.length());
if (offset == -1) {
String base = path.substring(prefix.length());
Map adapters = (Map)s_assetAdapters.get(context);
if (adapters != null &&
adapters.containsKey(base)) {
Map adapters = (Map) s_assetAdapters.get(context);
if (adapters != null && adapters.containsKey(base)) {
if (s_log.isDebugEnabled()) {
s_log.debug("Following asset");
}
@ -98,20 +92,17 @@ public class ContentItemTraversalAdapter
String base = path.substring(prefix.length(), offset);
String rest = path.substring(offset + 1);
Map adapters = (Map)s_assetAdapters.get(context);
if (adapters != null &&
adapters.containsKey(base)) {
DomainObjectTraversalAdapter adapter = (DomainObjectTraversalAdapter)
adapters.get(base);
Map adapters = (Map) s_assetAdapters.get(context);
if (adapters != null && adapters.containsKey(base)) {
DomainObjectTraversalAdapter adapter = (DomainObjectTraversalAdapter) adapters.get(
base);
if (s_log.isDebugEnabled()) {
s_log.debug("Delegate to asset adapter " + base +
" " + rest + " " + adapter);
s_log.debug("Delegate to asset adapter " + base + " " + rest + " " + adapter);
}
return adapter.processProperty(obj, "/object/" + rest, prop, context);
} else {
if (s_log.isDebugEnabled()) {
s_log.debug("Delegate to primary adapter " + base +
" " + rest);
s_log.debug("Delegate to primary adapter " + base + " " + rest);
}
return super.processProperty(obj, path, prop, context);
}

View File

@ -299,7 +299,6 @@ public interface DataQuery {
*
* @return The filter that has just been added to the query
**/
Filter addFilter(String conditions);

View File

@ -7,14 +7,15 @@ import com.arsdigita.persistence.DataCollection;
import com.arsdigita.persistence.Filter;
/**
* An extension to the {@link CMSDataCollectionDefinition}. With this definition it is possible to filter an object
* list using a second category system/terms domain. This class is designed to be used together with the
* {@link CategorisedDataCollectionRenderer} which displays the objects in a list with several sections.
* An extension to the {@link CMSDataCollectionDefinition}. With this definition it is possible to
* filter an object list using a second category system/terms domain. This class is designed to be
* used together with the {@link CategorisedDataCollectionRenderer} which displays the objects in a
* list with several sections.
*
* @author Jens Pelzetter <jens@jp-digital.de>
* @version $Id$
*/
public class CategorisedDataCollectionDefinition extends CMSDataCollectionDefinition{
public class CategorisedDataCollectionDefinition extends CMSDataCollectionDefinition {
private String termDomain;
@ -34,10 +35,12 @@ public class CategorisedDataCollectionDefinition extends CMSDataCollectionDefini
final Category rootCat = domain.getModel();
//final FilterFactory filterFactory = objects.getFilterFactory();
final Filter filter = objects.addInSubqueryFilter(getCategorizedObjectPath("id"), "com.arsdigita.categorization.objectIDsInSubtree");
final Filter filter = objects.addInSubqueryFilter(
getCategorizedObjectPath("id"),
"com.arsdigita.categorization.objectIDsInSubtree");
filter.set("categoryID", rootCat.getID());
objects.addOrder("parent.categories.link.sortKey");
//objects.addOrder("parent.categories.link.sortKey");
//objects.addOrder("title desc");
}

View File

@ -27,11 +27,12 @@ import org.apache.log4j.Logger;
/**
* <p>
* An extended {@code DataCollectionRenderer} which displays a object list split into several sections. The sections
* are created using a second category system/term domain set using the {@link #setTermDomain(java.lang.String)}
* method in the JSP template. This renderer is designed to be used together with the
* {@link CategorisedDataCollectionRenderer}. To use them, a special JSP template is required. More specificly a JSP
* template using these two class would look like this (only relevant parts shown):
* An extended {@code DataCollectionRenderer} which displays a object list split into several
* sections. The sections are created using a second category system/term domain set using the
* {@link #setTermDomain(java.lang.String)} method in the JSP template. This renderer is designed to
* be used together with the {@link CategorisedDataCollectionRenderer}. To use them, a special JSP
* template is required. More specificly a JSP template using these two class would look like this
* (only relevant parts shown):
* </p>
* <pre>
* ...
@ -54,9 +55,9 @@ import org.apache.log4j.Logger;
* </jsp:scriplet>
* </pre>
* <p>
* This example will create a list of objects of the type {@link GenericPerson}, split into sections definied by the
* terms domain identified by the key {@code memberTypes}. Only the root terms of the domain are used for creating the
* sections.
* This example will create a list of objects of the type {@link GenericPerson}, split into sections
* definied by the terms domain identified by the key {@code memberTypes}. Only the root terms of
* the domain are used for creating the sections.
* </p>
*
* @author Jens Pelzetter <jens@jp-digital.de>
@ -143,8 +144,7 @@ public class CategorisedDataCollectionRenderer extends CMSDataCollectionRenderer
}
paginator.addAttribute("pageParam", pageParam);
paginator.addAttribute("baseURL", URL.there(url.getPathInfo(), map).
toString());
paginator.addAttribute("baseURL", URL.there(url.getPathInfo(), map).toString());
// Quasimodo: End
paginator.addAttribute("pageNumber", Long.toString(pageNumber));
@ -167,16 +167,17 @@ public class CategorisedDataCollectionRenderer extends CMSDataCollectionRenderer
//if (m_specializeObjects) {
object = (ACSObject) DomainObjectFactory.newInstance(dobj);
if (object == null) {
s_log.error(String.format("Failed to specialize object with with id %s. Skiping object.", dobj.
getOID().toString()));
s_log.error(String.format(
"Failed to specialize object with with id %s. Skiping object.",
dobj.getOID().toString()));
continue;
} else {
s_log.debug("Specializing successful.");
}
//}
// Get the content bundle to retrieve the terms/categories. This is necessary because the bundle is
// object which is categorised not the item itself.
// Get the content bundle to retrieve the terms/categories. This is necessary
//because the bundle is object which is categorised not the item itself.
final ACSObject categorisedObj;
if (object instanceof ContentPage) {
final ContentPage item = (ContentPage) object;
@ -185,20 +186,23 @@ public class CategorisedDataCollectionRenderer extends CMSDataCollectionRenderer
categorisedObj = object;
}
// Get the term from the term domain used to separate the list which are associated the current object.
// Get the term from the term domain used to separate the list which are associated the
// current object.
final DomainCollection terms = domain.getDirectTerms(categorisedObj);
if (terms.next()) {
while (terms.next()) {
//Get the category
final Category cat = ((Term) terms.getDomainObject()).getModel();
// If a new section starts create a new section element. Ordering has to be done the theme using the
// sortKey attribute added to the section
// If a new section starts create a new section element. Ordering has to be done
// the theme using the sortKey attribute added to the section
if (currentCat == null) {
currentCat = cat;
final Element section = Navigation.newElement(content, "section");
section.addAttribute("id", cat.getID().toString());
section.addAttribute("url", cat.getURL());
section.addAttribute("title", cat.getName(GlobalizationHelper.getNegotiatedLocale().getLanguage()));
final DataAssociationCursor childCats = domain.getModel().getRelatedCategories(Category.CHILD);
section.addAttribute("title", cat.getName(GlobalizationHelper.
getNegotiatedLocale().getLanguage()));
final DataAssociationCursor childCats = domain.getModel().getRelatedCategories(
Category.CHILD);
childCats.addEqualsFilter("id", cat.getID());
if (childCats.next()) {
section.addAttribute("sortKey", childCats.get("link.sortKey").toString());
@ -215,12 +219,15 @@ public class CategorisedDataCollectionRenderer extends CMSDataCollectionRenderer
final Element section = Navigation.newElement(content, "section");
section.addAttribute("id", cat.getID().toString());
section.addAttribute("url", cat.getURL());
section.addAttribute("title", cat.getName(GlobalizationHelper.getNegotiatedLocale().
section.addAttribute("title", cat.getName(GlobalizationHelper.
getNegotiatedLocale().
getLanguage()));
final DataAssociationCursor childCats = domain.getModel().getRelatedCategories(Category.CHILD);
final DataAssociationCursor childCats = domain.getModel().
getRelatedCategories(Category.CHILD);
childCats.addEqualsFilter("id", cat.getID());
if (childCats.next()) {
section.addAttribute("sortKey", childCats.get("link.sortKey").toString());
section.
addAttribute("sortKey", childCats.get("link.sortKey").toString());
}
childCats.close();
currentSection = section;
@ -246,7 +253,8 @@ public class CategorisedDataCollectionRenderer extends CMSDataCollectionRenderer
final Iterator properties = getProperties().iterator();
while (properties.hasNext()) {
final DataCollectionPropertyRenderer property = (DataCollectionPropertyRenderer) properties.next();
final DataCollectionPropertyRenderer property = (DataCollectionPropertyRenderer) properties.
next();
property.render(objects, item);
}

View File

@ -12,7 +12,6 @@
* rights and limitations under the License.
*
*/
package com.arsdigita.navigation.cms;
import com.arsdigita.navigation.NavigationModel;
@ -21,26 +20,27 @@ import com.arsdigita.london.terms.Domain;
import com.arsdigita.london.terms.Term;
/**
* Use this to display the items in one specific category,
* bypassing the navigation model.
* Use this to display the items in one specific category, bypassing the navigation model.
*/
public class CategoryDataCollectionDefinition extends CMSDataCollectionDefinition {
private Category m_category = null;
public void setCategoryByPID(String pid, String domain) {
Domain dom = Domain.retrieve(domain);
Term term = dom.getTerm(pid);
Category cat = term.getModel();
setCategory(cat);
Domain dom = Domain.retrieve(domain);
Term term = dom.getTerm(pid);
Category cat = term.getModel();
setCategory(cat);
}
public void setCategory(Category category) {
m_category = category;
m_category = category;
}
/** Use the specified category if any; otherwise use the model. */
/**
* Use the specified category if any; otherwise use the model.
*/
protected Category getCategory(NavigationModel model) {
return (m_category != null) ? m_category : model.getCategory();
return (m_category != null) ? m_category : model.getCategory();
}
}

View File

@ -248,8 +248,8 @@
<xsl:attribute name="href">
<xsl:value-of select="normalize-space(./contacts/contact[@contactType='commonContact']/contactentries[keyId='homepage']/value)"/>
</xsl:attribute>
<xsl:if test="string-length(./titlePre) &gt; 0">
<xsl:value-of select="./titlePre"/>
<xsl:if test="string-length(./titlepre) &gt; 0">
<xsl:value-of select="./titlepre"/>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:if test="string-length(./givenname) &gt; 0">
@ -259,16 +259,16 @@
<xsl:if test="string-length(./givenname) &gt; 0">
<xsl:value-of select="./surname"/>
</xsl:if>
<xsl:if test="string-length(./titlePost) &gt; 0">
<xsl:if test="string-length(./titlepost) &gt; 0">
<xsl:text>, </xsl:text>
<xsl:value-of select="./titlePost"/>
<xsl:value-of select="./titlepost"/>
</xsl:if>
</a>
</xsl:when>
<xsl:otherwise>
<span class="CIname memberName">
<xsl:if test="string-length(./titlePre) &gt; 0">
<xsl:value-of select="./titlePre"/>
<xsl:if test="string-length(./titlepre) &gt; 0">
<xsl:value-of select="./titlepre"/>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:if test="string-length(./givenname) &gt; 0">
@ -278,9 +278,9 @@
<xsl:if test="string-length(./givenname) &gt; 0">
<xsl:value-of select="./surname"/>
</xsl:if>
<xsl:if test="string-length(./titlePost) &gt; 0">
<xsl:if test="string-length(./titlepost) &gt; 0">
<xsl:text>, </xsl:text>
<xsl:value-of select="./titlePost"/>
<xsl:value-of select="./titlepost"/>
</xsl:if>
</span>
</xsl:otherwise>

View File

@ -223,6 +223,7 @@ namespace com.arsdigita.cms.contenttypes {
class AddressType
class Agenda
class Article
class ArticleSection
class Bookmark
class Contact
class ContentGroup
@ -248,16 +249,38 @@ namespace com.arsdigita.cms.contenttypes {
class HistoricDate
class Image
class InlineSite
class IsoCountry
class Job
class LegalNotice
class Link
class Member
class Minutes
class MOTDItem
class MultiPartArticle
class NewsItem
class Organization
class Person
class PressRelease
class PublicPersonalProfile
class PublicPersonalProfileBundle
class PublicPersonalProfileNavItem
class ResearchNetwork
class ResearchNetworkMembership
class Service
class SimpleAddress
class SimpleOrganization
class SimpleOrganizationBundle
class SiteProxy
class Survey
class SurveyResponse
class SurveyAnswer
com.arsdigita.kernel.ACSObject <|-- Link
com.arsdigita.kernel.ACSObject <|-- ResearchNetworkMembership
com.arsdigita.cms.ContentItem <|-- ContentGroup
com.arsdigita.cms.ContentItem <|-- ContentGroupAssociation
com.arsdigita.cms.ContentItem <|-- SurveyResponse
com.arsdigita.cms.ContentItem <|-- SurveyAnswer
com.arsdigita.cms.ContentBundle <|-- GenericAddressBundle
com.arsdigita.cms.ContentBundle <|-- GenericContactBundle
com.arsdigita.cms.ContentBundle <|-- GenericOrganizationalUnitBundle
@ -266,6 +289,7 @@ namespace com.arsdigita.cms.contenttypes {
com.arsdigita.cms.ContentItem <|-- GenericContactEntry
com.arsdigita.cms.ContentItem <|-- DecisionTreeSectionOption
com.arsdigita.cms.ContentItem <|-- DecisionTreeOptionTarget
com.arsdigita.cms.ContentPage <|-- ArticleSection
com.arsdigita.cms.ContentPage <|-- Bookmark
com.arsdigita.cms.ContentPage <|-- DecisionTree
com.arsdigita.cms.ContentPage <|-- DecisionTreeSection
@ -280,16 +304,32 @@ namespace com.arsdigita.cms.contenttypes {
com.arsdigita.cms.ContentPage <|-- Image
com.arsdigita.cms.ContentPage <|-- InlineSite
com.arsdigita.cms.ContentPage <|-- Job
com.arsdigita.cms.ContentPage <|-- MOTDItem
com.arsdigita.cms.ContentPage <|-- MultiPartArticle
com.arsdigita.cms.ContentPage <|-- Organization
com.arsdigita.cms.ContentPage <|-- PublicPersonalProfile
com.arsdigita.cms.ContentPage <|-- ResearchNetwork
com.arsdigita.cms.ContentPage <|-- Service
com.arsdigita.cms.ContentPage <|-- SimpleAddress
com.arsdigita.cms.ContentPage <|-- SiteProxy
com.arsdigita.cms.ContentPage <|-- Survey
GenericAddress <|-- Address
GenericArticle <|-- Agenda
GenericArticle <|-- Article
GenericArticle <|-- Event
GenericArticle <|-- HistoricDate
GenericArticle <|-- LegalNotice
GenericArticle <|-- Minutes
GenericArticle <|-- NewsItem
GenericArticle <|-- PressRelease
GenericContact <|-- Contact
GenericPerson <|-- Member
GenericPerson <|-- Person
GenericOrganizationalUnit <|-- SimpleOrganization
GenericOrganizationalUnitBundle <|-- SimpleOrganizationBundle
ArticleSection -- com.arsdigita.cms.TextAsset
ArticleSection -- com.arsdigita.cms.ReusableImageAsset
ContentGroup -- ContentGroupAssociation
ContentGroupAssociation -- com.arsdigita.cms.ContentItem
DecisionTree -- DecisionTreeSection
@ -304,8 +344,26 @@ namespace com.arsdigita.cms.contenttypes {
GenericOrganizationalUnitBundle -- GenericPersonBundle
Image -- com.arsdigita.cms.ImageAsset
Link -- ContentItem
MOTDItem -- com.arsdigita.cms.FileAsset
Organization -- com.arsdigita.cms.ImageAsset
MultiPartArticle -- ArticleSection
PublicPersonalProfileBundle -- GenericPersonBundle
PublicPersonalProfile -- PublicPersonalProfileNavItem
ResearchNetwork -- ResearchNetworkMembership
ResarchNetworkMembership -- Person
SimpleAddress -- IsoCountry
Survey -- com.arsdigita.formbuilder.FormSection
Survey -- SurveyResponse
SurveyResponse -- SurveyAnswer
}
namespace com.arsdigita.cms.contenttypes.xmlfeed {
class XMLFeed
com.arsdigita.cms.formbuilder.FormItem <|-- XMLFeed
XMLFeed -- com.arsdigita.cms.FileAsset
}
namespace com.arsdigita.cms.formbuilder {