- Added the name/URL stub of a category to the XML output
- The template parser of Foundry now uses the name attribute for creating the path of the current category to determine if there is special layout template for a category git-svn-id: https://svn.libreccm.org/ccm/trunk@3089 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
03a494498c
commit
243b62082c
|
|
@ -912,7 +912,7 @@
|
||||||
</foundry:doc-result>
|
</foundry:doc-result>
|
||||||
</foundry:doc>
|
</foundry:doc>
|
||||||
<xsl:function name="foundry:read-current-category">
|
<xsl:function name="foundry:read-current-category">
|
||||||
<xsl:sequence select="string-join($data-tree/nav:categoryPath/nav:category/@title, '/')"/>
|
<xsl:sequence select="string-join($data-tree/nav:categoryPath/nav:category/@name, '/')"/>
|
||||||
</xsl:function>
|
</xsl:function>
|
||||||
|
|
||||||
<xsl:function name="foundry:shying" as="xs:string">
|
<xsl:function name="foundry:shying" as="xs:string">
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.navigation.ui;
|
package com.arsdigita.navigation.ui;
|
||||||
|
|
||||||
import com.arsdigita.navigation.Navigation;
|
import com.arsdigita.navigation.Navigation;
|
||||||
|
|
@ -42,6 +41,7 @@ public abstract class CategoryComponent extends AbstractComponent {
|
||||||
response,
|
response,
|
||||||
category.getID(),
|
category.getID(),
|
||||||
category.getName(),
|
category.getName(),
|
||||||
|
category.getURL(),
|
||||||
category.getDescription(),
|
category.getDescription(),
|
||||||
locateCategory(category));
|
locateCategory(category));
|
||||||
}
|
}
|
||||||
|
|
@ -50,17 +50,24 @@ public abstract class CategoryComponent extends AbstractComponent {
|
||||||
HttpServletResponse response,
|
HttpServletResponse response,
|
||||||
BigDecimal id,
|
BigDecimal id,
|
||||||
String title,
|
String title,
|
||||||
|
String urlStub,
|
||||||
String description,
|
String description,
|
||||||
String url) {
|
String url) {
|
||||||
Element content = Navigation.newElement("category");
|
Element content = Navigation.newElement("category");
|
||||||
content.addAttribute("id", XML.format(id));
|
content.addAttribute("id", XML.format(id));
|
||||||
content.addAttribute("title", title);
|
content.addAttribute("title", title);
|
||||||
|
if (urlStub == null || urlStub.isEmpty()) {
|
||||||
|
content.addAttribute("name", title);
|
||||||
|
} else {
|
||||||
|
content.addAttribute("name", urlStub);
|
||||||
|
}
|
||||||
content.addAttribute("description", description);
|
content.addAttribute("description", description);
|
||||||
content.addAttribute("url", url);
|
content.addAttribute("url", url);
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String locateCategory(Category cat) {
|
protected String locateCategory(Category cat) {
|
||||||
return Navigation.redirectURL(cat.getOID());
|
return Navigation.redirectURL(cat.getOID());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -171,6 +171,7 @@ public abstract class AbstractTree extends CategoryComponent {
|
||||||
response,
|
response,
|
||||||
cat.getID(),
|
cat.getID(),
|
||||||
cat.getName(),
|
cat.getName(),
|
||||||
|
cat.getURL(),
|
||||||
cat.getDescription(),
|
cat.getDescription(),
|
||||||
concatURLs ? path : Navigation.redirectURL(cat.getOID()));
|
concatURLs ? path : Navigation.redirectURL(cat.getOID()));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue