diff --git a/framework/common/entitydef/entitymodel.xml b/framework/common/entitydef/entitymodel.xml index 959d567ec3..f4600acb6e 100644 --- a/framework/common/entitydef/entitymodel.xml +++ b/framework/common/entitydef/entitymodel.xml @@ -620,6 +620,23 @@ under the License. The main action which can be done with this portlet, possible values: CREATE UPDATE VIEW DELETE + + + + + + + + + + + + + + + + + diff --git a/framework/common/webcommon/WEB-INF/actions/includes/ListPortalPortlets.groovy b/framework/common/webcommon/WEB-INF/actions/includes/ListPortalPortlets.groovy index 1bc6b87a73..f5f768d59d 100644 --- a/framework/common/webcommon/WEB-INF/actions/includes/ListPortalPortlets.groovy +++ b/framework/common/webcommon/WEB-INF/actions/includes/ListPortalPortlets.groovy @@ -20,25 +20,30 @@ import org.ofbiz.entity.*; import org.ofbiz.entity.condition.*; - -ppIter = delegator.find("PortalPortlet", null, null, null, null, null); +ppCond = EntityCondition.makeCondition("portletCategoryId", EntityOperator.EQUALS, parameters.portletCategoryId); +categories = delegator.findList("PortletPortletCategory", ppCond, null, null, null, false); portalPortlets = []; -inMap = [:]; -while (portlet = ppIter.next()) { + categories.each { category -> + pCond = EntityCondition.makeCondition("portalPortletId", EntityOperator.EQUALS, category.get("portalPortletId")); + listPortalPortlets = delegator.findList("PortalPortlet", pCond, null, null, null, false); - if (portlet.securityServiceName && portlet.securityMainAction) { - inMap.mainAction = portlet.securityMainAction; - inMap.userLogin = context.userLogin; - result = dispatcher.runSync(portlet.securityServiceName, inMap) - hasPermission = result.hasPermission; - } else { - hasPermission = true; - } + inMap = [:]; + listPortalPortlets.each { listPortalPortlet -> + if (listPortalPortlet.securityServiceName && listPortalPortlet.securityMainAction) { + inMap.mainAction = listPortalPortlet.securityMainAction; + inMap.userLogin = context.userLogin; + result = dispatcher.runSync(listPortalPortlet.securityServiceName, inMap) + hasPermission = result.hasPermission; + } else { + hasPermission = true; + } - if (hasPermission) { - portalPortlets.add(portlet); - } + if (hasPermission) { + portalPortlets.add(listPortalPortlet); + } + } } -context.portalPortlets = portalPortlets; +context.portletCat = delegator.findAll("PortletCategory"); +context.portalPortlets = portalPortlets; \ No newline at end of file diff --git a/framework/common/webcommon/portal/listPortalPortlets.ftl b/framework/common/webcommon/portal/listPortalPortlets.ftl index 9c08ce823b..02780aff04 100644 --- a/framework/common/webcommon/portal/listPortalPortlets.ftl +++ b/framework/common/webcommon/portal/listPortalPortlets.ftl @@ -49,6 +49,9 @@ margin: 1em;
${portalPortlet.description}
+
+ ${parameters.portletCategoryId} +
<#if portalPortlet.screenshot?has_content> @@ -66,6 +69,7 @@ margin: 1em; <#assign leftColumn = !leftColumn/> - + <#else/> +

Please, choose new category again, No portlet in this category.

diff --git a/framework/common/widget/PortalPageForms.xml b/framework/common/widget/PortalPageForms.xml index 8265b33f70..420d9a7cbd 100644 --- a/framework/common/widget/PortalPageForms.xml +++ b/framework/common/widget/PortalPageForms.xml @@ -67,5 +67,14 @@ under the License. - + + +
+ + + + +
+ diff --git a/framework/common/widget/PortalPageScreens.xml b/framework/common/widget/PortalPageScreens.xml index 6e16943b77..2cfa6f59d9 100644 --- a/framework/common/widget/PortalPageScreens.xml +++ b/framework/common/widget/PortalPageScreens.xml @@ -105,7 +105,10 @@ under the License. - + + + + diff --git a/framework/example/data/ExampleDemoData.xml b/framework/example/data/ExampleDemoData.xml index 677dbc20ae..5915be3dec 100644 --- a/framework/example/data/ExampleDemoData.xml +++ b/framework/example/data/ExampleDemoData.xml @@ -30,4 +30,12 @@ under the License. + + + + + + + + diff --git a/specialpurpose/myportal/data/MyPortalTypeData.xml b/specialpurpose/myportal/data/MyPortalTypeData.xml index c7b9c017b6..4f21de6e94 100644 --- a/specialpurpose/myportal/data/MyPortalTypeData.xml +++ b/specialpurpose/myportal/data/MyPortalTypeData.xml @@ -73,6 +73,13 @@ + + + + + + + @@ -84,13 +91,13 @@ - + - - - + + + @@ -150,6 +157,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml b/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml index c5dc3c392e..79655ae487 100644 --- a/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml +++ b/specialpurpose/myportal/webapp/myportal/WEB-INF/controller.xml @@ -29,7 +29,7 @@ - + diff --git a/specialpurpose/myportal/widget/CommonScreens.xml b/specialpurpose/myportal/widget/CommonScreens.xml index 7c46a016b9..069120e795 100644 --- a/specialpurpose/myportal/widget/CommonScreens.xml +++ b/specialpurpose/myportal/widget/CommonScreens.xml @@ -146,11 +146,7 @@ under the License.
- - - - - +