. More progress on Define Web Content Forms dialog

- ad-hoc workflow selection screen (as per new wireframes)
 - fixed selection bug on Form Details screen (and in UISelectList component)
. Invite Users step of Create Web Project wizard now has email notification as optional
. Fixed issue to restrict the selection of the same authority only allowed once in the Invite Users step

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4296 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-11-06 15:45:41 +00:00
parent c6ff68c709
commit 135691df4e
12 changed files with 333 additions and 52 deletions

View File

@@ -806,7 +806,6 @@ create_website_step1_title=Step One - Web Project Details
create_website_step1_desc=Enter the information about the web project.
website_dnsname=DNS name
validation_invalid_dns_name=Invalid website DNS name, a minimum of 2 alpha-numeric characters are accepted.
website_forms=Form Templates
website_selected_forms=Selected Web Content Forms
website_save_location=Save Location
website_save_location_info=Use the following pattern when saving content
@@ -814,23 +813,29 @@ website_filename_pattern=Filename pattern
website_workflow=Workflow
website_workflow_info=Use the following workflow
website_form_summary=Using workflow ''{0}'', with filename pattern ''{1}'', {2} template(s) selected.
website_forms=Define Forms
form_template_details=Form Details
form_template_details_desc=Edit the details of this Form Template
form_template_conf_workflow=Configure Workflow
form_template_select_templates=Select Templates
form_template_templates=Manage Presentation Templates
form_template_templates_desc=Setup the Presentation Templates you want to use for the Web Content Form.
create_website_step2_title=Step Two - Form Templates
create_website_step2_title=Step Two - Define Web Content Forms
create_website_step2_desc=Setup the forms you want to use in this project.
website_select_form=Select Form Templates to use
website_select_templates=Select Presentation Templates to use
website_selected_templates=Selected Presentation Templates
website_settings=Specify Settings
create_website_step3_title=Step Three - Web Project Settings
create_website_step3_desc=Specify settings for this Web Project.
website_select_workflows=Select Workflows to use
website_selected_workflows=Selected Workflows
website_invite=Invite Users
create_website_step3_title=Step Three - Invite Users
create_website_step3_desc=Select users and their roles.
create_website_step4_title=Step Four - Invite Users
create_website_step4_desc=Select users and their roles.
website_notify=Email Users
create_website_step4_title=Step Four - Notify Users
create_website_step4_desc=Notify the invited users.
create_website_step5_title=Step Five - Notify Users
create_website_step5_desc=Notify the invited users.
create_website_finish_instruction=To close this wizard and create your web project space click Finish. To review or change your selections click Back.
create_website_summary_users=Users and Roles

View File

@@ -21,18 +21,24 @@
description-id="create_website_step2_desc"
instruction-id="default_instruction" />
</step>
<step name="invite" title-id="website_invite" description-id="create_website_step3_desc">
<page path="/jsp/wcm/create-website-wizard/invite.jsp"
<step name="settings" title-id="website_settings" description-id="create_website_step3_desc">
<page path="/jsp/wcm/create-website-wizard/settings.jsp"
title-id="create_website_step3_title"
description-id="create_website_step3_desc"
instruction-id="default_instruction" />
</step>
<step name="notify" title-id="website_notify" description-id="create_website_step4_desc">
<page path="/jsp/wcm/create-website-wizard/notify.jsp"
<step name="invite" title-id="website_invite" description-id="create_website_step4_desc">
<page path="/jsp/wcm/create-website-wizard/invite.jsp"
title-id="create_website_step4_title"
description-id="create_website_step4_desc"
instruction-id="default_instruction" />
</step>
<step name="notify" title-id="website_notify" description-id="create_website_step5_desc">
<page path="/jsp/wcm/create-website-wizard/notify.jsp"
title-id="create_website_step5_title"
description-id="create_website_step5_desc"
instruction-id="default_instruction" />
</step>
<step name="summary" title-id="summary" description-id="summary_step_description">
<page path="/jsp/wizard/summary.jsp"
title-id="summary"

View File

@@ -64,6 +64,7 @@ import org.apache.commons.logging.LogFactory;
public class CreateWebsiteWizard extends BaseWizardBean
{
private static final String COMPONENT_FORMLIST = "form-list";
private static final String COMPONENT_WORKFLOWLIST = "workflow-list";
private static final String MSG_DESCRIPTION = "description";
private static final String MSG_NAME = "name";
private static final String MSG_USERROLES = "create_website_summary_users";
@@ -90,12 +91,21 @@ public class CreateWebsiteWizard extends BaseWizardBean
/** transient list of form UIListItem objects */
private List<UIListItem> formsList = null;
/** list of forms wrapper objects */
/** list of form wrapper objects */
private List<FormWrapper> forms = null;
/** Current form action dialog context */
private FormWrapper actionForm = null;
/** datamodel for table of selected workflows */
private DataModel workflowsDataModel = null;
/** transient list of workflow UIListItem objects */
private List<UIListItem> workflowsList = null;
/** list of workflow wrapper objects */
private List<WorkflowWrapper> workflows = null;
// ------------------------------------------------------------------------------
// Wizard implementation
@@ -113,6 +123,8 @@ public class CreateWebsiteWizard extends BaseWizardBean
this.description = null;
this.formsDataModel = null;
this.forms = new ArrayList<FormWrapper>(8);
this.workflowsDataModel = null;
this.workflows = new ArrayList<WorkflowWrapper>(4);
// init the dependant bean we are using for the invite users pages
InviteWebsiteUsersWizard wiz = getInviteUsersWizard();
@@ -208,6 +220,10 @@ public class CreateWebsiteWizard extends BaseWizardBean
return outcome;
}
// ------------------------------------------------------------------------------
// Service setters
/**
* @param avmService The AVMService to set.
*/
@@ -224,6 +240,10 @@ public class CreateWebsiteWizard extends BaseWizardBean
this.permissionService = permissionService;
}
// ------------------------------------------------------------------------------
// Bean getters and setters
/**
* @return Returns the name.
*/
@@ -240,25 +260,8 @@ public class CreateWebsiteWizard extends BaseWizardBean
this.name = name;
}
public DataModel getFormsDataModel()
{
if (this.formsDataModel == null)
{
this.formsDataModel = new ListDataModel();
}
this.formsDataModel.setWrappedData(this.forms);
return this.formsDataModel;
}
public void setFormsDataModel(DataModel formsDataModel)
{
this.formsDataModel = formsDataModel;
}
/**
* @return
* @return DNS name
*/
public String getDnsName()
{
@@ -266,7 +269,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
}
/**
* @param dnsName
* @param DNS name
*/
public void setDnsName(String dnsName)
{
@@ -340,8 +343,35 @@ public class CreateWebsiteWizard extends BaseWizardBean
new String[] {this.name, this.description, buf.toString()});
}
// ------------------------------------------------------------------------------
// Define Web Content Workflows page
/**
* @return List of UI items to represent the available Forms for all websites
* @return JSF data model for the Form templates
*/
public DataModel getFormsDataModel()
{
if (this.formsDataModel == null)
{
this.formsDataModel = new ListDataModel();
}
this.formsDataModel.setWrappedData(this.forms);
return this.formsDataModel;
}
/**
* @param formsDataModel JSF data model for the Form templates
*/
public void setFormsDataModel(DataModel formsDataModel)
{
this.formsDataModel = formsDataModel;
}
/**
* @return List of UI items to represent the available Workflows for all websites
*/
public List<UIListItem> getFormsList()
{
@@ -411,6 +441,82 @@ public class CreateWebsiteWizard extends BaseWizardBean
this.actionForm = actionForm;
}
// ------------------------------------------------------------------------------
// Specify Settings (ah-hoc Workflows) page
/**
* @return JSF data model for the Workflow templates
*/
public DataModel getWorkflowsDataModel()
{
if (this.workflowsDataModel == null)
{
this.workflowsDataModel = new ListDataModel();
}
this.workflowsDataModel.setWrappedData(this.workflows);
return this.workflowsDataModel;
}
/**
* @param workflowsDataModel JSF data model for the Workflow templates
*/
public void setWorkflowsDataModel(DataModel workflowsDataModel)
{
this.workflowsDataModel = workflowsDataModel;
}
/**
* @return List of UI items to represent the available Workflows for all websites
*/
public List<UIListItem> getWorkflowsList()
{
List<UIListItem> items = new ArrayList<UIListItem>();
// TODO: add list of workflows from config
UIListItem item = new UIListItem();
item.setValue("default");
item.setLabel("Default");
item.setDescription("Default adhoc workflow");
item.setImage(WebResources.IMAGE_WORKFLOW_32);
items.add(item);
this.workflowsList = items;
return items;
}
/**
* Action handler called when the Add to List button is pressed for a workflow
*/
public void addWorkflow(ActionEvent event)
{
UISelectList selectList = (UISelectList)event.getComponent().findComponent(COMPONENT_WORKFLOWLIST);
int index = selectList.getRowIndex();
if (index != -1)
{
String workflow = (String)this.workflowsList.get(index).getValue();
this.workflows.add(new WorkflowWrapper(workflow, null));
}
}
/**
* Remove a workflow from the selected list
*/
public void removeWorkflow(ActionEvent event)
{
WorkflowWrapper wrapper = (WorkflowWrapper)this.workflowsDataModel.getRowData();
if (wrapper != null)
{
this.workflows.remove(wrapper);
}
}
// ------------------------------------------------------------------------------
// Invite users page
/**
* @return the InviteWebsiteUsersWizard delegate bean
*/
@@ -420,6 +526,10 @@ public class CreateWebsiteWizard extends BaseWizardBean
FacesContext.getCurrentInstance(), "InviteWebsiteUsersWizard");
}
// ------------------------------------------------------------------------------
// Helper methods
/**
* Helper to get the ID of the 'Websites' system folder
*
@@ -670,8 +780,11 @@ public class CreateWebsiteWizard extends BaseWizardBean
}
// ------------------------------------------------------------------------------
// Inner classes
/**
* Wrapper class for a configurable template Form instance in the UI
* Wrapper class for a configurable template Form instance
*/
public static class FormWrapper
{
@@ -779,6 +892,9 @@ public class CreateWebsiteWizard extends BaseWizardBean
}
}
/**
* Class to represent a single configured Presentation Template instance
*/
public static class PresentationTemplate
{
private RenderingEngine engine;
@@ -835,4 +951,43 @@ public class CreateWebsiteWizard extends BaseWizardBean
this.filenamePattern = filenamePattern;
}
}
/**
* Class to represent a single configured Workflow instance
*/
public static class WorkflowWrapper
{
private String name;
private String filenamePattern;
public WorkflowWrapper(String name, String filenamePattern)
{
this.name = name;
this.filenamePattern = filenamePattern;
}
/**
* @return Returns the name of the workflow.
*/
public String getName()
{
return this.name;
}
/**
* @return Returns the filename pattern.
*/
public String getFilenamePattern()
{
return this.filenamePattern;
}
/**
* @param filenamePattern The filename pattern to set.
*/
public void setFilenamePattern(String filenamePattern)
{
this.filenamePattern = filenamePattern;
}
}
}

View File

@@ -21,13 +21,9 @@ import java.util.List;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.web.bean.TemplateSupportBean;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.bean.wcm.CreateWebsiteWizard.FormWrapper;
import org.alfresco.web.ui.common.component.UIListItem;
import org.alfresco.web.ui.wcm.WebResources;
@@ -35,6 +31,9 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Backing bean for the Website Project Form Details dialog.
* Launched from the Form Details button on the Define Web Content Forms page.
*
* @author Kevin Roast
*/
public class FormDetailsDialog extends BaseDialogBean
@@ -47,7 +46,7 @@ public class FormDetailsDialog extends BaseDialogBean
private String title;
private String description;
private String filenamePattern;
private String[] workflowSelectedValue = {"default"};
private String[] workflowSelectedValue;
/**
@@ -59,6 +58,8 @@ public class FormDetailsDialog extends BaseDialogBean
super.init(parameters);
this.title = null;
this.description = null;
this.filenamePattern = null;
this.workflowSelectedValue = null;
}
/**
@@ -150,6 +151,14 @@ public class FormDetailsDialog extends BaseDialogBean
*/
public String[] getWorkflowSelectedValue()
{
if (this.workflowSelectedValue == null)
{
String workflow = getActionForm().getWorkflow();
if (workflow != null)
{
this.workflowSelectedValue = new String[] {workflow};
}
}
return this.workflowSelectedValue;
}
@@ -168,6 +177,7 @@ public class FormDetailsDialog extends BaseDialogBean
{
List<UIListItem> items = new ArrayList<UIListItem>();
// TODO: add list of workflows from config
UIListItem item = new UIListItem();
item.setValue("default");
item.setLabel("Default");

View File

@@ -29,15 +29,18 @@ import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.wcm.CreateWebsiteWizard.FormWrapper;
import org.alfresco.web.bean.wcm.CreateWebsiteWizard.PresentationTemplate;
import org.alfresco.web.forms.Form;
import org.alfresco.web.forms.RenderingEngine;
import org.alfresco.web.ui.common.component.UIListItem;
import org.alfresco.web.ui.common.component.UISelectList;
import org.alfresco.web.ui.wcm.WebResources;
import org.alfresco.web.forms.Form;
import org.alfresco.web.forms.RenderingEngine;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Backing bean for the Website Project Form Templates dialog.
* Launched from the Select Templates button on the Define Web Content Forms page.
*
* @author Kevin Roast
*/
public class FormTemplatesDialog extends BaseDialogBean
@@ -94,6 +97,9 @@ public class FormTemplatesDialog extends BaseDialogBean
return this.websiteWizard.getActionForm();
}
/**
* @return JSF data model wrapping the templates selected by the user
*/
public DataModel getTemplatesDataModel()
{
if (this.templatesDataModel == null)
@@ -106,6 +112,9 @@ public class FormTemplatesDialog extends BaseDialogBean
return this.templatesDataModel;
}
/**
* @param templatesDataModel JSF data model wrapping the templates
*/
public void setTemplatesDataModel(DataModel templatesDataModel)
{
this.templatesDataModel = templatesDataModel;

View File

@@ -25,6 +25,18 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard
private Node website;
/**
* @see org.alfresco.web.bean.wizard.InviteUsersWizard#init()
*/
@Override
public void init()
{
super.init();
// only allow one selection per authority
allowDuplicateAuthorities = false;
}
/**
* @see org.alfresco.web.bean.wizard.AbstractWizardBean#getWizardDescription()
*/

View File

@@ -94,6 +94,9 @@ public abstract class InviteUsersWizard extends AbstractWizardBean
/** list of user/group role wrapper objects */
private List<UserGroupRole> userGroupRoles = null;
/** True to allow duplicate authorities (with a different role) */
protected boolean allowDuplicateAuthorities = true;
/** dialog state */
private String notify = NOTIFY_YES;
@@ -387,7 +390,7 @@ public abstract class InviteUsersWizard extends AbstractWizardBean
{
UserGroupRole wrapper = this.userGroupRoles.get(n);
if (authority.equals(wrapper.getAuthority()) &&
role.equals(wrapper.getRole()))
(!this.allowDuplicateAuthorities || role.equals(wrapper.getRole())))
{
foundExisting = true;
break;

View File

@@ -440,6 +440,8 @@ public class UISelectList extends UIInput implements NamingContainer
* @param rowIndex
*/
public void setRowIndex(int rowIndex)
{
if (isActiveSelect())
{
this.rowIndex = rowIndex;
for (Iterator itr=getChildren().iterator(); itr.hasNext(); /**/)
@@ -455,6 +457,7 @@ public class UISelectList extends UIInput implements NamingContainer
}
}
}
}
/**
* Get the multi-select rendering flag

View File

@@ -40,7 +40,7 @@
rendered="#{DialogManager.bean.templatesDataModel.rowCount != 0}">
<h:column>
<f:facet name="header">
<h:outputText value="#{msg.title}" />
<h:outputText value="#{msg.name}" />
</f:facet>
<h:outputText value="#{row.title}" />
</h:column>

View File

@@ -43,7 +43,7 @@
rendered="#{WizardManager.bean.formsDataModel.rowCount != 0}">
<h:column>
<f:facet name="header">
<h:outputText value="#{msg.title}" />
<h:outputText value="#{msg.name}" />
</f:facet>
<h:outputText value="#{row.title}" />
</h:column>

View File

@@ -52,7 +52,15 @@
</script>
</f:verbatim>
<h:outputText styleClass="mainSubTitle" value="#{msg.email_message}" />
<h:panelGrid style="padding-bottom:12px" columns="1" cellpadding="2" cellspacing="2" border="0" width="100%">
<h:outputText value="#{msg.send_email}" />
<h:selectOneRadio value="#{InviteWebsiteUsersWizard.notify}">
<f:selectItem itemValue="yes" itemLabel="#{msg.yes}" />
<f:selectItem itemValue="no" itemLabel="#{msg.no}" />
</h:selectOneRadio>
</h:panelGrid>
<h:outputText value="#{msg.email_message}" styleClass="mainSubTitle" />
<h:panelGrid columns="2" cellpadding="2" cellspacing="2" border="0" width="100%">
<h:outputText value="#{msg.subject}:" />
<h:panelGroup>

View File

@@ -0,0 +1,70 @@
<%--
Copyright (C) 2005 Alfresco, Inc.
Licensed under the Mozilla Public License version 1.1
with a permitted attribution clause. You may obtain a
copy of the License at
http://www.alfresco.org/legal/license.txt
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific
language governing permissions and limitations under the
License.
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page buffer="32kb" contentType="text/html;charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<h:panelGrid columns="1" cellpadding="2" cellpadding="2" width="100%">
<%-- Workflow selection list - scrollable DIV area --%>
<h:outputText styleClass="mainSubText" value="#{msg.website_select_workflows}:" />
<h:panelGroup>
<f:verbatim><div style="height:108px;*height:112px;width:300px;overflow:auto" class='selectListTable'></f:verbatim>
<a:selectList id="workflow-list" activeSelect="true" style="width:276px" itemStyleClass="selectListItem">
<a:listItems value="#{WizardManager.bean.workflowsList}" />
<h:commandButton value="#{msg.add_to_list_button}" styleClass="dialogControls" actionListener="#{WizardManager.bean.addWorkflow}" />
</a:selectList>
<f:verbatim></div></f:verbatim>
</h:panelGroup>
<%-- Selected Workflow table, with configuration buttons and info text --%>
<h:outputText styleClass="mainSubText" style="padding-top:8px" value="#{msg.website_selected_workflows}:" />
<h:dataTable value="#{WizardManager.bean.workflowsDataModel}" var="row"
rowClasses="selectedItemsRow,selectedItemsRowAlt"
styleClass="selectedItems" headerClass="selectedItemsHeader"
cellspacing="0" cellpadding="4"
rendered="#{WizardManager.bean.workflowsDataModel.rowCount != 0}">
<h:column>
<f:facet name="header">
<h:outputText value="#{msg.name}" />
</f:facet>
<h:outputText value="#{row.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{msg.configure}" />
</f:facet>
<h:outputText value="#{msg.website_filename_pattern}:" style="padding-right:4px" />
<h:inputText value="#{row.filenamePattern}" />
<h:commandButton value="#{msg.form_template_conf_workflow}" style="margin-left:4px" styleClass="dialogControls" />
</h:column>
<h:column>
<a:actionLink actionListener="#{WizardManager.bean.removeWorkflow}" image="/images/icons/delete.gif"
value="#{msg.remove}" showLink="false" style="padding-left:6px" />
</h:column>
</h:dataTable>
<a:panel id="no-items" rendered="#{WizardManager.bean.workflowsDataModel.rowCount == 0}">
<h:panelGrid columns="1" cellpadding="2" styleClass="selectedItems" rowClasses="selectedItemsHeader,selectedItemsRow">
<h:outputText id="no-items-name" value="#{msg.name}" />
<h:outputText styleClass="selectedItemsRow" id="no-items-msg" value="#{msg.no_selected_items}" />
</h:panelGrid>
</a:panel>
</h:panelGrid>