Author: mwringe
Date: 2011-08-19 15:54:37 -0400 (Fri, 19 Aug 2011)
New Revision: 7193
Modified:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/model/Application.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalConfig.java
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalProperties.java
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/classic/portal.xml
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
Log:
JBEPP-1098: merge in changes from GTNPORTAL-1558 to add support to configure behaviour of
portlet show info bar.
Modified:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/model/Application.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/model/Application.java 2011-08-19
18:35:04 UTC (rev 7192)
+++
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/model/Application.java 2011-08-19
19:54:37 UTC (rev 7193)
@@ -46,7 +46,7 @@
private String description;
- private boolean showInfoBar = true;
+ private boolean showInfoBar;
private boolean showApplicationState = true;
Modified:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalConfig.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalConfig.java 2011-08-19
18:35:04 UTC (rev 7192)
+++
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalConfig.java 2011-08-19
19:54:37 UTC (rev 7193)
@@ -245,6 +245,28 @@
setProperty(PortalProperties.SESSION_ALIVE, type);
}
+ public Boolean isShowInfobar()
+ {
+ String value = getProperty(PortalProperties.SHOW_PORTLET_INFO, "1");
+ if (Integer.parseInt(value) == 1)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ public void setShowInfobar(Boolean value)
+ {
+ if (value)
+ {
+ setProperty(PortalProperties.SHOW_PORTLET_INFO, "1");
+ }
+ else
+ {
+ setProperty(PortalProperties.SHOW_PORTLET_INFO, "0");
+ }
+ }
+
public void setDescription(String description)
{
this.description = description;
Modified:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalProperties.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalProperties.java 2011-08-19
18:35:04 UTC (rev 7192)
+++
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalProperties.java 2011-08-19
19:54:37 UTC (rev 7193)
@@ -35,4 +35,6 @@
final public static String SESSION_NEVER = "never";
final public static String GADGET_SERVER = "gadgetServer";
+
+ final public static String SHOW_PORTLET_INFO = "showPortletInfo";
}
Modified:
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2011-08-19
18:35:04 UTC (rev 7192)
+++
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2011-08-19
19:54:37 UTC (rev 7193)
@@ -364,6 +364,7 @@
UIPortalForm.label.option.always=Always
UIPortalForm.label.option.onDemand=On Demand
UIPortalForm.label.option.never=Never
+UIPortalForm.label.showInfobar=Show info bar by default
UIPortalForm.tab.label.PortalSetting=Portal Setting
UIPortalForm.tab.label.PortalTemplate=Portal Templates
UIPortalForm.tab.label.PermissionSetting=Permission Setting
Modified:
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2011-08-19
18:35:04 UTC (rev 7192)
+++
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2011-08-19
19:54:37 UTC (rev 7193)
@@ -336,6 +336,7 @@
UIPortalForm.label.option.always=Always
UIPortalForm.label.option.onDemand=On Demand
UIPortalForm.label.option.never=Never
+UIPortalForm.label.showInfobar=Afficher la barre d'info par défaut
UIPortalForm.tab.label.PortalSetting=Configuration du portal
UIPortalForm.tab.label.PortalTemplate=Modèles de portails
UIPortalForm.tab.label.PermissionSetting=Configuration des permissions
Modified:
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties 2011-08-19
18:35:04 UTC (rev 7192)
+++
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties 2011-08-19
19:54:37 UTC (rev 7193)
@@ -331,6 +331,7 @@
UIPortalForm.label.option.always=Luôn luôn
UIPortalForm.label.option.onDemand=Theo yêu cầu
UIPortalForm.label.option.never=Không bao giờ
+UIPortalForm.label.showInfobar=Mặc định hiển thị thanh thông tin
UIPortalForm.tab.label.PortalSetting=Cấu hình Portal
UIPortalForm.tab.label.PortalTemplate=Các Portal mẫu
UIPortalForm.tab.label.PermissionSetting=Tùy chọn phân quyền sử dụng
Modified:
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/classic/portal.xml
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/classic/portal.xml 2011-08-19
18:35:04 UTC (rev 7192)
+++
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/classic/portal.xml 2011-08-19
19:54:37 UTC (rev 7193)
@@ -30,6 +30,7 @@
<edit-permission>*:/platform/administrators</edit-permission>
<properties>
<entry key="sessionAlive">onDemand</entry>
+ <entry key="showPortletInfo">0</entry>
</properties>
<portal-layout>
Modified:
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2011-08-19
18:35:04 UTC (rev 7192)
+++
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2011-08-19
19:54:37 UTC (rev 7193)
@@ -309,6 +309,28 @@
setProperty(PortalProperties.SESSION_ALIVE, type);
}
+ public Boolean isShowInfobar()
+ {
+ String value = getProperty(PortalProperties.SHOW_PORTLET_INFO, "1");
+ if (Integer.parseInt(value) == 1)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ public void setShowInfobar(Boolean value)
+ {
+ if (value)
+ {
+ setProperty(PortalProperties.SHOW_PORTLET_INFO, "1");
+ }
+ else
+ {
+ setProperty(PortalProperties.SHOW_PORTLET_INFO, "0");
+ }
+ }
+
public String getLabel()
{
return label;
Modified:
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2011-08-19
18:35:04 UTC (rev 7192)
+++
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2011-08-19
19:54:37 UTC (rev 7193)
@@ -21,6 +21,7 @@
import org.exoplatform.application.registry.Application;
import org.exoplatform.portal.application.PortalRequestContext;
+import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.ApplicationState;
@@ -28,6 +29,7 @@
import org.exoplatform.portal.config.model.CloneApplicationState;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.TransientApplicationState;
+import org.exoplatform.portal.mop.SiteType;
import org.exoplatform.portal.webui.application.PortletState;
import org.exoplatform.portal.webui.application.UIPortlet;
import org.exoplatform.portal.webui.container.UITabContainer;
@@ -332,6 +334,12 @@
}
uiPortlet.setPortletInPortal(uiTarget instanceof UIPortal);
uiPortlet.setShowEditControl(true);
+
+ //TODO Wait to fix issue EXOGTN-213 and then
+ //we should get "showInfobar" from current UI portal instead of
Storage service
+ UIPortal currentPortal = Util.getUIPortal();
+ DataStorage storage = uiApp.getApplicationComponent(DataStorage.class);
+
uiPortlet.setShowInfoBar(storage.getPortalConfig(currentPortal.getSiteKey().getTypeName(),
currentPortal.getSiteKey().getName()).isShowInfobar());
uiSource = uiPortlet;
}
List<UIComponent> children = uiTarget.getChildren();
Modified:
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2011-08-19
18:35:04 UTC (rev 7192)
+++
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2011-08-19
19:54:37 UTC (rev 7193)
@@ -55,6 +55,7 @@
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.event.EventListener;
+import org.exoplatform.webui.form.UIFormCheckBoxInput;
import org.exoplatform.webui.form.UIFormInputItemSelector;
import org.exoplatform.webui.form.UIFormInputSet;
import org.exoplatform.webui.form.UIFormSelectBox;
@@ -80,7 +81,8 @@
@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 = 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 = {
@EventConfig(name = "Save", listeners =
UIPortalForm.CreateActionListener.class),
@EventConfig(listeners = UIPortalForm.SelectItemOptionActionListener.class, phase =
Phase.DECODE),
@@ -97,6 +99,8 @@
private static final String FIELD_SESSION_ALIVE = "sessionAlive";
+ private static final String FIELD_SHOW_INFOBAR = "showInfobar";
+
private static final String FIELD_LABEL = "label";
private static final String FIELD_DESCRIPTION = "description";
@@ -269,6 +273,11 @@
new UIFormSelectBox(FIELD_SESSION_ALIVE, FIELD_SESSION_ALIVE,
listSessionAlive);
uiSessionAliveBox.setValue(PortalProperties.SESSION_ON_DEMAND);
uiPropertiesSet.addUIFormInput(uiSessionAliveBox);
+
+ //TODO add more box for showPortletMode and showWindowState if needed
+ UIFormCheckBoxInput<Boolean> uiShowInfobarBox = new
UIFormCheckBoxInput<Boolean>(FIELD_SHOW_INFOBAR, FIELD_SHOW_INFOBAR, true);
+ uiShowInfobarBox.setOnChange("CheckShowInfobar");
+ uiPropertiesSet.addChild(uiShowInfobarBox);
addUIFormInput(uiPropertiesSet);
UIFormInputSet uiPermissionSetting = createUIComponent(UIFormInputSet.class,
"PermissionSetting", null);
@@ -417,6 +426,21 @@
}
}
+ static public class CheckShowActionListener extends EventListener<UIPortalForm>
+ {
+ public void execute(Event<UIPortalForm> event) throws Exception
+ {
+ UIPortalForm uiForm = event.getSource();
+ UIFormInputSet InfoForm = uiForm.getChildById("Properties");
+ UIFormCheckBoxInput<Boolean> showInfobarForm =
InfoForm.getUIFormCheckBoxInput(UIPortalForm.FIELD_SHOW_INFOBAR);
+
+ //TODO: When we need to implement for showPortletMode or showWindowState
+ // we can change how to get/set value for showInfobarForm (as well as of
PortalConfig)
+ showInfobarForm.setValue(showInfobarForm.isChecked());
+ event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
+ }
+ }
+
private String capitalizeFirstLetter(String word)
{
if (word == null)