gatein SVN: r509 - portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application.
by do-not-reply@jboss.org
Author: liem_nguyen
Date: 2009-11-05 23:08:34 -0500 (Thu, 05 Nov 2009)
New Revision: 509
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
Log:
GTNPORTAL-174 Still drag & drop gadget when switch view mode of dashboard portlet
Modified: portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl 2009-11-06 03:25:19 UTC (rev 508)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl 2009-11-06 04:08:34 UTC (rev 509)
@@ -298,7 +298,7 @@
<div class="EDITION-BLOCK EDITION-PORTLET" style="display: none;">
<div style="position: relative;">
- <div style="position: absolute; top: -86px;">
+ <div style="position: absolute; top: -86px;z-index:999;">
<div class="NewLayer"><span></span></div>
<div class="CONTROL-PORTLET CONTROL-BLOCK" style="position: absolute; top: -6px;">
<%/*Begin InfoBar*/%>
15 years, 1 month
gatein SVN: r508 - portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config.
by do-not-reply@jboss.org
Author: trong.tran
Date: 2009-11-05 22:25:19 -0500 (Thu, 05 Nov 2009)
New Revision: 508
Modified:
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
Log:
GTNPORTAL-119 remove a failed test temporarily
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2009-11-05 10:48:16 UTC (rev 507)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2009-11-06 03:25:19 UTC (rev 508)
@@ -462,27 +462,6 @@
}
}.execute(null);
}
-
- public void testClonePage()
- {
- new UnitTest()
- {
- public void execute() throws Exception
- {
- Page page = new Page();
- page.setOwnerType("group");
- page.setOwnerId("/platform/administrators");
- page.setName("whatever");
- page.setTitle("testTitle");
- userPortalConfigSer_.create(page);
-
- String newName = "newPage";
- Page newPage = userPortalConfigSer_.renewPage(page.getPageId(), newName, page.getOwnerType(), page.getOwnerId());
- assertEquals(newName, newPage.getName());
- assertEquals(page.getTitle(), newPage.getTitle());
- }
- }.execute(null);
- }
public void testUpdatePage()
{
15 years, 1 month
gatein SVN: r507 - in portal/trunk/web/portal/src/main/webapp: groovy/portal/webui/navigation and 1 other directory.
by do-not-reply@jboss.org
Author: tam_nguyen
Date: 2009-11-05 05:48:16 -0500 (Thu, 05 Nov 2009)
New Revision: 507
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ar.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ru.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/navigation/UIAddGroupNavigation.gtmpl
Log:
GTNPORTAL-82 Should show message when user does not have the right to add navigation ( Mary/Demo)
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ar.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ar.xml 2009-11-05 09:50:48 UTC (rev 506)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ar.xml 2009-11-05 10:48:16 UTC (rev 507)
@@ -2271,6 +2271,9 @@
<Action>
<Add>Add Navigation</Add>
</Action>
+ <Label>
+ <NoPermission>This user doesn't have permisson to add navigation</NoPermission>
+ </Label>
<header>
<Group>Group</Group>
</header>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2009-11-05 09:50:48 UTC (rev 506)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2009-11-05 10:48:16 UTC (rev 507)
@@ -1365,4 +1365,5 @@
############################################################################
UIAddGroupNavigation.Action.Add=Add Navigation
+UIAddGroupNavigation.Label.NoPermission=This user doesn't have permisson to add navigation
UIAddGroupNavigation.header.Group=Group
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2009-11-05 09:50:48 UTC (rev 506)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2009-11-05 10:48:16 UTC (rev 507)
@@ -1332,4 +1332,5 @@
############################################################################
UIAddGroupNavigation.Action.Add=Add Navigation
+UIAddGroupNavigation.Label.NoPermission=This user doesn't have permisson to add navigation
UIAddGroupNavigation.header.Group=Group
\ No newline at end of file
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ru.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ru.properties 2009-11-05 09:50:48 UTC (rev 506)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ru.properties 2009-11-05 10:48:16 UTC (rev 507)
@@ -1355,4 +1355,5 @@
############################################################################
UIAddGroupNavigation.Action.Add=Добавить навигацию
+UIAddGroupNavigation.Label.NoPermission=This user doesn't have permisson to add navigation
UIAddGroupNavigation.header.Group=Группа
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties 2009-11-05 09:50:48 UTC (rev 506)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties 2009-11-05 10:48:16 UTC (rev 507)
@@ -1345,4 +1345,5 @@
# org.exoplatform.navigation.webui.component.UIAddGroupNavigation #
############################################################################
-UIAddGroupNavigation.Action.Add=Додати навігацію
\ No newline at end of file
+UIAddGroupNavigation.Action.Add=Додати навігацію
+UIAddGroupNavigation.Label.NoPermission=This user doesn't have permisson to add navigation
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties 2009-11-05 09:50:48 UTC (rev 506)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties 2009-11-05 10:48:16 UTC (rev 507)
@@ -1332,4 +1332,5 @@
############################################################################
UIAddGroupNavigation.Action.Add=Add Navigation
-UIAddGroupNavigation.header.Group=Group
\ No newline at end of file
+UIAddGroupNavigation.header.Group=Group
+UIAddGroupNavigation.Label.NoPermission=This user doesn't have permisson to add navigation
Modified: portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/navigation/UIAddGroupNavigation.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/navigation/UIAddGroupNavigation.gtmpl 2009-11-05 09:50:48 UTC (rev 506)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/navigation/UIAddGroupNavigation.gtmpl 2009-11-05 10:48:16 UTC (rev 507)
@@ -6,7 +6,9 @@
listGroupNames = uicomponent.loadGroups();
uicomponent.renderChild(UIVirtualList.class); %>
-
+ <% if (listGroupNames == null){ %>
+ <%=_ctx.appRes("UIAddGroupNavigation.Label.NoPermission")%>
+ <% } %>
<div class="UIAction">
<table class="ActionContainer">
<tr>
15 years, 1 month
gatein SVN: r506 - portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component.
by do-not-reply@jboss.org
Author: tan_pham_dinh
Date: 2009-11-05 04:50:48 -0500 (Thu, 05 Nov 2009)
New Revision: 506
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java
Log:
GTNPORTAL-141: Problem when delete gadgets model in ApplicationRegistry
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java 2009-11-05 09:45:37 UTC (rev 505)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java 2009-11-05 09:50:48 UTC (rev 506)
@@ -23,6 +23,9 @@
import org.exoplatform.application.gadget.GadgetRegistryService;
import org.exoplatform.application.gadget.Source;
import org.exoplatform.application.gadget.SourceStorage;
+import org.exoplatform.application.registry.Application;
+import org.exoplatform.application.registry.ApplicationCategory;
+import org.exoplatform.application.registry.ApplicationRegistryService;
import org.exoplatform.applicationregistry.webui.Util;
import org.exoplatform.web.WebAppController;
import org.exoplatform.web.application.ApplicationMessage;
@@ -185,9 +188,31 @@
sourceStorage.removeSource(dirPath + "/" + name + ".xml");
}
uiManagement.reload();
+
+ // update to ApplicationOrganizer
+ removeFromApplicationRegistry(name);
+ UIApplicationOrganizer uiOrganizer =
+ uiManagement.getParent().findFirstComponentOfType(UIApplicationOrganizer.class);
+ ApplicationCategory selectedCate = uiOrganizer.getSelectedCategory();
+ uiOrganizer.reload();
+ uiOrganizer.setSelectedCategory(selectedCate);
+
ctx.addUIComponentToUpdateByAjax(uiManagement);
}
+ private void removeFromApplicationRegistry(String name) throws Exception
+ {
+ ApplicationRegistryService appRegService =
+ org.exoplatform.portal.webui.util.Util.getUIPortalApplication().getApplicationComponent(
+ ApplicationRegistryService.class);
+ List<ApplicationCategory> cates = appRegService.getApplicationCategories();
+ for (ApplicationCategory cate : cates)
+ {
+ Application app = appRegService.getApplication(cate.getName(), name);
+ if (app != null)
+ appRegService.remove(app);
+ }
+ }
}
public static class AddLocalGadgetActionListener extends EventListener<UIGadgetManagement>
15 years, 1 month
gatein SVN: r505 - portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-11-05 04:45:37 -0500 (Thu, 05 Nov 2009)
New Revision: 505
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
Log:
wrong formatting
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2009-11-05 09:29:56 UTC (rev 504)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSession.java 2009-11-05 09:45:37 UTC (rev 505)
@@ -93,17 +93,20 @@
}
}
- private ChromatticSession getSession() {
- try {
- Model model = getModel();
- Field f = model.getClass().getDeclaredField("session");
- f.setAccessible(true);
- return (ChromatticSession)f.get(model);
- }
- catch (Exception e) {
- throw new Error(e);
- }
- }
+ private ChromatticSession getSession()
+ {
+ try
+ {
+ Model model = getModel();
+ Field f = model.getClass().getDeclaredField("session");
+ f.setAccessible(true);
+ return (ChromatticSession)f.get(model);
+ }
+ catch (Exception e)
+ {
+ throw new Error(e);
+ }
+ }
public Workspace getWorkspace()
{
15 years, 1 month
gatein SVN: r504 - in portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource: config/tasks and 1 other directories.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2009-11-05 04:29:56 -0500 (Thu, 05 Nov 2009)
New Revision: 504
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/GateinSkinConfigRemoval.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinDependentManager.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinService.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortalSkinTask.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortletSkinTask.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/AbstractTaskXMLBinding.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/GateinResource.java
Log:
GTNPORTAL-130: Skin undeployment
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/GateinSkinConfigRemoval.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/GateinSkinConfigRemoval.java 2009-11-05 09:15:32 UTC (rev 503)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/GateinSkinConfigRemoval.java 2009-11-05 09:29:56 UTC (rev 504)
@@ -18,26 +18,30 @@
*/
package org.exoplatform.portal.resource;
+import java.util.List;
+import java.util.Set;
+
import org.gatein.wci.WebAppEvent;
import org.gatein.wci.WebAppLifeCycleEvent;
/**
* @author <a href="mailto:hoang281283@gmail.com">Minh Hoang TO</a>
* @version $Id$
- *
+ *
*/
public class GateinSkinConfigRemoval extends AbstractResourceHandler
{
-
+
private SkinService service;
-
+
private String portalContainerName;
-
- public GateinSkinConfigRemoval(String _portalContainerName, SkinService _service){
+
+ public GateinSkinConfigRemoval(String _portalContainerName, SkinService _service)
+ {
this.portalContainerName = _portalContainerName;
this.service = _service;
}
-
+
/**
* @see org.exoplatform.portal.resource.AbstractResourceHandler#onEvent(org.gatein.wci.WebAppEvent)
*/
@@ -45,12 +49,63 @@
public void onEvent(WebAppEvent event)
{
// TODO Auto-generated method stub
- if(event instanceof WebAppLifeCycleEvent){
+ if (event instanceof WebAppLifeCycleEvent)
+ {
WebAppLifeCycleEvent waEvent = (WebAppLifeCycleEvent)event;
- if(waEvent.getType() == WebAppLifeCycleEvent.REMOVED){
-
+ if (waEvent.getType() == WebAppLifeCycleEvent.REMOVED)
+ {
+ String webApp = event.getWebApp().getServletContext().getContextPath();
+ removeWebAppSkin(webApp);
}
}
}
+ private void removeWebAppSkin(String webApp)
+ {
+ try
+ {
+ removePortalSkins(webApp);
+ removePortletSkins(webApp);
+ removeSkinName(webApp);
+
+ // Update the 'skinDependentManager'
+ SkinDependentManager.clearAssociatedSkins(webApp);
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+
+ private void removePortalSkins(String webApp) throws Exception
+ {
+ List<SkinKey> portalSkins = SkinDependentManager.getPortalSkins(webApp);
+ service.remove(portalSkins);
+ }
+
+ private void removePortletSkins(String webApp) throws Exception
+ {
+ List<SkinKey> portletSkins = SkinDependentManager.getPortletSkins(webApp);
+ service.remove(portletSkins);
+ }
+
+ /**
+ * Remove skinName defined by the webApp, if no other webApps supports the
+ * skinName
+ */
+ private void removeSkinName(String webApp) throws Exception
+ {
+ Set<String> supportedSkins = SkinDependentManager.getSkinNames(webApp);
+ if (supportedSkins != null)
+ {
+ for (String skin : supportedSkins)
+ {
+ if (SkinDependentManager.skinNameIsRemovable(skin, webApp))
+ {
+ service.removeSupportedSkin(skin);
+ }
+ }
+ }
+ }
+
}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinDependentManager.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinDependentManager.java 2009-11-05 09:15:32 UTC (rev 503)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinDependentManager.java 2009-11-05 09:29:56 UTC (rev 504)
@@ -18,20 +18,130 @@
*/
package org.exoplatform.portal.resource;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
/**
* @author <a href="mailto:hoang281283@gmail.com">Minh Hoang TO</a>
* @version $Id$
- *
+ *
*/
public class SkinDependentManager
-{
-
- /** Map of skinName (Default, Mac, Vista ) and associated web applications */
- private static Map<String, List<String>> skinName_dependentApps_Map = new HashMap<String, List<String>>();
+{
-
+ private static Map<String, Set<String>> skinName_Apps_map = new HashMap<String, Set<String>>();
+
+ private static Map<String, Set<String>> app_skinNames_map = new HashMap<String, Set<String>>();
+
+ private static Map<String, List<SkinKey>> app_portalSkins_map = new HashMap<String, List<SkinKey>>();
+
+ private static Map<String, List<SkinKey>> app_portletSkins_map = new HashMap<String, List<SkinKey>>();
+
+ public static void addSkinDeployedInApp(String webApp, String skinName)
+ {
+ Set<String> skinsDefinedInApp = app_skinNames_map.get(webApp);
+ if (skinsDefinedInApp == null)
+ {
+ skinsDefinedInApp = new HashSet<String>();
+ skinsDefinedInApp.add(skinName);
+ app_skinNames_map.put(webApp, skinsDefinedInApp);
+ return;
+ }
+ skinsDefinedInApp.add(skinName);
+ }
+
+ public static void addDependentAppToSkinName(String skinName, String dependentApp)
+ {
+ Set<String> dependentApps = skinName_Apps_map.get(skinName);
+ if (dependentApps == null)
+ {
+ dependentApps = new HashSet<String>();
+ dependentApps.add(dependentApp);
+ skinName_Apps_map.put(skinName, dependentApps);
+ return;
+ }
+ dependentApps.add(dependentApp);
+ }
+
+ public static boolean skinNameIsRemovable(String skinName, String dependentApp)
+ {
+ Set<String> dependentApps = skinName_Apps_map.get(skinName);
+ if (dependentApps == null)
+ {
+ return false;
+ }
+ // Remove the dependentApp defining 'skinName' skin
+ dependentApps.remove(dependentApp);
+
+ if (dependentApps.isEmpty())
+ {
+ skinName_Apps_map.remove(skinName);
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public static void addPortalSkin(String webApp, String moduleName, String skinName)
+ {
+ addSkin(webApp, new SkinKey(moduleName, skinName), app_portalSkins_map);
+ }
+
+ public static void addPortletSkin(String webApp, String moduleName, String skinName)
+ {
+ addSkin(webApp, new SkinKey(moduleName, skinName), app_portletSkins_map);
+ }
+
+ public static List<SkinKey> getPortalSkins(String webApp)
+ {
+ return app_portalSkins_map.get(webApp);
+ }
+
+ public static List<SkinKey> getPortletSkins(String webApp)
+ {
+ return app_portletSkins_map.get(webApp);
+ }
+
+ public static Set<String> getSkinNames(String webApp)
+ {
+ return app_skinNames_map.get(webApp);
+ }
+
+ public static void clearAssociatedSkins(String webApp)
+ {
+ app_portalSkins_map.remove(webApp);
+ app_portletSkins_map.remove(webApp);
+ }
+
+ public static void removeSkinName(String webApp, String skinName)
+ {
+ Set<String> skinsDefinedInApp = app_skinNames_map.get(webApp);
+ if (skinsDefinedInApp == null)
+ {
+ return;
+ }
+ else
+ {
+ skinsDefinedInApp.remove(skinName);// TODO: Check the remove here
+ }
+ }
+
+ private static void addSkin(String webApp, SkinKey key, Map<String, List<SkinKey>> map)
+ {
+ List<SkinKey> skinKeys = map.get(webApp);
+ if (skinKeys == null)
+ {
+ skinKeys = new ArrayList<SkinKey>(5);
+ skinKeys.add(key);
+ map.put(webApp, skinKeys);
+ return;
+ }
+ skinKeys.add(key);
+ }
}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinService.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinService.java 2009-11-05 09:15:32 UTC (rev 503)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/SkinService.java 2009-11-05 09:29:56 UTC (rev 504)
@@ -97,7 +97,7 @@
/** The deployer. */
private final AbstractResourceHandler deployer;
-
+
/** The removal. */
private final AbstractResourceHandler removal;
@@ -116,15 +116,16 @@
private final MainResourceResolver mainResolver;
/**
- * The name of the portal container
- */
+ * The name of the portal container
+ */
final String portalContainerName;
/**
- * An id used for caching request. The id life cycle is the same than the class instance because
- * we consider css will change until server is restarted. Of course this only applies for the
- * developing mode set to false.
- */
+ * An id used for caching request. The id life cycle is the same than the
+ * class instance because we consider css will change until server is
+ * restarted. Of course this only applies for the developing mode set to
+ * false.
+ */
final String id = Long.toString(System.currentTimeMillis());
public SkinService(ExoContainerContext context)
@@ -137,7 +138,7 @@
portletThemes_ = new HashMap<String, Set<String>>();
portalContainerName = context.getPortalContainerName();
mainResolver = new MainResourceResolver(portalContainerName, skinConfigs_);
- deployer = new GateinSkinConfigDeployer(portalContainerName, this);
+ deployer = new GateinSkinConfigDeployer(portalContainerName, this);
removal = new GateinSkinConfigRemoval(portalContainerName, this);
}
@@ -154,12 +155,18 @@
/**
* Register the stylesheet for a portal Skin.
- *
- * @param module skin module identifier
- * @param skinName skin name
- * @param cssPath path uri to the css file. This is relative to the root context, use leading '/'
- * @param scontext the webapp's {@link javax.servlet.ServletContext}
- * @param overwrite if any previous skin should be replaced by that one
+ *
+ * @param module
+ * skin module identifier
+ * @param skinName
+ * skin name
+ * @param cssPath
+ * path uri to the css file. This is relative to the root context,
+ * use leading '/'
+ * @param scontext
+ * the webapp's {@link javax.servlet.ServletContext}
+ * @param overwrite
+ * if any previous skin should be replaced by that one
*/
public void addPortalSkin(String module, String skinName, String cssPath, ServletContext scontext, boolean overwrite)
{
@@ -196,8 +203,9 @@
/**
* Merge several skins into one single skin.
- *
- * @param skins the skins to merge
+ *
+ * @param skins
+ * the skins to merge
* @return the merged skin
*/
public Skin merge(Collection<SkinConfig> skins)
@@ -207,8 +215,9 @@
/**
* Add a resource resolver to plug external resolvers.
- *
- * @param resolver a resolver to add
+ *
+ * @param resolver
+ * a resolver to add
*/
public void addResourceResolver(ResourceResolver resolver)
{
@@ -265,8 +274,9 @@
/**
* Return the CSS content of the file specified by the given URI.
- *
- * @param cssPath path of the css to find
+ *
+ * @param cssPath
+ * path of the css to find
* @return the css
*/
public String getCSS(String cssPath)
@@ -390,6 +400,23 @@
skinConfigs_.remove(key);
}
+ public void removeSupportedSkin(String skinName) throws Exception
+ {
+ availableSkins_.remove(skinName);
+ }
+
+ public void remove(List<SkinKey> keys) throws Exception
+ {
+ if (keys == null)
+ {
+ return;
+ }
+ for (SkinKey key : keys)
+ {
+ skinConfigs_.remove(key);
+ }
+ }
+
public int size()
{
return skinConfigs_.size();
@@ -474,9 +501,11 @@
/**
* Filter what if it's annotated with the alternative orientation.
- *
- * @param line the line to include
- * @param orientation the orientation
+ *
+ * @param line
+ * the line to include
+ * @param orientation
+ * the orientation
* @return true if the line is included
*/
private boolean wantInclude(String line, Orientation orientation)
@@ -538,7 +567,9 @@
@Managed
@ManagedDescription("Reload a specified skin")
- public void reloadSkin(@ManagedDescription("The skin id") @ManagedName("skinId") String skinId)
+ public void reloadSkin(@ManagedDescription("The skin id")
+ @ManagedName("skinId")
+ String skinId)
{
ltCache.remove(skinId);
rtCache.remove(skinId);
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortalSkinTask.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortalSkinTask.java 2009-11-05 09:15:32 UTC (rev 503)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortalSkinTask.java 2009-11-05 09:29:56 UTC (rev 504)
@@ -19,6 +19,7 @@
package org.exoplatform.portal.resource.config.tasks;
+import org.exoplatform.portal.resource.SkinDependentManager;
import org.exoplatform.portal.resource.SkinService;
import javax.servlet.ServletContext;
@@ -26,10 +27,10 @@
/**
*
* Created by eXoPlatform SAS
- *
+ *
* Author: Minh Hoang TO - hoang281283(a)gmail.com
- *
- * Sep 16, 2009
+ *
+ * Sep 16, 2009
*/
public class PortalSkinTask extends AbstractSkinTask
{
@@ -80,8 +81,19 @@
{
return;
}
- String fullCSSPath = scontext.getContextPath() + cssPath;
+ String contextPath = scontext.getContextPath();
+ String fullCSSPath = contextPath + cssPath;
skinService.addPortalSkin(moduleName, skinName, fullCSSPath, scontext, overwrite);
+ updateSkinDependentManager(contextPath, moduleName, skinName);
}
+ /** Update skinDependentManager as it is needed to undeploy skin at runtime */
+ private void updateSkinDependentManager(String webApp, String moduleName, String skinName)
+ {
+ SkinDependentManager.addPortalSkin(webApp, moduleName, skinName);
+ SkinDependentManager.addSkinDeployedInApp(webApp, skinName);
+
+ // Remark: Invoked only in PortalSkinTask
+ SkinDependentManager.addDependentAppToSkinName(skinName, webApp);
+ }
}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortletSkinTask.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortletSkinTask.java 2009-11-05 09:15:32 UTC (rev 503)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/tasks/PortletSkinTask.java 2009-11-05 09:29:56 UTC (rev 504)
@@ -19,6 +19,7 @@
package org.exoplatform.portal.resource.config.tasks;
+import org.exoplatform.portal.resource.SkinDependentManager;
import org.exoplatform.portal.resource.SkinService;
import javax.servlet.ServletContext;
@@ -26,10 +27,10 @@
/**
*
* Created by eXoPlatform SAS
- *
+ *
* Author: Minh Hoang TO - hoang281283(a)gmail.com
- *
- * Sep 16, 2009
+ *
+ * Sep 16, 2009
*/
public class PortletSkinTask extends AbstractSkinTask
{
@@ -87,8 +88,16 @@
applicationName = scontext.getContextPath();
}
String moduleName = applicationName + "/" + portletName;
- String fullCSSPath = scontext.getContextPath() + cssPath;
+ String contextPath = scontext.getContextPath();
+ String fullCSSPath = contextPath + cssPath;
skinService.addSkin(moduleName, skinName, fullCSSPath, scontext, overwrite);
+ updateSkinDependentManager(contextPath, moduleName, skinName);
}
+ private void updateSkinDependentManager(String webApp, String moduleName, String skinName)
+ {
+ SkinDependentManager.addPortletSkin(webApp, moduleName, skinName);
+ SkinDependentManager.addSkinDeployedInApp(webApp, skinName);
+ }
+
}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/AbstractTaskXMLBinding.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/AbstractTaskXMLBinding.java 2009-11-05 09:15:32 UTC (rev 503)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/AbstractTaskXMLBinding.java 2009-11-05 09:29:56 UTC (rev 504)
@@ -29,10 +29,10 @@
/**
*
* Created by eXoPlatform SAS
- *
+ *
* Author: Minh Hoang TO - hoang281283(a)gmail.com
- *
- * Sep 17, 2009
+ *
+ * Sep 17, 2009
*/
public abstract class AbstractTaskXMLBinding
{
@@ -53,6 +53,7 @@
PortalSkinTask pTask = new PortalSkinTask();
bindingCSSPath(pTask, element);
bindingSkinName(pTask, element);
+ bindingModuleName(pTask, element);
return pTask;
}
@@ -79,6 +80,17 @@
task.setSkinName(skinName);
}
+ private void bindingModuleName(PortalSkinTask task, Element element)
+ {
+ NodeList nodes = element.getElementsByTagName(GateinResource.SKIN_MODULE_TAG);
+ if (nodes == null || nodes.getLength() < 1)
+ {
+ return;
+ }
+ String skinModule = nodes.item(0).getFirstChild().getNodeValue();
+ task.setModuleName(skinModule);
+ }
+
}
public static class ThemeTaskXMLBinding extends AbstractTaskXMLBinding
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/GateinResource.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/GateinResource.java 2009-11-05 09:15:32 UTC (rev 503)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/resource/config/xml/GateinResource.java 2009-11-05 09:29:56 UTC (rev 504)
@@ -22,10 +22,10 @@
/**
*
* Created by eXoPlatform SAS
- *
+ *
* Author: Minh Hoang TO - hoang281283(a)gmail.com
- *
- * Sep 17, 2009
+ *
+ * Sep 17, 2009
*/
public interface GateinResource
{
@@ -34,6 +34,8 @@
final public static String SKIN_NAME_TAG = "skin-name";
+ final public static String SKIN_MODULE_TAG = "skin-module";
+
final public static String PORTAl_SKIN_TAG = "portal-skin";
final public static String PORTLET_SKIN_TAG = "portlet-skin";
@@ -51,12 +53,12 @@
final public static String STYLE_THEME_TAG = "style-theme";
final public static String THEME_NAME_TAG = "theme-name";
-
+
final public static String JAVA_SCRIPT_TAG = "javascript";
-
+
final public static String JAVA_SCRIPT_PARAM = "param";
-
+
final public static String JAVA_SCRIPT_MODULE = "js-module";
-
+
final public static String JAVA_SCRIPT_PATH = "js-path";
}
15 years, 1 month
gatein SVN: r503 - portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config.
by do-not-reply@jboss.org
Author: tam_nguyen
Date: 2009-11-05 04:15:32 -0500 (Thu, 05 Nov 2009)
New Revision: 503
Modified:
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
Log:
GTNPORTAL-119 Problem when clone node
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2009-11-05 08:57:24 UTC (rev 502)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2009-11-05 09:15:32 UTC (rev 503)
@@ -463,6 +463,27 @@
}.execute(null);
}
+ public void testClonePage()
+ {
+ new UnitTest()
+ {
+ public void execute() throws Exception
+ {
+ Page page = new Page();
+ page.setOwnerType("group");
+ page.setOwnerId("/platform/administrators");
+ page.setName("whatever");
+ page.setTitle("testTitle");
+ userPortalConfigSer_.create(page);
+
+ String newName = "newPage";
+ Page newPage = userPortalConfigSer_.renewPage(page.getPageId(), newName, page.getOwnerType(), page.getOwnerId());
+ assertEquals(newName, newPage.getName());
+ assertEquals(page.getTitle(), newPage.getTitle());
+ }
+ }.execute(null);
+ }
+
public void testUpdatePage()
{
new UnitTest()
15 years, 1 month
gatein SVN: r502 - portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-11-05 03:57:24 -0500 (Thu, 05 Nov 2009)
New Revision: 502
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
Log:
removed the UserPortalConfigService cache that is redundant with the new model cache
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2009-11-05 07:49:15 UTC (rev 501)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2009-11-05 08:57:24 UTC (rev 502)
@@ -31,9 +31,6 @@
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.config.model.TransientApplicationState;
import org.exoplatform.portal.pom.config.ModelDemarcation;
-import org.exoplatform.services.cache.CacheService;
-import org.exoplatform.services.cache.ExoCache;
-import org.exoplatform.services.cache.ExpireKeyStartWithSelector;
import org.exoplatform.services.listener.ListenerService;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -76,26 +73,17 @@
private ListenerService listenerService;
- protected ExoCache<String, PortalConfig> portalConfigCache_;
-
- protected ExoCache<String, Page> pageConfigCache_;
-
- protected ExoCache<String, PageNavigation> pageNavigationCache_;
-
private NewPortalConfigListener newPortalConfigListener_;
private Log log = ExoLogger.getLogger("Portal:UserPortalConfigService");
- public UserPortalConfigService(UserACL userACL, DataStorage storage, CacheService cacheService,
+ public UserPortalConfigService(UserACL userACL, DataStorage storage,
OrganizationService orgService, ListenerService listenerService) throws Exception
{
this.storage_ = storage;
this.orgService_ = orgService;
this.listenerService = listenerService;
this.userACL_ = userACL;
- this.portalConfigCache_ = cacheService.getCacheInstance(PortalConfig.class.getName());
- this.pageConfigCache_ = cacheService.getCacheInstance(Page.class.getName());
- this.pageNavigationCache_ = cacheService.getCacheInstance(PageNavigation.class.getName());
}
/**
@@ -135,13 +123,7 @@
*/
public UserPortalConfig getUserPortalConfig(String portalName, String accessUser) throws Exception
{
- PortalConfig portal = portalConfigCache_.get(portalName);
- if (portal == null)
- {
- portal = storage_.getPortalConfig(portalName);
- if (portal != null)
- portalConfigCache_.put(portalName, portal);
- }
+ PortalConfig portal = storage_.getPortalConfig(portalName);
if (portal == null || !userACL_.hasPermission(portal))
return null;
@@ -288,10 +270,6 @@
PortalConfig config = storage_.getPortalConfig(ownerType, ownerId);
if (config != null)
{
- if (ownerType.equals("portal"))
- {
- portalConfigCache_.remove(config.getName());
- }
storage_.remove(config);
}
}
@@ -305,7 +283,6 @@
public void update(PortalConfig portal) throws Exception
{
storage_.save(portal);
- portalConfigCache_.select(new ExpireKeyStartWithSelector<String, PortalConfig>(portal.getName()));
}
/**
@@ -321,11 +298,7 @@
{
if (pageId == null)
return null;
- Page page = pageConfigCache_.get(pageId);
- if (page == null)
- page = storage_.getPage(pageId); // TODO: pageConfigCache_ needs to be
- // updated
- return page;
+ return storage_.getPage(pageId); // TODO: pageConfigCache_ needs to be
}
/**
@@ -346,11 +319,6 @@
public Page getPage(String pageId, String accessUser) throws Exception
{
Page page = getPage(pageId);
- if (page != null)
- { // Add a check on page value before put it into the
- // cache
- pageConfigCache_.put(pageId, page);
- }
if (page == null || !userACL_.hasPermission(page))
{
return null;
@@ -371,7 +339,6 @@
public void remove(Page page) throws Exception
{
storage_.remove(page);
- pageConfigCache_.remove(page.getPageId());
listenerService.broadcast(REMOVE_PAGE_EVENT, this, page);
}
@@ -389,9 +356,6 @@
{
storage_.create(page);
- // Remove from the cache since the page can contain transient objects
- pageConfigCache_.remove(page.getPageId());
-
//
listenerService.broadcast(CREATE_PAGE_EVENT, this, page);
}
@@ -411,9 +375,6 @@
{
List<ModelChange> changes = storage_.save(page);
- // Remove from the cache since the page can contain transient objects
- pageConfigCache_.remove(page.getPageId());
-
//
listenerService.broadcast(UPDATE_PAGE_EVENT, this, page);
return changes;
@@ -433,7 +394,6 @@
{
storage_.create(navigation);
navigation.setSerialMark(System.currentTimeMillis());
- pageNavigationCache_.put(navigation.getOwner(), navigation);
listenerService.broadcast(CREATE_NAVIGATION_EVENT, this, navigation);
}
@@ -450,7 +410,6 @@
public void update(PageNavigation navigation) throws Exception
{
storage_.save(navigation);
- pageNavigationCache_.select(new ExpireKeyStartWithSelector<String, PageNavigation>(navigation.getOwner()));
listenerService.broadcast(UPDATE_NAVIGATION_EVENT, this, navigation);
}
@@ -467,21 +426,15 @@
public void remove(PageNavigation navigation) throws Exception
{
storage_.remove(navigation);
- pageNavigationCache_.remove(navigation.getOwner());
listenerService.broadcast(REMOVE_NAVIGATION_EVENT, this, navigation);
}
public PageNavigation getPageNavigation(String ownerType, String id) throws Exception
{
- PageNavigation navigation = (PageNavigation)pageNavigationCache_.get(ownerType + "::" + id);
- if (navigation == null)
+ PageNavigation navigation = storage_.getPageNavigation(ownerType, id);
+ if (navigation != null)
{
- navigation = storage_.getPageNavigation(ownerType, id);
- if (navigation != null)
- {
- navigation.setSerialMark(System.currentTimeMillis());
- pageNavigationCache_.put(navigation.getOwner(), navigation);
- }
+ navigation.setSerialMark(System.currentTimeMillis());
}
return navigation;
}
15 years, 1 month
gatein SVN: r501 - portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component.
by do-not-reply@jboss.org
Author: liem_nguyen
Date: 2009-11-05 02:49:15 -0500 (Thu, 05 Nov 2009)
New Revision: 501
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java
Log:
GTNPORTAL-184 Unknown error when double click delete portal
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java 2009-11-05 07:43:12 UTC (rev 500)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java 2009-11-05 07:49:15 UTC (rev 501)
@@ -89,7 +89,7 @@
{
UIPopupWindow editNavigation = addChild(UIPopupWindow.class, null, null);
editNavigation.setWindowSize(400, 400);
- editNavigation.setId(editNavigation.getId()+ "-" + UUID.randomUUID().toString().replaceAll("-", ""));
+ editNavigation.setId(editNavigation.getId() + "-" + UUID.randomUUID().toString().replaceAll("-", ""));
//loadPortalConfigs();
}
@@ -192,7 +192,7 @@
String portalName = event.getRequestContext().getRequestParameter(OBJECTID);
UserPortalConfigService service = event.getSource().getApplicationComponent(UserPortalConfigService.class);
PortalRequestContext prContext = Util.getPortalRequestContext();
- UIPortalApplication uiPortalApp = event.getSource().getAncestorOfType(UIPortalApplication.class);
+ UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
UserPortalConfig config = service.getUserPortalConfig(portalName, prContext.getRemoteUser());
if (config != null && config.getPortalConfig().isModifiable())
15 years, 1 month
gatein SVN: r500 - in portal/trunk: component/portal/src/main/java/org/exoplatform/portal/config/model and 3 other directories.
by do-not-reply@jboss.org
Author: truong.le
Date: 2009-11-05 02:43:12 -0500 (Thu, 05 Nov 2009)
New Revision: 500
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPortalNavigation.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
Log:
GTNPORTAL-197: Refresh navigation after a navigation is saved in datastorage
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2009-11-05 07:41:43 UTC (rev 499)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2009-11-05 07:43:12 UTC (rev 500)
@@ -201,13 +201,15 @@
/**
* Compute and returns the list that the specified user can manage. If the
* user is root then all existing groups are returned otherwise the list is
- * computed from the groups in which the user has a configured membership. The
- * membership is configured from the value returned by
+ * computed from the groups in which the user has a configured membership.
+ * The membership is configured from the value returned by
* {@link org.exoplatform.portal.config.UserACL#getMakableMT()}
*
- * @param remoteUser the user to get the makable navigations
+ * @param remoteUser
+ * the user to get the makable navigations
* @return the list of groups
- * @throws Exception any exception
+ * @throws Exception
+ * any exception
*/
public List<String> getMakableNavigations(String remoteUser) throws Exception
{
@@ -233,9 +235,12 @@
* This method should create a the portal config, pages and navigation
* according to the template name.
*
- * @param portalName the portal name
- * @param template the template to use
- * @throws Exception any exception
+ * @param portalName
+ * the portal name
+ * @param template
+ * the template to use
+ * @throws Exception
+ * any exception
*/
public void createUserPortalConfig(String ownerType, String portalName, String template) throws Exception
{
@@ -257,8 +262,10 @@
* This method removes the PortalConfig, Page and PageNavigation that belong
* to the portal in the database.
*
- * @param portalName the portal name
- * @throws Exception any exception
+ * @param portalName
+ * the portal name
+ * @throws Exception
+ * any exception
*/
public void removeUserPortalConfig(String portalName) throws Exception
{
@@ -268,10 +275,13 @@
/**
* This method removes the PortalConfig, Page and PageNavigation that belong
* to the portal in the database.
- *
- * @param ownerType the owner type
- * @param ownerId the portal name
- * @throws Exception any exception
+ *
+ * @param ownerType
+ * the owner type
+ * @param ownerId
+ * the portal name
+ * @throws Exception
+ * any exception
*/
public void removeUserPortalConfig(String ownerType, String ownerId) throws Exception
{
@@ -301,9 +311,11 @@
/**
* This method load the page according to the pageId and returns.
*
- * @param pageId the page id
+ * @param pageId
+ * the page id
* @return the page
- * @throws Exception any exception
+ * @throws Exception
+ * any exception
*/
public Page getPage(String pageId) throws Exception
{
@@ -323,10 +335,13 @@
* {@link UserACL#hasPermission(org.exoplatform.portal.config.model.Page)}
* method.
*
- * @param pageId the page id
- * @param accessUser never used
+ * @param pageId
+ * the page id
+ * @param accessUser
+ * never used
* @return the page
- * @throws Exception any exception
+ * @throws Exception
+ * any exception
*/
public Page getPage(String pageId, String accessUser) throws Exception
{
@@ -348,8 +363,10 @@
* {@link org.exoplatform.portal.config.UserPortalConfigService#REMOVE_PAGE_EVENT}
* when the removal is successful.
*
- * @param page the page to remove
- * @throws Exception any exception
+ * @param page
+ * the page to remove
+ * @throws Exception
+ * any exception
*/
public void remove(Page page) throws Exception
{
@@ -363,8 +380,10 @@
* {@link org.exoplatform.portal.config.UserPortalConfigService#CREATE_PAGE_EVENT}
* when the creation is successful.
*
- * @param page the page to create
- * @throws Exception any exception
+ * @param page
+ * the page to create
+ * @throws Exception
+ * any exception
*/
public void create(Page page) throws Exception
{
@@ -382,9 +401,11 @@
* {@link org.exoplatform.portal.config.UserPortalConfigService#UPDATE_PAGE_EVENT}
* when the creation is successful.
*
- * @param page the page to update
+ * @param page
+ * the page to update
* @return the list of model changes that occured
- * @throws Exception any exception
+ * @throws Exception
+ * any exception
*/
public List<ModelChange> update(Page page) throws Exception
{
@@ -403,12 +424,15 @@
* {@link org.exoplatform.portal.config.UserPortalConfigService#CREATE_NAVIGATION_EVENT}
* when the creation is successful.
*
- * @param navigation the navigation to create
- * @throws Exception any exception
+ * @param navigation
+ * the navigation to create
+ * @throws Exception
+ * any exception
*/
public void create(PageNavigation navigation) throws Exception
{
storage_.create(navigation);
+ navigation.setSerialMark(System.currentTimeMillis());
pageNavigationCache_.put(navigation.getOwner(), navigation);
listenerService.broadcast(CREATE_NAVIGATION_EVENT, this, navigation);
}
@@ -418,8 +442,10 @@
* {@link org.exoplatform.portal.config.UserPortalConfigService#UPDATE_NAVIGATION_EVENT}
* when the creation is successful.
*
- * @param navigation the navigation to update
- * @throws Exception any exception
+ * @param navigation
+ * the navigation to update
+ * @throws Exception
+ * any exception
*/
public void update(PageNavigation navigation) throws Exception
{
@@ -433,8 +459,10 @@
* {@link org.exoplatform.portal.config.UserPortalConfigService#REMOVE_NAVIGATION_EVENT}
* when the removal is successful.
*
- * @param navigation the navigation to remove
- * @throws Exception any exception
+ * @param navigation
+ * the navigation to remove
+ * @throws Exception
+ * any exception
*/
public void remove(PageNavigation navigation) throws Exception
{
@@ -445,9 +473,16 @@
public PageNavigation getPageNavigation(String ownerType, String id) throws Exception
{
- PageNavigation navigation = pageNavigationCache_.get(ownerType + "::" + id);
+ PageNavigation navigation = (PageNavigation)pageNavigationCache_.get(ownerType + "::" + id);
if (navigation == null)
+ {
navigation = storage_.getPageNavigation(ownerType, id);
+ if (navigation != null)
+ {
+ navigation.setSerialMark(System.currentTimeMillis());
+ pageNavigationCache_.put(navigation.getOwner(), navigation);
+ }
+ }
return navigation;
}
@@ -479,12 +514,17 @@
/**
* Clones a page.
*
- * @param pageId the id of the page to clone
- * @param pageName the new page name
- * @param ownerType the new page owner type
- * @param ownerId the new page owner id
+ * @param pageId
+ * the id of the page to clone
+ * @param pageName
+ * the new page name
+ * @param ownerType
+ * the new page owner type
+ * @param ownerId
+ * the new page owner id
* @return the newly created page
- * @throws Exception any exception
+ * @throws Exception
+ * any exception
*/
public Page renewPage(String pageId, String pageName, String ownerType, String ownerId) throws Exception
{
@@ -493,12 +533,16 @@
/**
* Creates a page from an existing template.
- *
- * @param temp the template name
- * @param ownerType the new owner type
- * @param ownerId the new owner id
+ *
+ * @param temp
+ * the template name
+ * @param ownerType
+ * the new owner type
+ * @param ownerId
+ * the new owner id
* @return the page
- * @throws Exception any exception
+ * @throws Exception
+ * any exception
*/
public Page createPageTemplate(String temp, String ownerType, String ownerId) throws Exception
{
@@ -509,9 +553,10 @@
/**
* Load all navigation that user has edit permission.
- *
+ *
* @return the navigation the user can edit
- * @throws Exception any exception
+ * @throws Exception
+ * any exception
*/
public List<PageNavigation> loadEditableNavigations() throws Exception
{
@@ -538,9 +583,10 @@
/**
* Returns the list of group ids that do not have an existing navigation.
- *
+ *
* @return the group id with no navigation
- * @throws Exception any exception
+ * @throws Exception
+ * any exception
*/
public Set<String> findGroupWithoutNavigation() throws Exception
{
@@ -556,9 +602,10 @@
/**
* Returns the list of all portal names.
- *
+ *
* @return the list of all portal names
- * @throws Exception any exception
+ * @throws Exception
+ * any exception
*/
public List<String> getAllPortalNames() throws Exception
{
@@ -578,10 +625,13 @@
/**
* Update the ownership recursively on the model graph.
- *
- * @param object the model object graph root
- * @param ownerType the new owner type
- * @param ownerId the new owner id
+ *
+ * @param object
+ * the model object graph root
+ * @param ownerType
+ * the new owner type
+ * @param ownerId
+ * the new owner id
*/
private void updateOwnership(ModelObject object, String ownerType, String ownerId)
{
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java 2009-11-05 07:41:43 UTC (rev 499)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PageNavigation.java 2009-11-05 07:43:12 UTC (rev 500)
@@ -47,6 +47,8 @@
private int priority = 1;
+ private long serialMark;
+
PageNavigation(String storageId)
{
super(storageId);
@@ -188,16 +190,26 @@
return null;
}
+ public long getSerialMark()
+ {
+ return serialMark;
+ }
+
+ public void setSerialMark(long serialModifiedKey)
+ {
+ this.serialMark = serialModifiedKey;
+ }
+
public PageNavigation clone()
{
PageNavigation newNav = new PageNavigation();
newNav.setOwnerId(ownerId);
newNav.setOwnerType(ownerType);
newNav.setPriority(priority);
- // newNav.setAccessPermissions(accessPermissions);
- // newNav.setEditPermission(editPermission);
+ // newNav.setAccessPermissions(accessPermissions);
+ // newNav.setEditPermission(editPermission);
newNav.setModifiable(modifiable);
- // newNav.setDescription(description);
+ // newNav.setDescription(description);
newNav.setCreator(creator);
newNav.setModifier(modifier);
@@ -261,15 +273,6 @@
public NavigationData build()
{
List<NavigationNodeData> children = buildNavigationChildren();
- return new NavigationData(
- storageId,
- ownerType,
- ownerId,
- description,
- creator,
- modifier,
- priority,
- children
- );
+ return new NavigationData(storageId, ownerType, ownerId, description, creator, modifier, priority, children);
}
}
\ No newline at end of file
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2009-11-05 07:41:43 UTC (rev 499)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2009-11-05 07:43:12 UTC (rev 500)
@@ -152,7 +152,7 @@
appRes_ = getApplication().getResourceBundle(getLocale());
}
- public String getTitle()
+ public String getTitle() throws Exception
{
String title = (String)request_.getAttribute(REQUEST_TITLE);
if (title != null)
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPortalNavigation.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPortalNavigation.java 2009-11-05 07:41:43 UTC (rev 499)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPortalNavigation.java 2009-11-05 07:43:12 UTC (rev 500)
@@ -128,7 +128,7 @@
return treeNode_;
}
- public PageNavigation getSelectedNavigation()
+ public PageNavigation getSelectedNavigation() throws Exception
{
PageNavigation nav = Util.getUIPortal().getSelectedNavigation();
if (nav != null)
@@ -143,7 +143,7 @@
return selectedParent_;
}
- public PageNode getSelectedPageNode()
+ public PageNode getSelectedPageNode() throws Exception
{
if (selectedNode_ != null)
return selectedNode_;
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2009-11-05 07:41:43 UTC (rev 499)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2009-11-05 07:43:12 UTC (rev 500)
@@ -21,6 +21,7 @@
import org.exoplatform.portal.account.UIAccountSetting;
import org.exoplatform.portal.application.PortalRequestContext;
+import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.config.model.PortalConfig;
@@ -64,7 +65,8 @@
@EventConfig(listeners = ChangePageNodeActionListener.class),
@EventConfig(listeners = ChangeApplicationListActionListener.class),
@EventConfig(listeners = MoveChildActionListener.class),
- // @EventConfig(listeners = RemoveJSApplicationToDesktopActionListener.class),
+ // @EventConfig(listeners =
+ // RemoveJSApplicationToDesktopActionListener.class),
@EventConfig(listeners = UIPortal.ChangeWindowStateActionListener.class),
@EventConfig(listeners = UIPortal.LogoutActionListener.class),
@EventConfig(listeners = ShowLoginFormActionListener.class),
@@ -186,8 +188,29 @@
publicParameters_ = publicParams;
}
- public List<PageNavigation> getNavigations()
+ public List<PageNavigation> getNavigations() throws Exception
{
+ UserPortalConfigService serv = getApplicationComponent(UserPortalConfigService.class);
+ for (int i = 0; i < navigations.size(); i++)
+ {
+ PageNavigation ele = navigations.get(i);
+ PageNavigation temp = serv.getPageNavigation(ele.getOwnerType(), ele.getOwnerId());
+ if (temp != null)
+ {
+ if (temp.getSerialMark() != ele.getSerialMark())
+ {
+ temp.setModifiable(ele.isModifiable());
+ localizePageNavigation(temp);
+ navigations.set(i, temp);
+ }
+ }
+ else
+ {
+ navigations.remove(i);
+ --i;
+ }
+ }
+
return navigations;
}
@@ -197,11 +220,11 @@
selectedPaths_ = new ArrayList<PageNode>();
if (navigations == null || navigations.size() < 1)
return;
- // PageNavigation pNav = navigations.get(0);
- // if(pNav.getNodes() == null || pNav.getNodes().size() < 1) return;
+ // PageNavigation pNav = navigations.get(0);
+ // if(pNav.getNodes() == null || pNav.getNodes().size() < 1) return;
- //TODO dang.tung: get suitable navigation
- //----------------------------------------------------------
+ // TODO dang.tung: get suitable navigation
+ // ----------------------------------------------------------
PageNavigation pNav = null;
for (PageNavigation nav : navs)
{
@@ -213,7 +236,7 @@
}
if (pNav == null)
return;
- //----------------------------------------------------------
+ // ----------------------------------------------------------
selectedNode_ = pNav.getNodes().get(0);
selectedPaths_.add(selectedNode_);
UIPageBody uiPageBody = findFirstComponentOfType(UIPageBody.class);
@@ -229,7 +252,7 @@
selectedNode_ = node;
}
- public PageNode getSelectedNode()
+ public PageNode getSelectedNode() throws Exception
{
if (selectedNode_ != null)
return selectedNode_;
@@ -250,7 +273,7 @@
selectedPaths_ = nodes;
}
- public PageNavigation getSelectedNavigation()
+ public PageNavigation getSelectedNavigation() throws Exception
{
if (selectedNavigation_ != null && selectedNavigation_.getNodes() != null
&& selectedNavigation_.getNodes().size() > 0)
@@ -259,8 +282,8 @@
}
if (getNavigations().size() < 1)
return null;
- //TODO dang.tung: get right selectedNavigation
- //-------------------------------------------
+ // TODO dang.tung: get right selectedNavigation
+ // -------------------------------------------
List<PageNavigation> navs = getNavigations();
PageNavigation pNav = navs.get(0);
for (PageNavigation nav : navs)
@@ -271,7 +294,7 @@
break;
}
}
- //-------------------------------------------
+ // -------------------------------------------
setSelectedNavigation(pNav);
return pNav;
}
@@ -373,20 +396,24 @@
public void refreshNavigation(Locale locale)
{
- ResourceBundleManager mgr = getApplicationComponent(ResourceBundleManager.class);
for (PageNavigation nav : navigations)
{
- if (nav.getOwnerType().equals(PortalConfig.USER_TYPE))
- continue;
- ResourceBundle res =
- mgr.getNavigationResourceBundle(locale.getLanguage(), nav.getOwnerType(), nav.getOwnerId());
- for (PageNode node : nav.getNodes())
- {
- resolveLabel(res, node);
- }
+ localizePageNavigation(nav);
}
}
+ private void localizePageNavigation(PageNavigation nav)
+ {
+ ResourceBundleManager mgr = getApplicationComponent(ResourceBundleManager.class);
+ if (nav.getOwnerType().equals(PortalConfig.USER_TYPE))
+ return;
+ ResourceBundle res = mgr.getNavigationResourceBundle(locale, nav.getOwnerType(), nav.getOwnerId());
+ for (PageNode node : nav.getNodes())
+ {
+ resolveLabel(res, node);
+ }
+ }
+
private void resolveLabel(ResourceBundle res, PageNode node)
{
node.setResolvedLabel(res);
@@ -409,7 +436,8 @@
cookie.setPath(req.getContextPath());
cookie.setMaxAge(0);
prContext.getResponse().addCookie(cookie);
- //String portalName = URLEncoder.encode(Util.getUIPortal().getName(), "UTF-8") ;
+ // String portalName = URLEncoder.encode(Util.getUIPortal().getName(),
+ // "UTF-8") ;
String portalName = URLEncoder.encode(prContext.getPortalOwner(), "UTF-8");
String redirect = req.getContextPath() + "/public/" + portalName + "/";
prContext.getResponse().sendRedirect(redirect);
15 years, 1 month