- More workflow features

- Added single select capability to generic picker
- Fixed NPE in client (create rule wizard) due to missing messages

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3606 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2006-08-25 11:02:16 +00:00
parent 2a7eaf7cfb
commit 5257546c9c
35 changed files with 675 additions and 43 deletions

View File

@@ -958,6 +958,13 @@ completed_on=Completed on
outcome=Outcome outcome=Outcome
reassign=Reassign reassign=Reassign
cancel_workflow=Cancel Workflow cancel_workflow=Cancel Workflow
cancel_workflow_info=To cancel this workflow, click OK.
cancel_workflow_confirm=Are you sure you want to cancel the \"{0}\" workflow?
error_cancel_workflow=Unable to cancel the workflow due to system error:
reassign_workitem_title=Reassign Work Item
reassign_workitem_desc=This dialog allows you to reassign a work item.
reassign_select_user=Select the user to assign the work item to, then press OK.
error_reassign_workitem=Unable to reassign the work item due to system error:
# Admin Console messages # Admin Console messages
title_admin_console=Administration Console title_admin_console=Administration Console

View File

@@ -42,9 +42,9 @@
<config> <config>
<actions> <actions>
<action id="start-workflow"> <action id="start_workflow">
<label-id>start_workflow</label-id> <label-id>start_workflow</label-id>
<image>/images/icons/create_forum.gif</image> <image>/images/icons/new_workflow.gif</image>
<action>wizard:startWorkflow</action> <action>wizard:startWorkflow</action>
<action-listener>#{WizardManager.setupParameters}</action-listener> <action-listener>#{WizardManager.setupParameters}</action-listener>
<params> <params>
@@ -52,21 +52,36 @@
</params> </params>
</action> </action>
<action id="reassign-workflow"> <action id="reassign_workflow">
<label-id>reassign</label-id> <label-id>reassign</label-id>
<image>/images/icons/recover.gif</image> <image>/images/icons/reassign_workflow_item.gif</image>
<action>null</action> <action>dialog:reassignWorkItem</action>
<action-listener>#{DialogManager.setupParameters}</action-listener>
<params>
<param name="workitem-id">#{actionContext.id}</param>
</params>
</action> </action>
<action id="cancel-workflow"> <action id="cancel_workflow">
<label-id>cancel_workflow</label-id> <label-id>cancel_workflow</label-id>
<image>/images/icons/reject.gif</image> <image>/images/icons/cancel_workflow.gif</image>
<action>dialog:cancelWorkflow</action>
<action-listener>#{DialogManager.setupParameters}</action-listener>
<params>
<param name="workflow-instance-id">#{actionContext.workflowInstanceId}</param>
<param name="workflow-instance-name">#{actionContext.workflowInstanceName}</param>
</params>
</action>
<action id="add_package_item">
<label-id>add</label-id>
<image>/images/icons/add_item.gif</image>
<action>null</action> <action>null</action>
</action> </action>
<action id="remove-package-item"> <action id="remove_package_item">
<label-id>remove</label-id> <label-id>remove</label-id>
<image>/images/icons/delete.gif</image> <image>/images/icons/remove_item.gif</image>
<action-listener>#{DialogManager.bean.removePackageItem}</action-listener> <action-listener>#{DialogManager.bean.removePackageItem}</action-listener>
<params> <params>
<param name="id">#{actionContext.id}</param> <param name="id">#{actionContext.id}</param>
@@ -74,19 +89,19 @@
</action> </action>
<action-group id="document_browse_menu"> <action-group id="document_browse_menu">
<action idref="start-workflow" /> <action idref="start_workflow" />
</action-group> </action-group>
<action-group id="doc_details_actions"> <action-group id="doc_details_actions">
<action idref="start-workflow" /> <action idref="start_workflow" />
</action-group> </action-group>
<action-group id="manage_workitem_actions"> <action-group id="dashlet_todo_actions">
<action idref="reassign-workflow" /> <action idref="reassign_workflow" />
</action-group> </action-group>
<action-group id="completed_workitem_actions"> <action-group id="dashlet_completed_actions">
<action idref="cancel-workflow" /> <action idref="cancel_workflow" />
</action-group> </action-group>
<action-group id="workflow_item_read_actions"> <action-group id="workflow_item_read_actions">
@@ -95,17 +110,18 @@
<action-group id="workflow_item_collection_actions"> <action-group id="workflow_item_collection_actions">
<action idref="details_doc" /> <action idref="details_doc" />
<action idref="remove-package-item" /> <action idref="remove_package_item" />
</action-group> </action-group>
<action-group id="workflow_item_edit_actions"> <action-group id="workflow_item_edit_actions">
<!-- edit, checkout, checkin -->
<action idref="details_doc" /> <action idref="details_doc" />
<action idref="remove-package-item" /> <action idref="checkout_doc" />
<action idref="cancelcheckout_doc" />
<action idref="remove_package_item" />
</action-group> </action-group>
<action-group id="workflow_package_collection_actions"> <action-group id="workflow_collection_actions">
<action idref="add-package-item" /> <action idref="add_package_item" />
</action-group> </action-group>
</actions> </actions>
</config> </config>
@@ -118,7 +134,7 @@
<wizards> <wizards>
<wizard name="startWorkflow" managed-bean="StartWorkflowWizard" <wizard name="startWorkflow" managed-bean="StartWorkflowWizard"
title-id="start_workflow_wizard" description-id="start_workflow_desc" title-id="start_workflow_wizard" description-id="start_workflow_desc"
icon="/images/icons/users_large.gif"> icon="/images/icons/new_workflow_large.gif">
<step name="choose-workflow" title-id="step_choose_workflow" <step name="choose-workflow" title-id="step_choose_workflow"
description-id="start_workflow_choose_desc"> description-id="start_workflow_choose_desc">
<page path="/jsp/workflow/start-workflow-wizard/choose-workflow.jsp" <page path="/jsp/workflow/start-workflow-wizard/choose-workflow.jsp"
@@ -150,9 +166,16 @@
<config> <config>
<dialogs> <dialogs>
<dialog name="manageWorkItem" page="/jsp/workflow/manage-workitem-dialog.jsp" <dialog name="manageWorkItem" page="/jsp/workflow/manage-workitem-dialog.jsp"
managed-bean="ManageWorkItemDialog" icon="/images/icons/create_space_large.gif" managed-bean="ManageWorkItemDialog" icon="/images/icons/manage_workflow_item_large.gif"
title-id="manage_workitem_title" description-id="manage_workitem_desc" title-id="manage_workitem_title" description-id="manage_workitem_desc" />
actions-config-id="manage_workitem_actions" />
<dialog name="cancelWorkflow" page="/jsp/workflow/cancel-workflow-dialog.jsp"
managed-bean="CancelWorkflowDialog" icon="/images/icons/cancel_workflow_large.gif"
title-id="cancel_workflow" description-id="cancel_workflow_info" />
<dialog name="reassignWorkItem" page="/jsp/workflow/reassign-workitem-dialog.jsp"
managed-bean="ReassignWorkItemDialog" icon="/images/icons/reassign_workflow_item_large.gif"
title-id="reassign_workitem_title" description-id="reassign_workitem_desc" />
</dialogs> </dialogs>
</config> </config>

View File

@@ -196,7 +196,12 @@ public abstract class BaseActionWizard extends BaseWizardBean
this.actions = new ArrayList<SelectItem>(); this.actions = new ArrayList<SelectItem>();
for (ActionDefinition ruleActionDef : ruleActions) for (ActionDefinition ruleActionDef : ruleActions)
{ {
this.actions.add(new SelectItem(ruleActionDef.getName(), ruleActionDef.getTitle())); String title = ruleActionDef.getTitle();
if (title == null || title.length() == 0)
{
title = ruleActionDef.getName();
}
this.actions.add(new SelectItem(ruleActionDef.getName(), title));
} }
// make sure the list is sorted by the label // make sure the list is sorted by the label

View File

@@ -0,0 +1,106 @@
package org.alfresco.web.bean.workflow;
import java.text.MessageFormat;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.service.cmr.workflow.WorkflowService;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Bean implementation for the "Cancel Workflow" dialog
*
* @author gavinc
*/
public class CancelWorkflowDialog extends BaseDialogBean
{
protected String workflowInstanceId;
protected WorkflowService workflowService;
private static final Log logger = LogFactory.getLog(CancelWorkflowDialog.class);
// ------------------------------------------------------------------------------
// Dialog implementation
@Override
public void init(Map<String, String> parameters)
{
super.init(parameters);
// make sure the workflow instance id has been passed
this.workflowInstanceId = this.parameters.get("workflow-instance-id");
if (this.workflowInstanceId == null || this.workflowInstanceId.length() == 0)
{
throw new IllegalArgumentException("Cancel workflow dialog called without workflow instance id");
}
}
@Override
protected String finishImpl(FacesContext context, String outcome)
throws Exception
{
if (logger.isDebugEnabled())
logger.debug("Cancelling workflow with id: " + this.workflowInstanceId);
// cancel the workflow
this.workflowService.cancelWorkflow(this.workflowInstanceId);
if (logger.isDebugEnabled())
logger.debug("Cancelled workflow with id: " + this.workflowInstanceId);
return outcome;
}
@Override
protected String getErrorMessageId()
{
return "error_cancel_workflow";
}
@Override
public boolean getFinishButtonDisabled()
{
return false;
}
// ------------------------------------------------------------------------------
// Bean Getters and Setters
/**
* Returns the confirmation to display to the user before deleting the content.
*
* @return The formatted message to display
*/
public String getConfirmMessage()
{
String confirmMsg = Application.getMessage(FacesContext.getCurrentInstance(),
"cancel_workflow_confirm");
return MessageFormat.format(confirmMsg,
new Object[] {this.parameters.get("workflow-instance-name")});
}
/**
* Returns the workflow service instance
*
* @return WorkflowService instance
*/
public WorkflowService getWorkflowService()
{
return workflowService;
}
/**
* Sets the workflow service to use
*
* @param workflowService The WorkflowService instance
*/
public void setWorkflowService(WorkflowService workflowService)
{
this.workflowService = workflowService;
}
}

View File

@@ -313,6 +313,28 @@ public class ManageWorkItemDialog extends BaseDialogBean
return this.workItemNode; return this.workItemNode;
} }
/**
* Returns the action group the current task uses for the workflow package
*
* @return action group id
*/
public String getPackageActionGroup()
{
return (String)this.workItem.properties.get(
WorkflowModel.PROP_PACKAGE_ACTION_GROUP);
}
/**
* Returns the action group the current task uses for each workflow package item
*
* @return action group id
*/
public String getPackageItemActionGroup()
{
return (String)this.workItem.properties.get(
WorkflowModel.PROP_PACKAGE_ITEM_ACTION_GROUP);
}
/** /**
* Returns a list of resources associated with this work item * Returns a list of resources associated with this work item
* i.e. the children of the workflow package * i.e. the children of the workflow package

View File

@@ -0,0 +1,199 @@
package org.alfresco.web.bean.workflow;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
import javax.transaction.UserTransaction;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.cmr.workflow.WorkflowService;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.SortableSelectItem;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.UIGenericPicker;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Bean implementation for the "Reassign Work Item" dialog
*
* @author gavinc
*/
public class ReassignWorkItemDialog extends BaseDialogBean
{
protected String workItemId;
protected WorkflowService workflowService;
protected PersonService personService;
private static final Log logger = LogFactory.getLog(ReassignWorkItemDialog.class);
// ------------------------------------------------------------------------------
// Dialog implementation
@Override
public void init(Map<String, String> parameters)
{
super.init(parameters);
this.workItemId = this.parameters.get("workitem-id");
if (this.workItemId == null || this.workItemId.length() == 0)
{
throw new IllegalArgumentException("Reassign workitem dialog called without task id");
}
}
@Override
protected String finishImpl(FacesContext context, String outcome)
throws Exception
{
if (logger.isDebugEnabled())
logger.debug("Reassigning work item with id: " + this.workItemId);
UIComponent picker = context.getViewRoot().findComponent("dialog:dialog-body:user-picker");
if (picker != null && picker instanceof UIGenericPicker)
{
UIGenericPicker userPicker = (UIGenericPicker)picker;
String[] user = userPicker.getSelectedResults();
if (user != null && user.length > 0)
{
// create a map to hold the new owner property then update the task
String userName = user[0];
Map<QName, Serializable> params = new HashMap<QName, Serializable>(1);
params.put(ContentModel.PROP_OWNER, userName);
this.workflowService.updateTask(this.workItemId, params, null, null);
}
else
{
if (logger.isWarnEnabled())
logger.warn("Failed to find selected user, reassign was unsuccessful");
}
}
else
{
if (logger.isWarnEnabled())
logger.warn("Failed to find user-picker component, reassign was unsuccessful");
}
if (logger.isDebugEnabled())
logger.debug("Reassigning work item with id: " + this.workItemId);
return outcome;
}
@Override
protected String getErrorMessageId()
{
return "error_reassign_workitem";
}
// ------------------------------------------------------------------------------
// Bean Getters and Setters
/**
* Property accessed by the Generic Picker component.
*
* @return the array of filter options to show in the users/groups picker
*/
public SelectItem[] getFilters()
{
ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance());
return new SelectItem[] {new SelectItem("0", bundle.getString("users"))};
}
/**
* Query callback method executed by the Generic Picker component.
* This method is part of the contract to the Generic Picker, it is up to the backing bean
* to execute whatever query is appropriate and return the results.
*
* @param filterIndex Index of the filter drop-down selection
* @param contains Text from the contains textbox
*
* @return An array of SelectItem objects containing the results to display in the picker.
*/
public SelectItem[] pickerCallback(int filterIndex, String contains)
{
FacesContext context = FacesContext.getCurrentInstance();
SelectItem[] items;
UserTransaction tx = null;
try
{
tx = Repository.getUserTransaction(context, true);
tx.begin();
// build xpath to match available User/Person objects
NodeRef peopleRef = personService.getPeopleContainer();
// NOTE: see SearcherComponentTest
String xpath = "*[like(@" + NamespaceService.CONTENT_MODEL_PREFIX + ":" + "firstName, '%" + contains + "%', false)" +
" or " + "like(@" + NamespaceService.CONTENT_MODEL_PREFIX + ":" + "lastName, '%" + contains + "%', false)]";
List<NodeRef> nodes = searchService.selectNodes(
peopleRef,
xpath,
null,
this.namespaceService,
false);
items = new SelectItem[nodes.size()];
for (int index=0; index<nodes.size(); index++)
{
NodeRef personRef = nodes.get(index);
String firstName = (String)this.nodeService.getProperty(personRef, ContentModel.PROP_FIRSTNAME);
String lastName = (String)this.nodeService.getProperty(personRef, ContentModel.PROP_LASTNAME);
String username = (String)this.nodeService.getProperty(personRef, ContentModel.PROP_USERNAME);
SelectItem item = new SortableSelectItem(username, firstName + " " + lastName, lastName);
items[index] = item;
}
Arrays.sort(items);
// commit the transaction
tx.commit();
}
catch (Throwable err)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
items = new SelectItem[0];
}
return items;
}
/**
* Sets the workflow service to use
*
* @param workflowService The WorkflowService instance
*/
public void setWorkflowService(WorkflowService workflowService)
{
this.workflowService = workflowService;
}
/**
* @param permissionService The PermissionService to set.
*/
public void setPersonService(PersonService personService)
{
this.personService = personService;
}
}

View File

@@ -12,6 +12,7 @@ import javax.faces.model.SelectItem;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.repo.workflow.WorkflowModel; import org.alfresco.repo.workflow.WorkflowModel;
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.workflow.WorkflowDefinition; import org.alfresco.service.cmr.workflow.WorkflowDefinition;
import org.alfresco.service.cmr.workflow.WorkflowPath; import org.alfresco.service.cmr.workflow.WorkflowPath;
@@ -207,6 +208,54 @@ public class StartWorkflowWizard extends BaseWizardBean
return this.startTaskNode; return this.startTaskNode;
} }
/**
* Returns the action group the current task uses for the workflow package
*
* @return action group id
*/
public String getPackageActionGroup()
{
String actionGroup = null;
WorkflowDefinition flowDef = this.workflows.get(this.selectedWorkflow);
WorkflowTaskDefinition taskDef = flowDef.startTaskDefinition;
if (taskDef != null)
{
PropertyDefinition propDef = taskDef.metadata.getProperties().get(
WorkflowModel.PROP_PACKAGE_ACTION_GROUP);
if (propDef != null)
{
actionGroup = propDef.getDefaultValue();
}
}
return actionGroup;
}
/**
* Returns the action group the current task uses for each workflow package item
*
* @return action group id
*/
public String getPackageItemActionGroup()
{
String actionGroup = null;
WorkflowDefinition flowDef = this.workflows.get(this.selectedWorkflow);
WorkflowTaskDefinition taskDef = flowDef.startTaskDefinition;
if (taskDef != null)
{
PropertyDefinition propDef = taskDef.metadata.getProperties().get(
WorkflowModel.PROP_PACKAGE_ITEM_ACTION_GROUP);
if (propDef != null)
{
actionGroup = propDef.getDefaultValue();
}
}
return actionGroup;
}
/** /**
* @return Returns the summary data for the wizard. * @return Returns the summary data for the wizard.
*/ */

View File

@@ -74,7 +74,11 @@ public class WorkflowBean
this.workItems = new ArrayList<Node>(tasks.size()); this.workItems = new ArrayList<Node>(tasks.size());
for (WorkflowTask task : tasks) for (WorkflowTask task : tasks)
{ {
this.workItems.add(createWorkItem(task)); Node node = createWorkItem(task);
this.workItems.add(node);
if (logger.isDebugEnabled())
logger.debug("Added to do work item: " + node);
} }
// commit the changes // commit the changes
@@ -117,7 +121,11 @@ public class WorkflowBean
this.completedWorkItems = new ArrayList<Node>(tasks.size()); this.completedWorkItems = new ArrayList<Node>(tasks.size());
for (WorkflowTask task : tasks) for (WorkflowTask task : tasks)
{ {
this.completedWorkItems.add(createWorkItem(task)); Node node = createWorkItem(task);
this.completedWorkItems.add(node);
if (logger.isDebugEnabled())
logger.debug("Added completed work item: " + node);
} }
// commit the changes // commit the changes
@@ -237,9 +245,10 @@ public class WorkflowBean
node.getProperties().put("sourceSpaceId", context.getId()); node.getProperties().put("sourceSpaceId", context.getId());
} }
// add the outcome label for any completed task // add extra properties for completed tasks
if (task.state.equals(WorkflowTaskState.COMPLETED)) if (task.state.equals(WorkflowTaskState.COMPLETED))
{ {
// add the outcome label for any completed task
String outcome = null; String outcome = null;
String transition = (String)task.properties.get(WorkflowModel.PROP_OUTCOME); String transition = (String)task.properties.get(WorkflowModel.PROP_OUTCOME);
if (transition != null) if (transition != null)
@@ -259,6 +268,10 @@ public class WorkflowBean
node.getProperties().put("outcome", outcome); node.getProperties().put("outcome", outcome);
} }
} }
// add the workflow instance id and name this taks belongs to
node.getProperties().put("workflowInstanceId", task.path.instance.id);
node.getProperties().put("workflowInstanceName", task.path.instance.definition.title);
} }
return node; return node;

View File

@@ -67,6 +67,7 @@ public class UIGenericPicker extends UICommand
private Boolean showContains = null; private Boolean showContains = null;
private Boolean showAddButton = null; private Boolean showAddButton = null;
private Boolean filterRefresh = null; private Boolean filterRefresh = null;
private Boolean multiSelect = null;
private String addButtonLabel; private String addButtonLabel;
private Integer width = null; private Integer width = null;
private Integer height = null; private Integer height = null;
@@ -118,6 +119,7 @@ public class UIGenericPicker extends UICommand
currentResults = (SelectItem[])values[11]; currentResults = (SelectItem[])values[11];
filters = (SelectItem[])values[12]; filters = (SelectItem[])values[12];
filterRefresh = (Boolean)values[13]; filterRefresh = (Boolean)values[13];
multiSelect = (Boolean)values[14];
} }
/** /**
@@ -125,7 +127,7 @@ public class UIGenericPicker extends UICommand
*/ */
public Object saveState(FacesContext context) public Object saveState(FacesContext context)
{ {
Object values[] = new Object[14]; Object values[] = new Object[15];
// standard component attributes are saved by the super class // standard component attributes are saved by the super class
values[0] = super.saveState(context); values[0] = super.saveState(context);
values[1] = showFilter; values[1] = showFilter;
@@ -141,6 +143,7 @@ public class UIGenericPicker extends UICommand
values[11] = currentResults; values[11] = currentResults;
values[12] = filters; values[12] = filters;
values[13] = filterRefresh; values[13] = filterRefresh;
values[14] = multiSelect;
return (values); return (values);
} }
@@ -354,7 +357,14 @@ public class UIGenericPicker extends UICommand
out.write(Integer.toString(getHeight())); out.write(Integer.toString(getHeight()));
out.write("px' name='"); out.write("px' name='");
out.write(clientId + FIELD_RESULTS); out.write(clientId + FIELD_RESULTS);
out.write("' multiple>"); out.write("' id='");
out.write(clientId + FIELD_RESULTS);
out.write("'");
if (getMultiSelect() == true)
{
out.write(" multiple");
}
out.write(">");
// results // results
if (currentResults != null) if (currentResults != null)
@@ -530,6 +540,28 @@ public class UIGenericPicker extends UICommand
this.filterRefresh = Boolean.valueOf(filterRefresh); this.filterRefresh = Boolean.valueOf(filterRefresh);
} }
/**
* @return true if multi select should be enabled.
*/
public boolean getMultiSelect()
{
ValueBinding vb = getValueBinding("multiSelect");
if (vb != null)
{
this.multiSelect = (Boolean)vb.getValue(getFacesContext());
}
return multiSelect != null ? multiSelect.booleanValue() : true;
}
/**
* @param multiSelect Flag to determine whether multi select is enabled
*/
public void setMultiSelect(boolean multiSelect)
{
this.multiSelect = Boolean.valueOf(multiSelect);
}
/** /**
* @return Returns the width. * @return Returns the width.
*/ */
@@ -633,6 +665,7 @@ public class UIGenericPicker extends UICommand
/** /**
* Class representing the an action relevant to the Generic Selector component. * Class representing the an action relevant to the Generic Selector component.
*/ */
@SuppressWarnings("serial")
public static class PickerEvent extends ActionEvent public static class PickerEvent extends ActionEvent
{ {
public PickerEvent(UIComponent component, int action, int filterIndex, String contains, String[] results) public PickerEvent(UIComponent component, int action, int filterIndex, String contains, String[] results)

View File

@@ -20,7 +20,6 @@ import javax.faces.FacesException;
import javax.faces.component.UICommand; import javax.faces.component.UICommand;
import javax.faces.component.UIComponent; import javax.faces.component.UIComponent;
import javax.faces.el.MethodBinding; import javax.faces.el.MethodBinding;
import javax.faces.el.ValueBinding;
import org.alfresco.web.ui.common.component.UIGenericPicker; import org.alfresco.web.ui.common.component.UIGenericPicker;
@@ -57,6 +56,7 @@ public class GenericPickerTag extends BaseComponentTag
setBooleanProperty(component, "showContains", this.showContains); setBooleanProperty(component, "showContains", this.showContains);
setBooleanProperty(component, "showAddButton", this.showAddButton); setBooleanProperty(component, "showAddButton", this.showAddButton);
setBooleanProperty(component, "filterRefresh", this.filterRefresh); setBooleanProperty(component, "filterRefresh", this.filterRefresh);
setBooleanProperty(component, "multiSelect", this.multiSelect);
setStringProperty(component, "addButtonLabel", this.addButtonLabel); setStringProperty(component, "addButtonLabel", this.addButtonLabel);
setActionProperty((UICommand)component, this.action); setActionProperty((UICommand)component, this.action);
setActionListenerProperty((UICommand)component, this.actionListener); setActionListenerProperty((UICommand)component, this.actionListener);
@@ -94,6 +94,7 @@ public class GenericPickerTag extends BaseComponentTag
this.queryCallback = null; this.queryCallback = null;
this.filters = null; this.filters = null;
this.filterRefresh = null; this.filterRefresh = null;
this.multiSelect = null;
} }
/** /**
@@ -205,8 +206,20 @@ public class GenericPickerTag extends BaseComponentTag
{ {
this.filterRefresh = filterRefresh; this.filterRefresh = filterRefresh;
} }
/**
* Set the multiSelect
*
* @param mutliSelect the multiSelect
*/
public void setMultiSelect(String multiSelect)
{
this.multiSelect = multiSelect;
}
/** the multiSelect */
private String multiSelect;
/** the filterRefresh */ /** the filterRefresh */
private String filterRefresh; private String filterRefresh;

View File

@@ -1693,6 +1693,12 @@
<required>false</required> <required>false</required>
<rtexprvalue>true</rtexprvalue> <rtexprvalue>true</rtexprvalue>
</attribute> </attribute>
<attribute>
<name>multiSelect</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute> <attribute>
<name>addButtonLabel</name> <name>addButtonLabel</name>

View File

@@ -1781,6 +1781,92 @@
</managed-property> </managed-property>
</managed-bean> </managed-bean>
<managed-bean>
<description>
The bean that backs up the Cancel Workflow Dialog
</description>
<managed-bean-name>CancelWorkflowDialog</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.workflow.CancelWorkflowDialog</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>nodeService</property-name>
<value>#{NodeService}</value>
</managed-property>
<managed-property>
<property-name>fileFolderService</property-name>
<value>#{FileFolderService}</value>
</managed-property>
<managed-property>
<property-name>searchService</property-name>
<value>#{SearchService}</value>
</managed-property>
<managed-property>
<property-name>navigator</property-name>
<value>#{NavigationBean}</value>
</managed-property>
<managed-property>
<property-name>browseBean</property-name>
<value>#{BrowseBean}</value>
</managed-property>
<managed-property>
<property-name>dictionaryService</property-name>
<value>#{DictionaryService}</value>
</managed-property>
<managed-property>
<property-name>namespaceService</property-name>
<value>#{NamespaceService}</value>
</managed-property>
<managed-property>
<property-name>workflowService</property-name>
<value>#{WorkflowService}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>
The bean that backs up the Reassign Work Item Dialog
</description>
<managed-bean-name>ReassignWorkItemDialog</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.workflow.ReassignWorkItemDialog</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>nodeService</property-name>
<value>#{NodeService}</value>
</managed-property>
<managed-property>
<property-name>fileFolderService</property-name>
<value>#{FileFolderService}</value>
</managed-property>
<managed-property>
<property-name>searchService</property-name>
<value>#{SearchService}</value>
</managed-property>
<managed-property>
<property-name>navigator</property-name>
<value>#{NavigationBean}</value>
</managed-property>
<managed-property>
<property-name>browseBean</property-name>
<value>#{BrowseBean}</value>
</managed-property>
<managed-property>
<property-name>dictionaryService</property-name>
<value>#{DictionaryService}</value>
</managed-property>
<managed-property>
<property-name>namespaceService</property-name>
<value>#{NamespaceService}</value>
</managed-property>
<managed-property>
<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> <managed-bean>
<managed-bean-name>WorkflowBean</managed-bean-name> <managed-bean-name>WorkflowBean</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.workflow.WorkflowBean</managed-bean-class> <managed-bean-class>org.alfresco.web.bean.workflow.WorkflowBean</managed-bean-class>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,26 @@
<%--
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="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ 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:outputText value="#{DialogManager.bean.confirmMessage}" styleClass="mainSubTitle" />

View File

@@ -90,7 +90,7 @@
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{msg.actions}"/> <h:outputText value="#{msg.actions}"/>
</f:facet> </f:facet>
<r:actions id="actions-col-actions" value="workflow_item_collection_actions" <r:actions id="actions-col-actions" value="#{DialogManager.bean.packageItemActionGroup}"
context="#{r}" showLink="false" styleClass="inlineAction" /> context="#{r}" showLink="false" styleClass="inlineAction" />
</a:column> </a:column>

View File

@@ -0,0 +1,40 @@
<%--
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="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ 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:outputText value="#{msg.reassign_select_user}<br/><br/>" escape="false" />
<a:genericPicker id="user-picker" showAddButton="false" filters="#{DialogManager.bean.filters}"
queryCallback="#{DialogManager.bean.pickerCallback}" multiSelect="false" />
<script type="text/javascript">
document.getElementById("dialog:dialog-body:user-picker_results").onchange = checkButtonState;
function checkButtonState()
{
var button = document.getElementById("dialog:finish-button");
var list = document.getElementById("dialog:dialog-body:user-picker_results");
button.disabled = (list.selectedIndex == -1);
}
</script>

View File

@@ -21,7 +21,7 @@
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<h:panelGroup rendered="#{empty WizardManager.bean.taskMetadataNode}"> <h:panelGroup rendered="#{WizardManager.bean.taskMetadataNode == null}">
<f:verbatim> <f:verbatim>
<%PanelGenerator.generatePanelStart(out, request.getContextPath(), "yellowInner", "#ffffcc");%> <%PanelGenerator.generatePanelStart(out, request.getContextPath(), "yellowInner", "#ffffcc");%>
<table><tr><td> <table><tr><td>
@@ -37,10 +37,14 @@
</f:verbatim> </f:verbatim>
</h:panelGroup> </h:panelGroup>
<a:panel id="props-panel" label="#{msg.properties}" rendered="#{not empty WizardManager.bean.taskMetadataNode}" <h:panelGroup rendered="#{WizardManager.bean.taskMetadataNode != null}">
border="white" bgcolor="white" titleBorder="blue" titleBgcolor="#D3E6FE" styleClass="mainSubTitle"> <a:panel id="props-panel" label="#{msg.properties}" border="white" bgcolor="white"
titleBorder="blue" titleBgcolor="#D3E6FE" styleClass="mainSubTitle">
<r:propertySheetGrid id="task-props" value="#{WizardManager.bean.taskMetadataNode}" <r:propertySheetGrid id="task-props" value="#{WizardManager.bean.taskMetadataNode}"
var="taskProps" columns="1" externalConfig="true" /> var="taskProps" columns="1" externalConfig="true" />
</a:panel> </a:panel>
</h:panelGroup>

View File

@@ -14,7 +14,7 @@
<a:sortLink label="#{msg.title}" value="name" mode="case-insensitive" styleClass="header"/> <a:sortLink label="#{msg.title}" value="name" mode="case-insensitive" styleClass="header"/>
</f:facet> </f:facet>
<f:facet name="small-icon"> <f:facet name="small-icon">
<h:graphicImage url="/images/icons/View_details.gif" /> <h:graphicImage url="/images/icons/completed_workflow_item.gif" />
</f:facet> </f:facet>
<h:outputText value="#{r.name}" /> <h:outputText value="#{r.name}" />
</a:column> </a:column>
@@ -66,7 +66,7 @@
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{msg.actions}"/> <h:outputText value="#{msg.actions}"/>
</f:facet> </f:facet>
<r:actions value="completed_workitem_actions" context="#{r}" showLink="false" <r:actions value="dashlet_completed_actions" context="#{r}" showLink="false"
styleClass="inlineAction" /> styleClass="inlineAction" />
</a:column> </a:column>

View File

@@ -15,7 +15,7 @@
</f:facet> </f:facet>
<f:facet name="small-icon"> <f:facet name="small-icon">
<h:panelGroup> <h:panelGroup>
<a:actionLink value="#{r.name}" image="/images/icons/View_details.gif" showLink="false" <a:actionLink value="#{r.name}" image="/images/icons/workflow_item.gif" showLink="false"
actionListener="#{DialogManager.setupParameters}" action="dialog:manageWorkItem"> actionListener="#{DialogManager.setupParameters}" action="dialog:manageWorkItem">
<f:param name="id" value="#{r.id}" /> <f:param name="id" value="#{r.id}" />
</a:actionLink> </a:actionLink>
@@ -82,7 +82,7 @@
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{msg.actions}"/> <h:outputText value="#{msg.actions}"/>
</f:facet> </f:facet>
<r:actions value="manage_workitem_actions" context="#{r}" showLink="false" <r:actions value="dashlet_todo_actions" context="#{r}" showLink="false"
styleClass="inlineAction" /> styleClass="inlineAction" />
</a:column> </a:column>