From b4cd75d64f2e2bc20919980274168ff6142be6da Mon Sep 17 00:00:00 2001 From: jensp Date: Fri, 12 Sep 2014 12:01:08 +0000 Subject: [PATCH] Some changes for the CategorisedObjectList: Now the the items are sorted according to the sorting in the secondary category system. git-svn-id: https://svn.libreccm.org/ccm/trunk@2851 8810af33-2d31-482b-a856-94f89814c4df --- .../CategorisedDataCollectionRenderer.java | 25 +- .../web/themes/foundry/foundry/main.xsl | 41 +- .../includes/navigation/objectList.xsl | 401 +++++++++--------- 3 files changed, 251 insertions(+), 216 deletions(-) diff --git a/ccm-navigation/src/com/arsdigita/navigation/cms/CategorisedDataCollectionRenderer.java b/ccm-navigation/src/com/arsdigita/navigation/cms/CategorisedDataCollectionRenderer.java index 83677bdf4..4537309e0 100644 --- a/ccm-navigation/src/com/arsdigita/navigation/cms/CategorisedDataCollectionRenderer.java +++ b/ccm-navigation/src/com/arsdigita/navigation/cms/CategorisedDataCollectionRenderer.java @@ -168,8 +168,8 @@ public class CategorisedDataCollectionRenderer extends CMSDataCollectionRenderer 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())); + "Failed to specialize object with with id %s. Skiping object.", + dobj.getOID().toString())); continue; } else { s_log.debug("Specializing successful."); @@ -200,9 +200,9 @@ public class CategorisedDataCollectionRenderer extends CMSDataCollectionRenderer section.addAttribute("id", cat.getID().toString()); section.addAttribute("url", cat.getURL()); section.addAttribute("title", cat.getName(GlobalizationHelper. - getNegotiatedLocale().getLanguage())); + getNegotiatedLocale().getLanguage())); final DataAssociationCursor childCats = domain.getModel().getRelatedCategories( - Category.CHILD); + Category.CHILD); childCats.addEqualsFilter("id", cat.getID()); if (childCats.next()) { section.addAttribute("sortKey", childCats.get("link.sortKey").toString()); @@ -220,14 +220,14 @@ public class CategorisedDataCollectionRenderer extends CMSDataCollectionRenderer section.addAttribute("id", cat.getID().toString()); section.addAttribute("url", cat.getURL()); section.addAttribute("title", cat.getName(GlobalizationHelper. - getNegotiatedLocale(). - getLanguage())); + getNegotiatedLocale(). + getLanguage())); final DataAssociationCursor childCats = domain.getModel(). - getRelatedCategories(Category.CHILD); + getRelatedCategories(Category.CHILD); childCats.addEqualsFilter("id", cat.getID()); if (childCats.next()) { section. - addAttribute("sortKey", childCats.get("link.sortKey").toString()); + addAttribute("sortKey", childCats.get("link.sortKey").toString()); } childCats.close(); currentSection = section; @@ -253,14 +253,19 @@ 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); } final Element path = Navigation.newElement(item, "path"); path.setText(getStableURL(dobj, object)); //item.addContent(path); + if (currentCat != null + && currentCat.getSortKey(categorisedObj) != null) { + item.addAttribute("sortKey", currentCat.getSortKey(categorisedObj).toString()); + } generateItemXML(item, dobj, object, index); diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/main.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/main.xsl index 00e868dbd..a38bfdaff 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/main.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/main.xsl @@ -26,18 +26,45 @@ xmlns:bebop="http://www.arsdigita.com/bebop/1.0" version="1.0"> - - - + + -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ccm-sci-bundle/web/themes/mandalay/includes/navigation/objectList.xsl b/ccm-sci-bundle/web/themes/mandalay/includes/navigation/objectList.xsl index 8e86c9084..9c9aad487 100755 --- a/ccm-sci-bundle/web/themes/mandalay/includes/navigation/objectList.xsl +++ b/ccm-sci-bundle/web/themes/mandalay/includes/navigation/objectList.xsl @@ -31,208 +31,211 @@ + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:bebop="http://www.arsdigita.com/bebop/1.0" + xmlns:cms="http://www.arsdigita.com/cms/1.0" + xmlns:nav="http://ccm.redhat.com/navigation" + xmlns:mandalay="http://mandalay.quasiweb.de" + exclude-result-prefixes="xsl bebop cms nav mandalay" + version="1.0"> - - + + - - - - - - - - - - - - -

- - - - -

-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- - - - -

-
- - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - - - - - - - - - - - - - - - - - -
-
-
- -
- - - - - - - - - - - -
    - - - - - - - -
  • -

    -
      - -
    • - -
      -
    • -
      -
    -
  • -
    - - -
  • - - - - - - - + + + + + + + + - -
    -
  • -
    -
-
+
+ + +

+ + + + +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + +

+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + +
+
+
+ +
+ + + + + + + + + + + +
    + + + + + + + +
  • +

    + +

    +
      + + +
    • + +
      +
    • +
      +
    +
  • +
    + + +
  • + + + + + + + + + +
    +
  • +
    +
+