diff --git a/ccm-cms/src/main/java/org/librecms/ui/PageTreeNodeModel.java b/ccm-cms/src/main/java/org/librecms/ui/PageTreeNodeModel.java index da6e5271e..cd9f49d5d 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/PageTreeNodeModel.java +++ b/ccm-cms/src/main/java/org/librecms/ui/PageTreeNodeModel.java @@ -30,6 +30,8 @@ import java.util.Map; */ public class PageTreeNodeModel { + private String uuid; + private String categoryName; private String categoryPath; @@ -44,7 +46,15 @@ public class PageTreeNodeModel { children = new ArrayList<>(); properties = new HashMap<>(); } - + + public String getUuid() { + return uuid; + } + + public void setUuid(final String uuid) { + this.uuid = uuid; + } + public String getCategoryName() { return categoryName; } @@ -54,7 +64,7 @@ public class PageTreeNodeModel { } public String getCategoryPath() { - return categoryName; + return categoryPath; } protected void setCategoryPath(final String categoryPath) { diff --git a/ccm-cms/src/main/java/org/librecms/ui/PagesController.java b/ccm-cms/src/main/java/org/librecms/ui/PagesController.java index a7e1bc209..05c594acf 100644 --- a/ccm-cms/src/main/java/org/librecms/ui/PagesController.java +++ b/ccm-cms/src/main/java/org/librecms/ui/PagesController.java @@ -21,6 +21,7 @@ package org.librecms.ui; import org.libreccm.api.Identifier; import org.libreccm.api.IdentifierParser; import org.libreccm.categorization.Category; +import org.libreccm.categorization.CategoryManager; import org.libreccm.categorization.CategoryRepository; import org.libreccm.categorization.Domain; import org.libreccm.categorization.DomainRepository; @@ -64,6 +65,9 @@ public class PagesController { private static final String PAGES_LIST_TEMPLATE = "org/librecms/ui/cms/pages.xhtml"; + @Inject + private CategoryManager categoryManager; + @Inject private CategoryRepository categoryRepo; @@ -241,7 +245,7 @@ public class PagesController { } @POST - @Path("/{pagesInstance}/{category}/@add") + @Path("/{pagesInstance}/{category:[\\w\\-/]+}/@add") @AuthorizationRequired @RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN) @Transactional(Transactional.TxType.REQUIRED) @@ -281,7 +285,7 @@ public class PagesController { } @GET - @Path("/{pagesInstance}/{category}/@details") + @Path("/{pagesInstance}/{category:[\\w\\-/]+}/@details") @AuthorizationRequired @RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN) @Transactional(Transactional.TxType.REQUIRED) @@ -331,7 +335,7 @@ public class PagesController { } @POST - @Path("/{pagesInstance}/{category}/@remove") + @Path("/{pagesInstance}/{category:[\\w\\-/]+}/@remove") @AuthorizationRequired @RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN) @Transactional(Transactional.TxType.REQUIRED) @@ -368,7 +372,7 @@ public class PagesController { } @POST - @Path("/{pagesInstance}/{category}/@add-property") + @Path("/{pagesInstance}/{category:[\\w\\-/]+}/@add-property") @AuthorizationRequired @RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN) @Transactional(Transactional.TxType.REQUIRED) @@ -422,7 +426,7 @@ public class PagesController { } @POST - @Path("/{pagesInstance}/{category}/{propertyKey}/@edit") + @Path("/{pagesInstance}/{category:[\\w\\-/]+}/{propertyKey}/@edit") @AuthorizationRequired @RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN) @Transactional(Transactional.TxType.REQUIRED) @@ -441,7 +445,7 @@ public class PagesController { } @POST - @Path("/{pagesInstance}/{category}/{propertyKey}/@remove") + @Path("/{pagesInstance}/{category:[\\w\\-/]+}/{propertyKey}/@remove") @AuthorizationRequired @RequiresPrivilege(CoreConstants.PRIVILEGE_ADMIN) @Transactional(Transactional.TxType.REQUIRED) @@ -522,6 +526,8 @@ public class PagesController { ); final PageTreeNodeModel node = new PageTreeNodeModel(); + node.setUuid(pageResult.map(Page::getUuid).orElse("")); + node.setCategoryPath(categoryManager.getCategoryPath(category)); node.setCategoryName(category.getName()); node.setPageAssigned(pageResult.isPresent()); node.setProperties( diff --git a/ccm-cms/src/main/resources/WEB-INF/views/org/librecms/ui/cms/pages-details.xhtml b/ccm-cms/src/main/resources/WEB-INF/views/org/librecms/ui/cms/pages-details.xhtml index 318df1f02..ba81b1afd 100644 --- a/ccm-cms/src/main/resources/WEB-INF/views/org/librecms/ui/cms/pages-details.xhtml +++ b/ccm-cms/src/main/resources/WEB-INF/views/org/librecms/ui/cms/pages-details.xhtml @@ -93,6 +93,13 @@
+basePath = #{basePath}
+root = #{root}
+node.categoryName = #{node.categoryName}
+node.categoryPath = #{node.categoryPath}
+