From 208716aadc6e58a9f64d0478affdc30a9ae20104 Mon Sep 17 00:00:00 2001 From: Ariel Backenroth Date: Sat, 13 Jan 2007 01:17:12 +0000 Subject: [PATCH] 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 --- .../web/bean/wcm/CreateWebsiteWizard.java | 75 ++++++++ source/web/WEB-INF/faces-config-beans.xml | 8 + .../jsp/wcm/create-form-wizard/summary.jsp | 106 +++++++---- .../wcm/create-web-content-wizard/summary.jsp | 25 ++- .../jsp/wcm/create-website-wizard/summary.jsp | 173 +++++++++++++----- 5 files changed, 295 insertions(+), 92 deletions(-) diff --git a/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java b/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java index bb39d55833..7a71252a2b 100644 --- a/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java +++ b/source/java/org/alfresco/web/bean/wcm/CreateWebsiteWizard.java @@ -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 getInvitedUsers() + { + + final FacesContext fc = FacesContext.getCurrentInstance(); + List invitedUserRoles = (List) + getInviteUsersWizard().getUserRolesDataModel().getWrappedData(); + List result = new LinkedList(); + 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 */ @@ -931,6 +971,8 @@ public class CreateWebsiteWizard extends BaseWizardBean this.outputPathPattern = outputPathPattern; } } + + ///////////////////////////////////////////////////////////////////////////// /** * 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; } + } + + ///////////////////////////////////////////////////////////////////////////// } diff --git a/source/web/WEB-INF/faces-config-beans.xml b/source/web/WEB-INF/faces-config-beans.xml index 36f38b1494..17549ae9c2 100644 --- a/source/web/WEB-INF/faces-config-beans.xml +++ b/source/web/WEB-INF/faces-config-beans.xml @@ -2230,6 +2230,10 @@ workflowService #{WorkflowService} + + personService + #{PersonService} + @@ -2267,6 +2271,10 @@ workflowService #{WorkflowService} + + personService + #{PersonService} + diff --git a/source/web/jsp/wcm/create-form-wizard/summary.jsp b/source/web/jsp/wcm/create-form-wizard/summary.jsp index 371831ca17..e4870d2e0f 100644 --- a/source/web/jsp/wcm/create-form-wizard/summary.jsp +++ b/source/web/jsp/wcm/create-form-wizard/summary.jsp @@ -30,28 +30,33 @@ - + - + -
${msg.description}: - - - ${msg.description_not_set} - - - ${WizardManager.bean.formDescription} - - -
-
${msg.schema_root_element_name}: ${WizardManager.bean.schemaRootElementName}
-
${msg.output_path_pattern}: ${WizardManager.bean.outputPathPatternForFormInstanceData}
+ + + + + + + + + +
${msg.description}: + + + ${msg.description_not_set} + + ${WizardManager.bean.formDescription} + +
${msg.schema_root_element_name}:${WizardManager.bean.schemaRootElementName}
${msg.output_path_pattern}:${WizardManager.bean.outputPathPatternForFormInstanceData}
@@ -62,34 +67,38 @@
- + - + style="width:100%"> - -
${msg.description}: - - - ${msg.description_not_set} - - - ${ret.description} - - -
-
${msg.rendering_engine_type}: ${ret.renderingEngine.name}
-
${msg.output_path_pattern}: ${ret.outputPathPatternForRendition}
-
${msg.mimetype_for_renditions}: ${ret.mimetypeForRendition}
+ + + + + + + + + + +
${msg.description}: + + + ${msg.description_not_set} + + ${ret.description} + +
${msg.rendering_engine_type}:${ret.renderingEngine.name}
${msg.output_path_pattern}:${ret.outputPathPatternForRendition}
${msg.mimetype_for_renditions}:${ret.mimetypeForRendition}
@@ -101,18 +110,35 @@
- + - + + image="/images/icons/workflow_large.gif"> + + + + + + + + +
${msg.description}: + + + ${msg.description_not_set} + + ${WizardManager.bean.defaultWorkflowDefinition.description} + +
+
+
diff --git a/source/web/jsp/wcm/create-web-content-wizard/summary.jsp b/source/web/jsp/wcm/create-web-content-wizard/summary.jsp index 01b4dd031a..9a558fdd93 100644 --- a/source/web/jsp/wcm/create-web-content-wizard/summary.jsp +++ b/source/web/jsp/wcm/create-web-content-wizard/summary.jsp @@ -29,18 +29,23 @@
- + - + -
${msg.form}: ${WizardManager.bean.form.title}
-
${msg.location}: ${WizardManager.bean.formInstanceData.sandboxRelativePath}
+ + + + + + +
${msg.form}:${WizardManager.bean.form.title}
${msg.location}:${WizardManager.bean.formInstanceData.sandboxRelativePath}
@@ -52,18 +57,18 @@
- + itemStyle="vertical-align: top; margin-right: 5px;"> @@ -95,13 +100,13 @@ - + itemStyle="vertical-align: top; margin-right: 5px;"> diff --git a/source/web/jsp/wcm/create-website-wizard/summary.jsp b/source/web/jsp/wcm/create-website-wizard/summary.jsp index cc267140a3..6281e2d921 100644 --- a/source/web/jsp/wcm/create-website-wizard/summary.jsp +++ b/source/web/jsp/wcm/create-website-wizard/summary.jsp @@ -30,17 +30,37 @@
- - - - - - - - - - - + + + + + + + + + + + + + + +
${msg.website_dnsname}: ${WizardManager.bean.dnsName}
${msg.website_webapp}: ${WizardManager.bean.webapp}
${msg.title}: ${WizardManager.bean.title}
${msg.description}: + + + ${msg.description_not_set} + + ${WizardManager.bean.description} + +
+
+
+
- - - - ${r.name} - - ${r.title} - - ${r.outputPathPattern} - - - ${r.workflow.title} - - - ${msg.none} - - - - + + + + + + + + + + + + + + + + + + +
${msg.name}: ${r.name}
${msg.title}: ${r.title}
${msg.output_path_pattern}: ${r.outputPathPattern}
${msg.description}: + + + ${msg.description_not_set} + + ${r.description} + +
${msg.workflow}: + + + ${msg.none} + + {r.workflow.title} + +
+
+
+
+
- - - - ${r.title} - - ${r.description} - - ${r.filenamePattern} - - - + + + + + + + + + + + + + + +
${msg.description}: + + + ${msg.description_not_set} + + ${r.description} + +
${msg.website_filename_pattern}: ${r.filenamePattern}
+
+
+
+
- - + + + + + + + + + + +
${msg.roles}: ${r.role}
+
+
+
+