Author: ndkhoiits
Date: 2011-04-08 06:03:03 -0400 (Fri, 08 Apr 2011)
New Revision: 6182
Modified:
portal/branches/site-describability/component/portal/src/test/java/org/exoplatform/portal/TestXSDCorruption.java
portal/branches/site-describability/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UISiteManagement.gtmpl
portal/branches/site-describability/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
portal/branches/site-describability/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
portal/branches/site-describability/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
portal/branches/site-describability/webui/portal/src/main/java/org/exoplatform/portal/webui/util/PortalDataMapper.java
Log:
GTNPORTAL-1854 Allow edit site's label and description on UI
Modified:
portal/branches/site-describability/component/portal/src/test/java/org/exoplatform/portal/TestXSDCorruption.java
===================================================================
---
portal/branches/site-describability/component/portal/src/test/java/org/exoplatform/portal/TestXSDCorruption.java 2011-04-08
07:54:33 UTC (rev 6181)
+++
portal/branches/site-describability/component/portal/src/test/java/org/exoplatform/portal/TestXSDCorruption.java 2011-04-08
10:03:03 UTC (rev 6182)
@@ -55,10 +55,10 @@
assertEquals(expected, sb.toString());
}
- public void testGateInResources1_0() throws Exception
+ public void testGateInResources1_x() throws Exception
{
assertHash("d0591b0a022a0c2929e1aed8979857cd",
"gatein_objects_1_0.xsd");
assertHash("99ae24c9bbfe1b59e066756a29ab6c79",
"gatein_objects_1_1.xsd");
- assertHash("a3e06cf2a8c72cd8528e1112415e0b8b",
"gatein_objects_1_2.xsd");
+ assertHash("616e7a91a5a841009f672af484f4861e",
"gatein_objects_1_2.xsd");
}
}
Modified:
portal/branches/site-describability/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UISiteManagement.gtmpl
===================================================================
---
portal/branches/site-describability/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UISiteManagement.gtmpl 2011-04-08
07:54:33 UTC (rev 6181)
+++
portal/branches/site-describability/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UISiteManagement.gtmpl 2011-04-08
10:03:03 UTC (rev 6182)
@@ -19,9 +19,20 @@
<tr>
<td class="Image"><img
src="/exoadmin/skin/navigation/webui/component/background/PlImg.gif"
alt=""/></td>
<td class="Content">
- <div
class="Label"><%=uicomponent.getFieldValue(portalConfig, 'name')
%></div>
-
- </td>
+ <div
class="Label"><%=uicomponent.getFieldValue(portalConfig, 'name')
%></div>
+ <%
+ def siteLabel = uicomponent.getFieldValue(portalConfig,
'label');
+ def siteDescription = uicomponent.getFieldValue(portalConfig,
'description');
+ if (siteLabel != null && siteLabel.trim().length()
> 0)
+ {
+ print
"""<div>$siteLabel</div>""";
+ }
+ if (siteDescription != null &&
siteDescription.trim().length() > 0)
+ {
+ print
"""<div>$siteDescription</div>""";
+ }
+ %>
+ </td>
<td class="ActionBlock">
<a href="<%=uicomponent.event("EditPortalLayout",
portalConfig.getName());%>"
class="EditLayoutIcon"><%=_ctx.appRes("UISiteManagement.label.editLayout")%></a>
<a href="<%=uicomponent.event("EditNavigation",
portalConfig.getName());%>"
class="EditNavIcon"><%=_ctx.appRes("UISiteManagement.label.editNav")%></a>
Modified:
portal/branches/site-describability/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
---
portal/branches/site-describability/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2011-04-08
07:54:33 UTC (rev 6181)
+++
portal/branches/site-describability/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2011-04-08
10:03:03 UTC (rev 6182)
@@ -355,6 +355,8 @@
UIPortalForm.msg.sameName=This portal name already exists.
UIPortalForm.msg.notExistAnymore=This portal is not existed or may be deleted.
UIPortalForm.label.name=Portal Name :
+UIPortalForm.label.label=Label :
+UIPortalForm.label.description=Description :
UIPortalForm.label.locale=#{word.locale} :
UIPortalForm.label.date=#{word.date} :
UIPortalForm.label.factoryId=Portal Types
Modified:
portal/branches/site-describability/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java
===================================================================
---
portal/branches/site-describability/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2011-04-08
07:54:33 UTC (rev 6181)
+++
portal/branches/site-describability/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortal.java 2011-04-08
10:03:03 UTC (rev 6182)
@@ -89,6 +89,10 @@
private String ownerType;
private String locale;
+
+ private String label;
+
+ private String description;
private String editPermission;
@@ -378,6 +382,26 @@
setProperty(PortalProperties.SESSION_ALIVE, type);
}
+ public String getLabel()
+ {
+ return label;
+ }
+
+ public void setLabel(String label)
+ {
+ this.label = label;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
private void localizePageNavigation(PageNavigation nav,Locale locale)
{
ResourceBundleManager mgr = getApplicationComponent(ResourceBundleManager.class);
Modified:
portal/branches/site-describability/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
===================================================================
---
portal/branches/site-describability/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2011-04-08
07:54:33 UTC (rev 6181)
+++
portal/branches/site-describability/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2011-04-08
10:03:03 UTC (rev 6182)
@@ -96,6 +96,10 @@
private static final String FIELD_LOCALE = "locale";
private static final String FIELD_SESSION_ALIVE = "sessionAlive";
+
+ private static final String FIELD_LABEL = "label";
+
+ private static final String FIELD_DESCRIPTION = "description";
private String portalOwner_;
@@ -181,7 +185,6 @@
setActions(new String[]{"Save", "Close"});
}
- @SuppressWarnings("unchecked")
private class LanguagesComparator implements Comparator<SelectItemOption>
{
public int compare(SelectItemOption o1, SelectItemOption o2)
@@ -237,7 +240,10 @@
StringLengthValidator.class, 3,
30).addValidator(IdentifierValidator.class).setEditable(false))
.addUIFormInput(
new UIFormSelectBox(FIELD_LOCALE, FIELD_LOCALE,
languages).addValidator(MandatoryValidator.class));
-
+
+ uiSettingSet.addUIFormInput(new UIFormStringInput(FIELD_LABEL, FIELD_LABEL,
null));
+ uiSettingSet.addUIFormInput(new UIFormStringInput(FIELD_DESCRIPTION,
FIELD_DESCRIPTION, null));
+
List<SelectItemOption<String>> listSkin = new
ArrayList<SelectItemOption<String>>();
SkinService skinService = getApplicationComponent(SkinService.class);
for (String skin : skinService.getAvailableSkinNames())
Modified:
portal/branches/site-describability/webui/portal/src/main/java/org/exoplatform/portal/webui/util/PortalDataMapper.java
===================================================================
---
portal/branches/site-describability/webui/portal/src/main/java/org/exoplatform/portal/webui/util/PortalDataMapper.java 2011-04-08
07:54:33 UTC (rev 6181)
+++
portal/branches/site-describability/webui/portal/src/main/java/org/exoplatform/portal/webui/util/PortalDataMapper.java 2011-04-08
10:03:03 UTC (rev 6182)
@@ -198,6 +198,8 @@
PortalConfig model = new PortalConfig(uiPortal.getOwnerType(), uiPortal.getName(),
uiPortal.getStorageId());
model.setAccessPermissions(uiPortal.getAccessPermissions());
model.setEditPermission(uiPortal.getEditPermission());
+ model.setLabel(uiPortal.getLabel());
+ model.setDescription(uiPortal.getDescription());
model.setLocale(uiPortal.getLocale());
model.setSkin(uiPortal.getSkin());
model.setModifiable(uiPortal.isModifiable());
@@ -347,6 +349,8 @@
uiPortal.setOwner(model.getName());
uiPortal.setModifiable(model.isModifiable());
+ uiPortal.setLabel(model.getLabel());
+ uiPortal.setDescription(model.getDescription());
uiPortal.setLocale(model.getLocale());
uiPortal.setSkin(model.getSkin());
uiPortal.setAccessPermissions(model.getAccessPermissions());