mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
- Added workflow history to completed task dialog (allows user to see what happened through completed workflows)
- Fixed errors emitted from completed WCM workflows - Toned down the appearance of workflow selection in the submit dialog git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5774 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -575,10 +575,15 @@ public class SubmitDialog extends BaseDialogBean
|
||||
WorkflowDefinition workflowDef = this.workflowService.getDefinitionByName(wrapper.name);
|
||||
UIListItem item = new UIListItem();
|
||||
item.setValue(workflowDef.getName());
|
||||
item.setLabel(workflowDef.getTitle());
|
||||
item.setDescription(workflowDef.getDescription());
|
||||
item.setImage(WebResources.IMAGE_WORKFLOW_32);
|
||||
String label = workflowDef.getTitle();
|
||||
String desc = workflowDef.getDescription();
|
||||
if (desc != null && desc.length() > 0)
|
||||
{
|
||||
label = label + "(" + desc + ")";
|
||||
}
|
||||
item.setLabel(label);
|
||||
items.add(item);
|
||||
|
||||
// add first workflow as default selection
|
||||
if (workflowSelectedValue == null)
|
||||
{
|
||||
|
@@ -654,25 +654,28 @@ public class ManageTaskDialog extends BaseDialogBean
|
||||
|
||||
if (this.workflowPackage.getStoreRef().getProtocol().equals(StoreRef.PROTOCOL_AVM))
|
||||
{
|
||||
final NodeRef stagingNodeRef = (NodeRef)
|
||||
this.nodeService.getProperty(this.workflowPackage,
|
||||
WCMModel.PROP_AVM_DIR_INDIRECTION);
|
||||
final String stagingAvmPath = AVMNodeConverter.ToAVMVersionPath(stagingNodeRef).getSecond();
|
||||
final String packageAvmPath = AVMNodeConverter.ToAVMVersionPath(this.workflowPackage).getSecond();
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("comparing " + packageAvmPath + " with " + stagingAvmPath);
|
||||
for (AVMDifference d : this.avmSyncService.compare(-1, packageAvmPath,
|
||||
-1, stagingAvmPath,
|
||||
null))
|
||||
if (this.nodeService.exists(this.workflowPackage))
|
||||
{
|
||||
final NodeRef stagingNodeRef = (NodeRef)
|
||||
this.nodeService.getProperty(this.workflowPackage,
|
||||
WCMModel.PROP_AVM_DIR_INDIRECTION);
|
||||
final String stagingAvmPath = AVMNodeConverter.ToAVMVersionPath(stagingNodeRef).getSecond();
|
||||
final String packageAvmPath = AVMNodeConverter.ToAVMVersionPath(this.workflowPackage).getSecond();
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("got difference " + d);
|
||||
if (d.getDifferenceCode() == AVMDifference.NEWER ||
|
||||
d.getDifferenceCode() == AVMDifference.CONFLICT)
|
||||
LOGGER.debug("comparing " + packageAvmPath + " with " + stagingAvmPath);
|
||||
for (AVMDifference d : this.avmSyncService.compare(-1, packageAvmPath,
|
||||
-1, stagingAvmPath,
|
||||
null))
|
||||
{
|
||||
this.addAVMNode(new AVMNode(this.avmService.lookup(d.getSourceVersion(),
|
||||
d.getSourcePath(),
|
||||
true)));
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("got difference " + d);
|
||||
if (d.getDifferenceCode() == AVMDifference.NEWER ||
|
||||
d.getDifferenceCode() == AVMDifference.CONFLICT)
|
||||
{
|
||||
this.addAVMNode(new AVMNode(this.avmService.lookup(d.getSourceVersion(),
|
||||
d.getSourcePath(),
|
||||
true)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -400,12 +400,14 @@ public class UISelectList extends UIInput implements NamingContainer
|
||||
Utils.outputAttribute(out, getAttributes().get("itemStyleClass"), "class");
|
||||
out.write("><div style='padding:2px'>");
|
||||
out.write(item.getLabel());
|
||||
out.write("</div><div style='padding:2px'>");
|
||||
out.write("</div>");
|
||||
if (description != null)
|
||||
{
|
||||
out.write("<div style='padding:2px'>");
|
||||
out.write(description);
|
||||
out.write("</div>");
|
||||
}
|
||||
out.write("</div></td>");
|
||||
out.write("</td>");
|
||||
|
||||
if (activeSelect)
|
||||
{
|
||||
|
@@ -55,6 +55,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
public class UIWorkflowHistory extends SelfRenderingComponent
|
||||
{
|
||||
protected WorkflowInstance value = null;
|
||||
protected Boolean completedMode = null;
|
||||
|
||||
private static final Log logger = LogFactory.getLog(UIWorkflowHistory.class);
|
||||
|
||||
@@ -84,15 +85,17 @@ public class UIWorkflowHistory extends SelfRenderingComponent
|
||||
// standard component attributes are restored by the super class
|
||||
super.restoreState(context, values[0]);
|
||||
this.value = (WorkflowInstance)values[1];
|
||||
this.completedMode = (Boolean)values[2];
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object saveState(FacesContext context)
|
||||
{
|
||||
Object values[] = new Object[8];
|
||||
Object values[] = new Object[3];
|
||||
// standard component attributes are saved by the super class
|
||||
values[0] = super.saveState(context);
|
||||
values[1] = this.value;
|
||||
values[2] = this.completedMode;
|
||||
return values;
|
||||
}
|
||||
|
||||
@@ -113,6 +116,7 @@ public class UIWorkflowHistory extends SelfRenderingComponent
|
||||
logger.debug("Retrieving workflow history for workflow instance: " + wi);
|
||||
|
||||
WorkflowTaskQuery query = new WorkflowTaskQuery();
|
||||
query.setActive(!getCompletedMode());
|
||||
query.setProcessId(wi.id);
|
||||
query.setTaskState(WorkflowTaskState.COMPLETED);
|
||||
query.setOrderBy(new WorkflowTaskQuery.OrderBy[] {
|
||||
@@ -253,4 +257,34 @@ public class UIWorkflowHistory extends SelfRenderingComponent
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns whether the history is for a completed workflow instance
|
||||
*/
|
||||
public boolean getCompletedMode()
|
||||
{
|
||||
if (this.completedMode == null)
|
||||
{
|
||||
ValueBinding vb = getValueBinding("completedMode");
|
||||
if (vb != null)
|
||||
{
|
||||
this.completedMode = (Boolean)vb.getValue(getFacesContext());
|
||||
}
|
||||
}
|
||||
|
||||
if (this.completedMode == null)
|
||||
{
|
||||
this.completedMode = Boolean.FALSE;
|
||||
}
|
||||
|
||||
return this.completedMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param completedMode Sets whether the history is for a completed workflow instance
|
||||
*/
|
||||
public void setCompletedMode(boolean completedMode)
|
||||
{
|
||||
this.completedMode = Boolean.valueOf(completedMode);
|
||||
}
|
||||
}
|
||||
|
@@ -35,6 +35,9 @@ import org.alfresco.web.ui.common.tag.HtmlComponentTag;
|
||||
*/
|
||||
public class WorkflowHistoryTag extends HtmlComponentTag
|
||||
{
|
||||
private String value;
|
||||
private String completedMode;
|
||||
|
||||
/**
|
||||
* @see javax.faces.webapp.UIComponentTag#getComponentType()
|
||||
*/
|
||||
@@ -59,6 +62,7 @@ public class WorkflowHistoryTag extends HtmlComponentTag
|
||||
super.setProperties(component);
|
||||
|
||||
setStringProperty(component, "value", this.value);
|
||||
setBooleanProperty(component, "completedMode", this.completedMode);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,6 +72,7 @@ public class WorkflowHistoryTag extends HtmlComponentTag
|
||||
{
|
||||
super.release();
|
||||
this.value = null;
|
||||
this.completedMode = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,6 +85,13 @@ public class WorkflowHistoryTag extends HtmlComponentTag
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/** the value (binding to the workflow instance) */
|
||||
private String value;
|
||||
/**
|
||||
* Sets whether the component is showing history for a completed workflow
|
||||
*
|
||||
* @param completedMode
|
||||
*/
|
||||
public void setCompletedMode(String completedMode)
|
||||
{
|
||||
this.completedMode = completedMode;
|
||||
}
|
||||
}
|
||||
|
@@ -1957,6 +1957,12 @@
|
||||
<required>false</required>
|
||||
<rtexprvalue>true</rtexprvalue>
|
||||
</attribute>
|
||||
|
||||
<attribute>
|
||||
<name>completedMode</name>
|
||||
<required>false</required>
|
||||
<rtexprvalue>true</rtexprvalue>
|
||||
</attribute>
|
||||
</tag>
|
||||
|
||||
<tag>
|
||||
|
@@ -88,7 +88,7 @@
|
||||
<h:panelGroup rendered="#{DialogManager.bean.workflowListSize != 0}">
|
||||
<h:outputText value="#{msg.submit_workflow_selection}" />
|
||||
<h:panelGrid columns="2" cellpadding="2" cellpadding="2">
|
||||
<a:selectList id="workflow-list" multiSelect="false" styleClass="selectListTable" itemStyleClass="selectListItem"
|
||||
<a:selectList id="workflow-list" multiSelect="false" styleClass="noBrColumn" itemStyle="padding-top: 3px;"
|
||||
value="#{DialogManager.bean.workflowSelectedValue}">
|
||||
<a:listItems value="#{DialogManager.bean.workflowList}" />
|
||||
</a:selectList>
|
||||
@@ -106,7 +106,7 @@
|
||||
</h:panelGroup>
|
||||
</h:panelGrid>
|
||||
|
||||
<h:panelGrid columns="1" cellpadding="2" style="padding-top:10px;padding-bottom:4px;"
|
||||
<h:panelGrid columns="1" cellpadding="2" style="padding-top:6px;padding-bottom:4px;"
|
||||
width="100%" rowClasses="wizardSectionHeading">
|
||||
<h:outputText value=" #{msg.content_launch}" escape="false" />
|
||||
</h:panelGrid>
|
||||
|
@@ -107,4 +107,11 @@
|
||||
|
||||
<r:workflowSummary id="workflow-summary" value="#{DialogManager.bean.workflowInstance}" styleClass="workflowSummary" />
|
||||
|
||||
<f:verbatim><div style="padding-left:9px;padding-top:8px;padding-bottom:4px"></f:verbatim>
|
||||
<a:panel id="pending-submission-panel" label="#{msg.workflow_history}" progressive="true"
|
||||
expanded="false" styleClass="mainSubTitle">
|
||||
<r:workflowHistory id="workflow-history" value="#{DialogManager.bean.workflowInstance}"
|
||||
styleClass="workflowHistoryList" completedMode="true" />
|
||||
</a:panel>
|
||||
<f:verbatim></div></f:verbatim>
|
||||
</a:panel>
|
||||
|
Reference in New Issue
Block a user