gatein SVN: r7866 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/localization.
by do-not-reply@jboss.org
Author: haint
Date: 2011-10-25 06:32:29 -0400 (Tue, 25 Oct 2011)
New Revision: 7866
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/localization/LocalizationFilter.java
Log:
GTNPORTAL-2207 Hardcode for getting portal container in LocalizationFilter.java
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/localization/LocalizationFilter.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/localization/LocalizationFilter.java 2011-10-25 10:30:39 UTC (rev 7865)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/localization/LocalizationFilter.java 2011-10-25 10:32:29 UTC (rev 7866)
@@ -26,6 +26,7 @@
import org.exoplatform.container.RootContainer;
import org.exoplatform.container.component.ComponentRequestLifecycle;
import org.exoplatform.container.component.RequestLifeCycle;
+import org.exoplatform.container.web.AbstractFilter;
import org.exoplatform.portal.Constants;
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.services.log.ExoLogger;
@@ -37,7 +38,12 @@
import org.exoplatform.services.resources.LocaleContextInfo;
import org.exoplatform.services.resources.LocalePolicy;
-import javax.servlet.Filter;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Set;
+
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
@@ -45,11 +51,6 @@
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Locale;
-import java.util.Set;
/**
* This filter provides {@link HttpServletRequest#getLocale()} and {@link HttpServletRequest#getLocales()}
@@ -79,17 +80,18 @@
*
* @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
*/
-public class LocalizationFilter implements Filter
+public class LocalizationFilter extends AbstractFilter
{
private static Log log = ExoLogger.getLogger("portal:LocalizationFilter");
private static ThreadLocal<Locale> currentLocale = new ThreadLocal<Locale>();
private Locale portalLocale = Locale.ENGLISH;
-
- public void init(FilterConfig filterConfig) throws ServletException
+
+ @Override
+ protected void afterInit(FilterConfig config) throws ServletException
{
- String locale = filterConfig.getInitParameter("PortalLocale");
+ String locale = config.getInitParameter("PortalLocale");
locale = locale != null ? locale.trim() : null;
if (locale != null && locale.length() > 0)
portalLocale = LocaleContextInfo.getLocale(locale);
@@ -129,7 +131,7 @@
// Initialize currentLocale
- ExoContainer container = ExoContainerContext.getCurrentContainerIfPresent();
+ ExoContainer container = getContainer();
if (container == null)
{
// Nothing we can do, move on
@@ -137,9 +139,6 @@
return;
}
- if (container instanceof RootContainer)
- container = (ExoContainer) container.getComponentInstance("portal");
-
LocaleConfigService localeConfigService = (LocaleConfigService)
container.getComponentInstanceOfType(LocaleConfigService.class);
LocalePolicy localePolicy = (LocalePolicy) container.getComponentInstanceOfType(LocalePolicy.class);
13 years, 2 months
gatein SVN: r7865 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page.
by do-not-reply@jboss.org
Author: haint
Date: 2011-10-25 06:30:39 -0400 (Tue, 25 Oct 2011)
New Revision: 7865
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java
Log:
GTNPORTAL-2209 Search page doesn't cache properly
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java 2011-10-25 10:20:05 UTC (rev 7864)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java 2011-10-25 10:30:39 UTC (rev 7865)
@@ -108,20 +108,17 @@
protected String pageSelectedId_;
- private static List<SelectItemOption<String>> OPTIONS = new ArrayList<SelectItemOption<String>>(2);
+ private List<SelectItemOption<String>> OPTIONS = new ArrayList<SelectItemOption<String>>(2);
- static
+ private Query<Page> lastQuery_;
+
+ public UIPageBrowser() throws Exception
{
WebuiRequestContext contextui = WebuiRequestContext.getCurrentInstance();
ResourceBundle res = contextui.getApplicationResourceBundle();
OPTIONS.add(new SelectItemOption<String>(res.getString("UIPageSearchForm.label.option.portal"), "portal"));
OPTIONS.add(new SelectItemOption<String>(res.getString("UIPageSearchForm.label.option.group"), "group"));
- }
-
- private Query<Page> lastQuery_;
-
- public UIPageBrowser() throws Exception
- {
+
UIPageSearchForm uiSearchForm = addChild(UIPageSearchForm.class, null, null);
uiSearchForm.setOptions(OPTIONS);
uiSearchForm.setId("UIPageSearchForm");
13 years, 2 months
gatein SVN: r7864 - portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization.
by do-not-reply@jboss.org
Author: haint
Date: 2011-10-25 06:20:05 -0400 (Tue, 25 Oct 2011)
New Revision: 7864
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/organization-configuration.xml
Log:
GTNPORTAL-2211 Declare the MembershipUpdateListener in organization-configuration.xml
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/organization-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/organization-configuration.xml 2011-10-25 10:12:51 UTC (rev 7863)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/organization-configuration.xml 2011-10-25 10:20:05 UTC (rev 7864)
@@ -298,5 +298,11 @@
</object-param>
</init-params>
</component-plugin>
+
+ <component-plugin>
+ <name>MembershipUpdateListener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.organization.impl.MembershipUpdateListener</type>
+ </component-plugin>
</external-component-plugins>
</configuration>
13 years, 2 months
gatein SVN: r7863 - portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form.
by do-not-reply@jboss.org
Author: haint
Date: 2011-10-25 06:12:51 -0400 (Tue, 25 Oct 2011)
New Revision: 7863
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormSelectBox.java
Log:
GTNPORTAL-2218 No difference between the two selectbox: objectId is always null on UIFormSelectBox
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormSelectBox.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormSelectBox.java 2011-10-25 10:11:37 UTC (rev 7862)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormSelectBox.java 2011-10-25 10:12:51 UTC (rev 7863)
@@ -212,7 +212,7 @@
protected String renderOnChangeEvent(UIForm uiForm) throws Exception
{
- return uiForm.event(onchange_, (String)null);
+ return uiForm.event(onchange_, (String)getId());
}
public void processRender(WebuiRequestContext context) throws Exception
@@ -277,4 +277,4 @@
if (this.isMandatory())
w.write(" *");
}
-}
\ No newline at end of file
+}
13 years, 2 months
gatein SVN: r7862 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation.
by do-not-reply@jboss.org
Author: haint
Date: 2011-10-25 06:11:37 -0400 (Tue, 25 Oct 2011)
New Revision: 7862
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNodeSelector.java
Log:
GTNPORTAL-2220 Not locale in UIPageNodeSelector when change user language in user profile
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNodeSelector.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNodeSelector.java 2011-10-25 09:59:10 UTC (rev 7861)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNodeSelector.java 2011-10-25 10:11:37 UTC (rev 7862)
@@ -109,6 +109,7 @@
return null;
}
+
NodeChangeQueue<UserNode> queue = new NodeChangeQueue<UserNode>();
userPortal.updateNode(node, Scope.GRANDCHILDREN, queue);
for (NodeChange<UserNode> change : queue)
@@ -122,7 +123,9 @@
}
}
}
- return node;
+
+ UserNavigation nav = userPortal.getNavigation(node.getNavigation().getKey());
+ return userPortal.resolvePath(nav, null, node.getURI());
}
public void setSelectedURI(String uri) throws Exception
13 years, 2 months
gatein SVN: r7861 - portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent.
by do-not-reply@jboss.org
Author: haint
Date: 2011-10-25 05:59:10 -0400 (Tue, 25 Oct 2011)
New Revision: 7861
Modified:
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css
Log:
GTNPORTAL-2222 Small UI bug when edit page or edit layout
Modified: portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css 2011-10-25 09:54:16 UTC (rev 7860)
+++ portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css 2011-10-25 09:59:10 UTC (rev 7861)
@@ -88,6 +88,7 @@
margin: 0px 5px 0px 0px; /* orientation=rt */
background: url('background/DefaultContainerIcon.gif') no-repeat left 3px; /* orientation=lt */
background: url('background/DefaultContainerIcon.gif') no-repeat right 1px; /* orientation=rt */
+ width:auto;
}
.UIColumnContainer .ControlIcon {
13 years, 2 months
gatein SVN: r7860 - portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/application.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2011-10-25 05:54:16 -0400 (Tue, 25 Oct 2011)
New Revision: 7860
Modified:
portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/application/ResourceRequestFilter.java
Log:
GTNPORTAL-2192: Show broken pipe log on Tomcat server
Modified: portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/application/ResourceRequestFilter.java
===================================================================
--- portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/application/ResourceRequestFilter.java 2011-10-25 09:30:47 UTC (rev 7859)
+++ portal/trunk/component/web/resources/src/main/java/org/exoplatform/portal/application/ResourceRequestFilter.java 2011-10-25 09:54:16 UTC (rev 7860)
@@ -34,6 +34,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.net.SocketException;
import java.net.URLDecoder;
import java.nio.charset.Charset;
import java.util.Date;
@@ -149,8 +150,15 @@
}
catch (Exception e)
{
- log.error("Could not render css " + uri, e);
- httpResponse.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ if (e instanceof SocketException)
+ {
+ //Should we print something/somewhere exception message
+ }
+ else
+ {
+ log.error("Could not render css " + uri, e);
+ httpResponse.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ }
}
}
else
13 years, 2 months
gatein SVN: r7858 - in portal/trunk/web/portal/src/main/webapp/WEB-INF/conf: portal and 1 other directory.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2011-10-25 04:45:58 -0400 (Tue, 25 Oct 2011)
New Revision: 7858
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
Log:
GTNPORTAL-2197: Allow to tune caches easily
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml 2011-10-25 07:20:27 UTC (rev 7857)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/common-configuration.xml 2011-10-25 08:45:58 UTC (rev 7858)
@@ -117,8 +117,8 @@
<description>The default cache configuration</description>
<object type="org.exoplatform.services.cache.ExoCacheConfig">
<field name="name"><string>default</string></field>
- <field name="maxSize"><int>300</int></field>
- <field name="liveTime"><long>600</long></field>
+ <field name="maxSize"><int>${cache.config.default.maxSize:300}</int></field>
+ <field name="liveTime"><long>${cache.config.default.liveTime:600}</long></field>
<field name="distributed"><boolean>false</boolean></field>
<field name="implementation"><string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string></field>
</object>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2011-10-25 07:20:27 UTC (rev 7857)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2011-10-25 08:45:58 UTC (rev 7858)
@@ -334,10 +334,10 @@
<string>MOPSessionManager</string>
</field>
<field name="maxSize">
- <int>5000</int>
+ <int>${cache.config.MOPSessionManager.maxSize:5000}</int>
</field>
<field name="liveTime">
- <long>600</long>
+ <long>${cache.config.MOPSessionManager.liveTime:600}</long>
</field>
<field name="implementation">
<string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string>
@@ -360,8 +360,11 @@
<string>MOPSessionManager</string>
</field>
<field name="expirationTimeout">
- <long>600</long>
+ <long>${cache.config.MOPSessionManager.expirationTimeout:600000}</long>
</field>
+ <field name="maxNodes">
+ <int>${cache.config.MOPSessionManager.maxNodes:5000}</int>
+ </field>
<field name="distributed">
<boolean>true</boolean>
</field>
@@ -385,10 +388,10 @@
<string>NavigationService</string>
</field>
<field name="maxSize">
- <int>5000</int>
+ <int>${cache.config.NavigationService.maxSize:5000}</int>
</field>
<field name="liveTime">
- <long>600</long>
+ <long>${cache.config.NavigationService.liveTime:600}</long>
</field>
<field name="implementation">
<string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string>
@@ -411,10 +414,10 @@
<string>NavigationService</string>
</field>
<field name="expirationTimeout">
- <long>600000</long>
+ <long>${cache.config.NavigationService.expirationTimeout:600000}</long>
</field>
<field name="maxNodes">
- <int>5000</int>
+ <int>${cache.config.NavigationService.maxNodes:5000}</int>
</field>
<field name="distributed">
<boolean>true</boolean>
@@ -432,17 +435,17 @@
<description>add Exo Cache Config</description>
<init-params>
<object-param>
- <name>cache.config.NavigationService</name>
+ <name>cache.config.DescriptionService</name>
<description>The JBoss Cache configuration for the dezcription service</description>
<object type="org.exoplatform.services.cache.ExoCacheConfig">
<field name="name">
<string>DescriptionService</string>
</field>
<field name="maxSize">
- <int>5000</int>
+ <int>${cache.config.DescriptionService.maxSize:5000}</int>
</field>
<field name="liveTime">
- <long>600</long>
+ <long>${cache.config.DescriptionService.liveTime:600}</long>
</field>
<field name="implementation">
<string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string>
@@ -458,17 +461,17 @@
<description>add Exo Cache Config</description>
<init-params>
<object-param>
- <name>cache.config.ConfigurationService</name>
+ <name>cache.config.DescriptionService</name>
<description>The JBoss Cache configuration for the description service</description>
<object type="org.exoplatform.services.cache.impl.jboss.ea.EAExoCacheConfig">
<field name="name">
<string>DescriptionService</string>
</field>
<field name="expirationTimeout">
- <long>600000</long>
+ <long>${cache.config.DescriptionService.expirationTimeout:600000}</long>
</field>
<field name="maxNodes">
- <int>5000</int>
+ <int>${cache.config.DescriptionService.maxNodes:5000}</int>
</field>
<field name="distributed">
<boolean>true</boolean>
13 years, 2 months
gatein SVN: r7857 - in portal/trunk: web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UISelector/UIItemSelector and 6 other directories.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2011-10-25 03:20:27 -0400 (Tue, 25 Oct 2011)
New Revision: 7857
Removed:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/portal/PortalTemplateConfigOption.groovy
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/PortalTemplateConfigOption.java
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UISelector/UIItemSelector/Stylesheet.css
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/conf/portal/portal/template/basic/portal.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/template/classic/portal.xml
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
Log:
GTNPORTAL-1766: Adding a new portal template requires editing of the Groovy code for the template list
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 2011-10-25 07:15:09 UTC (rev 7856)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2011-10-25 07:20:27 UTC (rev 7857)
@@ -44,7 +44,6 @@
import org.exoplatform.services.organization.Group;
import org.exoplatform.services.organization.OrganizationService;
import org.picocontainer.Startable;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@@ -673,4 +672,14 @@
{
return newPortalConfigListener_.getDefaultPortal();
}
+
+ public Set<String> getPortalTemplates()
+ {
+ return newPortalConfigListener_.getTemplateConfigs(PortalConfig.PORTAL_TYPE);
+ }
+
+ public PortalConfig getPortalConfigFromTemplate(String templateName)
+ {
+ return newPortalConfigListener_.getPortalConfigFromTemplate(PortalConfig.PORTAL_TYPE, templateName);
+ }
}
Modified: portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UISelector/UIItemSelector/Stylesheet.css
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UISelector/UIItemSelector/Stylesheet.css 2011-10-25 07:15:09 UTC (rev 7856)
+++ portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UISelector/UIItemSelector/Stylesheet.css 2011-10-25 07:20:27 UTC (rev 7857)
@@ -1,22 +1,22 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
.UIItemSelector {
margin: 2px 0px 2px 2px; /* orientation=lt */
margin: 2px 2px 2px 0px; /* orientation=rt */
@@ -42,7 +42,7 @@
background: url('background/TemplateContainer.jpg') no-repeat center -836px;
}
-.UIItemSelector .ItemDetailList .TemplateContainer .ClassicPortalImage {
+.UIItemSelector .ItemDetailList .TemplateContainer .classicImage {
height: 222px;
background: url('background/TemplateContainer.jpg') no-repeat center -392px;
margin-top: 9px;
@@ -53,13 +53,13 @@
background: url('background/TemplateContainer.jpg') no-repeat center -170px;
margin-top: 9px;
}
-
-.UIItemSelector .ItemDetailList .TemplateContainer .BasicPortalImage {
- height: 222px;
- background: url('background/TemplateContainer.jpg') no-repeat center -1059px;
- margin-top: 9px;
-}
+.UIItemSelector .ItemDetailList .TemplateContainer .basicImage {
+ height: 222px;
+ background: url('background/TemplateContainer.jpg') no-repeat center -1052px;
+ margin-top: 9px;
+}
+
.UIItemSelector .TemplateContainer .DefaultImage {
height: 222px;
background: url('background/TemplateContainer.jpg') no-repeat center -392px;
@@ -156,15 +156,15 @@
margin: 0px 5px 0px 5px;
}
-.UIItemSelector .RightColumnStyle .ItemDetailList .Title {
- width: 300px; overflow: hidden;
-}
-
+.UIItemSelector .RightColumnStyle .ItemDetailList .Title {
+ width: 300px; overflow: hidden;
+}
+
.UIItemSelector .RightColumnStyle .ItemListContainer .Title {
- width: 143px; overflow: hidden;
-}
-
-.UIItemSelector .RightColumnStyle .Title {
+ width: 143px; overflow: hidden;
+}
+
+.UIItemSelector .RightColumnStyle .Title {
line-height: 22px; white-space: nowrap;
font-weight: bold; color: #5c5c5c;
float: left; /* orientation=lt */
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 2011-10-25 07:15:09 UTC (rev 7856)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2011-10-25 07:20:27 UTC (rev 7857)
@@ -888,8 +888,8 @@
UIPortalBrowser.msg.Invalid-createPermission=You do not have the right to create a new portal. Contact the administrator.
UIPortalBrowser.deletePortal=Are you sure you want to delete this portal?
SitePortal.label=Site Portal
-ClassicPortal.label=Classic Portal
-BasicPortal.label=Basic Portal
+classic.label=Classic Portal
+basic.label=Basic Portal
############################################################################
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 2011-10-25 07:15:09 UTC (rev 7856)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2011-10-25 07:20:27 UTC (rev 7857)
@@ -809,7 +809,8 @@
UIPortalBrowser.msg.Invalid-createPermission=Vous n'avez pas le droit de créer un nouveau portail. Contactez un administrateur SVP.
UIPortalBrowser.deletePortal=Confirmez-vous la suppression de ce portail ?
SitePortal.label=Portail Site
-ClassicPortal.label=Portal Classique
+classic.label=Portal Classique
+basic.label=Portal Base
############################################################################
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/template/basic/portal.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/template/basic/portal.xml 2011-10-25 07:15:09 UTC (rev 7856)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/template/basic/portal.xml 2011-10-25 07:20:27 UTC (rev 7857)
@@ -25,6 +25,8 @@
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
<portal-name>@owner@</portal-name>
+ <label>Basic Portal</label>
+ <description>This is basic portal template</description>
<locale>en</locale>
<access-permissions>Everyone</access-permissions>
<edit-permission>*:/platform/administrators</edit-permission>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/template/classic/portal.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/template/classic/portal.xml 2011-10-25 07:15:09 UTC (rev 7856)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/template/classic/portal.xml 2011-10-25 07:20:27 UTC (rev 7857)
@@ -25,6 +25,8 @@
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
<portal-name>@owner@</portal-name>
+ <label>Classic Portal</label>
+ <description>This is classic portal template</description>
<locale>en</locale>
<access-permissions>Everyone</access-permissions>
<edit-permission>*:/platform/administrators</edit-permission>
Deleted: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/portal/PortalTemplateConfigOption.groovy
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/portal/PortalTemplateConfigOption.groovy 2011-10-25 07:15:09 UTC (rev 7856)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/portal/PortalTemplateConfigOption.groovy 2011-10-25 07:20:27 UTC (rev 7857)
@@ -1,40 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-import java.util.List;
-import java.util.ArrayList;
-import org.exoplatform.portal.webui.portal.PortalTemplateConfigOption ;
-import org.exoplatform.webui.core.model.SelectItemCategory;
-
-List options = new ArrayList();
-
- SelectItemCategory basic = new SelectItemCategory("BasicPortal");
- basic.addSelectItemOption(
- new PortalTemplateConfigOption("Basic Portal", "basic", "Basic Portal", "BasicPortal").addGroup("/platform/guest")
- );
- options.add(basic);
-
- SelectItemCategory guest = new SelectItemCategory("ClassicPortal");
- guest.addSelectItemOption(
- //new PortalTemplateConfigOption("", "site", "Site Portal", "SitePortal").addGroup("/guest")
- new PortalTemplateConfigOption("", "classic", "Classic Portal", "ClassicPortal").addGroup("/platform/guests")
- );
- options.add(guest);
-
-return options ;
Deleted: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/PortalTemplateConfigOption.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/PortalTemplateConfigOption.java 2011-10-25 07:15:09 UTC (rev 7856)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/PortalTemplateConfigOption.java 2011-10-25 07:20:27 UTC (rev 7857)
@@ -1,54 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.portal.webui.portal;
-
-import org.exoplatform.webui.core.model.SelectItemOption;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Pham Dung Ha
- * ha.pham(a)exoplatform.com
- * May 11, 2007
- */
-public class PortalTemplateConfigOption extends SelectItemOption<String>
-{
-
- private List<String> accessGroup_;
-
- public PortalTemplateConfigOption(String label, String value, String desc, String icon) throws Exception
- {
- super(label, value, desc, icon);
- accessGroup_ = new ArrayList<String>();
- }
-
- public List<String> getGroups()
- {
- return accessGroup_;
- }
-
- public PortalTemplateConfigOption addGroup(String accessGroup)
- {
- accessGroup_.add(accessGroup);
- return this;
- }
-}
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2011-10-25 07:15:09 UTC (rev 7856)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2011-10-25 07:20:27 UTC (rev 7857)
@@ -17,7 +17,7 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.exoplatform.portal.webui.portal;
+package org.exoplatform.portal.webui.portal;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
@@ -35,19 +35,14 @@
import org.exoplatform.portal.webui.workspace.UIMaskWorkspace;
import org.exoplatform.portal.webui.workspace.UIPortalApplication;
import org.exoplatform.portal.webui.workspace.UIWorkingWorkspace;
-import org.exoplatform.services.organization.Group;
-import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.resources.LocaleConfig;
import org.exoplatform.services.resources.LocaleConfigService;
import org.exoplatform.services.resources.ResourceBundleService;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
-import org.exoplatform.webui.config.InitParams;
-import org.exoplatform.webui.config.Param;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.ComponentConfigs;
import org.exoplatform.webui.config.annotation.EventConfig;
-import org.exoplatform.webui.config.annotation.ParamConfig;
import org.exoplatform.webui.core.UIApplication;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
import org.exoplatform.webui.core.model.SelectItemCategory;
@@ -78,13 +73,14 @@
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
+import java.util.Set;
@ComponentConfigs({
@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIFormTabPane.gtmpl", events = {
@EventConfig(listeners = UIPortalForm.SaveActionListener.class),
@EventConfig(listeners = UIMaskWorkspace.CloseActionListener.class, phase = Phase.DECODE),
@EventConfig(listeners = UIPortalForm.CheckShowActionListener.class)}),
- @ComponentConfig(id = "CreatePortal", lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIFormTabPane.gtmpl", initParams = @ParamConfig(name = "PortalTemplateConfigOption", value = "system:/WEB-INF/conf/uiconf/portal/webui/portal/PortalTemplateConfigOption.groovy"), events = {
+ @ComponentConfig(id = "CreatePortal", lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIFormTabPane.gtmpl", events = {
@EventConfig(name = "Save", listeners = UIPortalForm.CreateActionListener.class),
@EventConfig(listeners = UIPortalForm.SelectItemOptionActionListener.class, phase = Phase.DECODE),
@EventConfig(listeners = UIMaskWorkspace.CloseActionListener.class, phase = Phase.DECODE)}),
@@ -110,14 +106,11 @@
private List<SelectItemOption<String>> languages = new ArrayList<SelectItemOption<String>>();
- @SuppressWarnings("unchecked")
- public UIPortalForm(InitParams initParams) throws Exception
+ public void initPortalTemplateTab() throws Exception
{
- super("UIPortalForm");
UIFormInputItemSelector uiTemplateInput = new UIFormInputItemSelector("PortalTemplate", null);
addUIFormInput(uiTemplateInput);
setSelectedTab(uiTemplateInput.getId());
- createDefaultItem();
UIFormInputSet uiPortalSetting = this.<UIFormInputSet> getChildById("PortalSetting");
UIFormStringInput uiNameInput = uiPortalSetting.getUIStringInput(FIELD_NAME);
@@ -127,17 +120,19 @@
setActions(new String[]{"Save", "Close"});
- if (initParams == null)
+ UserPortalConfigService configService = this.getApplicationComponent(UserPortalConfigService.class);
+ Set<String> portalTemplates = configService.getPortalTemplates();
+ for (String tempName : portalTemplates)
{
- return;
+ SelectItemCategory category = new SelectItemCategory(tempName);
+ PortalConfig config = configService.getPortalConfigFromTemplate(tempName);
+ if(config != null)
+ {
+ SelectItemOption<String> option = new SelectItemOption<String>(config.getLabel(), tempName, config.getDescription(), tempName);
+ category.addSelectItemOption(option);
+ uiTemplateInput.getItemCategories().add(category);
+ }
}
- WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
- Param param = initParams.getParam("PortalTemplateConfigOption");
- List<SelectItemCategory> portalTemplates = (List<SelectItemCategory>)param.getFreshObject(context);
- for (SelectItemCategory itemCategory : portalTemplates)
- {
- uiTemplateInput.getItemCategories().add(itemCategory);
- }
if (uiTemplateInput.getSelectedItemOption() == null)
{
uiTemplateInput.getItemCategories().get(0).setSelected(true);
@@ -149,7 +144,6 @@
super("UIPortalForm");
createDefaultItem();
setSelectedTab("PortalSetting");
-
}
public void setBindingBean() throws Exception
@@ -413,15 +407,6 @@
UIPortalForm uiForm = event.getSource();
UIFormInputItemSelector templateInput = uiForm.getChild(UIFormInputItemSelector.class);
uiForm.setSelectedTab(templateInput.getId());
- PortalTemplateConfigOption selectItem =
- (PortalTemplateConfigOption)templateInput.getSelectedCategory().getSelectItemOptions().get(0);
- List<String> groupIds = selectItem.getGroups();
- Group[] groups = new Group[groupIds.size()];
- OrganizationService service = uiForm.getApplicationComponent(OrganizationService.class);
- for (int i = 0; i < groupIds.size(); i++)
- {
- groups[i] = service.getGroupHandler().findGroupById(groupIds.get(i));
- }
event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
}
}
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2011-10-25 07:15:09 UTC (rev 7856)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2011-10-25 07:20:27 UTC (rev 7857)
@@ -248,6 +248,7 @@
}
UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
UIPortalForm uiNewPortal = uiMaskWS.createUIComponent(UIPortalForm.class, "CreatePortal", "UIPortalForm");
+ uiNewPortal.initPortalTemplateTab();
uiMaskWS.setUIComponent(uiNewPortal);
uiMaskWS.setShow(true);
prContext.addUIComponentToUpdateByAjax(uiMaskWS);
13 years, 2 months
gatein SVN: r7856 - in portal/trunk: web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UISelector/UIItemSelector and 6 other directories.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2011-10-25 03:15:09 -0400 (Tue, 25 Oct 2011)
New Revision: 7856
Added:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/portal/PortalTemplateConfigOption.groovy
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/PortalTemplateConfigOption.java
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UISelector/UIItemSelector/Stylesheet.css
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/conf/portal/portal/template/basic/portal.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/template/classic/portal.xml
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
Log:
Revert the last commit due to wrong commit message
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 2011-10-25 06:59:20 UTC (rev 7855)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2011-10-25 07:15:09 UTC (rev 7856)
@@ -44,6 +44,7 @@
import org.exoplatform.services.organization.Group;
import org.exoplatform.services.organization.OrganizationService;
import org.picocontainer.Startable;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@@ -672,14 +673,4 @@
{
return newPortalConfigListener_.getDefaultPortal();
}
-
- public Set<String> getPortalTemplates()
- {
- return newPortalConfigListener_.getTemplateConfigs(PortalConfig.PORTAL_TYPE);
- }
-
- public PortalConfig getPortalConfigFromTemplate(String templateName)
- {
- return newPortalConfigListener_.getPortalConfigFromTemplate(PortalConfig.PORTAL_TYPE, templateName);
- }
}
Modified: portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UISelector/UIItemSelector/Stylesheet.css
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UISelector/UIItemSelector/Stylesheet.css 2011-10-25 06:59:20 UTC (rev 7855)
+++ portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UISelector/UIItemSelector/Stylesheet.css 2011-10-25 07:15:09 UTC (rev 7856)
@@ -1,22 +1,22 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
.UIItemSelector {
margin: 2px 0px 2px 2px; /* orientation=lt */
margin: 2px 2px 2px 0px; /* orientation=rt */
@@ -42,7 +42,7 @@
background: url('background/TemplateContainer.jpg') no-repeat center -836px;
}
-.UIItemSelector .ItemDetailList .TemplateContainer .classicImage {
+.UIItemSelector .ItemDetailList .TemplateContainer .ClassicPortalImage {
height: 222px;
background: url('background/TemplateContainer.jpg') no-repeat center -392px;
margin-top: 9px;
@@ -53,13 +53,13 @@
background: url('background/TemplateContainer.jpg') no-repeat center -170px;
margin-top: 9px;
}
+
+.UIItemSelector .ItemDetailList .TemplateContainer .BasicPortalImage {
+ height: 222px;
+ background: url('background/TemplateContainer.jpg') no-repeat center -1059px;
+ margin-top: 9px;
+}
-.UIItemSelector .ItemDetailList .TemplateContainer .basicImage {
- height: 222px;
- background: url('background/TemplateContainer.jpg') no-repeat center -1052px;
- margin-top: 9px;
-}
-
.UIItemSelector .TemplateContainer .DefaultImage {
height: 222px;
background: url('background/TemplateContainer.jpg') no-repeat center -392px;
@@ -156,15 +156,15 @@
margin: 0px 5px 0px 5px;
}
-.UIItemSelector .RightColumnStyle .ItemDetailList .Title {
- width: 300px; overflow: hidden;
-}
-
+.UIItemSelector .RightColumnStyle .ItemDetailList .Title {
+ width: 300px; overflow: hidden;
+}
+
.UIItemSelector .RightColumnStyle .ItemListContainer .Title {
- width: 143px; overflow: hidden;
-}
-
-.UIItemSelector .RightColumnStyle .Title {
+ width: 143px; overflow: hidden;
+}
+
+.UIItemSelector .RightColumnStyle .Title {
line-height: 22px; white-space: nowrap;
font-weight: bold; color: #5c5c5c;
float: left; /* orientation=lt */
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 2011-10-25 06:59:20 UTC (rev 7855)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2011-10-25 07:15:09 UTC (rev 7856)
@@ -888,8 +888,8 @@
UIPortalBrowser.msg.Invalid-createPermission=You do not have the right to create a new portal. Contact the administrator.
UIPortalBrowser.deletePortal=Are you sure you want to delete this portal?
SitePortal.label=Site Portal
-classic.label=Classic Portal
-basic.label=Basic Portal
+ClassicPortal.label=Classic Portal
+BasicPortal.label=Basic Portal
############################################################################
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 2011-10-25 06:59:20 UTC (rev 7855)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2011-10-25 07:15:09 UTC (rev 7856)
@@ -809,8 +809,7 @@
UIPortalBrowser.msg.Invalid-createPermission=Vous n'avez pas le droit de créer un nouveau portail. Contactez un administrateur SVP.
UIPortalBrowser.deletePortal=Confirmez-vous la suppression de ce portail ?
SitePortal.label=Portail Site
-classic.label=Portal Classique
-basic.label=Portal Base
+ClassicPortal.label=Portal Classique
############################################################################
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/template/basic/portal.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/template/basic/portal.xml 2011-10-25 06:59:20 UTC (rev 7855)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/template/basic/portal.xml 2011-10-25 07:15:09 UTC (rev 7856)
@@ -25,8 +25,6 @@
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
<portal-name>@owner@</portal-name>
- <label>Basic Portal</label>
- <description>This is basic portal template</description>
<locale>en</locale>
<access-permissions>Everyone</access-permissions>
<edit-permission>*:/platform/administrators</edit-permission>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/template/classic/portal.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/template/classic/portal.xml 2011-10-25 06:59:20 UTC (rev 7855)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/template/classic/portal.xml 2011-10-25 07:15:09 UTC (rev 7856)
@@ -25,8 +25,6 @@
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
<portal-name>@owner@</portal-name>
- <label>Classic Portal</label>
- <description>This is classic portal template</description>
<locale>en</locale>
<access-permissions>Everyone</access-permissions>
<edit-permission>*:/platform/administrators</edit-permission>
Copied: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/portal/PortalTemplateConfigOption.groovy (from rev 7854, portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/portal/PortalTemplateConfigOption.groovy)
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/portal/PortalTemplateConfigOption.groovy (rev 0)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/portal/PortalTemplateConfigOption.groovy 2011-10-25 07:15:09 UTC (rev 7856)
@@ -0,0 +1,40 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+import java.util.List;
+import java.util.ArrayList;
+import org.exoplatform.portal.webui.portal.PortalTemplateConfigOption ;
+import org.exoplatform.webui.core.model.SelectItemCategory;
+
+List options = new ArrayList();
+
+ SelectItemCategory basic = new SelectItemCategory("BasicPortal");
+ basic.addSelectItemOption(
+ new PortalTemplateConfigOption("Basic Portal", "basic", "Basic Portal", "BasicPortal").addGroup("/platform/guest")
+ );
+ options.add(basic);
+
+ SelectItemCategory guest = new SelectItemCategory("ClassicPortal");
+ guest.addSelectItemOption(
+ //new PortalTemplateConfigOption("", "site", "Site Portal", "SitePortal").addGroup("/guest")
+ new PortalTemplateConfigOption("", "classic", "Classic Portal", "ClassicPortal").addGroup("/platform/guests")
+ );
+ options.add(guest);
+
+return options ;
Copied: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/PortalTemplateConfigOption.java (from rev 7854, portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/PortalTemplateConfigOption.java)
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/PortalTemplateConfigOption.java (rev 0)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/PortalTemplateConfigOption.java 2011-10-25 07:15:09 UTC (rev 7856)
@@ -0,0 +1,54 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.portal.webui.portal;
+
+import org.exoplatform.webui.core.model.SelectItemOption;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Pham Dung Ha
+ * ha.pham(a)exoplatform.com
+ * May 11, 2007
+ */
+public class PortalTemplateConfigOption extends SelectItemOption<String>
+{
+
+ private List<String> accessGroup_;
+
+ public PortalTemplateConfigOption(String label, String value, String desc, String icon) throws Exception
+ {
+ super(label, value, desc, icon);
+ accessGroup_ = new ArrayList<String>();
+ }
+
+ public List<String> getGroups()
+ {
+ return accessGroup_;
+ }
+
+ public PortalTemplateConfigOption addGroup(String accessGroup)
+ {
+ accessGroup_.add(accessGroup);
+ return this;
+ }
+}
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2011-10-25 06:59:20 UTC (rev 7855)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2011-10-25 07:15:09 UTC (rev 7856)
@@ -17,7 +17,7 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.exoplatform.portal.webui.portal;
+package org.exoplatform.portal.webui.portal;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
@@ -35,14 +35,19 @@
import org.exoplatform.portal.webui.workspace.UIMaskWorkspace;
import org.exoplatform.portal.webui.workspace.UIPortalApplication;
import org.exoplatform.portal.webui.workspace.UIWorkingWorkspace;
+import org.exoplatform.services.organization.Group;
+import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.resources.LocaleConfig;
import org.exoplatform.services.resources.LocaleConfigService;
import org.exoplatform.services.resources.ResourceBundleService;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.config.InitParams;
+import org.exoplatform.webui.config.Param;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.ComponentConfigs;
import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.config.annotation.ParamConfig;
import org.exoplatform.webui.core.UIApplication;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
import org.exoplatform.webui.core.model.SelectItemCategory;
@@ -73,14 +78,13 @@
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-import java.util.Set;
@ComponentConfigs({
@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIFormTabPane.gtmpl", events = {
@EventConfig(listeners = UIPortalForm.SaveActionListener.class),
@EventConfig(listeners = UIMaskWorkspace.CloseActionListener.class, phase = Phase.DECODE),
@EventConfig(listeners = UIPortalForm.CheckShowActionListener.class)}),
- @ComponentConfig(id = "CreatePortal", lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIFormTabPane.gtmpl", events = {
+ @ComponentConfig(id = "CreatePortal", lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIFormTabPane.gtmpl", initParams = @ParamConfig(name = "PortalTemplateConfigOption", value = "system:/WEB-INF/conf/uiconf/portal/webui/portal/PortalTemplateConfigOption.groovy"), events = {
@EventConfig(name = "Save", listeners = UIPortalForm.CreateActionListener.class),
@EventConfig(listeners = UIPortalForm.SelectItemOptionActionListener.class, phase = Phase.DECODE),
@EventConfig(listeners = UIMaskWorkspace.CloseActionListener.class, phase = Phase.DECODE)}),
@@ -106,11 +110,14 @@
private List<SelectItemOption<String>> languages = new ArrayList<SelectItemOption<String>>();
- public void initPortalTemplateTab() throws Exception
+ @SuppressWarnings("unchecked")
+ public UIPortalForm(InitParams initParams) throws Exception
{
+ super("UIPortalForm");
UIFormInputItemSelector uiTemplateInput = new UIFormInputItemSelector("PortalTemplate", null);
addUIFormInput(uiTemplateInput);
setSelectedTab(uiTemplateInput.getId());
+ createDefaultItem();
UIFormInputSet uiPortalSetting = this.<UIFormInputSet> getChildById("PortalSetting");
UIFormStringInput uiNameInput = uiPortalSetting.getUIStringInput(FIELD_NAME);
@@ -120,19 +127,17 @@
setActions(new String[]{"Save", "Close"});
- UserPortalConfigService configService = this.getApplicationComponent(UserPortalConfigService.class);
- Set<String> portalTemplates = configService.getPortalTemplates();
- for (String tempName : portalTemplates)
+ if (initParams == null)
{
- SelectItemCategory category = new SelectItemCategory(tempName);
- PortalConfig config = configService.getPortalConfigFromTemplate(tempName);
- if(config != null)
- {
- SelectItemOption<String> option = new SelectItemOption<String>(config.getLabel(), tempName, config.getDescription(), tempName);
- category.addSelectItemOption(option);
- uiTemplateInput.getItemCategories().add(category);
- }
+ return;
}
+ WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
+ Param param = initParams.getParam("PortalTemplateConfigOption");
+ List<SelectItemCategory> portalTemplates = (List<SelectItemCategory>)param.getFreshObject(context);
+ for (SelectItemCategory itemCategory : portalTemplates)
+ {
+ uiTemplateInput.getItemCategories().add(itemCategory);
+ }
if (uiTemplateInput.getSelectedItemOption() == null)
{
uiTemplateInput.getItemCategories().get(0).setSelected(true);
@@ -144,6 +149,7 @@
super("UIPortalForm");
createDefaultItem();
setSelectedTab("PortalSetting");
+
}
public void setBindingBean() throws Exception
@@ -407,6 +413,15 @@
UIPortalForm uiForm = event.getSource();
UIFormInputItemSelector templateInput = uiForm.getChild(UIFormInputItemSelector.class);
uiForm.setSelectedTab(templateInput.getId());
+ PortalTemplateConfigOption selectItem =
+ (PortalTemplateConfigOption)templateInput.getSelectedCategory().getSelectItemOptions().get(0);
+ List<String> groupIds = selectItem.getGroups();
+ Group[] groups = new Group[groupIds.size()];
+ OrganizationService service = uiForm.getApplicationComponent(OrganizationService.class);
+ for (int i = 0; i < groupIds.size(); i++)
+ {
+ groups[i] = service.getGroupHandler().findGroupById(groupIds.get(i));
+ }
event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
}
}
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2011-10-25 06:59:20 UTC (rev 7855)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2011-10-25 07:15:09 UTC (rev 7856)
@@ -248,7 +248,6 @@
}
UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
UIPortalForm uiNewPortal = uiMaskWS.createUIComponent(UIPortalForm.class, "CreatePortal", "UIPortalForm");
- uiNewPortal.initPortalTemplateTab();
uiMaskWS.setUIComponent(uiNewPortal);
uiMaskWS.setShow(true);
prContext.addUIComponentToUpdateByAjax(uiMaskWS);
13 years, 2 months