Author: wesleyhales
Date: 2007-10-27 12:15:32 -0400 (Sat, 27 Oct 2007)
New Revision: 8783
Added:
branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/img/max-icon.gif
branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/img/min-icon.gif
branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/img/norm-icon.gif
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/style.css
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editProperties.xhtml
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml
Log:
JBPORTAL-1765 - Adapt the admin portlet to let the user set a default window state
Added:
branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/img/max-icon.gif
===================================================================
(Binary files differ)
Property changes on:
branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/img/max-icon.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/img/min-icon.gif
===================================================================
(Binary files differ)
Property changes on:
branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/img/min-icon.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/img/norm-icon.gif
===================================================================
(Binary files differ)
Property changes on:
branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/img/norm-icon.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/style.css
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/style.css 2007-10-26
23:10:01 UTC (rev 8782)
+++
branches/JBoss_Portal_Branch_2_6/core-admin/src/bin/portal-admin-war/style.css 2007-10-27
16:15:32 UTC (rev 8783)
@@ -502,3 +502,7 @@
display: inline-block;
vertical-align: middle;
}
+
+.admin-ui .objectList img.windowStateIcon{
+ margin: 0 5px 0 0;
+}
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-10-26
23:10:01 UTC (rev 8782)
+++
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-10-27
16:15:32 UTC (rev 8783)
@@ -258,6 +258,23 @@
return getChildren(object, PortalObject.WINDOW_MASK);
}
});
+ setProperty("maximizedStateExists", new
AbstractPropertyDecorator(Boolean.class)
+ {
+ public Object getValue(Object bean)
+ {
+ PortalObject object = (PortalObject)bean;
+ ArrayList children = new ArrayList(getChildren(object,
PortalObject.WINDOW_MASK));
+ for (IteratorStatus i = new IteratorStatus(children.iterator());
i.hasNext();)
+ {
+ PortalObject portalObject = (PortalObject)i.next();
+ if
(portalObject.getDeclaredProperties().containsValue("MAXIMIZED"))
+ {
+ return Boolean.TRUE;
+ }
+ }
+ return Boolean.FALSE;
+ }
+ });
}
};
portalObjectDecorator.setProperty("id", new
AbstractPropertyDecorator(String.class)
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-10-26
23:10:01 UTC (rev 8782)
+++
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-10-27
16:15:32 UTC (rev 8783)
@@ -161,6 +161,9 @@
/** . */
public PageManagerBean pageManager;
+ /** . */
+ private Boolean maximizedStateExists;
+
// Wired services
public String getNamespace()
@@ -378,6 +381,14 @@
return theme;
}
+ public Boolean getMaximizedStateExists() {
+ return maximizedStateExists;
+ }
+
+ public void setMaximizedStateExists(Boolean maximizedStateExists) {
+ this.maximizedStateExists = maximizedStateExists;
+ }
+
// UI operations
public void selectObject(PortalObject po)
@@ -458,6 +469,9 @@
{
PortalObjectId poid = getSelectedPortalObjectId();
+ Map pmap = getRequestParameterMap();
+ maximizedStateExists =
Boolean.valueOf((String)pmap.get("maximizedStateExists"));
+
PortalObject object = portalObjectContainer.getObject(poid);
// Update state if possible
@@ -499,7 +513,7 @@
private PortalObjectId getSelectedPortalObjectId()
{
// Get id
- Map pmap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ Map pmap = getRequestParameterMap();
String id = (String)pmap.get("id");
// Set the state from the id
@@ -509,10 +523,14 @@
public void selectPlugin()
{
// Get plugin
- Map pmap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ Map pmap = getRequestParameterMap();
selectedPlugin = (String)pmap.get("plugin");
}
+ public Map getRequestParameterMap(){
+ return
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ }
+
public void selectParentObject(ActionEvent actionEvent)
{
PortalObject parent = getSelectedObjectParent();
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java 2007-10-26
23:10:01 UTC (rev 8782)
+++
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java 2007-10-27
16:15:32 UTC (rev 8783)
@@ -60,6 +60,7 @@
public static final PropertyInfo WINDOW_CONTENT_TYPE = new
PropertyInfo(WindowImpl.PORTAL_PROP_WINDOW_CONTENT_TYPE, new LocalizedString("Content
type"), new LocalizedString("The type of content of a window"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
public static final PropertyInfo DEFAULT_CHILD_NAME = new
PropertyInfo(WindowImpl.PORTAL_PROP_DEFAULT_OBJECT_NAME, new LocalizedString("Default
child name"), new LocalizedString("The child name used when no specific child
name is explicited"), "java.lang.String",
PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
public static final PropertyInfo PAGE_ORDER = new PropertyInfo("order", new
LocalizedString("Tab order"), new LocalizedString("The order value to
display pages in tabs"), "java.lang.String",
PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
+ public static final PropertyInfo INITIAL_WINDOW_STATE = new
PropertyInfo(WindowImpl.PORTAL_INITIAL_WINDOW_STATE, new LocalizedString("Initial
Mode"), new LocalizedString("The inital mode of the window"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
//
@@ -169,6 +170,7 @@
WINDOW_PROPERTIES.add(THEME_RENDER_REGION_ID);
WINDOW_PROPERTIES.add(THEME_RENDER_REGION_ORDER);
WINDOW_PROPERTIES.add(WINDOW_CONTENT_TYPE);
+ WINDOW_PROPERTIES.add(INITIAL_WINDOW_STATE);
//
CONTROL_PAGE_PROPERTIES.add(CONTROL_POLICY_PAGE_ACCESS_DENIED);
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml 2007-10-26
23:10:01 UTC (rev 8782)
+++
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml 2007-10-27
16:15:32 UTC (rev 8783)
@@ -14,7 +14,7 @@
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
-
+
<!-- defines property creation section -->
<table cellpadding="0" cellspacing="0"
width="100%">
<tr>
@@ -22,9 +22,8 @@
</tr>
<tr>
<td valign="top" class="portlet-section-body">
-
+
<h:form>
-
<!-- defines layout of property form -->
<table>
<tbody>
@@ -101,9 +100,27 @@
<h:selectBooleanCheckbox value="#{prop.value}"
readonly="#{prop.readOnly}"
rendered="#{prop.type ==
'java.lang.Boolean'}"/>
+
<h:inputText styleClass="portlet-form-input-field"
value="#{prop.value}"
readonly="#{prop.readOnly}"
- rendered="#{prop.type ==
'java.lang.String'}"/>
+ rendered="#{prop.type eq
'java.lang.String' and prop.name ne
'portal.windowInitialState'}"/>
+
+ <h:selectOneMenu
styleClass="portlet-form-input-field"
+ value="#{prop.value}"
+ rendered="#{prop.type eq
'java.lang.String' and prop.name eq 'portal.windowInitialState' and
(!portalobjectmgr.maximizedStateExists or prop.value eq 'MAXIMIZED')}">
+ <f:selectItem itemLabel="Choose One..."
itemValue=""/>
+ <f:selectItem itemLabel="Maximized"
itemValue="MAXIMIZED"/>
+ <f:selectItem itemLabel="Minimized"
itemValue="MINIMIZED"/>
+ <f:selectItem itemLabel="Normal"
itemValue="NORMAL"/>
+ </h:selectOneMenu>
+
+ <h:selectOneMenu
styleClass="portlet-form-input-field"
+ value="#{prop.value}"
disabled="true"
+ rendered="#{prop.type eq
'java.lang.String' and prop.name eq 'portal.windowInitialState' and
(portalobjectmgr.maximizedStateExists and prop.value ne 'MAXIMIZED')}">
+ <f:selectItem itemLabel="Minimized"
itemValue="MINIMIZED"/>
+ </h:selectOneMenu>
+
+
</h:column>
<h:column>
<f:facet name="header">Delete</f:facet>
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editProperties.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editProperties.xhtml 2007-10-26
23:10:01 UTC (rev 8782)
+++
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editProperties.xhtml 2007-10-27
16:15:32 UTC (rev 8783)
@@ -25,9 +25,11 @@
</h:form>
</div>
+ <div style="padding:5px">
<ui:include src="common/editProperties.xhtml">
<ui:param name="properties"
value="#{portalobjectmgr.selectedProperties}"/>
</ui:include>
+ </div>
<br/>
<c:if
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml 2007-10-26
23:10:01 UTC (rev 8782)
+++
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml 2007-10-27
16:15:32 UTC (rev 8783)
@@ -118,6 +118,9 @@
<c:if test="#{not empty portalobjectmgr.selectedObject.windows}">
<h3 class="sectionTitle">Manage windows within <span
class="objectName">#{portalobjectmgr.selectedObject.name}</span>
#{portalobjectmgr.selectedObject.typeName}</h3>
+
+ <ui:param name="maximizedStateExists"
value="#{portalobjectmgr.selectedObject.maximizedStateExists}"/>
+
<h:dataTable var="object"
value="#{portalobjectmgr.selectedObject.windows}"
styleClass="objectList"
rowClasses="portlet-section-body,portlet-section-alternate"
columnClasses="objectNameColumn, objectActionColumn"
@@ -126,11 +129,25 @@
<f:facet name="header">
<h:outputText value="Window"/>
</f:facet>
+
+ <h:graphicImage
title="#{object.declaredProperties['portal.windowInitialState'] eq
'MINIMIZED' ? 'This window is set to a minimized state.' : 'This
window defaults to a normal state.'}"
+ rendered="#{!maximizedStateExists}"
+
value="#{object.declaredProperties['portal.windowInitialState'] eq
'MINIMIZED' ? '/img/min-icon.gif' : '/img/norm-icon.gif' }"
+ styleClass="windowStateIcon"
+ alt="" />
+
+ <h:graphicImage
title="#{object.declaredProperties['portal.windowInitialState'] eq
'MAXIMIZED' ? 'This window is set to a maximized state.' : 'This
window defaults to a minimized state because one window within this page is set to
maximized.'}"
+ rendered="#{maximizedStateExists}"
+
value="#{object.declaredProperties['portal.windowInitialState'] eq
'MAXIMIZED' ? '/img/max-icon.gif' : '/img/min-icon.gif'}"
+ styleClass="windowStateIcon"
+ alt="" />
+
<h:commandLink
action="#{portalobjectmgr.selectObject}">#{object.name}
- <f:param name="id" value="#{object.id}"/>
+ <f:param name="id" value="#{object.id}"/>
</h:commandLink>
- </h:column>
- <h:column>
+
+ </h:column>
+ <h:column>
<f:facet name="header">
<h:outputText value="Actions"/>
</f:facet>
@@ -141,12 +158,13 @@
</h:commandLink> | <h:commandLink action="editProperties"
styleClass="actionProperties"
actionListener="#{portalobjectmgr.selectObject}">
<f:param name="id" value="#{object.id}"/>
+ <f:param name="maximizedStateExists"
value="#{portalobjectmgr.selectedObject.maximizedStateExists}"/>
Properties
- </h:commandLink> | <h:commandLink action="renameObject"
styleClass="actionRename"
+ </h:commandLink> | <h:commandLink action="renameObject"
styleClass="actionRename"
actionListener="#{portalobjectmgr.selectObject}">
<f:param name="id" value="#{object.id}"/>
Rename
- </h:commandLink> | <h:commandLink action="confirm"
actionListener="#{portalobjectmgr.selectObject}"
+ </h:commandLink> | <h:commandLink action="confirm"
actionListener="#{portalobjectmgr.selectObject}"
styleClass="actionDelete">
<f:param name="id" value="#{object.id}"/>
Delete
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml 2007-10-26
23:10:01 UTC (rev 8782)
+++
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml 2007-10-27
16:15:32 UTC (rev 8783)
@@ -50,7 +50,7 @@
fatalClass="portlet-msg-error"
warnClass="portlet-msg-alert"/>
<!-- Content -->
- <ui:insert name="content">Content</ui:insert>
+ <ui:insert name="content">Content</ui:insert>
</ui:define>
</ui:decorate>
</div>