gatein SVN: r1211 - in portal/trunk: portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component and 1 other directories.
by do-not-reply@jboss.org
Author: wesleyhales
Date: 2010-01-10 13:02:26 -0500 (Sun, 10 Jan 2010)
New Revision: 1211
Added:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpGrid.gtmpl
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIGrid.gtmpl
Log:
Fixed issues with grid and other errors. Had to utilize ProducerOverview to do so. Still working on getting tab to stick when change is made.
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java 2010-01-09 22:38:27 UTC (rev 1210)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java 2010-01-10 18:02:26 UTC (rev 1211)
@@ -26,10 +26,12 @@
import org.exoplatform.commons.utils.ListAccess;
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.web.application.ApplicationMessage;
+import org.exoplatform.webui.application.WebuiRequestContext;
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.core.UIApplication;
+import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.core.UIGrid;
import org.exoplatform.webui.core.UIPopupWindow;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
@@ -55,23 +57,18 @@
import java.util.Map;
/** @author Wesley Hales */
-@ComponentConfigs({
- @ComponentConfig(id = "RegistrationPropertySelector", type = UIGrid.class, template = "system:/groovy/webui/core/UIGrid.gtmpl"),
- @ComponentConfig(
- lifecycle = UIFormLifecycle.class,
- template = "app:/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl",
- events = {
- @EventConfig(listeners = UIWsrpProducerEditor.AddPropertyActionListener.class),
- @EventConfig(listeners = UIWsrpProducerEditor.EditPropertyActionListener.class),
- @EventConfig(listeners = UIWsrpProducerEditor.DeletePropertyActionListener.class),
- @EventConfig(listeners = UIWsrpProducerEditor.SaveActionListener.class)
- }
- )})
+
+@ComponentConfig(
+ lifecycle = UIFormLifecycle.class,
+ template = "app:/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl",
+ events = {
+ @EventConfig(listeners = UIWsrpProducerEditor.SaveActionListener.class)
+})
+
public class UIWsrpProducerEditor extends UIForm
{
- private static String[] FIELDS = {"name", "description", "label", "hint"};
- private static String[] SELECT_ACTIONS = {"AddProperty", "EditProperty", "DeleteProperty"};
+
private static final String REG_REQUIRED_FOR_DESCRIPTION = "registrationrequiredforfulldescription";
private static final String STRICT_MODE = "strictmode";
private static final String REQUIRES_REGISTRATION = "requiresregistration";
@@ -80,16 +77,15 @@
private static final String REGISTRATION_DETAILS = "registrationdetails";
private ProducerConfigurationService configService;
- private static final String REGISTRATION_PROPERTIES = "RegistrationPropertySelector";
- private static final String REGISTRATION_PROPERTIES_ITERATOR = "ProducerPropPageIterator";
+
private UIFormInputSet registrationDetails;
private UIFormInputBase<String> policy;
private UIFormInputBase<String> validator;
private UIFormCheckBoxInput regReqForDesc;
private UIFormCheckBoxInput strictMode;
private UIFormCheckBoxInput<Boolean> regRequired;
- private UIGrid registrationProperties;
+
public UIWsrpProducerEditor() throws Exception
{
configService = Util.getUIPortalApplication().getApplicationComponent(ProducerConfigurationService.class);
@@ -120,22 +116,9 @@
validator = new UIFormStringInput(VALIDATOR_CLASS, VALIDATOR_CLASS, null);
registrationDetails.addUIFormInput(validator);
- // registration properties
- registrationProperties = registrationDetails.addChild(UIGrid.class, REGISTRATION_PROPERTIES, null);
- //configure the edit and delete buttons based on an id from the data list - this will also be passed as param to listener
- registrationProperties.configure("name", FIELDS, SELECT_ACTIONS);
- registrationProperties.getUIPageIterator().setId(REGISTRATION_PROPERTIES_ITERATOR);
- registrationDetails.addChild(registrationProperties.getUIPageIterator());
- registrationProperties.getUIPageIterator().setRendered(false);
+
init();
-
- //add the popup for property edit and adding new properties
- UIPopupWindow popup = addChild(UIPopupWindow.class, null, null);
- popup.setWindowSize(400, 300);
- UIWsrpProducerPropertyEditor propertyForm = createUIComponent(UIWsrpProducerPropertyEditor.class, null, "Producer Property Editor");
- popup.setUIComponent(propertyForm);
- popup.setRendered(false);
}
ProducerConfigurationService getService()
@@ -159,7 +142,7 @@
{
registrationDetails.setRendered(true);
- RegistrationPolicy policy = registrationRequirements.getPolicy();
+ RegistrationPolicy policy = registrationRequirements.getPolicy();
String policyClassName = policy.getClass().getName();
this.policy.setValue(policyClassName);
@@ -176,72 +159,20 @@
}
// registration properties
- Map<QName, RegistrationPropertyDescription> regProps = configuration.getRegistrationRequirements().getRegistrationProperties();
- registrationProperties.getUIPageIterator().setPageList(createPageList(getPropertyList(regProps)));
+
}
else
{
registrationDetails.setRendered(false);
+ //getParent().findComponentById(UIWsrpProducerOverview.REGISTRATION_PROPERTIES).setRendered(false);
}
}
- private List<RegistrationPropertyDescription> getPropertyList(Map<QName, RegistrationPropertyDescription> descriptions) throws Exception
- {
- Comparator<RegistrationPropertyDescription> descComparator = new Comparator<RegistrationPropertyDescription>()
- {
- public int compare(RegistrationPropertyDescription o1, RegistrationPropertyDescription o2)
- {
- return o1.getName().toString().compareTo(o2.getName().toString());
- }
- };
- List<RegistrationPropertyDescription> result = new ArrayList<RegistrationPropertyDescription>(descriptions.values());
- Collections.sort(result, descComparator);
- return result;
- }
- private LazyPageList<RegistrationPropertyDescription> createPageList(final List<RegistrationPropertyDescription> pageList)
- {
- return new LazyPageList<RegistrationPropertyDescription>(new ListAccess<RegistrationPropertyDescription>()
- {
- public int getSize() throws Exception
- {
- return pageList.size();
- }
- public RegistrationPropertyDescription[] load(int index, int length) throws Exception, IllegalArgumentException
- {
- RegistrationPropertyDescription[] pcs = new RegistrationPropertyDescription[pageList.size()];
- if (index < 0)
- {
- throw new IllegalArgumentException("Illegal index: index must be a positive number");
- }
-
- if (length < 0)
- {
- throw new IllegalArgumentException("Illegal length: length must be a positive number");
- }
-
- if (index + length > pageList.size())
- {
- throw new IllegalArgumentException(
- "Illegal index or length: sum of the index and the length cannot be greater than the list size");
- }
-
- for (int i = 0; i < length; i++)
- {
- pcs[i] = pageList.get(i + index);
- }
-
- return pcs;
- }
-
- }, 10);
- }
-
-
static public class SaveActionListener extends EventListener<UIWsrpProducerEditor>
{
public void execute(Event<UIWsrpProducerEditor> event) throws Exception
@@ -275,70 +206,7 @@
}
}
- static public class EditPropertyActionListener extends EventListener<UIWsrpProducerEditor>
- {
- public void execute(Event<UIWsrpProducerEditor> event) throws Exception
- {
- UIWsrpProducerEditor source = event.getSource();
- UIPopupWindow popup = source.getChild(UIPopupWindow.class);
- UIWsrpProducerPropertyEditor editor = (UIWsrpProducerPropertyEditor)popup.getUIComponent();
- String id = event.getRequestContext().getRequestParameter(OBJECTID);
- try
- {
- editor.setRegistrationPropertyDescription(source.getService().getConfiguration().getRegistrationRequirements().getRegistrationPropertyWith(id));
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- popup.setUIComponent(editor);
- popup.setRendered(true);
- popup.setShow(true);
- }
- }
-
- static public class DeletePropertyActionListener extends EventListener<UIWsrpProducerEditor>
- {
- public void execute(Event<UIWsrpProducerEditor> event)
- {
- UIWsrpProducerEditor source = event.getSource();
- UIApplication uiApp = event.getRequestContext().getUIApplication();
- UIPopupWindow popup = source.getChild(UIPopupWindow.class);
- String id = event.getRequestContext().getRequestParameter(OBJECTID);
- try
- {
- ProducerConfigurationService service = source.getService();
- service.getConfiguration().getRegistrationRequirements().removeRegistrationProperty(id);
- service.saveConfiguration();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- uiApp.addMessage(new ApplicationMessage("Failed to delete Producer Property. Cause: " + e.getCause(), null, ApplicationMessage.ERROR));
- }
-
- }
- }
-
- static public class AddPropertyActionListener extends EventListener<UIWsrpProducerEditor>
- {
- public void execute(Event<UIWsrpProducerEditor> event) throws Exception
- {
- UIWsrpProducerEditor source = event.getSource();
- UIPopupWindow popup = source.getChild(UIPopupWindow.class);
- UIWsrpProducerPropertyEditor editor = (UIWsrpProducerPropertyEditor)popup.getUIComponent();
-
- //reset the form
- editor.setRegistrationPropertyDescription(null);
- popup.setRendered(true);
- popup.setShow(true);
- popup.setShowCloseButton(true);
- //popup.setShowMask(true);
-
- }
- }
-
public static class RegistrationOnChangeActionListener extends EventListener<UIFormCheckBoxInput>
{
public void execute(Event<UIFormCheckBoxInput> event) throws Exception
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java 2010-01-09 22:38:27 UTC (rev 1210)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java 2010-01-10 18:02:26 UTC (rev 1211)
@@ -22,28 +22,214 @@
*/
package org.exoplatform.wsrp.webui.component;
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.commons.utils.ListAccess;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.portal.webui.util.Util;
+import org.exoplatform.web.application.ApplicationMessage;
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.core.UIApplication;
import org.exoplatform.webui.core.UIContainer;
+import org.exoplatform.webui.core.UIGrid;
+import org.exoplatform.webui.core.UIPopupWindow;
import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
+import org.gatein.wsrp.producer.config.ProducerConfiguration;
import org.gatein.wsrp.producer.config.ProducerConfigurationService;
+import org.gatein.wsrp.registration.LocalizedString;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+import javax.xml.namespace.QName;
+import java.util.*;
+
/** @author Wesley Hales */
+@ComponentConfigs({
+@ComponentConfig(id = "RegistrationPropertySelector", type = UIGrid.class, template = "app:/groovy/wsrp/webui/component/UIWsrpGrid.gtmpl"),
@ComponentConfig(
lifecycle = UIApplicationLifecycle.class,
- template = "app:/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl"
-)
+ template = "app:/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl",
+ events = {
+ @EventConfig(listeners = UIWsrpProducerOverview.AddPropertyActionListener.class),
+ @EventConfig(listeners = UIWsrpProducerOverview.EditActionListener.class),
+ @EventConfig(listeners = UIWsrpProducerOverview.DeleteActionListener.class)
+ }
+)})
+
public class UIWsrpProducerOverview extends UIContainer
{
+ private static String[] FIELDS = {"key","name", "description", "label", "hint"};
+ private static String[] SELECT_ACTIONS = {"Add", "Edit", "Delete"};
+
+ public static final String REGISTRATION_PROPERTIES = "RegistrationPropertySelector";
+ private static final String REGISTRATION_PROPERTIES_ITERATOR = "ProducerPropPageIterator";
+ private UIGrid registrationProperties;
+ private ProducerConfigurationService configService;
private UIWsrpProducerEditor producerForm;
public UIWsrpProducerOverview() throws Exception
{
- producerForm = createUIComponent(UIWsrpProducerEditor.class, null, "Producer Editor");
- addChild(producerForm);
+ configService = Util.getUIPortalApplication().getApplicationComponent(ProducerConfigurationService.class);
+ ProducerConfiguration configuration = configService.getConfiguration();
+ //producerForm = createUIComponent();
+ addChild(UIWsrpProducerEditor.class, null, null);
+ // registration properties
+ registrationProperties = addChild(UIGrid.class, REGISTRATION_PROPERTIES, REGISTRATION_PROPERTIES);
+ //configure the edit and delete buttons based on an id from the data list - this will also be passed as param to listener
+ registrationProperties.configure("key", FIELDS, SELECT_ACTIONS);
+ registrationProperties.getUIPageIterator().setId(REGISTRATION_PROPERTIES_ITERATOR);
+ //registrationDetails.addChild(registrationProperties.getUIPageIterator());
+ registrationProperties.getUIPageIterator().setRendered(false);
+
+ Map<QName, RegistrationPropertyDescription> regProps = configuration.getRegistrationRequirements().getRegistrationProperties();
+ registrationProperties.getUIPageIterator().setPageList(createPageList(getPropertyList(regProps)));
+
+ //add the popup for property edit and adding new properties
+ UIPopupWindow popup = addChild(UIPopupWindow.class, null, null);
+ popup.setWindowSize(400, 300);
+ UIWsrpProducerPropertyEditor propertyForm = createUIComponent(UIWsrpProducerPropertyEditor.class, null, "Producer Property Editor");
+ popup.setUIComponent(propertyForm);
+ popup.setRendered(false);
+
}
+ private List<RegistrationPropertyDescription> getPropertyList(Map<QName, RegistrationPropertyDescription> descriptions) throws Exception
+ {
+ Comparator<RegistrationPropertyDescription> descComparator = new Comparator<RegistrationPropertyDescription>()
+ {
+ public int compare(RegistrationPropertyDescription o1, RegistrationPropertyDescription o2)
+ {
+ return o1.getName().toString().compareTo(o2.getName().toString());
+ }
+ };
+ List<RegistrationPropertyDescription> result = new ArrayList<RegistrationPropertyDescription>();
+ for (Object o : descriptions.entrySet()){
+ Map.Entry entry = (Map.Entry)o;
+ RegistrationPropertyDescription rpd = (RegistrationPropertyDescription)entry.getValue();
+ result.add(rpd);
+
+ }
+
+
+ //List<RegistrationPropertyDescription> result = new ArrayList<RegistrationPropertyDescription>(descriptions.values());
+ //Collections.sort(result, descComparator);
+ return result;
+ }
+
+ private LazyPageList<RegistrationPropertyDescription> createPageList(final List<RegistrationPropertyDescription> pageList)
+ {
+ return new LazyPageList<RegistrationPropertyDescription>(new ListAccess<RegistrationPropertyDescription>()
+ {
+
+ public int getSize() throws Exception
+ {
+ return pageList.size();
+ }
+
+ public RegistrationPropertyDescription[] load(int index, int length) throws Exception, IllegalArgumentException
+ {
+ RegistrationPropertyDescription[] pcs = new RegistrationPropertyDescription[pageList.size()];
+
+ if (index < 0)
+ {
+ throw new IllegalArgumentException("Illegal index: index must be a positive number");
+ }
+
+ if (length < 0)
+ {
+ throw new IllegalArgumentException("Illegal length: length must be a positive number");
+ }
+
+ if (index + length > pageList.size())
+ {
+ throw new IllegalArgumentException(
+ "Illegal index or length: sum of the index and the length cannot be greater than the list size");
+ }
+
+ for (int i = 0; i < length; i++)
+ {
+ pcs[i] = pageList.get(i + index);
+ }
+
+ return pcs;
+ }
+
+ }, 10);
+ }
+
+static public class EditActionListener extends EventListener<UIWsrpProducerOverview>
+ {
+ public void execute(Event<UIWsrpProducerOverview> event) throws Exception
+ {
+ UIWsrpProducerOverview source = event.getSource();
+ UIPopupWindow popup = source.getChild(UIPopupWindow.class);
+ UIWsrpProducerPropertyEditor editor = (UIWsrpProducerPropertyEditor)popup.getUIComponent();
+ String id = event.getRequestContext().getRequestParameter(OBJECTID);
+ try
+ {
+ editor.setRegistrationPropertyDescription(source.getService().getConfiguration().getRegistrationRequirements().getRegistrationPropertyWith(id));
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ popup.setUIComponent(editor);
+ popup.setRendered(true);
+ popup.setShow(true);
+
+ }
+ }
+
+ static public class DeleteActionListener extends EventListener<UIWsrpProducerOverview>
+ {
+ public void execute(Event<UIWsrpProducerOverview> event)
+ {
+ UIWsrpProducerOverview source = event.getSource();
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+ UIPopupWindow popup = source.getChild(UIPopupWindow.class);
+ String id = event.getRequestContext().getRequestParameter(OBJECTID);
+ try
+ {
+ ProducerConfigurationService service = source.getService();
+ service.getConfiguration().getRegistrationRequirements().removeRegistrationProperty(id);
+ service.saveConfiguration();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ uiApp.addMessage(new ApplicationMessage("Failed to delete Producer Property. Cause: " + e.getCause(), null, ApplicationMessage.ERROR));
+ }
+
+ }
+ }
+
+ static public class AddPropertyActionListener extends EventListener<UIWsrpProducerOverview>
+ {
+ public void execute(Event<UIWsrpProducerOverview> event) throws Exception
+ {
+ UIWsrpProducerOverview source = event.getSource();
+ UIPopupWindow popup = source.getChild(UIPopupWindow.class);
+ UIWsrpProducerPropertyEditor editor = (UIWsrpProducerPropertyEditor)popup.getUIComponent();
+
+ //reset the form
+ editor.setRegistrationPropertyDescription(null);
+ popup.setRendered(true);
+ popup.setShow(true);
+ popup.setShowCloseButton(true);
+ //popup.setShowMask(true);
+
+ }
+ }
+
+ ProducerConfigurationService getService()
+ {
+ return configService;
+ }
+
+
public ProducerConfigurationService getProducerConfigurationService() throws Exception
{
ExoContainer manager = ExoContainerContext.getCurrentContainer();
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl 2010-01-09 22:38:27 UTC (rev 1210)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl 2010-01-10 18:02:26 UTC (rev 1211)
@@ -1,67 +1,54 @@
-<%
- import org.exoplatform.webui.form.UIFormStringInput;
-%>
-
<div class="UILoginForm" id="ChildTest">
<% uiform.begin() %>
- <%
- UIFormStringInput name = uicomponent.getChild(UIFormStringInput.class);
- %>
- <div class="UserName">
- <div>
- <% //uiform.renderChild(0); %>
- <%
- for (field in uiform.getChildren())
- {
- if (field.isRendered())
- {
- %>
- <div class="form-row">
+
+ <div class="UserName">
+ <div>
+ <% //uiform.renderChild(0); %>
+ <%
+ for (field in uiform.getChildren()) {
+ if (field.isRendered()) {
+ %>
+ <div class="form-row">
<label>
<% fieldName = uicomponent.getLabel(field.getName()); %>
- <% if (!fieldName.equals(uicomponent.getId()))
- { %>
+ <% if (!fieldName.equals(uicomponent.getId())) { %>
<span class="FieldLabel">
- <% if (fieldName != null && fieldName.length() > 0)
- { %>
+ <% if (fieldName != null && fieldName.length() > 0) { %>
<%=uicomponent.getLabel(field.getName())%>
<% } %>
</span>
<% uiform.renderField(field) %>
<% }
- else
- { %>
+ else { %>
<% uiform.renderField(field) %>
<% } %>
</label>
- </div>
- <%
- }
- } %>
-
-
-
</div>
+ <%
+ }
+ } %>
</div>
- <div class="UIAction">
- <table class="ActionContainer">
- <tr>
- <td>
- <div onclick="<%=uicomponent.event("Save")%>" class="ActionButton LightBlueStyle">
- <div class="ButtonLeft">
- <div class="ButtonRight">
- <div class="ButtonMiddle">
- <a href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() + ".action.Save")%></a>
- </div>
+
+ </div>
+ <div class="UIAction">
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div onclick="<%=uicomponent.event("Save")%>" class="ActionButton LightBlueStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() + ".action.Save")%></a>
</div>
</div>
</div>
- </td>
- </tr>
- </table>
- </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
Added: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpGrid.gtmpl
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpGrid.gtmpl (rev 0)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpGrid.gtmpl 2010-01-10 18:02:26 UTC (rev 1211)
@@ -0,0 +1,112 @@
+<%
+ import org.exoplatform.webui.core.UIComponent;
+ import org.exoplatform.webui.form.UIForm;
+ import java.text.DateFormat;
+ import java.text.SimpleDateFormat;
+ import org.gatein.wsrp.registration.LocalizedString;
+
+ String[] beanFields = uicomponent.getBeanFields();
+ String[] beanActions = uicomponent.getBeanActions();
+ UIComponent uiParent = uicomponent.getParent();
+ String name = uicomponent.getLabel();
+ UIForm uiForm = uicomponent.getAncestorOfType(UIForm.class);
+
+ DateFormat dateFormat = null;
+ LocalizedString localizedString = null;
+%>
+<div id="$uicomponent.id">
+ <table class="UIGrid" cellspacing="0">
+ <thead>
+ <tr>
+ <%if(name != null) {%>
+ <%for(field in beanFields) { %>
+ <th><%=_ctx.appRes(name+".header."+field)%></th>
+ <%}%>
+ <%if(beanActions != null) { %>
+ <th><%=_ctx.appRes(name+".header.action")%></th>
+ <%}%>
+ <%}%>
+ <%if(name == null) {%>
+ <%for(field in beanFields) { %>
+ <th><%=_ctx.appRes(uiParent.getName()+".header."+field)%></th>
+ <%}%>
+ <%if(beanActions != null && beanActions.length > 0) { %>
+ <th><%=_ctx.appRes(uiParent.getName()+".header.action")%></th>
+ <%}%>
+ <%}%>
+ </tr>
+ </thead>
+ <tbody>
+ <%if(uicomponent.getUIPageIterator().getAvailable() < 1) {%>
+ <tr>
+ <td style="font-style:italic; color: #FF5604; text-align: center;" colspan="<%=beanFields.length+1%>">
+ <%=_ctx.appRes("UIGrid.msg.empty")%>
+ </td>
+ </tr>
+ <%} else {
+ def rowClass = null;
+ boolean even = true;
+ for (bean in uicomponent.getBeans()) {
+ if(even) rowClass = "EvenRow";
+ else rowClass = "OddRow";
+ even = !even;
+ %>
+ <tr class="$rowClass">
+ <%
+ for(field in beanFields) {
+ def fieldValue = uicomponent.getFieldValue(bean, field);
+ def cssClass = "";
+ if(fieldValue != null) {
+ def fieldClass = fieldValue.getClass();
+ if(fieldClass == Integer.class) cssClass = "number";
+ else if(java.util.Date.class.isAssignableFrom(fieldClass)) {
+ if(dateFormat == null) dateFormat = new SimpleDateFormat("HH:mm:ss yyyy-MM-dd");
+ cssClass = "Datetime";
+ fieldValue = dateFormat.format(fieldValue);
+ }else if(org.gatein.wsrp.registration.LocalizedString.class.isAssignableFrom(fieldClass)) {
+ fieldValue = fieldValue.value
+ }
+ else cssClass = "Text";
+ } else {
+ fieldValue = "";
+ }
+ String value = fieldValue.toString();
+ println "<td><div class=\""+cssClass+"\" title='$fieldValue'>"+fieldValue+"</div></td>";
+ }
+ if(beanActions != null && beanActions.length > 0) {
+ %>
+ <td>
+ <div class="ActionContainer">
+ <%
+ def beanIdField = uicomponent.getBeanIdField();
+ for(action in beanActions) {
+ def beanId = uicomponent.getFieldValue(bean, beanIdField) ;
+ if(action == null) continue;
+ String title = _ctx.appRes(uicomponent.getParent().getName() + ".action.title." + action);
+ String actionLink = "";
+ if(uiForm != null){
+ actionLink = uiForm.event(action, uicomponent.getParent().getId(), beanId);
+ } else {
+ actionLink = uiParent.event(action, beanId);
+ }
+ %>
+ <img onclick="$actionLink" alt="" title="$title" src="/eXoResources/skin/sharedImages/Blank.gif" class="${action}Icon" />
+ <%}%>
+ </div>
+ </td>
+ <%
+ }
+ %>
+ </tr>
+ <%
+ }
+ }
+ %>
+ </tbody>
+ </table> <!--End UIGrid-->
+ <%
+ if(uicomponent.getUIPageIterator().getAvailablePage() > 1) {
+ _ctx.renderUIComponent(uicomponent.getUIPageIterator());
+ }
+ %>
+</div>
\ No newline at end of file
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl 2010-01-09 22:38:27 UTC (rev 1210)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl 2010-01-10 18:02:26 UTC (rev 1211)
@@ -1,69 +1,32 @@
<div class="WSRPProducerConfiguration">
<%
uiform.begin()
- for (field in uiform.getChildren())
- {
- if (field.isRendered())
- {
%>
- <div class="row">
- <%
- label = uicomponent.getLabel(field.getName());
- if (!label.equals(uicomponent.getId()))
- {
- %>
- <label>
- <%
- if (label != null && label.length() > 0)
- {
- %>
- <%=label%>
- <%
- }
- %>
- </label>
- <% uiform.renderField(field) %>
- </div>
<%
- }
- }
- }
- %>
-
- <div class="FloatRight">
-
- <div class="UIAction">
- <table class="ActionContainer">
- <tr>
- <td>
- <div onclick="<%=uicomponent.event("AddProperty")%>" class="ActionButton LightBlueStyle">
- <div class="ButtonLeft">
- <div class="ButtonRight">
- <div class="ButtonMiddle">
- <a href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() + ".action.AddProperty")%></a>
- </div>
- </div>
- </div>
- </div>
- </td>
- <td>
- <div onclick="<%=uicomponent.event("Save")%>" class="ActionButton LightBlueStyle">
- <div class="ButtonLeft">
- <div class="ButtonRight">
- <div class="ButtonMiddle">
- <a href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() + ".action.Save")%></a>
- </div>
- </div>
- </div>
- </div>
- </td>
- </tr>
- </table>
+ for (field in uiform.getChildren()) {
+ if (field.isRendered()) {
+ %>
+ <div class="form-row">
+ <label>
+ <% fieldName = uicomponent.getLabel(field.getName()); %>
+ <% if (!fieldName.equals(uicomponent.getId())) { %>
+ <span class="FieldLabel">
+ <% if (fieldName != null && fieldName.length() > 0) { %>
+ <%=uicomponent.getLabel(field.getName())%>
+ <% } %>
+ </span>
+ <% uiform.renderField(field) %>
+ <% }
+ else { %>
+ <% uiform.renderField(field) %>
+ <% } %>
+ </label>
</div>
+ <%
+ }
+ } %>
-
-
- <div class="ClearRight"><span></span></div>
+
<% uiform.end() %>
- </div>
+
</div>
\ No newline at end of file
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl 2010-01-09 22:38:27 UTC (rev 1210)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl 2010-01-10 18:02:26 UTC (rev 1211)
@@ -1,4 +1,40 @@
+<%
+ import org.exoplatform.wsrp.webui.component.UIWsrpProducerEditor;
+%>
+
<div class="<%=uicomponent.getId()%>" id="<%=uicomponent.getId()%>">
<% uicomponent.renderChildren(); %>
+
+ <div class="FloatRight">
+
+ <div class="UIAction">
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div onclick="<%=uicomponent.event("AddProperty")%>" class="ActionButton LightBlueStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() + ".action.AddProperty")%></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ <td>
+ <div onclick="<%=uicomponent.getChild(UIWsrpProducerEditor.class).event("Save")%>" class="ActionButton LightBlueStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getChild(UIWsrpProducerEditor.class).getId() + ".action.Save")%></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
</div>
\ No newline at end of file
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl 2010-01-09 22:38:27 UTC (rev 1210)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl 2010-01-10 18:02:26 UTC (rev 1211)
@@ -3,63 +3,59 @@
<%
%>
- <div class="SignIn">Add New Registration Property</div>
- <div class="FloatRight">
- <div class="FloatLeft">
- <div class="UserName">
+ <div class="form-title">Add New Registration Property</div>
+ <div>
+
+
<div>
- <!--label>Consumer Name</label-->
- <% //uiform.renderChild(0); %>
- <%
- for (field in uiform.getChildren())
- {
- if (field.isRendered())
- {
- %>
- <div>
- <% fieldName = uicomponent.getLabel(field.getName()); %>
- <% if (!fieldName.equals(uicomponent.getId()))
- { %>
- <div class="FieldLabel">
- <% if (fieldName != null && fieldName.length() > 0)
- { %>
- <%=uicomponent.getLabel(field.getName())%>
- <% } %>
+ <% //uiform.renderChild(0); %>
+ <%
+ for (field in uiform.getChildren()) {
+ if (field.isRendered()) {
+ %>
+ <div class="form-row">
+ <label>
+ <% fieldName = uicomponent.getLabel(field.getName()); %>
+ <% if (!fieldName.equals(uicomponent.getId())) { %>
+ <span class="FieldLabel">
+ <% if (fieldName != null && fieldName.length() > 0) { %>
+ <%=uicomponent.getLabel(field.getName())%>
+ <% } %>
+ </span>
+ <% uiform.renderField(field) %>
+ <% }
+ else { %>
+ <% uiform.renderField(field) %>
+ <% } %>
+ </label>
</div>
- <div class="FieldComponent"><% uiform.renderField(field) %></div>
- <% }
- else
- { %>
- <div class="FieldComponent"><% uiform.renderField(field) %></div>
- <% } %>
+ <%
+ }
+ } %>
+
</div>
- <%
- }
- } %>
+
</div>
- </div>
- <div class="UIAction">
- <table class="ActionContainer">
- <tr>
- <td>
- <div onclick="<%=uicomponent.event("Save")%>" class="ActionButton LightBlueStyle">
- <div class="ButtonLeft">
- <div class="ButtonRight">
- <div class="ButtonMiddle">
- <a href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() + ".action.Save")%></a>
+ <div class="UIAction">
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div onclick="<%=uicomponent.event("Save")%>" class="ActionButton LightBlueStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() + ".action.Save")%></a>
+ </div>
</div>
</div>
</div>
- </div>
- </td>
- </tr>
- </table>
- </div>
+ </td>
+ </tr>
+ </table>
+ </div>
- <div class="ClearLeft"><span></span></div>
- </div>
- <div class="ClearRight"><span></span></div>
- <% uiform.end() %>
-</div>
+
+ <% uiform.end() %>
+
</div>
\ No newline at end of file
Modified: portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIGrid.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIGrid.gtmpl 2010-01-09 22:38:27 UTC (rev 1210)
+++ portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIGrid.gtmpl 2010-01-10 18:02:26 UTC (rev 1211)
@@ -3,6 +3,7 @@
import org.exoplatform.webui.form.UIForm;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
+ import org.gatein.wsrp.registration.LocalizedString;
String[] beanFields = uicomponent.getBeanFields();
String[] beanActions = uicomponent.getBeanActions();
@@ -11,6 +12,7 @@
UIForm uiForm = uicomponent.getAncestorOfType(UIForm.class);
DateFormat dateFormat = null;
+ LocalizedString localizedString = null;
%>
<div id="$uicomponent.id">
<table class="UIGrid" cellspacing="0">
@@ -61,7 +63,9 @@
if(dateFormat == null) dateFormat = new SimpleDateFormat("HH:mm:ss yyyy-MM-dd");
cssClass = "Datetime";
fieldValue = dateFormat.format(fieldValue);
- }
+ }else if(org.gatein.wsrp.registration.LocalizedString.class.isAssignableFrom(fieldClass)) {
+ fieldValue = fieldValue.value
+ }
else cssClass = "Text";
} else {
fieldValue = "";
14 years, 11 months
gatein SVN: r1210 - portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-01-09 17:38:27 -0500 (Sat, 09 Jan 2010)
New Revision: 1210
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java
Log:
- Check for nulls as some elements are optional.
Modified: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java
===================================================================
--- portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java 2010-01-09 22:37:09 UTC (rev 1209)
+++ portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java 2010-01-09 22:38:27 UTC (rev 1210)
@@ -25,6 +25,7 @@
import org.chromattic.api.annotations.PrimaryType;
import org.chromattic.api.annotations.Property;
+import org.gatein.common.util.ParameterValidation;
import org.gatein.wsrp.registration.LocalizedString;
import org.gatein.wsrp.registration.RegistrationPropertyDescription;
@@ -67,9 +68,21 @@
public void initFrom(RegistrationPropertyDescription desc)
{
- setDescription(desc.getDescription().getValue());
- setHint(desc.getHint().getValue());
- setLabel(desc.getLabel().getValue());
+ LocalizedString description = desc.getDescription();
+ if (description != null)
+ {
+ setDescription(description.getValue());
+ }
+ LocalizedString hint = desc.getHint();
+ if (hint != null)
+ {
+ setHint(hint.getValue());
+ }
+ LocalizedString label = desc.getLabel();
+ if (label != null)
+ {
+ setLabel(label.getValue());
+ }
// convert QNames to Strings
setName(desc.getName().toString());
@@ -79,9 +92,21 @@
public RegistrationPropertyDescription toRegistrationPropertyDescription()
{
RegistrationPropertyDescription desc = new RegistrationPropertyDescription(getName(), QName.valueOf(getType()));
- desc.setDefaultDescription(getDescription());
- desc.setHint(new LocalizedString(getHint()));
- desc.setLabel(new LocalizedString(getLabel()));
+ String description = getDescription();
+ if (!ParameterValidation.isNullOrEmpty(description))
+ {
+ desc.setDefaultDescription(description);
+ }
+ String hint = getHint();
+ if (!ParameterValidation.isNullOrEmpty(hint))
+ {
+ desc.setHint(new LocalizedString(hint));
+ }
+ String label = getLabel();
+ if (!ParameterValidation.isNullOrEmpty(label))
+ {
+ desc.setLabel(new LocalizedString(label));
+ }
return desc;
}
14 years, 11 months
gatein SVN: r1209 - portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-01-09 17:37:09 -0500 (Sat, 09 Jan 2010)
New Revision: 1209
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java
Log:
- Cleaned-up some.
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java 2010-01-09 09:42:17 UTC (rev 1208)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java 2010-01-09 22:37:09 UTC (rev 1209)
@@ -36,6 +36,7 @@
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.form.UIForm;
+import org.exoplatform.webui.form.UIFormInputBase;
import org.exoplatform.webui.form.UIFormStringInput;
import org.exoplatform.webui.form.validator.MandatoryValidator;
import org.gatein.common.util.ParameterValidation;
@@ -54,26 +55,33 @@
protected static final String CACHE_EXPIRATION = "Seconds before cache expiration: ";
protected static final String TIMEOUT = "Milliseconds before timeout: ";
protected static final String WSDL_URL = "WSDL URL: ";
+ private UIFormInputBase<String> consumerName;
+ private UIFormStringInput cache;
+ private UIFormStringInput timeoutWS;
+ private UIFormStringInput wsdl;
public UIWsrpConsumerEditor() throws Exception
{
- addUIFormInput(new UIFormStringInput(CONSUMER_NAME, CONSUMER_NAME, null).addValidator(MandatoryValidator.class));
- addUIFormInput(new UIFormStringInput(CACHE_EXPIRATION, CACHE_EXPIRATION, null));
- addUIFormInput(new UIFormStringInput(TIMEOUT, TIMEOUT, null));
- addUIFormInput(new UIFormStringInput(WSDL_URL, WSDL_URL, null));
- //addChild(UIWsrpEndpointConfigForm.class,null,null);
+ consumerName = new UIFormStringInput(CONSUMER_NAME, CONSUMER_NAME, null).addValidator(MandatoryValidator.class);
+ addUIFormInput(consumerName);
+ cache = new UIFormStringInput(CACHE_EXPIRATION, CACHE_EXPIRATION, null);
+ addUIFormInput(cache);
+ timeoutWS = new UIFormStringInput(TIMEOUT, TIMEOUT, null);
+ addUIFormInput(timeoutWS);
+ wsdl = new UIFormStringInput(WSDL_URL, WSDL_URL, null);
+ addUIFormInput(wsdl);
}
private String getConsumerName()
{
- return getUIStringInput(CONSUMER_NAME).getValue();
+ return consumerName.getValue();
}
private Integer getCacheExpiration()
{
Integer cacheExp = 0;
- String cacheExpString = getUIStringInput(CACHE_EXPIRATION).getValue();
+ String cacheExpString = cache.getValue();
if (cacheExpString != null)
{
cacheExp = Integer.parseInt(cacheExpString);
@@ -84,7 +92,7 @@
private Integer getTimeout()
{
int timeout = ManageableServiceFactory.DEFAULT_TIMEOUT_MS;
- String timeoutString = getUIStringInput(TIMEOUT).getValue();
+ String timeoutString = timeoutWS.getValue();
if (!ParameterValidation.isNullOrEmpty(timeoutString))
{
timeout = Integer.parseInt(timeoutString);
@@ -95,7 +103,7 @@
private String getWSDLURL()
{
- return getUIStringInput(WSDL_URL).getValue();
+ return wsdl.getValue();
}
private Boolean newConsumer;
@@ -112,37 +120,27 @@
public void setConsumer(WSRPConsumer consumer) throws Exception
{
- //UIWsrpEndpointConfigForm uiWsrpEndpointConfigForm = getChild(UIWsrpEndpointConfigForm.class);
if (consumer == null)
{
- getUIStringInput(CONSUMER_NAME).setEditable(UIFormStringInput.ENABLE);
+ consumerName.setEditable(UIFormStringInput.ENABLE);
setNewConsumer(true);
return;
}
- getUIStringInput(CONSUMER_NAME).setEditable(UIFormStringInput.ENABLE);
+ consumerName.setEditable(UIFormStringInput.ENABLE);
- getUIStringInput(CONSUMER_NAME).setValue(consumer.getProducerId());
+ consumerName.setValue(consumer.getProducerId());
ProducerInfo producerInfo = consumer.getProducerInfo();
- getUIStringInput(CACHE_EXPIRATION).setValue(producerInfo.getExpirationCacheSeconds().toString());
- getUIStringInput(TIMEOUT).setValue("" + producerInfo.getEndpointConfigurationInfo().getWSOperationTimeOut());
- getUIStringInput(WSDL_URL).setValue(producerInfo.getEndpointConfigurationInfo().getWsdlDefinitionURL());
+ cache.setValue(producerInfo.getExpirationCacheSeconds().toString());
+ timeoutWS.setValue("" + producerInfo.getEndpointConfigurationInfo().getWSOperationTimeOut());
+ wsdl.setValue(producerInfo.getEndpointConfigurationInfo().getWsdlDefinitionURL());
setNewConsumer(false);
- //invokeGetBindingBean(consumer.getProducerInfo());
-
- //uiWsrpEndpointConfigForm.setProducerInfo(consumer.getProducerInfo());
- //uiWsrpEndpointConfigForm.invokeGetBindingBean(consumer.getProducerInfo().getEndpointConfigurationInfo());
- //bindingFields(consumer);
}
private void bindingFields(WSRPConsumer consumer)
{
- //ExoContainer manager = ExoContainerContext.getCurrentContainer();
- //ConsumerRegistry consumerRegistry = (ConsumerRegistry)manager.getComponentInstanceOfType(ConsumerRegistry.class);
ProducerInfo producerInfo = consumer.getProducerInfo();
producerInfo.setId(getConsumerName());
producerInfo.setExpirationCacheSeconds(getCacheExpiration());
- //EndpointConfigurationInfo ecinfo = producerInfo.getEndpointConfigurationInfo().setWsdlDefinitionURL();
- //producerInfo.getEndpointConfigurationInfo().setWsdlDefinitionURL(getWsdlUrl());
}
static public class SaveActionListener extends EventListener<UIWsrpConsumerEditor>
@@ -214,10 +212,6 @@
ConsumerRegistry consumerRegistry = (ConsumerRegistry)manager.getComponentInstanceOfType(ConsumerRegistry.class);
ProducerInfo producerInfo = consumerRegistry.getConsumer(getConsumerName()).getProducerInfo();
- //invokeSetBindingBean(consumer.getProducerInfo());
- //UIWsrpEndpointConfigForm uiWsrpEndpointConfigForm = getChild(UIWsrpEndpointConfigForm.class);
- //uiWsrpEndpointConfigForm.invokeSetBindingBean(consumer.getProducerInfo().getEndpointConfigurationInfo());
-
producerInfo.setId(getConsumerName());
producerInfo.setExpirationCacheSeconds(getCacheExpiration());
producerInfo.getEndpointConfigurationInfo().setWsdlDefinitionURL(getWSDLURL());
14 years, 11 months
gatein SVN: r1208 - in portal/trunk/docs/user-guide/en/modules: gadgetsAdmin and 2 other directories.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-01-09 04:42:17 -0500 (Sat, 09 Jan 2010)
New Revision: 1208
Modified:
portal/trunk/docs/user-guide/en/modules/account/Register_New_Accounts.xml
portal/trunk/docs/user-guide/en/modules/gadgetsAdmin/Manage_Gadgets_in_User_Workspace.xml
portal/trunk/docs/user-guide/en/modules/language/Change_Interface_Language.xml
portal/trunk/docs/user-guide/en/modules/language/Internationalization_Portlet.xml
portal/trunk/docs/user-guide/en/modules/language/Multi-Language_Navigation_Nodes.xml
portal/trunk/docs/user-guide/en/modules/language/Right_To_Left_Support_(RTL).xml
portal/trunk/docs/user-guide/en/modules/portal/Create_a_New_Portal.xml
portal/trunk/docs/user-guide/en/modules/portal/Manage_Portals.xml
portal/trunk/docs/user-guide/en/modules/portal/Switching_between_Portals.xml
Log:
further edits
Modified: portal/trunk/docs/user-guide/en/modules/account/Register_New_Accounts.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/account/Register_New_Accounts.xml 2010-01-08 18:02:27 UTC (rev 1207)
+++ portal/trunk/docs/user-guide/en/modules/account/Register_New_Accounts.xml 2010-01-09 09:42:17 UTC (rev 1208)
@@ -64,7 +64,7 @@
<term>Password</term>
<listitem>
<para>
- The *Password* must be between 6 and 30 characters and can contain space characters. Since Portal 2.6, space characters are either at the beginning or in the end can be counted.
+ The password must be between 6 and 30 characters and can contain spaces.
</para>
</listitem>
</varlistentry>
Modified: portal/trunk/docs/user-guide/en/modules/gadgetsAdmin/Manage_Gadgets_in_User_Workspace.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/gadgetsAdmin/Manage_Gadgets_in_User_Workspace.xml 2010-01-08 18:02:27 UTC (rev 1207)
+++ portal/trunk/docs/user-guide/en/modules/gadgetsAdmin/Manage_Gadgets_in_User_Workspace.xml 2010-01-09 09:42:17 UTC (rev 1208)
@@ -19,21 +19,22 @@
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.
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
--><title>Manage Gadgets</title>
- <orderedlist numeration="arabic">
- <listitem>
- <para>
- Gadgets are a small convenient applications that helps you perform private actions. &PRODUCT; provides you with some useful gadgets: todo, calendar, calculator and RSS Reader. Besides using ready-to-use gadgets, you can easily add gadgets organized in categories to meet the need of your work :
- </para>
- </listitem>
- </orderedlist>
- <section id="sect-User_Guide-Manage_Gadgets_in_User_Workspace-Add_a_Gadget">
- <title>Add a Gadget</title>
- <para>
- To add a gadget, you can follow these steps:
- </para>
+ <para>
+ Gadgets are a small convenient applications that help portal users perform private actions. &PRODUCT; provides you with some useful gadgets by default (see <xref linkend="sect-User_Guide-Dashboard_Portlet-Using_the_Dashboard_Workspace"/>.
+ </para>
+ <para>
+ In addition to these ready-to-use gadgets, &PRODUCT; allows you to easily add gadgets organized in categories to meet your needs.
+ </para>
+
+ <section id="sect-User_Guide-Manage_Gadgets_in_User_Workspace-Manage_Gadget_Categories">
+ <title>Manage Gadget Categories</title>
+ <formalpara>
+ <title>Add a Category</title>
+ <para></para>
+ </formalpara>
<procedure>
<step>
<para>
@@ -42,7 +43,7 @@
</step>
<step>
<para>
- Click the tool!images/Tool.png! icon to add a new category
+ Click the tool icon to add a new category
</para>
<mediaobject>
<imageobject>
@@ -62,7 +63,7 @@
</step>
<step>
<para>
- Click the add icon !images/AddIcon.png! to show the <emphasis role="bold">Gadget Container Form</emphasis> .
+ Click the add icon to show the <emphasis role="bold">Gadget Container Form</emphasis> .
</para>
<mediaobject>
<imageobject>
@@ -82,7 +83,7 @@
<term>Description</term>
<listitem>
<para>
- The brief description of the category.A length from 0 to 255 characters is allowed. This field is not required.
+ The brief description of the category. A length from 0 to 255 characters is allowed. This field is not required.
</para>
</listitem>
</varlistentry>
@@ -95,33 +96,39 @@
</step>
<step>
<para>
- Click on the <emphasis role="bold">Save</emphasis> button to accept adding a new category or click <emphasis role="bold">Cancel</emphasis> to quit. After you added the new category you will see it in the dialog :
+ Click on the <emphasis role="bold">Save</emphasis> button to accept the new category or click <emphasis role="bold">Cancel</emphasis> to quit. After you added the new category you will see it in the dialog :
</para>
<mediaobject>
<imageobject>
<imagedata fileref="images/GadgetManagement1.png" format="PNG" width="444" />
</imageobject>
</mediaobject>
- </step>
- <step>
- <para>
- Edit the information of an existing category by selecting it from the left pane, the selected category is marked by a symbol. Then click the edit icon to show the edit form. Change the current category information and click on the <emphasis role="bold">button</emphasis> to accept changes.
- </para>
- </step>
- <step>
- <para>
- Delete an existing category by selecting it from the left pane. In the message box Click on the <emphasis role="bold">OK</emphasis> button to confirm the deletion or click the <emphasis role="bold">Cancel</emphasis> button.
- </para>
</step>
+ </procedure>
+ <formalpara>
+ <title>Edit Categories</title>
+ <para>
+ Edit the information of an existing category by selecting it from the left pane, the selected category is marked by a symbol. Then click the edit icon to show the edit form. Change the current category information and click on the <emphasis role="bold">button</emphasis> to accept changes.
+ </para>
+ </formalpara>
+
+ <formalpara>
+ <title>Deleting a Category</title>
+ <para>
+ Delete an existing category by selecting it from the left pane. In the message box Click on the <emphasis role="bold">OK</emphasis> button to confirm the deletion or click the <emphasis role="bold">Cancel</emphasis> button.
+ </para>
+ </formalpara>
+ <para>
+ Click on the <emphasis role="bold">Save</emphasis> button in the <emphasis role="bold">Gadget Containers Management</emphasis> dialog to accept or on the <emphasis role="bold">Cancel</emphasis> button to quit. Added categories will be displayed in list in the User Workspace.
+ </para>
+ </section>
+ <section id="sect-User_Guide-Manage_Gadgets_in_User_Workspace-Add_Gadgets">
+ <title>Add Gadgets</title>
+ <procedure>
<step>
<para>
- Click on the <emphasis role="bold">Save</emphasis> button in the <emphasis role="bold">Gadget Containers Management</emphasis> dialog to accept or on the <emphasis role="bold">Cancel</emphasis> button to quit. Added categories will be displayed in list in the User Workspace.
+ Click the list icon to see category list and select the one you want to add a gadget to.
</para>
- </step>
- <step>
- <para>
- 4. Click the list icon!images/ListIcon.png! to see category list and select one in list.
- </para>
<mediaobject>
<imageobject>
<imagedata fileref="images/UserWorkspace1.png" format="PNG" width="444" />
@@ -130,7 +137,7 @@
</step>
<step>
<para>
- 5. Click the add icon!images/AddIcon1.png! at the bottom of the User Workspace to open the <emphasis role="bold">Add Application</emphasis> dialog:
+ Click the add icon at the bottom of the User Workspace to open the <emphasis role="bold">Add Application</emphasis> dialog:
</para>
<mediaobject>
<imageobject>
@@ -140,12 +147,12 @@
</step>
<step>
<para>
- Select a gadget by clicking the add icon !images/PlusIcon.png! that is located next to the the gadget. The selected gadget is displayed immediately in the user workspace. Normally, you can see only two gadgets in the User Workspace. When there are more gadgets, some gadgets are not visible.
+ Select a gadget by clicking the add icon (located next to the the gadget). The selected gadget is displayed immediately in the user workspace. Normally, you can see only two gadgets in the User Workspace. When there are more gadgets, some gadgets are not visible.
</para>
</step>
<step>
<para>
- Click the scroll down icon !images/DownIcon.png!images/ or the scroll up icon!images/ UpIcon.png! at the bottom of the User Workspace to see the other gadgets. If there are no more gadgets to scroll to, the color of the scroll down and scroll up icon switches to gray color.
+ Click the scroll down icon or the scroll up icon at the bottom of the User Workspace to see the other gadgets. The scroll icons will be greyed out when you reach the end of the available gadgets.
</para>
</step>
</procedure>
@@ -154,20 +161,18 @@
<section id="sect-User_Guide-Manage_Gadgets_in_User_Workspace-Edit_a_Gadget">
<title>Edit a Gadget</title>
<para>
- To edit a gadget, click !images/EditIcon.png! icon.
+ To edit a gadget, click the edit icon.
</para>
</section>
<section id="sect-User_Guide-Manage_Gadgets_in_User_Workspace-Remove_a_Gadget">
<title>Remove a Gadget</title>
<para>
- Remove a gadget from the User Workspace by using the functional bar!images/FunctionBar.png! at the upper right corner of that gadget.
+ Remove a gadget from the User Workspace by using the functional bar at the upper right corner of that gadget.
</para>
<para>
- Click the remove icon !images/RemoveIcon.png! . When the confirmation message appears, click the <emphasis role="bold">OK</emphasis> button to accept or the <emphasis role="bold">Cancel</emphasis> to quit.
+ Click the remove icon. When the confirmation message appears, click the <emphasis role="bold">OK</emphasis> button to accept or the <emphasis role="bold">Cancel</emphasis> to quit.
</para>
</section>
</section>
-
-
Modified: portal/trunk/docs/user-guide/en/modules/language/Change_Interface_Language.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/language/Change_Interface_Language.xml 2010-01-08 18:02:27 UTC (rev 1207)
+++ portal/trunk/docs/user-guide/en/modules/language/Change_Interface_Language.xml 2010-01-09 09:42:17 UTC (rev 1208)
@@ -23,8 +23,11 @@
--><title>Change Interface Language</title>
<para>
- &PRODUCT; provides users with the most familiar interface language to work with and perform all actions efficiently. The priority of the interface language is as follows:
+ &PRODUCT; allows users to choose their interface language to work with.
</para>
+ <para>
+ The priority of the interface language setting is:
+ </para>
<orderedlist numeration="arabic">
<listitem>
<para>
@@ -38,26 +41,26 @@
</listitem>
<listitem>
<para>
- Portal 's language
+ Portal's language
</para>
</listitem>
</orderedlist>
<para>
- Thus to display your prefered language, you should pay attention to this order to change the language type appropriately.
+ Users should pay attention to this order to change the language type appropriately.
</para>
<para>
- You can change the interface language permanently by three ways :
+ You can change the interface language permanently in three ways :
</para>
<section id="sect-User_Guide-Change_Interface_Language-The_1st_way">
<title>Method One</title>
<para>
- This way supports you to change the interface language of the current Portal.
+ This methods allows you to change the interface language of the current Portal.
</para>
- <procedure>
+ <!-- <procedure>
<step>
<para>
- Go to <emphasis role="bold">&PRODUCT; Start</emphasis> -> <emphasis role="bold">Administration</emphasis> -> <emphasis role="bold">Advanced</emphasis> --> <emphasis role="bold">Edit Current portal</emphasis>.
+ Go to <emphasis role="bold">&PRODUCT; Start</emphasis> -> <emphasis role="bold">Administration</emphasis> -> <emphasis role="bold">Advanced</emphasis> > <emphasis role="bold">Edit Current portal</emphasis>.
</para>
</step>
<step>
@@ -75,35 +78,45 @@
Click <emphasis role="bold">Save</emphasis> and <emphasis role="bold">Finish</emphasis>!images/FinishIcon.png! icon to take affect.
</para>
</step>
- </procedure>
- <!-- <para>
+ </procedure> -->
+ <para>
For Portal 2.6
</para>
<para>
You easily change the interface language of the current Portal by following guides:
</para>
- <para>
- 1. Go to <emphasis role="bold">Editor</emphasis> on the Toolbar > click <emphasis role="bold">Edit Page</emphasis>. The <emphasis role="bold">Edit Inline Composer</emphasis> popup will appear:
- </para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/EditInline.png" format="PNG" />
- </imageobject>
- </mediaobject>
- <para>
- 2. Click on <emphasis role="bold">Portal Properties</emphasis> to edit portal's properties.
- </para>
- <para>
- 3. In the <emphasis role="bold">Portal Setting</emphasis> tab: You can change display language of Portal by selecting another language in the <emphasis role="bold">Locale</emphasis> field.
- </para>
- <para>
- 4. Click <emphasis role="bold">Save</emphasis> and <emphasis role="bold">Finish</emphasis>!images/DiskIcon.png! icon to take affect.
- </para> -->
+ <procedure>
+ <step>
+ <para>
+ Go to <emphasis role="bold">Editor</emphasis> on the Toolbar and click <emphasis role="bold">Edit Page</emphasis>. The <emphasis role="bold">Edit Inline Composer</emphasis> popup will appear:
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/EditInline.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </step>
+ <step>
+ <para>
+ Click on <emphasis role="bold">Portal Properties</emphasis> to edit the portal's properties.
+ </para>
+ </step>
+ <step>
+ <para>
+ You can change display language of the portal by selecting another language in the <emphasis role="bold">Locale</emphasis> field of the <emphasis role="bold">Portal Setting</emphasis> tab.
+ </para>
+ </step>
+ <step>
+ <para>
+ Click <emphasis role="bold">Save</emphasis> and <emphasis role="bold">Finish</emphasis> to set the new language.
+ </para>
+ </step>
+ </procedure>
</section>
<section id="sect-User_Guide-Change_Interface_Language-The_2nd_way">
<title>Method Two</title>
- <para>
+<!-- <para>
If you can access &PRODUCT; Start, you can do this way to set interface language for yourself, not for interface language of Portal by these following steps:
</para>
<procedure>
@@ -132,41 +145,49 @@
Click the <emphasis role="bold">Apply</emphasis> button and wait for few seconds to take affect.
</para>
</step>
- </procedure>
- <!--<para>
+ </procedure> -->
+ <para>
For Portal 2.6
</para>
<para>
- You can set the interface language for yourself by following guides:
+ You can set the interface language for yourself by doing the following:
</para>
- <para>
- 1. Go to &PRODUCT; on the Toolbar > click <emphasis role="bold">Change Language</emphasis>
- </para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/InterfaceLanguage2.6.png" format="PNG" width="444" />
- </imageobject>
- </mediaobject>
- <para>
- The <emphasis role="bold">Interface Language Setting</emphasis> form is displayed with a list of all supported languages. The current using language is marked by!images/MarkedIcon.png! icon.
- </para>
- <para>
- 2. Select another one by clicking on the name of language.
- </para>
- <para>
- 3. Click the <emphasis role="bold">Apply</emphasis> button and wait for few seconds to take affect.
- </para> -->
+ <procedure>
+ <step>
+ <para>
+ Go to <emphasis role="bold">Editor</emphasis> on the Toolbar and click <emphasis role="bold">Change Language</emphasis>
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/InterfaceLanguage2.6.png" format="PNG" width="444" />
+ </imageobject>
+ </mediaobject>
+ <para>
+ The <emphasis role="bold">Interface Language Setting</emphasis> form is displayed with a list of all supported languages. The current using language is marked with an icon.
+ </para>
+ </step>
+ <step>
+ <para>
+ Select another language by clicking on its name in the list of available languages.
+ </para>
+ </step>
+ <step>
+ <para>
+ Click the <emphasis role="bold">Apply</emphasis> button and wait for few seconds for the change to take affect.
+ </para>
+ </step>
+ </procedure>
</section>
<section id="sect-User_Guide-Change_Interface_Language-The_3rd_way">
<title>Method Three</title>
<para>
- You also set interface language for yourself, not for interface language of the Portal by this way.
+ You can also set the interface language for yourself alone (and not for the entire Portal) this way:
</para>
<procedure>
<step>
<para>
- Click <emphasis role="bold">Change Language</emphasis> on the right corner to show the <emphasis role="bold">Interface Language Setting</emphasis> form:
+ Click on <emphasis role="bold">Change Language</emphasis> on the right corner to show the <emphasis role="bold">Interface Language Setting</emphasis> form:
</para>
<mediaobject>
<imageobject>
@@ -186,12 +207,12 @@
</step>
<step>
<para>
- Select another language in list. The selected language will be marked by !images/MarkedIcon.png! icon.
+ Select another language in list. The selected language will be marked with an icon.
</para>
</step>
<step>
<para>
- Click the <emphasis role="bold">Apply</emphasis> button to change the interface language and wait for few seconds to take affect or click the <emphasis role="bold">Cancel</emphasis> button to quit without changes.
+ Click the <emphasis role="bold">Apply</emphasis> button to change the interface language or click the <emphasis role="bold">Cancel</emphasis> button to quit without changes.
</para>
</step>
</procedure>
@@ -200,35 +221,32 @@
<section id="sect-User_Guide-Change_Interface_Language-Set_language_for_a_user">
<title>Set language for a user</title>
<para>
- There are two modes to set displaying language for a user.
+ There are two modes to set the interface language for a specific user.
</para>
<variablelist>
<varlistentry>
<term>Public Mode</term>
<listitem>
<para>
- Displaying language of this mode depends on the language of browser that you are using.
+ When accessing the portal in <emphasis role="bold">Public Mode</emphasis>, the interface language is dictated by the language setting of your web broweser.
</para>
<para>
- If you set language of browser that Portal does not support, the displaying language will be the language of Portal.
+ If you have set the language of your browser to one that &PRODUCT; does not support, the displaying language will be the language set at the Portal level (see above).
</para>
- <para>
- If you set language of browser that Portal supports, the displaying language will be the language of browser.
- </para>
</listitem>
</varlistentry>
<varlistentry>
<term>Private Mode</term>
<listitem>
<para>
- Displaying language of this mode belongs to the language of each user which is set when registering.
+ The interface language in <emphasis role="bold">Private Mode</emphasis> is set when registering each user. See step four of the process to register a new account <xref linkend="sect-User_Guide-Register_New_Accounts" />.
</para>
- <para>
- When you sign in by a default account (root, john, demo, marry): the displaying language of these users are none, so it will belong to browser's language. If you change value in the <emphasis role="bold">Language</emphasis> field in the <emphasis role="bold">User Profile</emphasis> tab (only default user: root and john can change this value by access 'Management' page: Go to <emphasis role="bold">Organization</emphasis>--> <emphasis role="bold">Management</emphasis> page), your displaying language will be the set value. Your displaying language has also directly affect when you change language by other ways.
+<!-- <para>
+ When you sign in with one of the default accounts in &PRODUCT; (Root, John, Demo or Mary) the displaying language of these users are none, so it will belong to browser's language. If you change value in the <emphasis role="bold">Language</emphasis> field in the <emphasis role="bold">User Profile</emphasis> tab (only default user: root and john can change this value by access 'Management' page: Go to <emphasis role="bold">Organization</emphasis> > <emphasis role="bold">Management</emphasis> page), your displaying language will be the set value. Your displaying language has also directly affect when you change language by other ways.
</para>
<para>
When you sign in by a new registered user: by default, your displaying language is English. However, if you set by another language in the <emphasis role="bold">Language</emphasis> field in the <emphasis role="bold">User Profile</emphasis> tab when you register a new account, your displaying language is the set language.
- </para>
+ </para> -->
</listitem>
</varlistentry>
</variablelist>
Modified: portal/trunk/docs/user-guide/en/modules/language/Internationalization_Portlet.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/language/Internationalization_Portlet.xml 2010-01-08 18:02:27 UTC (rev 1207)
+++ portal/trunk/docs/user-guide/en/modules/language/Internationalization_Portlet.xml 2010-01-09 09:42:17 UTC (rev 1208)
@@ -23,7 +23,7 @@
--><title>Internationalization Portlet</title>
<para>
- This portlet is used to define a word or a phrase of the current language to an expected language. The form of this portlet is like:
+ This portlet is used to define a word or a phrase of the current language in another language.
</para>
<mediaobject>
<imageobject>
@@ -31,7 +31,7 @@
</imageobject>
</mediaobject>
<para>
- Each resource supports a language. So, you can define a word or a phrase according to the supported language.
+ Each resource supports a language. You can define a word or a phrase according to the supported language.
</para>
<section id="sect-User_Guide-Internationalization_Portlet-Add_a_new_Resource">
@@ -59,7 +59,7 @@
<term>Language</term>
<listitem>
<para>
- The language that this resource 'll support. This field is required.
+ The language that this resource will support. This field is required.
</para>
</listitem>
</varlistentry>
@@ -89,8 +89,11 @@
<section id="sect-User_Guide-Internationalization_Portlet-View_and_Edit_a_Resource">
<title>View and Edit a Resource</title>
<para>
- Click the magnifying icon !images/GlassIcon.png! corresponding to resource which you want to view. On the view form, you also can edit information again by clicking the <emphasis role="bold">Edit</emphasis> button. You only can change <emphasis role="bold">Resource</emphasis> field, then click the <emphasis role="bold">Save</emphasis> button to accept changes or click the <emphasis role="bold">Cancel</emphasis> button to quit without saving any changes.
+ Click the magnifying glass icon corresponding to the resource which you want to view. On the view form, you also can edit information by clicking the <emphasis role="bold">Edit</emphasis> button. You can only edit the <emphasis role="bold">Resource</emphasis> field.
</para>
+ <para>
+ Click the <emphasis role="bold">Save</emphasis> button to submit your changes or click the <emphasis role="bold">Cancel</emphasis> button to quit without saving any changes.
+ </para>
<mediaobject>
<imageobject>
<imagedata fileref="images/Resource2.png" format="PNG" width="444" />
@@ -101,14 +104,14 @@
<section id="sect-User_Guide-Internationalization_Portlet-Delete_a_Resource">
<title>Delete a Resource</title>
<para>
- Click the trash can icon!images/DeleIcon.png! corresponding to the resource which you want to delete. There 'll be a confirmation message, click the <emphasis role="bold">OK</emphasis> button to confirm deleting and the <emphasis role="bold">Cancel</emphasis> button to quit.
+ Click the trash can icon corresponding to the resource which you want to delete. When prompted by the confirmation message, click the <emphasis role="bold">OK</emphasis> button to confirm the deletion or the <emphasis role="bold">Cancel</emphasis> button to quit.
</para>
</section>
<section id="sect-User_Guide-Internationalization_Portlet-Search_a_Resource">
<title>Search a Resource</title>
<para>
- The <emphasis role="bold">Search Resource</emphasis> form displays directly on the portlet:
+ The <emphasis role="bold">Search Resource</emphasis> form displays directly on the portlet.
</para>
<mediaobject>
<imageobject>
@@ -116,7 +119,7 @@
</imageobject>
</mediaobject>
<para>
- Enter the name of the resource which you want to search and select the supported language. Click the <emphasis role="bold">Search</emphasis> button to perform searching and displaying a list of the expected Resource.
+ Enter the name of the resource which you want to search and select the supported language. Click the <emphasis role="bold">Search</emphasis> button to perform the search and display a list of the matching Resources.
</para>
</section>
Modified: portal/trunk/docs/user-guide/en/modules/language/Multi-Language_Navigation_Nodes.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/language/Multi-Language_Navigation_Nodes.xml 2010-01-08 18:02:27 UTC (rev 1207)
+++ portal/trunk/docs/user-guide/en/modules/language/Multi-Language_Navigation_Nodes.xml 2010-01-09 09:42:17 UTC (rev 1208)
@@ -22,20 +22,29 @@
02110-1301 USA, or see the FSF site: http://www.fsf.org.
--><title>Multi-Language Navigation Nodes</title>
- <section id="sect-User_Guide-Multi_Language_Navigation_Nodes-Overview">
- <title>Overview</title>
+<warning>
+<para>
+ The <emphasis role="bold">Add New Portal</emphasis> button mentioned in this section does not appear under the <emphasis role="bold">Site</emphasis> navigation in GateIn 3.0 Beta 3, even when logged in as the Administrator.
+</para>
+</warning>
+
<para>
- &PRODUCT; supports a multi-language environment for your portal. You can internationalize any menu entry on the navigation. As the navigation bar is composed by nodes so you have to modify the display names of the nodes. Instead of entering the display name in English you have to use a so called resource key. This resource key is used to define the label that is shown on the navigation bar, the menu, and the breadcrumb.
+ &PRODUCT; supports a multi-language environment for your portal allowing you to internationalize any menu entry on the navigation.
</para>
- </section>
-
+ <para>
+ As the navigation bar is composed of nodes, you have to modify the display names of the nodes to enable this. Instead of entering the display name of the node in a defined language (English, for example) you have to use a language-neutral 'resource key'.
+ </para>
+ <para>
+ This resource key is then used to define the label that is shown for that node on the navigation bar, the menu and the breadcrumb.
+ </para>
+
<section id="sect-User_Guide-Multi_Language_Navigation_Nodes-Key_Format">
<title>Key Format</title>
<para>
The resource key format is: <emphasis role="bold">#{key}</emphasis>
</para>
<para>
- The resource key is the can contain any text that you consider to be fine. It should be human-readable and must not contain spaces.
+ The resource key can contain any text that you consider to be reasonable. It should, however, be human-readable and must not contain spaces.
</para>
</section>
@@ -65,9 +74,9 @@
</section>
<section id="sect-User_Guide-Multi_Language_Navigation_Nodes-Creating_Keys_using_the_Create_Page_Wizard">
- <title>Creating Keys using the *Create Page Wizard*</title>
+ <title>Creating Keys using the <emphasis role="bold">Create Page Wizard</emphasis></title>
<para>
- You can follow these steps:
+ To use a guided wizard to create keys, follow these steps:
</para>
<procedure>
<step>
@@ -77,12 +86,12 @@
</step>
<step>
<para>
- Click <emphasis role="bold">Next</emphasis> to move to step 1
+ Click the <emphasis role="bold">Next</emphasis> button.
</para>
</step>
<step>
<para>
- At step 1, continue as usual, but enter a resource key in the <emphasis role="bold">Display Name</emphasis> field.
+ Enter a resource key in the <emphasis role="bold">Display Name</emphasis> field.
</para>
<mediaobject>
<imageobject>
@@ -92,7 +101,7 @@
</step>
<step>
<para>
- Click on the <emphasis role="bold">Next</emphasis> button and continue and click on the <emphasis role="bold">Save</emphasis> button. For example, create a key named "AAA".
+ Click on the <emphasis role="bold">Next</emphasis> button to continue and click on the <emphasis role="bold">Save</emphasis> button.
</para>
</step>
</procedure>
@@ -100,7 +109,7 @@
</section>
<section id="sect-User_Guide-Multi_Language_Navigation_Nodes-CreatingEditing_Keys_by_Edit_Page_Wizard">
- <title>Creating/Editing Keys by *Edit Page Wizard*</title>
+ <title>Creating/Editing Keys by <emphasis role="bold">Edit Page Wizard</emphasis></title>
<procedure>
<step>
<para>
@@ -109,19 +118,19 @@
</step>
<step>
<para>
- Click on the <emphasis role="bold">Next</emphasis> button to move to step 1
+ Click on the <emphasis role="bold">Next</emphasis> button.
</para>
</step>
<step>
<para>
- At step 1, continue as usual, but enter a resource key in the <emphasis role="bold">Display Name</emphasis> field.
+ Enter a resource key in the <emphasis role="bold">Display Name</emphasis> field.
</para>
</step>
</procedure>
</section>
<section id="sect-User_Guide-Multi_Language_Navigation_Nodes-CreatingEditing_Keys_using_the_Edit_Page_and_Navigation">
- <title>Creating/Editing Keys using the *Edit Page and Navigation*</title>
+ <title>Creating/Editing Keys using the <emphasis role="bold">Edit Page and Navigation</emphasis></title>
<procedure>
<step>
<para>
@@ -132,7 +141,7 @@
<para>
There are two alternatives:
</para>
- <itemizedlist>
+ <orderedlist numeration="arabic">
<listitem>
<para>
Create a new node: Select the parent path, right click and click on <emphasis role="bold">Add new node</emphasis> option .
@@ -143,26 +152,29 @@
Edit an existing node: Right click on the node you want to create/edit key and click on <emphasis role="bold">Edit this node</emphasis> in the pop-up menu.
</para>
</listitem>
- </itemizedlist>
+ </orderedlist>
</step>
<step>
<para>
- A Create/Edit node dialog appears, enter a resource key in the <emphasis role="bold">Label</emphasis> field
+ A Create/Edit node dialog appears. Enter a resource key in the <emphasis role="bold">Label</emphasis> field
</para>
</step>
</procedure>
- <note>
- <para>
- You can reuse the same resource key in several nodes.
- </para>
- </note>
+ <note>
+ <para>
+ You can reuse the same resource key in several nodes.
+ </para>
+ </note>
</section>
<section id="sect-User_Guide-Multi_Language_Navigation_Nodes-Internationalize_Resource_Keys">
<title>Internationalize Resource Keys</title>
<para>
- &PRODUCT; organizes resource keys in resource files. Each file contains a list of keys and their meanings (translations) in one specific language. Normally one resource file has one language supported by Portal. This helps to structure the resource keys. Each resource file has a name and a language attribute. One resource file only can contain translations for one single language.
+ &PRODUCT; organizes resource keys in resource files. Each file contains a list of keys and their translations in one specific language.
</para>
+ <para>
+ Each resource file holds keys for one language supported by Portal. This helps to structure the resource keys. Each resource file has a name and a language attribute.
+ </para>
<para>
To utilize Internationalization features do the following:
@@ -182,50 +194,50 @@
<para>
Select a data resource that you want to internationalize. You also may search the desired resource name with a specific language:
</para>
- <itemizedlist>
+ <orderedlist numeration="arabic">
<listitem>
<para>
- Enter a resource name in the <emphasis role="bold">Name</emphasis> field in the <emphasis role="bold">Search Resource</emphasis> form
+ Enter a resource name in the <emphasis role="bold">Name</emphasis> field in the <emphasis role="bold">Search Resource</emphasis> form.
</para>
</listitem>
<listitem>
<para>
- Select a corresponding language of the resource.
+ Select a corresponding language for the resource.
</para>
</listitem>
<listitem>
<para>
- Click on the <emphasis role="bold">Search</emphasis> button to match all data resource and display the result on the table above.
+ Click on the <emphasis role="bold">Search</emphasis> button to match all data resource and display the result in the table above.
</para>
</listitem>
<listitem>
<para>
- If you want to define a key for a node which belongs to a specific portal, search for a resource like:locale.navigation.portal.portal name]
+ If you want to define a key for a node which belongs to a specific portal, search for a resource like <emphasis>[locale.navigation.portal.portal name]</emphasis>
</para>
</listitem>
- </itemizedlist>
+ </orderedlist>
<para>
- +Example:+ if you want to define a key of a node of portal "classic" in language French, search resource: locale.navigation.portal.classic with value in the <emphasis role="bold">Language</emphasis> field is "fr"
+ For example: if you want to define a key for a node of your portal <emphasis>Classic</emphasis> in French, you could search for the resource: <emphasis>locale.navigation.portal.classic</emphasis> with a value of <emphasis>fr</emphasis>in the <emphasis role="bold">Language</emphasis> field.
</para>
<itemizedlist>
<listitem>
<para>
- If you want to define a key for the node that belongs to a specific group, search resource like: locale.navigation.group.group path]
+ If you want to define a key for the node that belongs to a specific group, search for a resource like <emphasis>locale.navigation.group.group path]</emphasis>
</para>
</listitem>
</itemizedlist>
<para>
- +Example:+ if you want to define a key for a node on navigation of "administrators" group that is the sub one of the "platform" group in language French, search resource: locale.navigation.group.platform.administrators with the value in the <emphasis role="bold">Language</emphasis> field is "fr"
+ For example: if you want to define a key for a node on the navigation <emphasis>administrators</emphasis> group that is the sub-set of the <emphasis>platform</emphasis> group in French, you could search for a resource: <emphasis>locale.navigation.group.platform.administrators</emphasis> which has <emphasis role="bold">fr</emphasis> in the <emphasis role="bold">Language</emphasis> field.
</para>
</step>
<step>
<para>
- Click the magnifying glass!images/MagnifyIcon.png! icon corresponding to a data resource to see details of the resource file. Click the <emphasis role="bold">Edit</emphasis> button in order to modify the content.
+ Click the magnifying glass icon corresponding to a data resource to see details of the resource file. Click the <emphasis role="bold">Edit</emphasis> button in order to modify the content.
</para>
</step>
<step>
<para>
- Enter the resource key with the string that will be displayed as node name on the navigation bar .
+ Enter the resource key with the string that will be displayed as node name on the navigation bar.
</para>
</step>
<step>
@@ -240,11 +252,11 @@
<title>Walk-through</title>
<procedure>
<para>
- Below is a graphical walk-through illustrating how to change the language of a resource. In this case the current language is English and will be changed to French.
+ Below is a graphical walk-through illustrating how to change the language of a resource. In this case the language will be changed from English to French.
</para>
<step>
<para>
- Go to <emphasis role="bold">Create Page Wizard</emphasis>, at step 1, select navigation and enter values like in the figure below:
+ Go to <emphasis role="bold">Create Page Wizard</emphasis>, at step 1, select navigation and complete the values as shown below:
</para>
<mediaobject>
<imageobject>
@@ -267,14 +279,19 @@
</imageobject>
</mediaobject>
</step>
+ </procedure>
+ <para>
+ Now you have to define what to display instead of displaying the key.
+ </para>
+ <procedure>
<step>
<para>
- And now you have to define what to display instead of displaying the key. Go to <emphasis role="bold">GateIn Start</emphasis> -> <emphasis role="bold">Page Navigation</emphasis> -> <emphasis role="bold">Administration</emphasis> --> <emphasis role="bold">Internationalization</emphasis>.
+ Go to <emphasis role="bold">GateIn Start</emphasis>, highlight <emphasis role="bold">Page Navigation</emphasis> and then <emphasis role="bold">Administration</emphasis>. Click on <emphasis role="bold">Internationalization</emphasis>.
</para>
</step>
<step>
<para>
- Search resource locale.navigation.portal.classic with language French (fr)
+ Search for the resource <emphasis>locale.navigation.portal.classic</emphasis> with the language set to French (<emphasis role="bold">fr</emphasis>)
</para>
<mediaobject>
<imageobject>
@@ -284,7 +301,7 @@
</step>
<step>
<para>
- Click the magnifying icon!images/MagnifyIcon.png! to see the content.
+ Click the magnifying glass icon to see the content of that resource.
</para>
<mediaobject>
<imageobject>
@@ -294,7 +311,7 @@
</step>
<step>
<para>
- Click on the <emphasis role="bold">Edit</emphasis> button to modify. In the <emphasis role="bold">Resource</emphasis> field, enter the key and assign the string to display.
+ Click on the <emphasis role="bold">Edit</emphasis> button to modify the resource contents. In the <emphasis role="bold">Resource</emphasis> field, enter the key and assign the string to display.
</para>
<mediaobject>
<imageobject>
Modified: portal/trunk/docs/user-guide/en/modules/language/Right_To_Left_Support_(RTL).xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/language/Right_To_Left_Support_(RTL).xml 2010-01-08 18:02:27 UTC (rev 1207)
+++ portal/trunk/docs/user-guide/en/modules/language/Right_To_Left_Support_(RTL).xml 2010-01-09 09:42:17 UTC (rev 1208)
@@ -21,13 +21,10 @@
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA, or see the FSF site: http://www.fsf.org.
- --><title>RTL Support (Right To Left)</title>
+ --><title>Right To Left Support</title>
<para>
- GateIn Portal supports RTL (Right to Left) to meet the demand of Arabian customers who want to use the Portal by their own language for more convenient and easy to use. When you change from other languages to Arabic or set the displaying language as Arabic, the displaying on Portal will be changed to Right to Left (RTL) direction because Arabian usually read from Right to Left.
+ &PRODUCT; supports Right to Left (RTL) languages.
</para>
- <para>
- Some screen shots of Portal with RTL:
- </para>
<mediaobject>
<imageobject>
<imagedata fileref="images/HomePage2.png" format="PNG" width="444" />
Modified: portal/trunk/docs/user-guide/en/modules/portal/Create_a_New_Portal.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/portal/Create_a_New_Portal.xml 2010-01-08 18:02:27 UTC (rev 1207)
+++ portal/trunk/docs/user-guide/en/modules/portal/Create_a_New_Portal.xml 2010-01-09 09:42:17 UTC (rev 1208)
@@ -77,7 +77,7 @@
<term>Never</term>
<listitem>
<para>
- It never happens even if an application requests it <-- <emphasis role="bold"> WHAT never happens?</emphasis>
+ The session will never timeout, even if an application requests it.
</para>
</listitem>
</varlistentry>
@@ -85,7 +85,7 @@
<term>On-demand</term>
<listitem>
<para>
- It starts to be used as soon as an application requests it
+ The session will timeout if an application requests it
</para>
</listitem>
</varlistentry>
@@ -93,7 +93,7 @@
<term>Always</term>
<listitem>
<para>
- It's always enabled
+ The session will time out after a set period.
</para>
</listitem>
</varlistentry>
Modified: portal/trunk/docs/user-guide/en/modules/portal/Manage_Portals.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/portal/Manage_Portals.xml 2010-01-08 18:02:27 UTC (rev 1207)
+++ portal/trunk/docs/user-guide/en/modules/portal/Manage_Portals.xml 2010-01-09 09:42:17 UTC (rev 1208)
@@ -23,17 +23,97 @@
--><title>Manage Portals</title>
<para>
- You can easily manage a portal by editing or deleting it.
+ Portals can easily be managed by editing or deleting.
</para>
<section id="sect-User_Guide-Manage_Portals-Edit_a_Portal">
<title>Edit a Portal</title>
<para>
- You can change information of the current using portal such as properties or layout. However, you must have the edit right given by an Admininstrator. When you have edit right, follow these steps to edit the current portal:
+ You can change aspects of the current using portal, such as properties or layout if you have the edit right (granted by an Admininstrator).
</para>
+ <para>
+ If you have edit rights, follow these steps to edit the current portal:
+ </para>
<procedure>
+ <step>
+ <para>
+ Go to <emphasis role="bold">Editor</emphasis> on the Toolbar and click <emphasis role="bold">Edit Site Layout</emphasis>.
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/EditPortal.png" format="PNG" width="444" />
+ </imageobject>
+ </mediaobject>
+ </step>
+ <step>
+ <para>
+ Click the Properties button in the <emphasis role="bold">Edit Inline Composer</emphasis>. The edit Form of the portal will be shown:
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/EditPortal2.6New.png" format="PNG" width="444" />
+ </imageobject>
+ </mediaobject>
+ </step>
+ <step>
+ <para>
+ Change the properties of the current portal.
+ </para>
+ </step>
+ <step>
+ <para>
+ Click the <emphasis role="bold">Propertites</emphasis> tab. Select an option for <emphasis role="bold">Keep session alive</emphasis>
+ </para>
+ <para>
+ This option controls how long your session is kept alive. There are 3 options:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>Never</term>
+ <listitem>
+ <para>
+ The session will never timeout, even if an application requests it.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>On-demand</term>
+ <listitem>
+ <para>
+ The session will timeout if an application requests it
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Always</term>
+ <listitem>
+ <para>
+ The session will time out after a set period.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </step>
+ <step>
+ <para>
+ Set permissions for the portal:
+ </para>
+ <para>
+ To change any permission, click the <emphasis role="bold">Select Permission</emphasis> button and then select a group with the Membership type you want. Only one group can have the Edit Permission of the portal.
+ </para>
+ <para>
+ You can set the Edit Permission for the portal when you create or edit it.
+ </para>
+ </step>
+ <step>
+ <para>
+ Click the <emphasis role="bold">Save</emphasis> button to accept changes or the <emphasis role="bold">Cancel</emphasis> button to quit.
+ </para>
+ </step>
+ </procedure>
+<!-- <procedure>
<step>
<para>
- Go to <emphasis role="bold">GateIn Start</emphasis> -> <emphasis role="bold">Administration</emphasis> -> <emphasis role="bold">Advanced</emphasis> --> <emphasis role="bold">Edit Current Portal</emphasis>. A form to edit the current portal will appear:
+ Go to <emphasis role="bold">GateIn Start</emphasis> -> <emphasis role="bold">Administration</emphasis> -> <emphasis role="bold">Advanced</emphasis> > <emphasis role="bold">Edit Current Portal</emphasis>. A form to edit the current portal will appear:
</para>
<mediaobject>
<imageobject>
@@ -107,86 +187,6 @@
</varlistentry>
</variablelist>
</step>
- <!-- <informaltable colsep="0" frame="none" rowsep="0">
- <tgroup cols="2">
- <colspec align="center"></colspec>
- <colspec align="center"></colspec>
- <tbody>
- <row>
- <entry>
- <emphasis role="bold"> Indicator </emphasis>
- </entry>
- <entry>
- <emphasis role="bold"> Meaning </emphasis>
- </entry>
- </row>
- <row>
- <entry>
- !images/preview.png!
- </entry>
- <entry>
- *Preview page*: allows viewing node's page in preview mode.
- </entry>
- </row>
- <row>
- <entry>
- !images/EditPage.png!
- </entry>
- <entry>
- *Edit page properties*: allows editing node's page properties.
- </entry>
- </row>
- <row>
- <entry>
- !images/ShowContainer.png!
- </entry>
- <entry>
- *Show container*: allows listing all existing containers when editing node's page.
- </entry>
- </row>
- <row>
- <entry>
- !images/ShowPortlet.png!
- </entry>
- <entry>
- *Show portlet*: allows listing all existing portlets when editing node's page.
- </entry>
- </row>
- <row>
- <entry>
- !images/Savepage.png!
- </entry>
- <entry>
- *Save page*: allows saving changes of page when editing node's page.
- </entry>
- </row>
- <row>
- <entry>
- !images/RollBack.png!
- </entry>
- <entry>
- *Rollback*: allows canceling all changes that have not been saved.
- </entry>
- </row>
- <row>
- <entry>
- !images/Abort.png!
- </entry>
- <entry>
- *Abort*: allows canceling all changes that have not been saved and escaping Edit page and navigation form.
- </entry>
- </row>
- <row>
- <entry>
- !images/Finish1.png!
- </entry>
- <entry>
- *Finish*: allows saving all changes and escaping Edit page and navigation form.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable> -->
<step>
<para>
Click!images/EditPage.png! icon to edit portal properties.
@@ -207,76 +207,8 @@
Click!images/Savepage.png! icon to save changes.
</para>
</step>
- </procedure>
- <!-- <orderedlist id="orde-User_Guide-Edit_a_Portal-For_GateIn_Portal_2.6">
- <title>For GateIn Portal 2.6</title>
- <para>
- You must have the edit right to change information of the current using portal:
- </para>
- <listitem>
- <para>
- 1. Go to <emphasis role="bold">Editor</emphasis> on the Toolbar ->click <emphasis role="bold">Edit Site Layout</emphasis>.
- </para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/EditPortal.png" format="PNG" width="444" />
- </imageobject>
- </mediaobject>
- </listitem>
- <listitem>
- <para>
- 2. Click the!images/PortalProperties.png! button in the <emphasis role="bold">Edit Inline Composer</emphasis>. The edit Form of the portal will be shown:
- </para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/EditPortal2.6New.png" format="PNG" width="444" />
- </imageobject>
- </mediaobject>
- </listitem>
- <listitem>
- <para>
- 3. Change the properties of the current portal.
- </para>
- </listitem>
- <listitem>
- <para>
- 4. Click the <emphasis role="bold">Propertites</emphasis> tab. Select an option for <emphasis role="bold">Keep session alive</emphasis> that means keeping the working session for a long time to avoid the working time out. There are 3 options:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- Never : it never happens even if an application requests it.
- </para>
- </listitem>
- <listitem>
- <para>
- On-demand : it starts to be used as soon as an application requests it.
- </para>
- </listitem>
- <listitem>
- <para>
- Always: it's always enabled (which has a cost but the administrator will be aware of that).
- </para>
- </listitem>
- </itemizedlist>
- </listitem>
- <listitem>
- <para>
- 5. Set permissions for a portal:
- </para>
- <para>
- To change any permission, click the <emphasis role="bold">Select Permission</emphasis> button and then select a group with the Membership type you want. Only one group can have the Edit Permission of the portal.
- </para>
- <para>
- You can set the Edit Permission for the portal when you create or edit it.
- </para>
- </listitem>
- <listitem>
- <para>
- 6. Click the <emphasis role="bold">Save</emphasis> button to accept changes or the <emphasis role="bold">Cancel</emphasis> button to quit.
- </para>
- </listitem>
- </orderedlist> -->
+ </procedure> -->
+
</section>
<section id="sect-User_Guide-Manage_Portals-Delete_a_Portal">
@@ -296,7 +228,7 @@
</step>
<step>
<para>
- Click the trash can !images/deleteIcon.png! icon in the row of the portal you want to delete in the portal list.
+ Click the trash can icon in the row of the portal you want to delete in the portal list.
</para>
</step>
<step>
@@ -316,7 +248,7 @@
</step>
<step>
<para>
- Click on!images/DeletePortal2.6.png! .The confirmation message will appear:
+ Click on the Delete icon.The confirmation message will appear.
</para>
</step>
<step>
Modified: portal/trunk/docs/user-guide/en/modules/portal/Switching_between_Portals.xml
===================================================================
--- portal/trunk/docs/user-guide/en/modules/portal/Switching_between_Portals.xml 2010-01-08 18:02:27 UTC (rev 1207)
+++ portal/trunk/docs/user-guide/en/modules/portal/Switching_between_Portals.xml 2010-01-09 09:42:17 UTC (rev 1208)
@@ -23,10 +23,10 @@
--><title>Switching between Portals</title>
<para>
- GateIn Portal allows users to switch between Portals simply and easily. You can use another portals such as gateway, starting site if you are given the appropriate permissions by the administrators.
+ &PRODUCT; allows users to switch between portals simply and easily.
</para>
<para>
- Go to <emphasis role="bold">Site</emphasis> on the Toolbarm it will list all portals in which you have at least the access right
+ Go to <emphasis role="bold">Site</emphasis> on the Toolbar for a list all portals in which you have at least the access right
</para>
<mediaobject>
<imageobject>
@@ -34,7 +34,7 @@
</imageobject>
</mediaobject>
<para>
- You easily switch between Portals by simply clicking on the portal that you want to choose and wait for few seconds to take effect.
+ You easily switch between Portals by simply clicking on the portal that you wish to switch to and waiting for few seconds for the change to take effect.
</para>
</section>
14 years, 11 months
gatein SVN: r1207 - components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-01-08 13:02:27 -0500 (Fri, 08 Jan 2010)
New Revision: 1207
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/EndpointConfigurationInfo.java
Log:
- Do not start if we're already started.
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/EndpointConfigurationInfo.java 2010-01-08 15:26:33 UTC (rev 1206)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/EndpointConfigurationInfo.java 2010-01-08 18:02:27 UTC (rev 1207)
@@ -47,6 +47,7 @@
/** Access to the WS */
private transient ServiceFactory serviceFactory;
private transient String remoteHostAddress;
+ private transient boolean started;
public EndpointConfigurationInfo()
{
@@ -71,12 +72,20 @@
public void start() throws Exception
{
- serviceFactory.start();
+ if (!started)
+ {
+ serviceFactory.start();
+ started = true;
+ }
}
public void stop() throws Exception
{
- serviceFactory.stop();
+ if (started)
+ {
+ serviceFactory.stop();
+ started = false;
+ }
}
ServiceFactory getServiceFactory()
14 years, 11 months
gatein SVN: r1206 - in portal/trunk/portlet/exoadmin/src/main: webapp/groovy/wsrp/webui/component and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-01-08 10:26:33 -0500 (Fri, 08 Jan 2010)
New Revision: 1206
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerPropertyEditor.java
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl
Log:
- Fixed lots of issues with UIWsrpProducerEditor to be able to contextually display registration details based on whether registration is required or not.
- Cleaned-up some.
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java 2010-01-08 15:22:50 UTC (rev 1205)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java 2010-01-08 15:26:33 UTC (rev 1206)
@@ -24,8 +24,8 @@
import org.exoplatform.commons.utils.LazyPageList;
import org.exoplatform.commons.utils.ListAccess;
+import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.web.application.ApplicationMessage;
-import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.ComponentConfigs;
import org.exoplatform.webui.config.annotation.EventConfig;
@@ -38,6 +38,7 @@
import org.exoplatform.webui.form.UIForm;
import org.exoplatform.webui.form.UIFormCheckBoxInput;
import org.exoplatform.webui.form.UIFormInputBase;
+import org.exoplatform.webui.form.UIFormInputSet;
import org.exoplatform.webui.form.UIFormStringInput;
import org.gatein.registration.RegistrationPolicy;
import org.gatein.registration.policies.DefaultRegistrationPolicy;
@@ -79,14 +80,56 @@
private static final String REGISTRATION_DETAILS = "registrationdetails";
private ProducerConfigurationService configService;
- private UIWSRPFormInputSet registrationDetails;
+ private static final String REGISTRATION_PROPERTIES = "RegistrationPropertySelector";
+ private static final String REGISTRATION_PROPERTIES_ITERATOR = "ProducerPropPageIterator";
+ private UIFormInputSet registrationDetails;
+ private UIFormInputBase<String> policy;
+ private UIFormInputBase<String> validator;
+ private UIFormCheckBoxInput regReqForDesc;
+ private UIFormCheckBoxInput strictMode;
+ private UIFormCheckBoxInput<Boolean> regRequired;
+ private UIGrid registrationProperties;
public UIWsrpProducerEditor() throws Exception
{
- addUIFormInput(new UIFormCheckBoxInput(REG_REQUIRED_FOR_DESCRIPTION, REG_REQUIRED_FOR_DESCRIPTION, null));
- addUIFormInput(new UIFormCheckBoxInput(STRICT_MODE, STRICT_MODE, null));
- addUIFormInput(new UIFormCheckBoxInput(REQUIRES_REGISTRATION, REQUIRES_REGISTRATION, null));
+ configService = Util.getUIPortalApplication().getApplicationComponent(ProducerConfigurationService.class);
+ regReqForDesc = new UIFormCheckBoxInput(REG_REQUIRED_FOR_DESCRIPTION, REG_REQUIRED_FOR_DESCRIPTION, null);
+ addUIFormInput(regReqForDesc);
+ strictMode = new UIFormCheckBoxInput(STRICT_MODE, STRICT_MODE, null);
+ addUIFormInput(strictMode);
+
+ // registration required check box with onChange event
+ regRequired = new UIFormCheckBoxInput<Boolean>(REQUIRES_REGISTRATION, REQUIRES_REGISTRATION, null);
+ regRequired.setOnChange("RegistrationOnChange");
+ addUIFormInput(regRequired);
+ // because when we use setOnChange method, new eventListener will add to this form, we must re-set the actions of this form.
+ // thif form has no action, so i'll put empty string array
+ setActions(new String[]{});
+
+ // registration details
+ // form set to gather registration information
+ registrationDetails = new UIWSRPFormInputSet(REGISTRATION_DETAILS);
+ addUIFormInput(registrationDetails);
+
+ // policy
+ policy = new UIFormStringInput(POLICY_CLASS, POLICY_CLASS, null);
+ registrationDetails.addUIFormInput(policy);
+
+ // validator
+ validator = new UIFormStringInput(VALIDATOR_CLASS, VALIDATOR_CLASS, null);
+ registrationDetails.addUIFormInput(validator);
+
+ // registration properties
+ registrationProperties = registrationDetails.addChild(UIGrid.class, REGISTRATION_PROPERTIES, null);
+ //configure the edit and delete buttons based on an id from the data list - this will also be passed as param to listener
+ registrationProperties.configure("name", FIELDS, SELECT_ACTIONS);
+ registrationProperties.getUIPageIterator().setId(REGISTRATION_PROPERTIES_ITERATOR);
+ registrationDetails.addChild(registrationProperties.getUIPageIterator());
+ registrationProperties.getUIPageIterator().setRendered(false);
+
+ init();
+
//add the popup for property edit and adding new properties
UIPopupWindow popup = addChild(UIPopupWindow.class, null, null);
popup.setWindowSize(400, 300);
@@ -95,9 +138,9 @@
popup.setRendered(false);
}
- public void setConfigService(ProducerConfigurationService configService)
+ ProducerConfigurationService getService()
{
- this.configService = configService;
+ return configService;
}
private void init() throws Exception
@@ -105,57 +148,41 @@
ProducerConfiguration configuration = configService.getConfiguration();
ProducerRegistrationRequirements registrationRequirements = configuration.getRegistrationRequirements();
- getUIFormCheckBoxInput(REG_REQUIRED_FOR_DESCRIPTION).setValue(registrationRequirements.isRegistrationRequiredForFullDescription());
- getUIFormCheckBoxInput(STRICT_MODE).setValue(configuration.isUsingStrictMode());
+ regReqForDesc.setValue(registrationRequirements.isRegistrationRequiredForFullDescription());
+ strictMode.setValue(configuration.isUsingStrictMode());
boolean registrationRequired = registrationRequirements.isRegistrationRequired();
- getUIFormCheckBoxInput(REQUIRES_REGISTRATION).setValue(registrationRequired);
+ regRequired.setValue(registrationRequired);
- // reset potentially existing registration details
- if (registrationDetails != null)
- {
- removeChild(registrationDetails.getClass());
- }
-
// if registration is required then we display more information
if (registrationRequired)
{
- registrationDetails = new UIWSRPFormInputSet(REGISTRATION_DETAILS);
+ registrationDetails.setRendered(true);
- // registration policy
- UIFormInputBase<String> policyInput = new UIFormStringInput(POLICY_CLASS, POLICY_CLASS, null);
- addUIFormInput(policyInput);
-
RegistrationPolicy policy = registrationRequirements.getPolicy();
String policyClassName = policy.getClass().getName();
- policyInput.setValue(policyClassName);
+ this.policy.setValue(policyClassName);
// if policy is the default one, display information about the validator
if (ProducerRegistrationRequirements.DEFAULT_POLICY_CLASS_NAME.equals(policyClassName))
{
- UIFormInputBase<String> validatorInput = new UIFormStringInput(VALIDATOR_CLASS, VALIDATOR_CLASS, null);
- registrationDetails.addUIFormInput(validatorInput);
DefaultRegistrationPolicy defaultPolicy = (DefaultRegistrationPolicy)policy;
- validatorInput.setValue(defaultPolicy.getValidator().getClass().getName());
+ validator.setValue(defaultPolicy.getValidator().getClass().getName());
+ validator.setRendered(true);
}
+ else
+ {
+ validator.setRendered(false);
+ }
// registration properties
Map<QName, RegistrationPropertyDescription> regProps = configuration.getRegistrationRequirements().getRegistrationProperties();
-
- UIGrid uiGrid = registrationDetails.addChild(UIGrid.class, "RegistrationPropertySelector", null);
- //configure the edit and delete buttons based on an id from the data list - this will also be passed as param to listener
- uiGrid.configure("name", FIELDS, SELECT_ACTIONS);
-
- //add the propery grid
- uiGrid.getUIPageIterator().setId("ProducerPropPageIterator");
- addChild(uiGrid.getUIPageIterator());
- uiGrid.getUIPageIterator().setRendered(false);
- LazyPageList propertyList = createPageList(getPropertyList(regProps));
- uiGrid.getUIPageIterator().setPageList(propertyList);
-
- addUIFormInput(registrationDetails);
- registrationDetails.setRendered(true);
+ registrationProperties.getUIPageIterator().setPageList(createPageList(getPropertyList(regProps)));
}
+ else
+ {
+ registrationDetails.setRendered(false);
+ }
}
private List<RegistrationPropertyDescription> getPropertyList(Map<QName, RegistrationPropertyDescription> descriptions) throws Exception
@@ -219,61 +246,46 @@
{
public void execute(Event<UIWsrpProducerEditor> event) throws Exception
{
- UIWsrpProducerEditor producerEditor = event.getSource();
-
- WebuiRequestContext ctx = event.getRequestContext();
- producerEditor.save(ctx);
- //producerEditor.reset();
-
- }
- }
-
- public boolean save(WebuiRequestContext context) throws Exception
- {
- //ConsumerRegistry consumerRegistry = getConsumerRegistry();
- //ProducerInfo producerInfo = consumerRegistry.getProducerInfoByKey("").getRegistrationInfo().
- UIApplication uiApp = context.getUIApplication();
-
- ProducerConfiguration producerConfiguration = configService.getConfiguration();
-
- try
- {
+ UIWsrpProducerEditor source = event.getSource();
+ ProducerConfigurationService service = source.getService();
+ ProducerConfiguration producerConfiguration = service.getConfiguration();
ProducerRegistrationRequirements registrationRequirements = producerConfiguration.getRegistrationRequirements();
- registrationRequirements.setRegistrationRequiredForFullDescription(Boolean.parseBoolean(getUIFormCheckBoxInput(REG_REQUIRED_FOR_DESCRIPTION).getValue().toString()));
- producerConfiguration.setUsingStrictMode(Boolean.parseBoolean(getUIFormCheckBoxInput(STRICT_MODE).getValue().toString()));
+ registrationRequirements.setRegistrationRequiredForFullDescription(Boolean.parseBoolean(source.regReqForDesc.getValue().toString()));
+ producerConfiguration.setUsingStrictMode(Boolean.parseBoolean(source.strictMode.getValue().toString()));
- boolean requiresReg = Boolean.parseBoolean(getUIFormCheckBoxInput(REQUIRES_REGISTRATION).getValue().toString());
+ boolean requiresReg = Boolean.parseBoolean(source.regRequired.getValue().toString());
registrationRequirements.setRegistrationRequired(requiresReg);
- /*if (registrationDetails != null)
+ if (requiresReg)
{
- registrationRequirements.reloadPolicyFrom(registrationDetails.getUIStringInput(POLICY_CLASS).getValue(),
- registrationDetails.getUIStringInput(VALIDATOR_CLASS).getValue());
- }*/
+ registrationRequirements.reloadPolicyFrom(source.policy.getValue(), source.validator.getValue());
+ }
- configService.saveConfiguration();
- uiApp.addMessage(new ApplicationMessage("Producer Successfully Changed", null));
+ try
+ {
+ service.saveConfiguration();
+ }
+ catch (Exception e)
+ {
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+ uiApp.addMessage(new ApplicationMessage("Producer Modification Error", null, ApplicationMessage.ERROR));
+ e.printStackTrace();
+ }
+
+ source.init();
}
- catch (Exception e)
- {
- uiApp.addMessage(new ApplicationMessage("Producer Modification Error", null, ApplicationMessage.ERROR));
- e.printStackTrace();
- }
-
- return true;
}
- static public class EditPropertyActionListener extends EventListener<UIWsrpProducerOverview>
+ static public class EditPropertyActionListener extends EventListener<UIWsrpProducerEditor>
{
- public void execute(Event<UIWsrpProducerOverview> event) throws Exception
+ public void execute(Event<UIWsrpProducerEditor> event) throws Exception
{
- UIWsrpProducerOverview producerOverview = event.getSource();
- UIApplication uiApp = event.getRequestContext().getUIApplication();
- UIPopupWindow popup = producerOverview.getChild(UIPopupWindow.class);
+ UIWsrpProducerEditor source = event.getSource();
+ UIPopupWindow popup = source.getChild(UIPopupWindow.class);
UIWsrpProducerPropertyEditor editor = (UIWsrpProducerPropertyEditor)popup.getUIComponent();
String id = event.getRequestContext().getRequestParameter(OBJECTID);
try
{
- editor.setRegistrationPropertyDescription(producerOverview.getProducerConfigurationService().getConfiguration().getRegistrationRequirements().getRegistrationPropertyWith(id));
+ editor.setRegistrationPropertyDescription(source.getService().getConfiguration().getRegistrationRequirements().getRegistrationPropertyWith(id));
}
catch (Exception e)
{
@@ -286,19 +298,19 @@
}
}
- static public class DeletePropertyActionListener extends EventListener<UIWsrpProducerOverview>
+ static public class DeletePropertyActionListener extends EventListener<UIWsrpProducerEditor>
{
- public void execute(Event<UIWsrpProducerOverview> event)
+ public void execute(Event<UIWsrpProducerEditor> event)
{
- UIWsrpProducerOverview producerOverview = event.getSource();
+ UIWsrpProducerEditor source = event.getSource();
UIApplication uiApp = event.getRequestContext().getUIApplication();
- UIPopupWindow popup = producerOverview.getChild(UIPopupWindow.class);
- UIWsrpProducerPropertyEditor editor = (UIWsrpProducerPropertyEditor)popup.getUIComponent();
+ UIPopupWindow popup = source.getChild(UIPopupWindow.class);
String id = event.getRequestContext().getRequestParameter(OBJECTID);
try
{
- producerOverview.getProducerConfigurationService().getConfiguration().getRegistrationRequirements().removeRegistrationProperty(id);
- producerOverview.getProducerConfigurationService().saveConfiguration();
+ ProducerConfigurationService service = source.getService();
+ service.getConfiguration().getRegistrationRequirements().removeRegistrationProperty(id);
+ service.saveConfiguration();
}
catch (Exception e)
{
@@ -309,12 +321,12 @@
}
}
- static public class AddPropertyActionListener extends EventListener<UIWsrpProducerOverview>
+ static public class AddPropertyActionListener extends EventListener<UIWsrpProducerEditor>
{
- public void execute(Event<UIWsrpProducerOverview> event) throws Exception
+ public void execute(Event<UIWsrpProducerEditor> event) throws Exception
{
- UIWsrpProducerOverview wsrpProducerOverview = event.getSource();
- UIPopupWindow popup = wsrpProducerOverview.getChild(UIPopupWindow.class);
+ UIWsrpProducerEditor source = event.getSource();
+ UIPopupWindow popup = source.getChild(UIPopupWindow.class);
UIWsrpProducerPropertyEditor editor = (UIWsrpProducerPropertyEditor)popup.getUIComponent();
//reset the form
@@ -327,12 +339,17 @@
}
}
- @Override
- public void processRender(WebuiRequestContext context) throws Exception
+ public static class RegistrationOnChangeActionListener extends EventListener<UIFormCheckBoxInput>
{
- // reset the GUI
- init();
+ public void execute(Event<UIFormCheckBoxInput> event) throws Exception
+ {
+ UIFormCheckBoxInput source = event.getSource();
+ UIWsrpProducerEditor parent = source.getAncestorOfType(UIWsrpProducerEditor.class);
+ parent.init();
- super.processRender(context);
+ //update only the parent, avoid updating the full portlet
+ event.getRequestContext().addUIComponentToUpdateByAjax(parent);
+ }
}
+
}
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java 2010-01-08 15:22:50 UTC (rev 1205)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java 2010-01-08 15:26:33 UTC (rev 1206)
@@ -41,7 +41,6 @@
public UIWsrpProducerOverview() throws Exception
{
producerForm = createUIComponent(UIWsrpProducerEditor.class, null, "Producer Editor");
- producerForm.setConfigService(getProducerConfigurationService());
addChild(producerForm);
}
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerPropertyEditor.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerPropertyEditor.java 2010-01-08 15:22:50 UTC (rev 1205)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerPropertyEditor.java 2010-01-08 15:26:33 UTC (rev 1206)
@@ -35,7 +35,6 @@
import org.exoplatform.webui.form.UIForm;
import org.exoplatform.webui.form.UIFormStringInput;
import org.exoplatform.webui.form.validator.MandatoryValidator;
-import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
import org.gatein.wsrp.producer.config.ProducerConfiguration;
import org.gatein.wsrp.producer.config.ProducerConfigurationService;
import org.gatein.wsrp.registration.LocalizedString;
@@ -59,7 +58,8 @@
addUIFormInput(new UIFormStringInput(HINT, HINT, null).addValidator(MandatoryValidator.class));
}
- public void setRegistrationPropertyDescription(RegistrationPropertyDescription registrationPropertyDescription) throws Exception {
+ public void setRegistrationPropertyDescription(RegistrationPropertyDescription registrationPropertyDescription) throws Exception
+ {
this.registrationPropertyDescription_ = registrationPropertyDescription;
@@ -80,18 +80,11 @@
return registrationPropertyDescription_;
}
- static public class SaveActionListener extends EventListener<UIWsrpProducerEditor>
+ static public class SaveActionListener extends EventListener<UIWsrpProducerPropertyEditor>
{
- public void execute(Event<UIWsrpProducerEditor> event) throws Exception
+ public void execute(Event<UIWsrpProducerPropertyEditor> event) throws Exception
{
- UIWsrpProducerEditor producerEditor = event.getSource();
-
- UIWsrpProducerEditor producerOverview = producerEditor.getAncestorOfType(UIWsrpProducerEditor.class);
-
- WebuiRequestContext ctx = event.getRequestContext();
- producerEditor.save(ctx);
- //producerEditor.reset();
-
+ // todo: implement
}
}
@@ -102,15 +95,17 @@
ProducerConfiguration producerConfiguration = pconfService.getConfiguration();
-
RegistrationPropertyDescription regPropDesc = getRegistrationPropertyDescription();
- if(regPropDesc != null){
+ if (regPropDesc != null)
+ {
System.out.println("---------old1: " + regPropDesc.getDescription());
RegistrationPropertyDescription oldRegPropDesc = producerConfiguration.getRegistrationRequirements().getRegistrationProperties().get(regPropDesc);
invokeSetBindingBean(oldRegPropDesc);
System.out.println("---------new1: " + oldRegPropDesc.getNameAsString());
//return;
- }else{
+ }
+ else
+ {
RegistrationPropertyDescription newRegProcDesc = new RegistrationPropertyDescription();
newRegProcDesc.setDescription(new LocalizedString(getUIStringInput(DESCRIPTION).getValue()));
@@ -122,10 +117,13 @@
UIApplication uiApp = context.getUIApplication();
- try{
+ try
+ {
pconfService.saveConfiguration();
uiApp.addMessage(new ApplicationMessage("Producer Successfully Changed", null));
- }catch(Exception e){
+ }
+ catch (Exception e)
+ {
uiApp.addMessage(new ApplicationMessage("Producer Modification Error", null));
}
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl 2010-01-08 15:22:50 UTC (rev 1205)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl 2010-01-08 15:26:33 UTC (rev 1206)
@@ -1,32 +1,23 @@
-
-<%
- import org.exoplatform.webui.core.UIComponent ;
- import org.exoplatform.webui.form.UIFormPageIterator ;
- import org.exoplatform.webui.form.UIFormCheckBoxInput ;
-
-%>
-
-
<div class="<%=uicomponent.getId()%>" id="<%=uicomponent.getId()%>">
- <div class="UIAction">
+ <div class="UIAction">
<table class="ActionContainer">
- <tr>
- <td>
- <div onclick="<%=uicomponent.event("OpenPopup", "")%>" class="ActionButton LightBlueStyle">
- <div class="ButtonLeft">
- <div class="ButtonRight">
- <div class="ButtonMiddle">
- <a href="javascript:void(0);">Add New Consumer</a>
+ <tr>
+ <td>
+ <div onclick="<%=uicomponent.event("OpenPopup", "")%>" class="ActionButton LightBlueStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="javascript:void(0);">Add New Consumer</a>
+ </div>
+ </div>
</div>
- </div>
- </div>
- </div>
- </td>
- </tr>
+ </div>
+ </td>
+ </tr>
</table>
- </div>
+ </div>
- <% uicomponent.renderChildren(); %>
+ <% uicomponent.renderChildren(); %>
</div>
\ No newline at end of file
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl 2010-01-08 15:22:50 UTC (rev 1205)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl 2010-01-08 15:26:33 UTC (rev 1206)
@@ -36,7 +36,15 @@
<table class="ActionContainer">
<tr>
<td>
-
+ <div onclick="<%=uicomponent.event("AddProperty")%>" class="ActionButton LightBlueStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() + ".action.AddProperty")%></a>
+ </div>
+ </div>
+ </div>
+ </div>
</td>
<td>
<div onclick="<%=uicomponent.event("Save")%>" class="ActionButton LightBlueStyle">
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl 2010-01-08 15:22:50 UTC (rev 1205)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl 2010-01-08 15:26:33 UTC (rev 1206)
@@ -1,13 +1,4 @@
-
-<%
- import org.exoplatform.webui.core.UIComponent ;
- import org.exoplatform.webui.form.UIFormPageIterator ;
- import org.exoplatform.webui.form.UIFormCheckBoxInput ;
-
-%>
-
-
<div class="<%=uicomponent.getId()%>" id="<%=uicomponent.getId()%>">
- <% uicomponent.renderChildren(); %>
+ <% uicomponent.renderChildren(); %>
</div>
\ No newline at end of file
14 years, 11 months
gatein SVN: r1205 - portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-01-08 10:22:50 -0500 (Fri, 08 Jan 2010)
New Revision: 1205
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIContainer.java
Log:
- Removed some code duplication.
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIContainer.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIContainer.java 2010-01-08 15:21:58 UTC (rev 1204)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIContainer.java 2010-01-08 15:22:50 UTC (rev 1205)
@@ -1,16 +1,16 @@
/**
* 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
@@ -29,10 +29,7 @@
import java.util.ArrayList;
import java.util.List;
-/**
- * Created by The eXo Platform SAS
- * May 7, 2006
- */
+/** Created by The eXo Platform SAS May 7, 2006 */
@ComponentConfig(lifecycle = UIContainerLifecycle.class)
public class UIContainer extends UIComponent
{
@@ -52,14 +49,18 @@
public List<UIComponent> getChildren()
{
if (children == null)
+ {
children = new ArrayList<UIComponent>(3);
+ }
return children;
}
public void addChild(UIComponent uicomponent)
{
if (children == null)
+ {
children = new ArrayList<UIComponent>(3);
+ }
uicomponent.setParent(this);
children.add(uicomponent);
}
@@ -67,11 +68,15 @@
public UIComponent removeChildById(String id)
{
if (children == null)
+ {
return null;
+ }
for (UIComponent child : children)
{
if (!id.equals(child.getId()))
+ {
continue;
+ }
child.setParent(null);
children.remove(child);
return child;
@@ -82,11 +87,15 @@
public <T extends UIComponent> T removeChild(Class<T> clazz)
{
if (children == null)
+ {
return null;
+ }
for (UIComponent child : children)
{
if (!clazz.isInstance(child))
+ {
continue;
+ }
child.setParent(null);
children.remove(child);
return clazz.cast(child);
@@ -95,49 +104,66 @@
}
// todo (julien) : this is not type safe
+
@SuppressWarnings("unchecked")
public <T extends UIComponent> T getChildById(String id)
{
if (children == null)
+ {
return null;
+ }
for (UIComponent child : children)
{
if (id.equals(child.getId()))
+ {
return (T)child;
+ }
}
return null;
}
// todo (julien) : this is not type safe
+
@SuppressWarnings("unchecked")
public <T extends UIComponent> T getChild(int idx)
{
if (children == null)
+ {
return null;
+ }
if (children.size() <= idx)
+ {
return null;
+ }
return (T)children.get(idx);
}
public <T extends UIComponent> T getChild(Class<T> clazz)
{
if (children == null)
+ {
return null;
+ }
for (UIComponent uichild : children)
{
if (clazz.isInstance(uichild))
+ {
return clazz.cast(uichild);
+ }
}
return null;
}
// todo (julien) : this is not type safe
+
@SuppressWarnings("unchecked")
public <T extends UIComponent> T replaceChild(String targetChildId, UIComponent newComponent) throws Exception
{
if (children == null)
+ {
throw new Exception("Cannot find the child : " + targetChildId);
+ }
for (int i = 0; i < this.children.size(); i++)
{
UIComponent child = this.children.get(i);
@@ -172,21 +198,28 @@
}
// todo (julien) : this is not type safe
+
@SuppressWarnings("unchecked")
public <T extends UIComponent> T findComponentById(String id)
{
if (getId() != null)
{
if (getId().equals(id))
+ {
return (T)this;
+ }
}
if (children == null)
+ {
return null;
+ }
for (UIComponent uichild : children)
{
UIComponent found = uichild.findComponentById(id);
if (found != null)
+ {
return (T)found;
+ }
}
return null;
}
@@ -206,14 +239,20 @@
public <T extends UIComponent> T findFirstComponentOfType(Class<T> type)
{
if (type.isInstance(this))
+ {
return type.cast(this);
+ }
if (children == null)
+ {
return null;
+ }
for (UIComponent uichild : children)
{
T found = uichild.findFirstComponentOfType(type);
if (found != null)
+ {
return found;
+ }
}
return null;
}
@@ -221,9 +260,13 @@
public <T> void findComponentOfType(List<T> list, Class<T> type)
{
if (type.isInstance(this) && !list.contains(this))
+ {
list.add(type.cast(this));
+ }
if (children == null)
+ {
return;
+ }
for (UIComponent uichild : children)
{
uichild.findComponentOfType(list, type);
@@ -236,9 +279,13 @@
for (UIComponent child : list)
{
if (child.getId().equals(id))
+ {
child.setRendered(true);
+ }
else
+ {
child.setRendered(false);
+ }
}
}
@@ -248,9 +295,13 @@
for (UIComponent child : list)
{
if (type.isInstance(child))
+ {
child.setRendered(true);
+ }
else
+ {
child.setRendered(false);
+ }
}
}
@@ -273,20 +324,12 @@
public void renderChild(String id) throws Exception
{
- UIComponent uiChild = getChildById(id);
- if (uiChild.isRendered())
- {
- uiChild.processRender((WebuiRequestContext)WebuiRequestContext.getCurrentInstance());
- }
+ renderChild(getChildById(id));
}
public <T extends UIComponent> void renderChild(Class<T> clazz) throws Exception
{
- UIComponent uiChild = getChild(clazz);
- if (uiChild.isRendered())
- {
- uiChild.processRender((WebuiRequestContext)WebuiRequestContext.getCurrentInstance());
- }
+ renderChild(getChild(clazz));
}
public void renderUIComponent(UIComponent uicomponent) throws Exception
@@ -296,10 +339,14 @@
public void renderChild(int index) throws Exception
{
- UIComponent uiChild = getChild(index);
- if (uiChild.isRendered())
+ renderChild(getChild(index));
+ }
+
+ public void renderChild(UIComponent child) throws Exception
+ {
+ if (child.isRendered())
{
- uiChild.processRender((WebuiRequestContext)WebuiRequestContext.getCurrentInstance());
+ child.processRender((WebuiRequestContext)WebuiRequestContext.getCurrentInstance());
}
}
@@ -315,7 +362,9 @@
for (UIComponent child : list)
{
if (child.isRendered())
+ {
child.processRender(context);
+ }
}
}
@@ -327,7 +376,9 @@
UIContainer uiContainer = event.getSource();
String renderTab = context.getRequestParameter(UIComponent.OBJECTID);
if (renderTab == null)
+ {
return;
+ }
UIComponent uiComp = uiContainer.findComponentById(renderTab);
if (uiComp != null)
{
14 years, 11 months
gatein SVN: r1204 - portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-01-08 10:21:58 -0500 (Fri, 08 Jan 2010)
New Revision: 1204
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWSRPFormInputSet.java
Log:
- Fixed rendering method: cannot use a buffer to build the output markup first as calling renderUIComponent will not use it.
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWSRPFormInputSet.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWSRPFormInputSet.java 2010-01-08 10:42:14 UTC (rev 1203)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWSRPFormInputSet.java 2010-01-08 15:21:58 UTC (rev 1204)
@@ -25,7 +25,6 @@
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.form.UIForm;
-import org.exoplatform.webui.form.UIFormInputBase;
import org.exoplatform.webui.form.UIFormInputSet;
import java.io.Writer;
@@ -52,8 +51,8 @@
return;
}
- StringBuilder sb = new StringBuilder(512);
- sb.append("<div class=\"UIFormInputSet\">");
+ Writer w = context.getWriter();
+ w.write("<div class=\"UIFormInputSet\">");
ResourceBundle res = context.getApplicationResourceBundle();
UIForm uiForm = getAncestorOfType(UIForm.class);
@@ -61,33 +60,25 @@
{
if (inputEntry.isRendered())
{
- sb.append("<div class=\"row\">");
+ w.write("<div class=\"row\">");
String label;
try
{
label = uiForm.getLabel(res, inputEntry.getId());
- if (inputEntry instanceof UIFormInputBase)
- {
- ((UIFormInputBase)inputEntry).setLabel(label);
- }
}
catch (MissingResourceException ex)
{
- //label = " " ;
label = inputEntry.getName();
System.err.println("\n " + uiForm.getId() + ".label." + inputEntry.getId() + " not found value");
}
- sb.append("<label>").append(label).append("</label>");
+ w.write("<label>" + label + "</label>");
renderUIComponent(inputEntry);
- sb.append("</div>");
+ w.write("</div>");
}
}
- sb.append("</div>");
-
- Writer w = context.getWriter();
- w.write(sb.toString());
+ w.write("</div>");
}
}
14 years, 11 months
gatein SVN: r1203 - portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-01-08 05:42:14 -0500 (Fri, 08 Jan 2010)
New Revision: 1203
Modified:
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestUserACL.java
Log:
no need to extend BasicTestCase
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestUserACL.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestUserACL.java 2010-01-08 10:38:18 UTC (rev 1202)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestUserACL.java 2010-01-08 10:42:14 UTC (rev 1203)
@@ -19,6 +19,7 @@
package org.exoplatform.portal.config.security;
+import junit.framework.TestCase;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.config.UserACLMetaData;
import org.exoplatform.portal.config.model.Page;
@@ -27,7 +28,6 @@
import org.exoplatform.services.security.ConversationState;
import org.exoplatform.services.security.Identity;
import org.exoplatform.services.security.MembershipEntry;
-import org.exoplatform.test.BasicTestCase;
import java.util.Collection;
import java.util.Collections;
@@ -39,7 +39,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public abstract class AbstractTestUserACL extends BasicTestCase
+public abstract class AbstractTestUserACL extends TestCase
{
protected UserACL ua;
14 years, 11 months
gatein SVN: r1202 - in portal/trunk/component/portal/src: test/java/org/exoplatform/portal/config/security and 3 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-01-08 05:38:18 -0500 (Fri, 08 Jan 2010)
New Revision: 1202
Added:
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/nav/
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/nav/TestGroupNavACL.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/nav/TestPortalNavACL.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/nav/TestUserNavACL.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/page/
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/page/AbstractTestSharedPageACL.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/page/TestGroupPageACL.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/page/TestPortalPageACL.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/page/TestUserPageACL.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/portal/
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/portal/TestCreatePortalACL.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/portal/TestPortalACL.java
Removed:
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestSharedPageACL.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestCreatePortalACL.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupNavACL.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupPageACL.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalConfigACL.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalNavACL.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalPageACL.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserNavACL.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserPageACL.java
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACL.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestUserACL.java
Log:
- reorg unit test for user acl
- clarified a few points in user page access in edit mode
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACL.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACL.java 2010-01-08 06:45:41 UTC (rev 1201)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -239,23 +239,6 @@
return adminMSType;
}
- protected boolean findMembershipByUserAndGroupAndType(String groupId, String membership) throws Exception
- {
- ConversationState conv = ConversationState.getCurrent();
- Identity id = null;
- if (conv != null)
- {
- id = conv.getIdentity();
- }
-
- if (id == null)
- {
- return false;
- }
-
- return id.isMemberOf(groupId, membership);
- }
-
public boolean hasPermission(PortalConfig pconfig)
{
return hasPermission(getIdentity(), pconfig);
@@ -322,10 +305,6 @@
return false;
}
- // --------------------------------------------------------------------------//
- // Utility Methods //
- // --------------------------------------------------------------------------//
-
private boolean hasPermission(Identity identity, PortalConfig pconfig)
{
if (hasPermission(identity, pconfig.getEditPermission()))
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestSharedPageACL.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestSharedPageACL.java 2010-01-08 06:45:41 UTC (rev 1201)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestSharedPageACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -1,217 +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.config.security;
-
-import org.exoplatform.portal.config.model.Page;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public abstract class AbstractTestSharedPageACL extends AbstractTestUserACL
-{
-
- protected abstract String getOwnerType();
-
- public void testPage()
- {
- Page page = new Page();
- page.setOwnerType("group");
- page.setOwnerId("foo");
- page.setAccessPermissions(new String[0]);
-
- //
- assertTrue(root.hasPermission(page));
- assertFalse(administrator.hasPermission(page));
- assertFalse(manager.hasPermission(page));
- assertFalse(user.hasPermission(page));
- assertFalse(guest.hasPermission(page));
-
- //
- assertTrue(root.hasEditPermission(page));
- assertFalse(administrator.hasEditPermission(page));
- assertFalse(manager.hasEditPermission(page));
- assertFalse(user.hasEditPermission(page));
- assertFalse(guest.hasEditPermission(page));
- }
-
- public void testPageAccessibleByEveryone()
- {
- Page page = new Page();
- page.setOwnerType("group");
- page.setOwnerId("foo");
- page.setAccessPermissions(new String[]{"Everyone"});
-
- //
- assertTrue(root.hasPermission(page));
- assertTrue(administrator.hasPermission(page));
- assertTrue(manager.hasPermission(page));
- assertTrue(user.hasPermission(page));
- assertTrue(guest.hasPermission(page));
-
- //
- assertTrue(root.hasEditPermission(page));
- assertFalse(administrator.hasEditPermission(page));
- assertFalse(manager.hasEditPermission(page));
- assertFalse(user.hasEditPermission(page));
- assertFalse(guest.hasEditPermission(page));
- }
-
- public void testPageEditableByEveryone()
- {
- Page page = new Page();
- page.setOwnerType("group");
- page.setOwnerId("foo");
- page.setAccessPermissions(new String[0]);
- page.setEditPermission("Everyone");
-
- //
- assertTrue(root.hasPermission(page));
- assertTrue(administrator.hasPermission(page));
- assertTrue(manager.hasPermission(page));
- assertTrue(user.hasPermission(page));
- assertTrue(guest.hasPermission(page));
-
- //
- assertTrue(root.hasEditPermission(page));
- assertTrue(administrator.hasEditPermission(page));
- assertTrue(manager.hasEditPermission(page));
- assertTrue(user.hasEditPermission(page));
- assertTrue(guest.hasEditPermission(page));
- }
-
- public void testPageAccessibleByGuests()
- {
- Page page = new Page();
- page.setOwnerType("group");
- page.setOwnerId("foo");
- page.setAccessPermissions(new String[]{"whatever:/platform/guests"});
-
- //
- assertTrue(root.hasPermission(page));
- assertFalse(administrator.hasPermission(page));
- assertFalse(manager.hasPermission(page));
- assertFalse(user.hasPermission(page));
- assertTrue(guest.hasPermission(page));
-
- //
- assertTrue(root.hasEditPermission(page));
- assertFalse(administrator.hasEditPermission(page));
- assertFalse(manager.hasEditPermission(page));
- assertFalse(user.hasEditPermission(page));
- assertFalse(guest.hasEditPermission(page));
- }
-
- public void testPageEditableByGuests()
- {
- Page page = new Page();
- page.setOwnerType("group");
- page.setOwnerId("foo");
- page.setAccessPermissions(new String[0]);
- page.setEditPermission("whatever:/platform/guests");
-
- //
- assertTrue(root.hasPermission(page));
- assertFalse(administrator.hasPermission(page));
- assertFalse(manager.hasPermission(page));
- assertFalse(user.hasPermission(page));
- assertTrue(guest.hasPermission(page));
-
- //
- assertTrue(root.hasEditPermission(page));
- assertFalse(administrator.hasEditPermission(page));
- assertFalse(manager.hasEditPermission(page));
- assertFalse(user.hasEditPermission(page));
- assertTrue(guest.hasEditPermission(page));
- }
-
- public void testPageAccessibleByEveryOneAndGuests()
- {
- Page page = new Page();
- page.setOwnerType("group");
- page.setOwnerId("foo");
- page.setAccessPermissions(new String[]{"Everyone", "whatever:/platform/guests"});
-
- //
- assertTrue(root.hasPermission(page));
- assertTrue(administrator.hasPermission(page));
- assertTrue(manager.hasPermission(page));
- assertTrue(user.hasPermission(page));
- assertTrue(guest.hasPermission(page));
-
- //
- assertTrue(root.hasEditPermission(page));
- assertFalse(administrator.hasEditPermission(page));
- assertFalse(manager.hasEditPermission(page));
- assertFalse(user.hasEditPermission(page));
- assertFalse(guest.hasEditPermission(page));
- }
-
- public void testPageWithAccessPermission()
- {
- Page page = new Page();
- page.setOwnerType("group");
- page.setOwnerId("foo");
- page.setAccessPermissions(new String[]{"manager:/manageable"});
-
- //
- assertTrue(root.hasPermission(page));
- assertFalse(administrator.hasPermission(page));
- assertTrue(manager.hasPermission(page));
- assertFalse(user.hasPermission(page));
- assertFalse(guest.hasPermission(page));
-
- //
- page.setAccessPermissions(new String[]{"*:/manageable"});
-
- //
- assertTrue(root.hasPermission(page));
- assertFalse(administrator.hasPermission(page));
- assertTrue(manager.hasPermission(page));
- assertFalse(user.hasPermission(page));
- assertFalse(guest.hasPermission(page));
- }
-
- public void testPageWithEditPermission()
- {
- Page page = new Page();
- page.setOwnerType("group");
- page.setOwnerId("foo");
- page.setAccessPermissions(new String[0]);
- page.setEditPermission("manager:/manageable");
-
- //
- assertTrue(root.hasPermission(page));
- assertFalse(administrator.hasPermission(page));
- assertTrue(manager.hasPermission(page));
- assertFalse(user.hasPermission(page));
- assertFalse(guest.hasPermission(page));
-
- //
- page.setEditPermission("*:/manageable");
-
- //
- assertTrue(root.hasPermission(page));
- assertFalse(administrator.hasPermission(page));
- assertTrue(manager.hasPermission(page));
- assertFalse(user.hasPermission(page));
- assertFalse(guest.hasPermission(page));
- }
-}
\ No newline at end of file
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestUserACL.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestUserACL.java 2010-01-08 06:45:41 UTC (rev 1201)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestUserACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -42,9 +42,9 @@
public abstract class AbstractTestUserACL extends BasicTestCase
{
- UserACL ua;
+ protected UserACL ua;
- User root, administrator, manager, user, guest;
+ protected User root, administrator, manager, user, guest;
@Override
protected void setUp() throws Exception
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestCreatePortalACL.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestCreatePortalACL.java 2010-01-08 06:45:41 UTC (rev 1201)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestCreatePortalACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -1,36 +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.config.security;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class TestCreatePortalACL extends AbstractTestUserACL
-{
-
- public void testPermission()
- {
- assertTrue(root.hasCreatePortalPermission());
- assertTrue(administrator.hasCreatePortalPermission());
- assertFalse(manager.hasCreatePortalPermission());
- assertFalse(user.hasCreatePortalPermission());
- }
-}
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupNavACL.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupNavACL.java 2010-01-08 06:45:41 UTC (rev 1201)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupNavACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -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.config.security;
-
-import org.exoplatform.portal.config.model.PageNavigation;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class TestGroupNavACL extends AbstractTestUserACL
-{
-
- public void testNavEditByManager()
- {
- PageNavigation nav = new PageNavigation();
- nav.setOwnerType("group");
- nav.setOwnerId("manageable");
-
- //
- assertTrue(root.hasEditPermission(nav));
- assertFalse(administrator.hasEditPermission(nav));
- assertTrue(manager.hasEditPermission(nav));
- assertFalse(user.hasEditPermission(nav));
- assertFalse(guest.hasEditPermission(nav));
-
- //
- nav.setOwnerId("foo");
-
- //
- assertTrue(root.hasEditPermission(nav));
- assertFalse(administrator.hasEditPermission(nav));
- assertFalse(manager.hasEditPermission(nav));
- assertFalse(user.hasEditPermission(nav));
- assertFalse(guest.hasEditPermission(nav));
- }
-}
\ No newline at end of file
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupPageACL.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupPageACL.java 2010-01-08 06:45:41 UTC (rev 1201)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupPageACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -1,32 +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.config.security;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class TestGroupPageACL extends AbstractTestSharedPageACL
-{
- protected String getOwnerType()
- {
- return "Group";
- }
-}
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalConfigACL.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalConfigACL.java 2010-01-08 06:45:41 UTC (rev 1201)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalConfigACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -1,113 +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.config.security;
-
-import org.exoplatform.portal.config.model.PortalConfig;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class TestPortalConfigACL extends AbstractTestUserACL
-{
-
- public void testFoo()
- {
- PortalConfig portal = new PortalConfig();
- portal.setAccessPermissions(new String[0]);
-
- //
- assertTrue(root.hasEditPermission(portal));
- assertFalse(administrator.hasEditPermission(portal));
- assertFalse(manager.hasEditPermission(portal));
- assertFalse(user.hasEditPermission(portal));
- assertFalse(guest.hasEditPermission(portal));
-
- //
- assertTrue(root.hasPermission(portal));
- assertFalse(administrator.hasPermission(portal));
- assertFalse(manager.hasPermission(portal));
- assertFalse(user.hasPermission(portal));
- assertFalse(guest.hasPermission(portal));
- }
-
- public void testPortalAccessible()
- {
- PortalConfig portal = new PortalConfig();
- portal.setAccessPermissions(new String[]{"manager:/manageable"});
-
- //
- assertTrue(root.hasEditPermission(portal));
- assertFalse(administrator.hasEditPermission(portal));
- assertFalse(manager.hasEditPermission(portal));
- assertFalse(user.hasEditPermission(portal));
- assertFalse(guest.hasEditPermission(portal));
-
- //
- assertTrue(root.hasPermission(portal));
- assertFalse(administrator.hasPermission(portal));
- assertTrue(manager.hasPermission(portal));
- assertFalse(user.hasPermission(portal));
- assertFalse(guest.hasPermission(portal));
- }
-
- public void testPortalEditable()
- {
- PortalConfig portal = new PortalConfig();
- portal.setAccessPermissions(new String[0]);
- portal.setEditPermission("manager:/manageable");
-
- //
- assertTrue(root.hasEditPermission(portal));
- assertFalse(administrator.hasEditPermission(portal));
- assertTrue(manager.hasEditPermission(portal));
- assertFalse(user.hasEditPermission(portal));
- assertFalse(guest.hasEditPermission(portal));
-
- //
- assertTrue(root.hasPermission(portal));
- assertFalse(administrator.hasPermission(portal));
- assertTrue(manager.hasPermission(portal));
- assertFalse(user.hasPermission(portal));
- assertFalse(guest.hasPermission(portal));
- }
-
- public void testPortalAccessibleAndEditable()
- {
- PortalConfig portal = new PortalConfig();
- portal.setAccessPermissions(new String[]{"manager:/manageable"});
- portal.setEditPermission("manager:/manageable");
-
- //
- assertTrue(root.hasEditPermission(portal));
- assertFalse(administrator.hasEditPermission(portal));
- assertTrue(manager.hasEditPermission(portal));
- assertFalse(user.hasEditPermission(portal));
- assertFalse(guest.hasEditPermission(portal));
-
- //
- assertTrue(root.hasPermission(portal));
- assertFalse(administrator.hasPermission(portal));
- assertTrue(manager.hasPermission(portal));
- assertFalse(user.hasPermission(portal));
- assertFalse(guest.hasPermission(portal));
- }
-
-}
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalNavACL.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalNavACL.java 2010-01-08 06:45:41 UTC (rev 1201)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalNavACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -1,44 +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.config.security;
-
-import org.exoplatform.portal.config.model.PageNavigation;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class TestPortalNavACL extends AbstractTestUserACL
-{
-
- public void testNavEditByRoot()
- {
- PageNavigation nav = new PageNavigation();
- nav.setOwnerType("portal");
- nav.setOwnerId("foo");
-
- //
- assertTrue(root.hasEditPermission(nav));
- assertFalse(administrator.hasEditPermission(nav));
- assertFalse(manager.hasEditPermission(nav));
- assertFalse(user.hasEditPermission(nav));
- assertFalse(guest.hasEditPermission(nav));
- }
-}
\ No newline at end of file
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalPageACL.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalPageACL.java 2010-01-08 06:45:41 UTC (rev 1201)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalPageACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -1,32 +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.config.security;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class TestPortalPageACL extends AbstractTestSharedPageACL
-{
- protected String getOwnerType()
- {
- return "Portal";
- }
-}
\ No newline at end of file
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserNavACL.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserNavACL.java 2010-01-08 06:45:41 UTC (rev 1201)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserNavACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -1,44 +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.config.security;
-
-import org.exoplatform.portal.config.model.PageNavigation;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class TestUserNavACL extends AbstractTestUserACL
-{
-
- public void testNav()
- {
-
- PageNavigation nav = new PageNavigation();
- nav.setOwnerType("user");
- nav.setOwnerId("user");
-
- assertTrue(root.hasEditPermission(nav));
- assertFalse(administrator.hasEditPermission(nav));
- assertFalse(manager.hasEditPermission(nav));
- assertTrue(user.hasEditPermission(nav));
- assertFalse(guest.hasEditPermission(nav));
- }
-}
Deleted: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserPageACL.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserPageACL.java 2010-01-08 06:45:41 UTC (rev 1201)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserPageACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -1,114 +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.config.security;
-
-import org.exoplatform.portal.config.model.Page;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class TestUserPageACL extends AbstractTestUserACL
-{
- public void testUserPageIsAlwaysUsableOnlyByItsOwner()
- {
- Page page = new Page();
- page.setOwnerType("user");
- page.setOwnerId("user");
- page.setAccessPermissions(new String[0]);
- assertTrue(root.hasPermission(page));
- assertFalse(administrator.hasPermission(page));
- assertFalse(manager.hasPermission(page));
- assertTrue(user.hasPermission(page));
- assertFalse(guest.hasPermission(page));
- //assertTrue(root.hasEditPermission(page));
- assertFalse(administrator.hasEditPermission(page));
- assertFalse(manager.hasEditPermission(page));
- assertTrue(user.hasEditPermission(page));
- assertFalse(guest.hasEditPermission(page));
-
- //
- page = new Page();
- page.setOwnerType("user");
- page.setOwnerId("user");
- page.setAccessPermissions(new String[]{"manager:/manageable"});
- assertTrue(root.hasPermission(page));
- assertFalse(administrator.hasPermission(page));
- assertTrue(manager.hasPermission(page));
- assertTrue(user.hasPermission(page));
- assertFalse(guest.hasPermission(page));
- //assertTrue(root.hasEditPermission(page));
- assertFalse(administrator.hasEditPermission(page));
- assertFalse(manager.hasEditPermission(page));
- assertTrue(user.hasEditPermission(page));
- assertFalse(guest.hasEditPermission(page));
-
- //
- page = new Page();
- page.setOwnerType("user");
- page.setOwnerId("user");
- page.setAccessPermissions(new String[0]);
- page.setEditPermission("manager:/manageable");
- assertTrue(root.hasPermission(page));
- assertFalse(administrator.hasPermission(page));
- //assertTrue(manager.hasPermission(page));
- assertFalse(manager.hasPermission(page));
- assertTrue(user.hasPermission(page));
- assertFalse(guest.hasPermission(page));
- //assertTrue(root.hasEditPermission(page));
- assertFalse(administrator.hasEditPermission(page));
- //assertTrue(manager.hasEditPermission(page));
- assertTrue(user.hasEditPermission(page));
- assertFalse(guest.hasEditPermission(page));
-
- //
- page = new Page();
- page.setOwnerType("user");
- page.setOwnerId("user");
- page.setAccessPermissions(new String[]{"Everyone"});
- assertTrue(root.hasPermission(page));
- assertTrue(administrator.hasPermission(page));
- assertTrue(manager.hasPermission(page));
- assertTrue(user.hasPermission(page));
- assertTrue(guest.hasPermission(page));
- //assertTrue(root.hasEditPermission(page));
- assertFalse(administrator.hasEditPermission(page));
- assertFalse(manager.hasEditPermission(page));
- assertTrue(user.hasEditPermission(page));
- assertFalse(guest.hasEditPermission(page));
-
- //
- page = new Page();
- page.setOwnerType("user");
- page.setOwnerId("user");
- page.setAccessPermissions(new String[0]);
- page.setEditPermission("Everyone");
- assertTrue(root.hasPermission(page));
- //assertTrue(administrator.hasPermission(page));
- //assertTrue(manager.hasPermission(page));
- assertTrue(user.hasPermission(page));
- //assertTrue(guest.hasPermission(page));
- //assertTrue(root.hasEditPermission(page));
- //assertTrue(administrator.hasEditPermission(page));
- //assertTrue(manager.hasEditPermission(page));
- assertTrue(user.hasEditPermission(page));
- //assertTrue(guest.hasEditPermission(page));
- }
-}
Copied: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/nav/TestGroupNavACL.java (from rev 1192, portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupNavACL.java)
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/nav/TestGroupNavACL.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/nav/TestGroupNavACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -0,0 +1,55 @@
+/**
+ * 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.config.security.nav;
+
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.security.AbstractTestUserACL;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestGroupNavACL extends AbstractTestUserACL
+{
+
+ public void testNavEditByManager()
+ {
+ PageNavigation nav = new PageNavigation();
+ nav.setOwnerType("group");
+ nav.setOwnerId("manageable");
+
+ //
+ assertTrue(root.hasEditPermission(nav));
+ assertFalse(administrator.hasEditPermission(nav));
+ assertTrue(manager.hasEditPermission(nav));
+ assertFalse(user.hasEditPermission(nav));
+ assertFalse(guest.hasEditPermission(nav));
+
+ //
+ nav.setOwnerId("foo");
+
+ //
+ assertTrue(root.hasEditPermission(nav));
+ assertFalse(administrator.hasEditPermission(nav));
+ assertFalse(manager.hasEditPermission(nav));
+ assertFalse(user.hasEditPermission(nav));
+ assertFalse(guest.hasEditPermission(nav));
+ }
+}
\ No newline at end of file
Copied: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/nav/TestPortalNavACL.java (from rev 1192, portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalNavACL.java)
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/nav/TestPortalNavACL.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/nav/TestPortalNavACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -0,0 +1,45 @@
+/**
+ * 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.config.security.nav;
+
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.security.AbstractTestUserACL;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestPortalNavACL extends AbstractTestUserACL
+{
+
+ public void testNavEditByRoot()
+ {
+ PageNavigation nav = new PageNavigation();
+ nav.setOwnerType("portal");
+ nav.setOwnerId("foo");
+
+ //
+ assertTrue(root.hasEditPermission(nav));
+ assertFalse(administrator.hasEditPermission(nav));
+ assertFalse(manager.hasEditPermission(nav));
+ assertFalse(user.hasEditPermission(nav));
+ assertFalse(guest.hasEditPermission(nav));
+ }
+}
\ No newline at end of file
Copied: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/nav/TestUserNavACL.java (from rev 1192, portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserNavACL.java)
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/nav/TestUserNavACL.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/nav/TestUserNavACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -0,0 +1,45 @@
+/**
+ * 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.config.security.nav;
+
+import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.security.AbstractTestUserACL;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestUserNavACL extends AbstractTestUserACL
+{
+
+ public void testNav()
+ {
+
+ PageNavigation nav = new PageNavigation();
+ nav.setOwnerType("user");
+ nav.setOwnerId("user");
+
+ assertTrue(root.hasEditPermission(nav));
+ assertFalse(administrator.hasEditPermission(nav));
+ assertFalse(manager.hasEditPermission(nav));
+ assertTrue(user.hasEditPermission(nav));
+ assertFalse(guest.hasEditPermission(nav));
+ }
+}
Copied: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/page/AbstractTestSharedPageACL.java (from rev 1192, portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/AbstractTestSharedPageACL.java)
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/page/AbstractTestSharedPageACL.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/page/AbstractTestSharedPageACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -0,0 +1,218 @@
+/**
+ * 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.config.security.page;
+
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.security.AbstractTestUserACL;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public abstract class AbstractTestSharedPageACL extends AbstractTestUserACL
+{
+
+ protected abstract String getOwnerType();
+
+ public void testPage()
+ {
+ Page page = new Page();
+ page.setOwnerType(getOwnerType());
+ page.setOwnerId("foo");
+ page.setAccessPermissions(new String[0]);
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertFalse(manager.hasPermission(page));
+ assertFalse(user.hasPermission(page));
+ assertFalse(guest.hasPermission(page));
+
+ //
+ assertTrue(root.hasEditPermission(page));
+ assertFalse(administrator.hasEditPermission(page));
+ assertFalse(manager.hasEditPermission(page));
+ assertFalse(user.hasEditPermission(page));
+ assertFalse(guest.hasEditPermission(page));
+ }
+
+ public void testPageAccessibleByEveryone()
+ {
+ Page page = new Page();
+ page.setOwnerType(getOwnerType());
+ page.setOwnerId("foo");
+ page.setAccessPermissions(new String[]{"Everyone"});
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertTrue(administrator.hasPermission(page));
+ assertTrue(manager.hasPermission(page));
+ assertTrue(user.hasPermission(page));
+ assertTrue(guest.hasPermission(page));
+
+ //
+ assertTrue(root.hasEditPermission(page));
+ assertFalse(administrator.hasEditPermission(page));
+ assertFalse(manager.hasEditPermission(page));
+ assertFalse(user.hasEditPermission(page));
+ assertFalse(guest.hasEditPermission(page));
+ }
+
+ public void testPageEditableByEveryone()
+ {
+ Page page = new Page();
+ page.setOwnerType(getOwnerType());
+ page.setOwnerId("foo");
+ page.setAccessPermissions(new String[0]);
+ page.setEditPermission("Everyone");
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertTrue(administrator.hasPermission(page));
+ assertTrue(manager.hasPermission(page));
+ assertTrue(user.hasPermission(page));
+ assertTrue(guest.hasPermission(page));
+
+ //
+ assertTrue(root.hasEditPermission(page));
+ assertTrue(administrator.hasEditPermission(page));
+ assertTrue(manager.hasEditPermission(page));
+ assertTrue(user.hasEditPermission(page));
+ assertTrue(guest.hasEditPermission(page));
+ }
+
+ public void testPageAccessibleByGuests()
+ {
+ Page page = new Page();
+ page.setOwnerType(getOwnerType());
+ page.setOwnerId("foo");
+ page.setAccessPermissions(new String[]{"whatever:/platform/guests"});
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertFalse(manager.hasPermission(page));
+ assertFalse(user.hasPermission(page));
+ assertTrue(guest.hasPermission(page));
+
+ //
+ assertTrue(root.hasEditPermission(page));
+ assertFalse(administrator.hasEditPermission(page));
+ assertFalse(manager.hasEditPermission(page));
+ assertFalse(user.hasEditPermission(page));
+ assertFalse(guest.hasEditPermission(page));
+ }
+
+ public void testPageEditableByGuests()
+ {
+ Page page = new Page();
+ page.setOwnerType(getOwnerType());
+ page.setOwnerId("foo");
+ page.setAccessPermissions(new String[0]);
+ page.setEditPermission("whatever:/platform/guests");
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertFalse(manager.hasPermission(page));
+ assertFalse(user.hasPermission(page));
+ assertTrue(guest.hasPermission(page));
+
+ //
+ assertTrue(root.hasEditPermission(page));
+ assertFalse(administrator.hasEditPermission(page));
+ assertFalse(manager.hasEditPermission(page));
+ assertFalse(user.hasEditPermission(page));
+ assertTrue(guest.hasEditPermission(page));
+ }
+
+ public void testPageAccessibleByEveryOneAndGuests()
+ {
+ Page page = new Page();
+ page.setOwnerType(getOwnerType());
+ page.setOwnerId("foo");
+ page.setAccessPermissions(new String[]{"Everyone", "whatever:/platform/guests"});
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertTrue(administrator.hasPermission(page));
+ assertTrue(manager.hasPermission(page));
+ assertTrue(user.hasPermission(page));
+ assertTrue(guest.hasPermission(page));
+
+ //
+ assertTrue(root.hasEditPermission(page));
+ assertFalse(administrator.hasEditPermission(page));
+ assertFalse(manager.hasEditPermission(page));
+ assertFalse(user.hasEditPermission(page));
+ assertFalse(guest.hasEditPermission(page));
+ }
+
+ public void testPageWithAccessPermission()
+ {
+ Page page = new Page();
+ page.setOwnerType(getOwnerType());
+ page.setOwnerId("foo");
+ page.setAccessPermissions(new String[]{"manager:/manageable"});
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertTrue(manager.hasPermission(page));
+ assertFalse(user.hasPermission(page));
+ assertFalse(guest.hasPermission(page));
+
+ //
+ page.setAccessPermissions(new String[]{"*:/manageable"});
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertTrue(manager.hasPermission(page));
+ assertFalse(user.hasPermission(page));
+ assertFalse(guest.hasPermission(page));
+ }
+
+ public void testPageWithEditPermission()
+ {
+ Page page = new Page();
+ page.setOwnerType(getOwnerType());
+ page.setOwnerId("foo");
+ page.setAccessPermissions(new String[0]);
+ page.setEditPermission("manager:/manageable");
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertTrue(manager.hasPermission(page));
+ assertFalse(user.hasPermission(page));
+ assertFalse(guest.hasPermission(page));
+
+ //
+ page.setEditPermission("*:/manageable");
+
+ //
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertTrue(manager.hasPermission(page));
+ assertFalse(user.hasPermission(page));
+ assertFalse(guest.hasPermission(page));
+ }
+}
\ No newline at end of file
Copied: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/page/TestGroupPageACL.java (from rev 1192, portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestGroupPageACL.java)
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/page/TestGroupPageACL.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/page/TestGroupPageACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -0,0 +1,32 @@
+/**
+ * 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.config.security.page;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestGroupPageACL extends AbstractTestSharedPageACL
+{
+ protected String getOwnerType()
+ {
+ return "Group";
+ }
+}
Copied: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/page/TestPortalPageACL.java (from rev 1192, portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalPageACL.java)
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/page/TestPortalPageACL.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/page/TestPortalPageACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -0,0 +1,32 @@
+/**
+ * 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.config.security.page;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestPortalPageACL extends AbstractTestSharedPageACL
+{
+ protected String getOwnerType()
+ {
+ return "Portal";
+ }
+}
\ No newline at end of file
Copied: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/page/TestUserPageACL.java (from rev 1192, portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestUserPageACL.java)
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/page/TestUserPageACL.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/page/TestUserPageACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -0,0 +1,114 @@
+/**
+ * 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.config.security.page;
+
+import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.security.AbstractTestUserACL;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestUserPageACL extends AbstractTestUserACL
+{
+ public void testUserPageIsAlwaysUsableOnlyByItsOwner()
+ {
+ Page page = new Page();
+ page.setOwnerType("user");
+ page.setOwnerId("user");
+ page.setAccessPermissions(new String[0]);
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertFalse(manager.hasPermission(page));
+ assertTrue(user.hasPermission(page));
+ assertFalse(guest.hasPermission(page));
+ assertFalse(root.hasEditPermission(page));
+ assertFalse(administrator.hasEditPermission(page));
+ assertFalse(manager.hasEditPermission(page));
+ assertTrue(user.hasEditPermission(page));
+ assertFalse(guest.hasEditPermission(page));
+
+ //
+ page = new Page();
+ page.setOwnerType("user");
+ page.setOwnerId("user");
+ page.setAccessPermissions(new String[]{"manager:/manageable"});
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertTrue(manager.hasPermission(page));
+ assertTrue(user.hasPermission(page));
+ assertFalse(guest.hasPermission(page));
+ assertFalse(root.hasEditPermission(page));
+ assertFalse(administrator.hasEditPermission(page));
+ assertFalse(manager.hasEditPermission(page));
+ assertTrue(user.hasEditPermission(page));
+ assertFalse(guest.hasEditPermission(page));
+
+ //
+ page = new Page();
+ page.setOwnerType("user");
+ page.setOwnerId("user");
+ page.setEditPermission("manager:/manageable");
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertFalse(manager.hasPermission(page));
+ assertFalse(manager.hasPermission(page));
+ assertTrue(user.hasPermission(page));
+ assertFalse(guest.hasPermission(page));
+ assertFalse(root.hasEditPermission(page));
+ assertFalse(administrator.hasEditPermission(page));
+ assertFalse(manager.hasEditPermission(page));
+ assertTrue(user.hasEditPermission(page));
+ assertFalse(guest.hasEditPermission(page));
+
+ //
+ page = new Page();
+ page.setOwnerType("user");
+ page.setOwnerId("user");
+ page.setAccessPermissions(new String[]{"Everyone"});
+ assertTrue(root.hasPermission(page));
+ assertTrue(administrator.hasPermission(page));
+ assertTrue(manager.hasPermission(page));
+ assertTrue(user.hasPermission(page));
+ assertTrue(guest.hasPermission(page));
+ assertFalse(root.hasEditPermission(page));
+ assertFalse(administrator.hasEditPermission(page));
+ assertFalse(manager.hasEditPermission(page));
+ assertTrue(user.hasEditPermission(page));
+ assertFalse(guest.hasEditPermission(page));
+
+ //
+ page = new Page();
+ page.setOwnerType("user");
+ page.setOwnerId("user");
+ page.setAccessPermissions(new String[0]);
+ page.setEditPermission("Everyone");
+ assertTrue(root.hasPermission(page));
+ assertFalse(administrator.hasPermission(page));
+ assertFalse(manager.hasPermission(page));
+ assertTrue(user.hasPermission(page));
+ assertFalse(guest.hasPermission(page));
+ assertFalse(root.hasEditPermission(page));
+ assertFalse(administrator.hasEditPermission(page));
+ assertFalse(manager.hasEditPermission(page));
+ assertTrue(user.hasEditPermission(page));
+ assertFalse(guest.hasEditPermission(page));
+ }
+}
Copied: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/portal/TestCreatePortalACL.java (from rev 1192, portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestCreatePortalACL.java)
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/portal/TestCreatePortalACL.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/portal/TestCreatePortalACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -0,0 +1,38 @@
+/**
+ * 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.config.security.portal;
+
+import org.exoplatform.portal.config.security.AbstractTestUserACL;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestCreatePortalACL extends AbstractTestUserACL
+{
+
+ public void testPermission()
+ {
+ assertTrue(root.hasCreatePortalPermission());
+ assertTrue(administrator.hasCreatePortalPermission());
+ assertFalse(manager.hasCreatePortalPermission());
+ assertFalse(user.hasCreatePortalPermission());
+ }
+}
Copied: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/portal/TestPortalACL.java (from rev 1192, portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/TestPortalConfigACL.java)
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/portal/TestPortalACL.java (rev 0)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/security/portal/TestPortalACL.java 2010-01-08 10:38:18 UTC (rev 1202)
@@ -0,0 +1,114 @@
+/**
+ * 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.config.security.portal;
+
+import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.config.security.AbstractTestUserACL;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestPortalACL extends AbstractTestUserACL
+{
+
+ public void testFoo()
+ {
+ PortalConfig portal = new PortalConfig();
+ portal.setAccessPermissions(new String[0]);
+
+ //
+ assertTrue(root.hasEditPermission(portal));
+ assertFalse(administrator.hasEditPermission(portal));
+ assertFalse(manager.hasEditPermission(portal));
+ assertFalse(user.hasEditPermission(portal));
+ assertFalse(guest.hasEditPermission(portal));
+
+ //
+ assertTrue(root.hasPermission(portal));
+ assertFalse(administrator.hasPermission(portal));
+ assertFalse(manager.hasPermission(portal));
+ assertFalse(user.hasPermission(portal));
+ assertFalse(guest.hasPermission(portal));
+ }
+
+ public void testPortalAccessible()
+ {
+ PortalConfig portal = new PortalConfig();
+ portal.setAccessPermissions(new String[]{"manager:/manageable"});
+
+ //
+ assertTrue(root.hasEditPermission(portal));
+ assertFalse(administrator.hasEditPermission(portal));
+ assertFalse(manager.hasEditPermission(portal));
+ assertFalse(user.hasEditPermission(portal));
+ assertFalse(guest.hasEditPermission(portal));
+
+ //
+ assertTrue(root.hasPermission(portal));
+ assertFalse(administrator.hasPermission(portal));
+ assertTrue(manager.hasPermission(portal));
+ assertFalse(user.hasPermission(portal));
+ assertFalse(guest.hasPermission(portal));
+ }
+
+ public void testPortalEditable()
+ {
+ PortalConfig portal = new PortalConfig();
+ portal.setAccessPermissions(new String[0]);
+ portal.setEditPermission("manager:/manageable");
+
+ //
+ assertTrue(root.hasEditPermission(portal));
+ assertFalse(administrator.hasEditPermission(portal));
+ assertTrue(manager.hasEditPermission(portal));
+ assertFalse(user.hasEditPermission(portal));
+ assertFalse(guest.hasEditPermission(portal));
+
+ //
+ assertTrue(root.hasPermission(portal));
+ assertFalse(administrator.hasPermission(portal));
+ assertTrue(manager.hasPermission(portal));
+ assertFalse(user.hasPermission(portal));
+ assertFalse(guest.hasPermission(portal));
+ }
+
+ public void testPortalAccessibleAndEditable()
+ {
+ PortalConfig portal = new PortalConfig();
+ portal.setAccessPermissions(new String[]{"manager:/manageable"});
+ portal.setEditPermission("manager:/manageable");
+
+ //
+ assertTrue(root.hasEditPermission(portal));
+ assertFalse(administrator.hasEditPermission(portal));
+ assertTrue(manager.hasEditPermission(portal));
+ assertFalse(user.hasEditPermission(portal));
+ assertFalse(guest.hasEditPermission(portal));
+
+ //
+ assertTrue(root.hasPermission(portal));
+ assertFalse(administrator.hasPermission(portal));
+ assertTrue(manager.hasPermission(portal));
+ assertFalse(user.hasPermission(portal));
+ assertFalse(guest.hasPermission(portal));
+ }
+
+}
14 years, 11 months