making summary screens mostly consistent. this is a stop gap until after beta when we will make them prettier.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4818 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ariel Backenroth
2007-01-13 01:17:12 +00:00
parent 2063aa7426
commit 208716aadc
5 changed files with 295 additions and 92 deletions

View File

@@ -20,6 +20,7 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -36,6 +37,9 @@ import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.model.FileInfo;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.AuthorityType;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.cmr.workflow.WorkflowDefinition;
import org.alfresco.service.cmr.workflow.WorkflowService;
import org.alfresco.service.namespace.NamespaceService;
@@ -89,6 +93,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
protected AVMService avmService;
protected WorkflowService workflowService;
protected PersonService personService;
/** datamodel for table of selected forms */
protected DataModel formsDataModel = null;
@@ -327,6 +332,14 @@ public class CreateWebsiteWizard extends BaseWizardBean
this.workflowService = workflowService;
}
/**
* @param personService The PersonService to set.
*/
public void setPersonService(PersonService personService)
{
this.personService = personService;
}
// ------------------------------------------------------------------------------
// Bean getters and setters
@@ -460,6 +473,29 @@ public class CreateWebsiteWizard extends BaseWizardBean
new String[] {buf.toString()});
}
public List<UserWrapper> getInvitedUsers()
{
final FacesContext fc = FacesContext.getCurrentInstance();
List<UserGroupRole> invitedUserRoles = (List<UserGroupRole>)
getInviteUsersWizard().getUserRolesDataModel().getWrappedData();
List<UserWrapper> result = new LinkedList<UserWrapper>();
String currentUser = Application.getCurrentUser(fc).getUserName();
boolean foundCurrentUser = false;
for (UserGroupRole userRole : invitedUserRoles)
{
if (currentUser.equals(userRole.getAuthority()))
{
foundCurrentUser = true;
}
result.add(new UserWrapper(userRole.getAuthority(), userRole.getRole()));
}
if (foundCurrentUser == false)
{
result.add(new UserWrapper(currentUser, AVMConstants.ROLE_CONTENT_MANAGER));
}
return result;
}
// ------------------------------------------------------------------------------
// Define Web Content Workflows page
@@ -735,6 +771,8 @@ public class CreateWebsiteWizard extends BaseWizardBean
// ------------------------------------------------------------------------------
// Inner classes
/////////////////////////////////////////////////////////////////////////////
/**
* Wrapper class for a configurable template Form instance
*/
@@ -867,6 +905,8 @@ public class CreateWebsiteWizard extends BaseWizardBean
}
}
/////////////////////////////////////////////////////////////////////////////
/**
* Class to represent a single configured Presentation Template instance
*/
@@ -932,6 +972,8 @@ public class CreateWebsiteWizard extends BaseWizardBean
}
}
/////////////////////////////////////////////////////////////////////////////
/**
* Class to represent a single configured Workflow instance
*/
@@ -1031,4 +1073,37 @@ public class CreateWebsiteWizard extends BaseWizardBean
this.type = type;
}
}
/////////////////////////////////////////////////////////////////////////////
public class UserWrapper
{
private final String name, role;
public UserWrapper(final String authority, final String role)
{
if (AuthorityType.getAuthorityType(authority) == AuthorityType.USER ||
AuthorityType.getAuthorityType(authority) == AuthorityType.GUEST)
{
final NodeRef ref =
CreateWebsiteWizard.this.personService.getPerson(authority);
final String firstName = (String)
CreateWebsiteWizard.this.nodeService.getProperty(ref, ContentModel.PROP_FIRSTNAME);
final String lastName = (String)
CreateWebsiteWizard.this.nodeService.getProperty(ref, ContentModel.PROP_LASTNAME);
this.name = firstName + (lastName != null ? " " + lastName : "");
}
else
{
this.name = authority.substring(PermissionService.GROUP_PREFIX.length());
}
this.role = Application.getMessage(FacesContext.getCurrentInstance(), role);
}
public String getName() { return this.name; }
public String getRole() { return this.role; }
}
/////////////////////////////////////////////////////////////////////////////
}

View File

@@ -2230,6 +2230,10 @@
<property-name>workflowService</property-name>
<value>#{WorkflowService}</value>
</managed-property>
<managed-property>
<property-name>personService</property-name>
<value>#{PersonService}</value>
</managed-property>
</managed-bean>
<managed-bean>
@@ -2267,6 +2271,10 @@
<property-name>workflowService</property-name>
<value>#{WorkflowService}</value>
</managed-property>
<managed-property>
<property-name>personService</property-name>
<value>#{PersonService}</value>
</managed-property>
</managed-bean>
<managed-bean>

View File

@@ -30,28 +30,33 @@
<h:outputText value="&nbsp;#{msg.general_properties}" escape="false" />
</h:panelGrid>
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0">
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" width="100%">
<a:selectList id="form-list"
multiSelect="false"
activeSelect="true"
style="width:100%"
itemStyleClass="selectListItem">
<a:listItem label="${msg.name}: ${WizardManager.bean.formTitle}"
itemStyle="vertical-align: top; margin-right: 5px;">
<a:listItem label="<b>${WizardManager.bean.formTitle}</b>"
value="${WizardManager.bean.formName}"
image="/images/icons/webform_large.gif">
<jsp:attribute name="description">
<div>${msg.description}:
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<colgroup><col width="25%"/><col width="75%"/></colgroup>
<tbody>
<tr><td>${msg.description}:</td>
<td>
<c:choose>
<c:when test="${empty WizardManager.bean.formDescription}">
<span style="font-style:italic">${msg.description_not_set}</span>
</c:when>
<c:otherwise>
${WizardManager.bean.formDescription}
</c:otherwise>
<c:otherwise>${WizardManager.bean.formDescription}</c:otherwise>
</c:choose>
</div>
<div>${msg.schema_root_element_name}: ${WizardManager.bean.schemaRootElementName}</div>
<div>${msg.output_path_pattern}: ${WizardManager.bean.outputPathPatternForFormInstanceData}</div>
</td>
</tr>
<tr><td>${msg.schema_root_element_name}:</td><td>${WizardManager.bean.schemaRootElementName}</td></tr>
<tr><td>${msg.output_path_pattern}:</td><td>${WizardManager.bean.outputPathPatternForFormInstanceData}</td></tr>
</tbody>
</table>
</jsp:attribute>
</a:listItem>
</a:selectList>
@@ -62,34 +67,38 @@
<h:outputText value="&nbsp;#{msg.rendering_engine_templates}" escape="false" />
</h:panelGrid>
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0">
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" width="100%">
<h:outputText rendered="#{empty WizardManager.bean.renderingEngineTemplates}"
value="#{msg.no_selected_items}"/>
<a:selectList id="rendering-engine-template-list"
multiSelect="false"
itemStyle="vertical-align: top; margin-right: 5px;"
activeSelect="true"
style="width:100%"
itemStyleClass="selectListItem">
style="width:100%">
<c:forEach items="${WizardManager.bean.renderingEngineTemplates}" var="ret">
<a:listItem label="${msg.name}: ${ret.title}"
<a:listItem label="<b>${ret.title}</b>"
value="${ret.name}"
image="/images/icons/template_large.gif">
<jsp:attribute name="description">
<div>${msg.description}:
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<colgroup><col width="25%"/><col width="75%"/></colgroup>
<tbody>
<tr><td>${msg.description}:</td>
<td>
<c:choose>
<c:when test="${empty ret.description}">
<span style="font-style:italic">${msg.description_not_set}</span>
</c:when>
<c:otherwise>
${ret.description}
</c:otherwise>
<c:otherwise>${ret.description}</c:otherwise>
</c:choose>
</div>
<div>${msg.rendering_engine_type}: ${ret.renderingEngine.name}</div>
<div>${msg.output_path_pattern}: ${ret.outputPathPatternForRendition}</div>
<div>${msg.mimetype_for_renditions}: ${ret.mimetypeForRendition}</div>
</td>
</tr>
<tr><td>${msg.rendering_engine_type}:</td><td>${ret.renderingEngine.name}</td></tr>
<tr><td>${msg.output_path_pattern}:</td><td>${ret.outputPathPatternForRendition}</td></tr>
<tr><td>${msg.mimetype_for_renditions}:</td><td>${ret.mimetypeForRendition}</td></tr>
</tbody>
</table>
</jsp:attribute>
</a:listItem>
</c:forEach>
@@ -101,18 +110,35 @@
<h:outputText value="&nbsp;#{msg.default_workflow}" escape="false" />
</h:panelGrid>
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0">
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" width="100%">
<h:outputText value="#{msg.no_selected_items}"
rendered="#{WizardManager.bean.defaultWorkflowDefinition == null}"/>
<a:selectList id="workflow-list"
rendered="#{WizardManager.bean.defaultWorkflowDefinition != null}"
multiSelect="false"
activeSelect="true"
style="width:100%"
itemStyleClass="selectListItem">
<a:listItem label="${msg.name}: ${WizardManager.bean.defaultWorkflowDefinition.title}"
itemStyle="vertical-align: top; margin-right: 5px;"
style="width:100%">
<a:listItem label="<b>${WizardManager.bean.defaultWorkflowDefinition.title}</b>"
value="${WizardManager.bean.defaultWorkflowDefinition.name}"
description="${msg.description}: ${WizardManager.bean.defaultWorkflowDefinition.description}"
image="/images/icons/workflow_large.gif"/>
image="/images/icons/workflow_large.gif">
<jsp:attribute name="description">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<colgroup><col width="25%"/><col width="75%"/></colgroup>
<tbody>
<tr><td>${msg.description}:</td>
<td>
<c:choose>
<c:when test="${empty WizardManager.bean.defaultWorkflowDefinition.description}">
<span style="font-style:italic">${msg.description_not_set}</span>
</c:when>
<c:otherwise>${WizardManager.bean.defaultWorkflowDefinition.description}</c:otherwise>
</c:choose>
</td>
</tr>
</tbody>
</table>
</jsp:attribute>
</a:listItem>
</a:selectList>
</h:panelGrid>

View File

@@ -29,18 +29,23 @@
<h:outputText value="&nbsp;#{msg.create_web_content_summary_content_details}" escape="false" />
</h:panelGrid>
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0" width="100%">
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" width="100%">
<a:selectList id="form-instance-data-list"
multiSelect="false"
activeSelect="true"
style="width:100%"
itemStyleClass="selectListItem">
<a:listItem label="${WizardManager.bean.formInstanceData.name}"
itemStyle="vertical-align: top; margin-right: 5px;">
<a:listItem label="<b>${WizardManager.bean.formInstanceData.name}<b/>"
value="${WizardManager.bean.formInstanceData.name}"
image="/images/filetypes32/xml.gif">
<jsp:attribute name="description">
<div>${msg.form}: ${WizardManager.bean.form.title}</div>
<div>${msg.location}: ${WizardManager.bean.formInstanceData.sandboxRelativePath}</div>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<colgroup><col width="25%"/><col width="75%"/></colgroup>
<tbody>
<tr><td>${msg.form}:</td><td>${WizardManager.bean.form.title}</td></tr>
<tr><td>${msg.location}:</td><td>${WizardManager.bean.formInstanceData.sandboxRelativePath}</td></tr>
</tbody>
</table>
</jsp:attribute>
</a:listItem>
</a:selectList>
@@ -52,18 +57,18 @@
<h:outputText value="&nbsp;#{msg.create_web_content_summary_rendition_details}" escape="false" />
</h:panelGrid>
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0" width="100%"
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" width="100%"
rendered="#{!empty WizardManager.bean.renditions}">
<a:selectList id="rendition-list"
multiSelect="false"
activeSelect="true"
style="width:100%"
itemStyleClass="selectListItem">
itemStyle="vertical-align: top; margin-right: 5px;">
<c:forEach items="${WizardManager.bean.renditions}"
var="rendition"
varStatus="status">
<a:listItem id="listItem${status.index}"
label="${rendition.name}"
label="<b>${rendition.name}</b>"
value="${rendition.name}"
image="${rendition.fileTypeImage}">
<jsp:attribute name="description">
@@ -95,13 +100,13 @@
<h:outputText value="&nbsp;#{msg.create_web_content_summary_uploaded_files_details}" escape="false" />
</h:panelGrid>
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0" width="100%"
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" width="100%"
rendered="#{!empty WizardManager.bean.uploadedFiles}">
<a:selectList id="uploaded-file-list"
multiSelect="false"
activeSelect="true"
style="width:100%"
itemStyleClass="selectListItem">
itemStyle="vertical-align: top; margin-right: 5px;">
<a:listItems value="#{WizardManager.bean.uploadedFiles}"/>
</a:selectList>
</h:panelGrid>

View File

@@ -30,17 +30,37 @@
<h:outputText value="&nbsp;#{msg.general_properties}" escape="false" />
</h:panelGrid>
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0" style="margin-left:16px" styleClass="summary">
<h:outputText value="#{msg.name}:" styleClass="mainSubTitle" />
<h:outputText value="#{WizardManager.bean.name}"/>
<h:outputText value="#{msg.website_dnsname}:" styleClass="mainSubTitle" />
<h:outputText value="#{WizardManager.bean.dnsName}"/>
<h:outputText value="#{msg.website_webapp}:" styleClass="mainSubTitle" />
<h:outputText value="#{WizardManager.bean.webapp}"/>
<h:outputText value="#{msg.title}:" styleClass="mainSubTitle" />
<h:outputText value="#{WizardManager.bean.title}"/>
<h:outputText value="#{msg.description}:" styleClass="mainSubTitle" />
<h:outputText value="#{WizardManager.bean.description}"/>
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" width="100%">
<a:selectList id="webproject-list"
multiSelect="false"
activeSelect="true"
style="width:100%;"
itemStyle="vertical-align: top; margin-right: 5px;">
<a:listItem label="<b>${WizardManager.bean.name}</b>"
value="${WizardManager.bean.name}"
image="/images/icons/website_large.gif">
<jsp:attribute name="description">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<colgroup><col width="25%"/><col width="75%"/></colgroup>
<tbody>
<tr><td>${msg.website_dnsname}:</td><td> ${WizardManager.bean.dnsName}</td></tr>
<tr><td>${msg.website_webapp}:</td><td> ${WizardManager.bean.webapp}</td></tr>
<tr><td>${msg.title}:</td><td> ${WizardManager.bean.title}</td></tr>
<tr><td>${msg.description}:</td>
<td>
<c:choose>
<c:when test="${empty WizardManager.bean.description}">
<span style="font-style:italic">${msg.description_not_set}</span>
</c:when>
<c:otherwise>${WizardManager.bean.description}</c:otherwise>
</c:choose>
</td>
</tr>
</tbody>
</table>
</jsp:attribute>
</a:listItem>
</a:selectList>
</h:panelGrid>
<h:panelGrid columns="1" cellpadding="2" style="padding-top:16px;padding-bottom:4px;"
@@ -48,24 +68,50 @@
<h:outputText value="&nbsp;#{msg.website_web_content_forms}" escape="false" />
</h:panelGrid>
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0" style="margin-left:16px" styleClass="summary">
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0" width="100%">
<h:outputText rendered="#{empty WizardManager.bean.forms}"
value="#{msg.no_selected_items}"/>
<a:selectList id="form-list"
multiSelect="false"
activeSelect="true"
style="width:100%;"
itemStyle="vertical-align: top; margin-right: 5px;">
<c:forEach items="${WizardManager.bean.forms}" var="r">
<h:outputText value="#{msg.name}:" styleClass="mainSubTitle" />
<f:verbatim>${r.name}</f:verbatim>
<h:outputText value="#{msg.title}:" styleClass="mainSubTitle" />
<f:verbatim>${r.title}</f:verbatim>
<h:outputText value="#{msg.output_path_pattern}:" styleClass="mainSubTitle" />
<f:verbatim>${r.outputPathPattern}</f:verbatim>
<h:outputText value="#{msg.workflow}:" styleClass="mainSubTitle" />
<c:if test="${r.workflow != null}">
<f:verbatim>${r.workflow.title}</f:verbatim>
</c:if>
<c:if test="${r.workflow == null}">
<f:verbatim>${msg.none}</f:verbatim>
</c:if>
<f:verbatim />
<f:verbatim />
<a:listItem label="<b>${r.name}</b>"
value="${r.name}"
image="/images/icons/webform_large.gif">
<jsp:attribute name="description">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<colgroup><col width="25%"/><col width="75%"/></colgroup>
<tbody>
<tr><td>${msg.name}:</td><td> ${r.name}</td></tr>
<tr><td>${msg.title}:</td><td> ${r.title}</td></tr>
<tr><td>${msg.output_path_pattern}:</td><td> ${r.outputPathPattern}</td></tr>
<tr><td>${msg.description}:</td>
<td>
<c:choose>
<c:when test="${empty WizardManager.bean.description}">
<span style="font-style:italic">${msg.description_not_set}</span>
</c:when>
<c:otherwise>${r.description}</c:otherwise>
</c:choose>
</td>
<tr><td>${msg.workflow}:</td>
<td>
<c:choose>
<c:when test="${r.workflow == null}">
<span style="font-style:italic">${msg.none}</span>
</c:when>
<c:otherwise>{r.workflow.title}</c:otherwise>
</c:choose>
</td>
</tr>
</tbody>
</table>
</jsp:attribute>
</a:listItem>
</c:forEach>
</a:selectList>
</h:panelGrid>
<h:panelGrid columns="1" cellpadding="2" style="padding-top:16px;padding-bottom:4px;"
@@ -73,17 +119,39 @@
<h:outputText value="&nbsp;#{msg.website_selected_workflows}" escape="false" />
</h:panelGrid>
<h:panelGrid columns="2" cellpadding="3" cellspacing="3" border="0" style="margin-left:16px" styleClass="summary">
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" width="100%">
<h:outputText rendered="#{empty WizardManager.bean.workflows}"
value="#{msg.no_selected_items}"/>
<a:selectList id="workflow-list"
multiSelect="false"
activeSelect="true"
style="width:100%;"
itemStyle="vertical-align: top; margin-right: 5px;">
<c:forEach items="${WizardManager.bean.workflows}" var="r">
<h:outputText value="#{msg.name}:" styleClass="mainSubTitle" />
<f:verbatim>${r.title}</f:verbatim>
<h:outputText value="#{msg.description}:" styleClass="mainSubTitle" />
<f:verbatim>${r.description}</f:verbatim>
<h:outputText value="#{msg.website_filename_pattern}:" styleClass="mainSubTitle" />
<f:verbatim>${r.filenamePattern}</f:verbatim>
<f:verbatim />
<f:verbatim />
<a:listItem label="<b>${r.title}</b>"
value="${r.name}"
image="/images/icons/workflow_large.gif">
<jsp:attribute name="description">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<colgroup><col width="25%"/><col width="75%"/></colgroup>
<tbody>
<tr><td>${msg.description}:</td>
<td>
<c:choose>
<c:when test="${empty r.description}">
<span style="font-style:italic">${msg.description_not_set}</span>
</c:when>
<c:otherwise>${r.description}</c:otherwise>
</c:choose>
</td>
</tr>
<tr><td>${msg.website_filename_pattern}:</td><td> ${r.filenamePattern}</td></tr>
</tbody>
</table>
</jsp:attribute>
</a:listItem>
</c:forEach>
</a:selectList>
</h:panelGrid>
<h:panelGrid columns="1" cellpadding="2" style="padding-top:16px"
@@ -91,6 +159,27 @@
<h:outputText value="&nbsp;#{msg.create_website_summary_users}" escape="false" />
</h:panelGrid>
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0" style="margin-left:12px">
<h:outputText value="#{WizardManager.bean.summary}" escape="false" />
<h:panelGrid columns="1" cellpadding="3" cellspacing="3" border="0"
width="100%"
style="margin-left:12px">
<a:selectList id="users-list"
multiSelect="false"
activeSelect="true"
style="width:100%;"
itemStyle="vertical-align: top; margin-right: 5px;">
<c:forEach items="${WizardManager.bean.invitedUsers}" var="r">
<a:listItem label="<b>${r.name}</b>"
value="${r.name}"
image="/images/icons/user_large.gif">
<jsp:attribute name="description">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<colgroup><col width="25%"/><col width="75%"/></colgroup>
<tbody>
<tr><td>${msg.roles}:</td><td> ${r.role}</td></tr>
</tbody>
</table>
</jsp:attribute>
</a:listItem>
</c:forEach>
</a:selectList>
</h:panelGrid>