mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V2.1 to HEAD
6944: More hibernate session cache taming. 6945: Times for commits are close to linear in the number of items submitted. 6946: Missing break statement. (Courtesy of Jan). 6948: Fixed session cache eviction problem triggered by resetLayer(). 6956: Wrapped AVMService and AttributeService in TransactionResourceInterceptor. Reverted log4j.properties git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7368 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -15,11 +15,11 @@
|
|||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
* As a special exception to the terms and conditions of version 2.0 of
|
* As a special exception to the terms and conditions of version 2.0 of
|
||||||
* the GPL, you may redistribute this Program in connection with Free/Libre
|
* the GPL, you may redistribute this Program in connection with Free/Libre
|
||||||
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
||||||
* FLOSS exception. You should have recieved a copy of the text describing
|
* FLOSS exception. You should have recieved a copy of the text describing
|
||||||
* the FLOSS exception, and it is also available here:
|
* the FLOSS exception, and it is also available here:
|
||||||
* http://www.alfresco.com/legal/licensing"
|
* http://www.alfresco.com/legal/licensing"
|
||||||
*/
|
*/
|
||||||
package org.alfresco.web.bean.wcm;
|
package org.alfresco.web.bean.wcm;
|
||||||
@@ -84,7 +84,7 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Submit items for WCM workflow dialog.
|
* Submit items for WCM workflow dialog.
|
||||||
*
|
*
|
||||||
* @author Kevin Roast
|
* @author Kevin Roast
|
||||||
*/
|
*/
|
||||||
public class SubmitDialog extends BaseDialogBean
|
public class SubmitDialog extends BaseDialogBean
|
||||||
@@ -93,7 +93,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
private static final String SPACE_ICON = "/images/icons/" + BrowseBean.SPACE_SMALL_DEFAULT + ".gif";
|
private static final String SPACE_ICON = "/images/icons/" + BrowseBean.SPACE_SMALL_DEFAULT + ".gif";
|
||||||
private static final String MSG_DELETED_ITEM = "avm_node_deleted";
|
private static final String MSG_DELETED_ITEM = "avm_node_deleted";
|
||||||
private static final String MSG_ERR_WORKFLOW_CONFIG = "submit_workflow_config_error";
|
private static final String MSG_ERR_WORKFLOW_CONFIG = "submit_workflow_config_error";
|
||||||
|
|
||||||
private String comment;
|
private String comment;
|
||||||
private String label;
|
private String label;
|
||||||
private String[] workflowSelectedValue;
|
private String[] workflowSelectedValue;
|
||||||
@@ -102,7 +102,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
private boolean validateLinks = true;
|
private boolean validateLinks = true;
|
||||||
private Date defaultExpireDate;
|
private Date defaultExpireDate;
|
||||||
private Date launchDate;
|
private Date launchDate;
|
||||||
|
|
||||||
private List<ItemWrapper> submitItems;
|
private List<ItemWrapper> submitItems;
|
||||||
private List<ItemWrapper> warningItems;
|
private List<ItemWrapper> warningItems;
|
||||||
private HashSet<FormWorkflowWrapper> workflows;
|
private HashSet<FormWorkflowWrapper> workflows;
|
||||||
@@ -112,16 +112,16 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
private SandboxInfo sandboxInfo;
|
private SandboxInfo sandboxInfo;
|
||||||
private List<String> srcPaths;
|
private List<String> srcPaths;
|
||||||
|
|
||||||
// The virtualization server might need to be notified
|
// The virtualization server might need to be notified
|
||||||
// because one or more of the files submitted could alter
|
// because one or more of the files submitted could alter
|
||||||
// the behavior the virtual webapp in the target of the submit.
|
// the behavior the virtual webapp in the target of the submit.
|
||||||
// For example, the user might be submitting a new jar or web.xml file.
|
// For example, the user might be submitting a new jar or web.xml file.
|
||||||
//
|
//
|
||||||
// This must take place after the transaction has been completed;
|
// This must take place after the transaction has been completed;
|
||||||
// therefore, a variable is needed to store the path to the
|
// therefore, a variable is needed to store the path to the
|
||||||
// updated webapp so it can happen in doPostCommitProcessing.
|
// updated webapp so it can happen in doPostCommitProcessing.
|
||||||
private String virtUpdatePath;
|
private String virtUpdatePath;
|
||||||
|
|
||||||
protected AVMService avmService;
|
protected AVMService avmService;
|
||||||
protected AVMBrowseBean avmBrowseBean;
|
protected AVMBrowseBean avmBrowseBean;
|
||||||
protected WorkflowService workflowService;
|
protected WorkflowService workflowService;
|
||||||
@@ -129,12 +129,12 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
protected AVMLockingService avmLockingService;
|
protected AVMLockingService avmLockingService;
|
||||||
protected NameMatcher nameMatcher;
|
protected NameMatcher nameMatcher;
|
||||||
protected FormsService formsService;
|
protected FormsService formsService;
|
||||||
|
|
||||||
/** Current workflow for dialog context */
|
/** Current workflow for dialog context */
|
||||||
protected WorkflowConfiguration actionWorkflow = null;
|
protected WorkflowConfiguration actionWorkflow = null;
|
||||||
|
|
||||||
private static final Log logger = LogFactory.getLog(SubmitDialog.class);
|
private static final Log logger = LogFactory.getLog(SubmitDialog.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param avmService The AVM Service to set.
|
* @param avmService The AVM Service to set.
|
||||||
*/
|
*/
|
||||||
@@ -142,7 +142,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
this.avmService = avmService;
|
this.avmService = avmService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param avmSyncService The AVMSyncService to set.
|
* @param avmSyncService The AVMSyncService to set.
|
||||||
*/
|
*/
|
||||||
@@ -150,7 +150,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
this.avmSyncService = avmSyncService;
|
this.avmSyncService = avmSyncService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param avmLockingService The AVMLockingService to set
|
* @param avmLockingService The AVMLockingService to set
|
||||||
*/
|
*/
|
||||||
@@ -158,7 +158,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
this.avmLockingService = avmLockingService;
|
this.avmLockingService = avmLockingService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param avmBrowseBean The AVM BrowseBean to set
|
* @param avmBrowseBean The AVM BrowseBean to set
|
||||||
*/
|
*/
|
||||||
@@ -166,7 +166,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
this.avmBrowseBean = avmBrowseBean;
|
this.avmBrowseBean = avmBrowseBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param workflowService The WorkflowService to set.
|
* @param workflowService The WorkflowService to set.
|
||||||
*/
|
*/
|
||||||
@@ -174,7 +174,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
this.workflowService = workflowService;
|
this.workflowService = workflowService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param nameMatcher The nameMatcher to set.
|
* @param nameMatcher The nameMatcher to set.
|
||||||
*/
|
*/
|
||||||
@@ -198,7 +198,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
public void init(Map<String, String> parameters)
|
public void init(Map<String, String> parameters)
|
||||||
{
|
{
|
||||||
super.init(parameters);
|
super.init(parameters);
|
||||||
|
|
||||||
this.comment = null;
|
this.comment = null;
|
||||||
this.label = null;
|
this.label = null;
|
||||||
this.submitItems = null;
|
this.submitItems = null;
|
||||||
@@ -213,23 +213,23 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
this.workflowParams = null;
|
this.workflowParams = null;
|
||||||
this.sandboxInfo = null;
|
this.sandboxInfo = null;
|
||||||
this.virtUpdatePath = null;
|
this.virtUpdatePath = null;
|
||||||
|
|
||||||
// determine if the dialog has been started from a workflow
|
// determine if the dialog has been started from a workflow
|
||||||
this.loadSelectedNodesFromBrowseBean = Boolean.valueOf(this.parameters.get(PARAM_LOAD_SELECTED_NODES_FROM_BROWSE_BEAN));
|
this.loadSelectedNodesFromBrowseBean = Boolean.valueOf(this.parameters.get(PARAM_LOAD_SELECTED_NODES_FROM_BROWSE_BEAN));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||||
{
|
{
|
||||||
// NOTE: This does not get called in this dialog as we have overridden finish()
|
// NOTE: This does not get called in this dialog as we have overridden finish()
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String finish()
|
public String finish()
|
||||||
{
|
{
|
||||||
// NOTE: We need to handle the transaction ourselves in this dialog as the store needs
|
// NOTE: We need to handle the transaction ourselves in this dialog as the store needs
|
||||||
// to be committed and the virtualisation server informed of the workflow
|
// to be committed and the virtualisation server informed of the workflow
|
||||||
// sandbox BEFORE the workflow gets started. This is so that the link validation
|
// sandbox BEFORE the workflow gets started. This is so that the link validation
|
||||||
// service can use the virtualisation server to produce the link report.
|
// service can use the virtualisation server to produce the link report.
|
||||||
@@ -238,15 +238,15 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
// before running but there's no support for this.
|
// before running but there's no support for this.
|
||||||
// We therefore need to use 2 transactions, one to create the workflow store
|
// We therefore need to use 2 transactions, one to create the workflow store
|
||||||
// (if necessary) and one to start the workflow
|
// (if necessary) and one to start the workflow
|
||||||
|
|
||||||
if (getSubmitItemsSize() == 0)
|
if (getSubmitItemsSize() == 0)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
FacesContext context = FacesContext.getCurrentInstance();
|
FacesContext context = FacesContext.getCurrentInstance();
|
||||||
String outcome = null;
|
String outcome = null;
|
||||||
|
|
||||||
// check the isFinished flag to stop the finish button
|
// check the isFinished flag to stop the finish button
|
||||||
// being pressed multiple times
|
// being pressed multiple times
|
||||||
if (this.isFinished == false)
|
if (this.isFinished == false)
|
||||||
@@ -264,7 +264,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
// if there's no workflow submit changes directly to staging
|
// if there's no workflow submit changes directly to staging
|
||||||
outcome = submitDirectToStaging(context);
|
outcome = submitDirectToStaging(context);
|
||||||
|
|
||||||
// force an update of the virt server if necessary
|
// force an update of the virt server if necessary
|
||||||
if (this.virtUpdatePath != null)
|
if (this.virtUpdatePath != null)
|
||||||
{
|
{
|
||||||
@@ -278,21 +278,21 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
isFinished = false;
|
isFinished = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return outcome;
|
return outcome;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Submits the selected items straight to the staging area i.e. when
|
* Submits the selected items straight to the staging area i.e. when
|
||||||
* there is no workflow configured for the web project.
|
* there is no workflow configured for the web project.
|
||||||
*
|
*
|
||||||
* @param context Faces context
|
* @param context Faces context
|
||||||
* @return The outcome to use
|
* @return The outcome to use
|
||||||
*/
|
*/
|
||||||
protected String submitDirectToStaging(final FacesContext context)
|
protected String submitDirectToStaging(final FacesContext context)
|
||||||
{
|
{
|
||||||
String outcome = null;
|
String outcome = null;
|
||||||
|
|
||||||
RetryingTransactionHelper txnHelper = Repository.getRetryingTransactionHelper(context);
|
RetryingTransactionHelper txnHelper = Repository.getRetryingTransactionHelper(context);
|
||||||
RetryingTransactionCallback<String> callback = new RetryingTransactionCallback<String>()
|
RetryingTransactionCallback<String> callback = new RetryingTransactionCallback<String>()
|
||||||
{
|
{
|
||||||
@@ -302,7 +302,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
return submitDirectToStagingImpl();
|
return submitDirectToStagingImpl();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Execute
|
// Execute
|
||||||
@@ -313,21 +313,21 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
Utils.addErrorMessage(formatErrorMessage(e), e);
|
Utils.addErrorMessage(formatErrorMessage(e), e);
|
||||||
outcome = getErrorOutcome(e);
|
outcome = getErrorOutcome(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return outcome;
|
return outcome;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Submits the selected items via the configured workflow.
|
* Submits the selected items via the configured workflow.
|
||||||
* <p>
|
* <p>
|
||||||
* This method uses 2 separate transactions to perform the submit.
|
* This method uses 2 separate transactions to perform the submit.
|
||||||
* The first one creates the workflow sandbox. The virtualisation
|
* The first one creates the workflow sandbox. The virtualisation
|
||||||
* server is then informed of the new stores. The second
|
* server is then informed of the new stores. The second
|
||||||
* transaction then starts the appropriate workflow. This approach
|
* transaction then starts the appropriate workflow. This approach
|
||||||
* is needed to allow link validation to be performed on the
|
* is needed to allow link validation to be performed on the
|
||||||
* workflow sandbox.
|
* workflow sandbox.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param context Faces context
|
* @param context Faces context
|
||||||
* @return The outcome to use
|
* @return The outcome to use
|
||||||
*/
|
*/
|
||||||
@@ -345,7 +345,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
RetryingTransactionCallback<String> workflowCallback = new RetryingTransactionCallback<String>()
|
RetryingTransactionCallback<String> workflowCallback = new RetryingTransactionCallback<String>()
|
||||||
{
|
{
|
||||||
public String execute() throws Throwable
|
public String execute() throws Throwable
|
||||||
@@ -355,12 +355,12 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// create the workflow sandbox firstly
|
// create the workflow sandbox firstly
|
||||||
txnHelper.doInTransaction(sandboxCallback, false, true);
|
txnHelper.doInTransaction(sandboxCallback, false, true);
|
||||||
|
|
||||||
if (this.sandboxInfo != null)
|
if (this.sandboxInfo != null)
|
||||||
{
|
{
|
||||||
// inform the virtualisation server if the workflow sandbox was created
|
// inform the virtualisation server if the workflow sandbox was created
|
||||||
@@ -368,7 +368,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
AVMUtil.updateVServerWebapp(this.virtUpdatePath, true);
|
AVMUtil.updateVServerWebapp(this.virtUpdatePath, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// start the workflow
|
// start the workflow
|
||||||
@@ -379,7 +379,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
cleanupWorkflowSandbox(context);
|
cleanupWorkflowSandbox(context);
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we get this far return the default outcome
|
// if we get this far return the default outcome
|
||||||
outcome = this.getDefaultFinishOutcome();
|
outcome = this.getDefaultFinishOutcome();
|
||||||
}
|
}
|
||||||
@@ -389,25 +389,24 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
Utils.addErrorMessage(formatErrorMessage(e), e);
|
Utils.addErrorMessage(formatErrorMessage(e), e);
|
||||||
outcome = getErrorOutcome(e);
|
outcome = getErrorOutcome(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return outcome;
|
return outcome;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs the actual submisson to staging
|
* Performs the actual submisson to staging
|
||||||
*
|
*
|
||||||
* @return The outcome to use
|
* @return The outcome to use
|
||||||
*/
|
*/
|
||||||
protected String submitDirectToStagingImpl()
|
protected String submitDirectToStagingImpl()
|
||||||
{
|
{
|
||||||
// direct submit to the staging area without workflow
|
// direct submit to the staging area without workflow
|
||||||
List<ItemWrapper> items = getSubmitItems();
|
List<ItemWrapper> items = getSubmitItems();
|
||||||
|
|
||||||
// construct diffs for selected items for submission
|
// construct diffs for selected items for submission
|
||||||
String sandboxPath = AVMUtil.buildSandboxRootPath(this.avmBrowseBean.getSandbox());
|
String sandboxPath = AVMUtil.buildSandboxRootPath(this.avmBrowseBean.getSandbox());
|
||||||
String stagingPath = AVMUtil.buildSandboxRootPath(this.avmBrowseBean.getStagingStore());
|
String stagingPath = AVMUtil.buildSandboxRootPath(this.avmBrowseBean.getStagingStore());
|
||||||
List<AVMDifference> diffs = new ArrayList<AVMDifference>(items.size());
|
List<AVMDifference> diffs = new ArrayList<AVMDifference>(items.size());
|
||||||
|
|
||||||
String storeId = this.avmBrowseBean.getWebProject().getStoreId();
|
String storeId = this.avmBrowseBean.getWebProject().getStoreId();
|
||||||
for (ItemWrapper wrapper : items)
|
for (ItemWrapper wrapper : items)
|
||||||
{
|
{
|
||||||
@@ -418,10 +417,10 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
|
|
||||||
// process the expiration date (if any)
|
// process the expiration date (if any)
|
||||||
processExpirationDate(srcPath);
|
processExpirationDate(srcPath);
|
||||||
|
|
||||||
// recursively remove locks from this item
|
// recursively remove locks from this item
|
||||||
recursivelyRemoveLocks(storeId, -1, this.avmService.lookup(-1, srcPath, true), srcPath);
|
recursivelyRemoveLocks(storeId, -1, this.avmService.lookup(-1, srcPath, true), srcPath);
|
||||||
|
|
||||||
// If nothing has required notifying the virtualization server
|
// If nothing has required notifying the virtualization server
|
||||||
// so far, check to see if destPath forces a notification
|
// so far, check to see if destPath forces a notification
|
||||||
// (e.g.: it might be a path to a jar file within WEB-INF/lib).
|
// (e.g.: it might be a path to a jar file within WEB-INF/lib).
|
||||||
@@ -431,19 +430,17 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
this.virtUpdatePath = destPath;
|
this.virtUpdatePath = destPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// write changes to layer so files are marked as modified
|
// write changes to layer so files are marked as modified
|
||||||
this.avmSyncService.update(diffs, null, true, true, false, false, this.label, this.comment);
|
this.avmSyncService.update(diffs, null, true, true, false, false, this.label, this.comment);
|
||||||
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
AVMDAOs.Instance().fAVMNodeDAO.flush();
|
||||||
avmSyncService.flatten(sandboxPath, stagingPath);
|
avmSyncService.flatten(sandboxPath, stagingPath);
|
||||||
|
|
||||||
// if we get this far return the default outcome
|
// if we get this far return the default outcome
|
||||||
return this.getDefaultFinishOutcome();
|
return this.getDefaultFinishOutcome();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a workflow sandbox for all the submitted items
|
* Creates a workflow sandbox for all the submitted items
|
||||||
*
|
*
|
||||||
* @param context Faces context
|
* @param context Faces context
|
||||||
*/
|
*/
|
||||||
protected void createWorkflowSandbox(FacesContext context)
|
protected void createWorkflowSandbox(FacesContext context)
|
||||||
@@ -457,7 +454,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
this.workflowParams = wrapper.params;
|
this.workflowParams = wrapper.params;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.workflowParams != null)
|
if (this.workflowParams != null)
|
||||||
{
|
{
|
||||||
// Create workflow sandbox for workflow package
|
// Create workflow sandbox for workflow package
|
||||||
@@ -473,21 +470,21 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
// Example srcPath:
|
// Example srcPath:
|
||||||
// mysite--alice:/www/avm_webapps/ROOT/foo.txt
|
// mysite--alice:/www/avm_webapps/ROOT/foo.txt
|
||||||
String srcPath = wrapper.getDescriptor().getPath();
|
String srcPath = wrapper.getDescriptor().getPath();
|
||||||
|
|
||||||
// We *always* want to update virtualization server
|
// We *always* want to update virtualization server
|
||||||
// when a workflow sandbox is given data in the
|
// when a workflow sandbox is given data in the
|
||||||
// context of a submit workflow. Without this,
|
// context of a submit workflow. Without this,
|
||||||
// it would be impossible to see workflow data
|
// it would be impossible to see workflow data
|
||||||
// in context. The raw operation to create a
|
// in context. The raw operation to create a
|
||||||
// workflow sandbox does not notify the virtualization
|
// workflow sandbox does not notify the virtualization
|
||||||
// server that it exists because it's useful to
|
// server that it exists because it's useful to
|
||||||
// defer this operation until everything is already
|
// defer this operation until everything is already
|
||||||
// in place; this allows pointlessly fine-grained
|
// in place; this allows pointlessly fine-grained
|
||||||
// notifications to be suppressed (they're expensive).
|
// notifications to be suppressed (they're expensive).
|
||||||
//
|
//
|
||||||
// Therefore, just derive the name of the webapp
|
// Therefore, just derive the name of the webapp
|
||||||
// in the workflow sandbox from the 1st item in
|
// in the workflow sandbox from the 1st item in
|
||||||
// the submit list (even if it's not in WEB-INF),
|
// the submit list (even if it's not in WEB-INF),
|
||||||
// and force the virt server notification after the
|
// and force the virt server notification after the
|
||||||
// transaction has completed via doPostCommitProcessing.
|
// transaction has completed via doPostCommitProcessing.
|
||||||
if (this.virtUpdatePath == null)
|
if (this.virtUpdatePath == null)
|
||||||
@@ -495,41 +492,41 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
// Example workflow main store name:
|
// Example workflow main store name:
|
||||||
// mysite--workflow-9161f640-b020-11db-8015-130bf9b5b652
|
// mysite--workflow-9161f640-b020-11db-8015-130bf9b5b652
|
||||||
String workflowMainStoreName = sandboxInfo.getMainStoreName();
|
String workflowMainStoreName = sandboxInfo.getMainStoreName();
|
||||||
|
|
||||||
// The virtUpdatePath looks just like the srcPath
|
// The virtUpdatePath looks just like the srcPath
|
||||||
// except that it belongs to a the main store of
|
// except that it belongs to a the main store of
|
||||||
// the workflow sandbox instead of the sandbox
|
// the workflow sandbox instead of the sandbox
|
||||||
// that originated the submit.
|
// that originated the submit.
|
||||||
this.virtUpdatePath =
|
this.virtUpdatePath =
|
||||||
workflowMainStoreName +
|
workflowMainStoreName +
|
||||||
srcPath.substring(srcPath.indexOf(':'),srcPath.length());
|
srcPath.substring(srcPath.indexOf(':'),srcPath.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
// process the expiration date (if any)
|
// process the expiration date (if any)
|
||||||
processExpirationDate(srcPath);
|
processExpirationDate(srcPath);
|
||||||
|
|
||||||
this.srcPaths.add(srcPath);
|
this.srcPaths.add(srcPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
String workflowMainStoreName = sandboxInfo.getMainStoreName();
|
String workflowMainStoreName = sandboxInfo.getMainStoreName();
|
||||||
List<AVMDifference> diffs = new ArrayList<AVMDifference>(srcPaths.size());
|
List<AVMDifference> diffs = new ArrayList<AVMDifference>(srcPaths.size());
|
||||||
for (final String srcPath : srcPaths)
|
for (final String srcPath : srcPaths)
|
||||||
{
|
{
|
||||||
diffs.add(new AVMDifference(-1, srcPath, -1,
|
diffs.add(new AVMDifference(-1, srcPath, -1,
|
||||||
AVMUtil.getCorrespondingPath(srcPath, workflowMainStoreName),
|
AVMUtil.getCorrespondingPath(srcPath, workflowMainStoreName),
|
||||||
AVMDifference.NEWER));
|
AVMDifference.NEWER));
|
||||||
}
|
}
|
||||||
|
|
||||||
// write changes to layer so files are marked as modified
|
// write changes to layer so files are marked as modified
|
||||||
avmSyncService.update(diffs, null, true, true, false, false, null, null);
|
avmSyncService.update(diffs, null, true, true, false, false, null, null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// create error msg for display in dialog - the user must configure the workflow params
|
// create error msg for display in dialog - the user must configure the workflow params
|
||||||
Utils.addErrorMessage(Application.getMessage(context, MSG_ERR_WORKFLOW_CONFIG));
|
Utils.addErrorMessage(Application.getMessage(context, MSG_ERR_WORKFLOW_CONFIG));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts the configured workflow to allow the submitted items to be link
|
* Starts the configured workflow to allow the submitted items to be link
|
||||||
* checked and reviewed.
|
* checked and reviewed.
|
||||||
@@ -549,30 +546,30 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
if (tasks.size() == 1)
|
if (tasks.size() == 1)
|
||||||
{
|
{
|
||||||
WorkflowTask startTask = tasks.get(0);
|
WorkflowTask startTask = tasks.get(0);
|
||||||
|
|
||||||
if (startTask.state == WorkflowTaskState.IN_PROGRESS)
|
if (startTask.state == WorkflowTaskState.IN_PROGRESS)
|
||||||
{
|
{
|
||||||
final NodeRef workflowPackage =
|
final NodeRef workflowPackage =
|
||||||
AVMWorkflowUtil.createWorkflowPackage(this.srcPaths, sandboxInfo, path);
|
AVMWorkflowUtil.createWorkflowPackage(this.srcPaths, sandboxInfo, path);
|
||||||
|
|
||||||
this.workflowParams.put(WorkflowModel.ASSOC_PACKAGE, workflowPackage);
|
this.workflowParams.put(WorkflowModel.ASSOC_PACKAGE, workflowPackage);
|
||||||
|
|
||||||
// add submission parameters
|
// add submission parameters
|
||||||
this.workflowParams.put(WorkflowModel.PROP_WORKFLOW_DESCRIPTION, getComment());
|
this.workflowParams.put(WorkflowModel.PROP_WORKFLOW_DESCRIPTION, getComment());
|
||||||
this.workflowParams.put(WCMWorkflowModel.PROP_LABEL, getLabel());
|
this.workflowParams.put(WCMWorkflowModel.PROP_LABEL, getLabel());
|
||||||
this.workflowParams.put(WCMWorkflowModel.PROP_FROM_PATH,
|
this.workflowParams.put(WCMWorkflowModel.PROP_FROM_PATH,
|
||||||
AVMUtil.buildStoreRootPath(this.avmBrowseBean.getSandbox()));
|
AVMUtil.buildStoreRootPath(this.avmBrowseBean.getSandbox()));
|
||||||
this.workflowParams.put(WCMWorkflowModel.PROP_LAUNCH_DATE, this.launchDate);
|
this.workflowParams.put(WCMWorkflowModel.PROP_LAUNCH_DATE, this.launchDate);
|
||||||
this.workflowParams.put(WCMWorkflowModel.PROP_VALIDATE_LINKS,
|
this.workflowParams.put(WCMWorkflowModel.PROP_VALIDATE_LINKS,
|
||||||
new Boolean(this.validateLinks));
|
new Boolean(this.validateLinks));
|
||||||
this.workflowParams.put(WCMWorkflowModel.PROP_WEBAPP,
|
this.workflowParams.put(WCMWorkflowModel.PROP_WEBAPP,
|
||||||
this.avmBrowseBean.getWebapp());
|
this.avmBrowseBean.getWebapp());
|
||||||
this.workflowParams.put(WCMWorkflowModel.ASSOC_WEBPROJECT,
|
this.workflowParams.put(WCMWorkflowModel.ASSOC_WEBPROJECT,
|
||||||
this.avmBrowseBean.getWebsite().getNodeRef());
|
this.avmBrowseBean.getWebsite().getNodeRef());
|
||||||
|
|
||||||
// update start task with submit parameters
|
// update start task with submit parameters
|
||||||
this.workflowService.updateTask(startTask.id, this.workflowParams, null, null);
|
this.workflowService.updateTask(startTask.id, this.workflowParams, null, null);
|
||||||
|
|
||||||
// end the start task to trigger the first 'proper' task in the workflow
|
// end the start task to trigger the first 'proper' task in the workflow
|
||||||
this.workflowService.endTask(startTask.id, null);
|
this.workflowService.endTask(startTask.id, null);
|
||||||
}
|
}
|
||||||
@@ -580,11 +577,11 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cleans up the workflow sandbox created by the first transaction. This
|
* Cleans up the workflow sandbox created by the first transaction. This
|
||||||
* action is itself preformed in a separate transaction.
|
* action is itself preformed in a separate transaction.
|
||||||
*
|
*
|
||||||
* @param context Faces context
|
* @param context Faces context
|
||||||
*/
|
*/
|
||||||
protected void cleanupWorkflowSandbox(FacesContext context)
|
protected void cleanupWorkflowSandbox(FacesContext context)
|
||||||
@@ -611,7 +608,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
logger.error("Failed to cleanup workflow sandbox after workflow failure", e);
|
logger.error("Failed to cleanup workflow sandbox after workflow failure", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs the actual deletion of stores in the workflow sandbox.
|
* Performs the actual deletion of stores in the workflow sandbox.
|
||||||
*/
|
*/
|
||||||
@@ -620,7 +617,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
if (this.sandboxInfo != null)
|
if (this.sandboxInfo != null)
|
||||||
{
|
{
|
||||||
String mainWorkflowStore = this.sandboxInfo.getMainStoreName();
|
String mainWorkflowStore = this.sandboxInfo.getMainStoreName();
|
||||||
Map<QName, PropertyValue> matches = this.avmService.queryStorePropertyKey(mainWorkflowStore,
|
Map<QName, PropertyValue> matches = this.avmService.queryStorePropertyKey(mainWorkflowStore,
|
||||||
QName.createQName(null, ".sandbox-id%"));
|
QName.createQName(null, ".sandbox-id%"));
|
||||||
QName sandboxID = matches.keySet().iterator().next();
|
QName sandboxID = matches.keySet().iterator().next();
|
||||||
// Get all the stores in the sandbox.
|
// Get all the stores in the sandbox.
|
||||||
@@ -631,7 +628,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recursively remove locks from a path. Walking child folders looking for files
|
* Recursively remove locks from a path. Walking child folders looking for files
|
||||||
* to remove locks from.
|
* to remove locks from.
|
||||||
@@ -654,7 +651,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
}
|
}
|
||||||
desc = history.get(1);
|
desc = history.get(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, AVMNodeDescriptor> list = avmService.getDirectoryListingDirect(desc, true);
|
Map<String, AVMNodeDescriptor> list = avmService.getDirectoryListingDirect(desc, true);
|
||||||
for (Map.Entry<String, AVMNodeDescriptor> child : list.entrySet())
|
for (Map.Entry<String, AVMNodeDescriptor> child : list.entrySet())
|
||||||
{
|
{
|
||||||
@@ -705,10 +702,10 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
this.label = label;
|
this.label = label;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The default expiration date
|
* @return The default expiration date
|
||||||
*/
|
*/
|
||||||
public Date getDefaultExpireDate()
|
public Date getDefaultExpireDate()
|
||||||
{
|
{
|
||||||
return this.defaultExpireDate;
|
return this.defaultExpireDate;
|
||||||
@@ -721,7 +718,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
this.defaultExpireDate = defaultExpireDate;
|
this.defaultExpireDate = defaultExpireDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if a default expiration date is being entered
|
* @return true if a default expiration date is being entered
|
||||||
*/
|
*/
|
||||||
@@ -795,7 +792,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
// ensure all workflows have been collected from any form generated assets
|
// ensure all workflows have been collected from any form generated assets
|
||||||
calcluateListItemsAndWorkflows();
|
calcluateListItemsAndWorkflows();
|
||||||
|
|
||||||
// add the list of workflows for the website itself to the set
|
// add the list of workflows for the website itself to the set
|
||||||
NodeRef websiteRef = this.avmBrowseBean.getWebsite().getNodeRef();
|
NodeRef websiteRef = this.avmBrowseBean.getWebsite().getNodeRef();
|
||||||
List<ChildAssociationRef> webWorkflowRefs = this.nodeService.getChildAssocs(
|
List<ChildAssociationRef> webWorkflowRefs = this.nodeService.getChildAssocs(
|
||||||
@@ -815,7 +812,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
workflowMatchers.add(new FormWorkflowWrapper(wfName, params, matchPattern));
|
workflowMatchers.add(new FormWorkflowWrapper(wfName, params, matchPattern));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// perform match on each submitted file against available workflows
|
// perform match on each submitted file against available workflows
|
||||||
for (ItemWrapper wrapper : this.submitItems)
|
for (ItemWrapper wrapper : this.submitItems)
|
||||||
{
|
{
|
||||||
@@ -836,7 +833,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
// if all workflows are matched, there is no need to continue looping
|
// if all workflows are matched, there is no need to continue looping
|
||||||
if (workflowMatchers.size() == 0) break;
|
if (workflowMatchers.size() == 0) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// build a UI item for each available workflow
|
// build a UI item for each available workflow
|
||||||
List<UIListItem> items = new ArrayList<UIListItem>(this.workflows.size());
|
List<UIListItem> items = new ArrayList<UIListItem>(this.workflows.size());
|
||||||
for (FormWorkflowWrapper wrapper : this.workflows)
|
for (FormWorkflowWrapper wrapper : this.workflows)
|
||||||
@@ -861,10 +858,10 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
}
|
}
|
||||||
this.workflowItems = items;
|
this.workflowItems = items;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.workflowItems;
|
return this.workflowItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return size of the workflow selection list
|
* @return size of the workflow selection list
|
||||||
*/
|
*/
|
||||||
@@ -872,7 +869,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
return getWorkflowList().size();
|
return getWorkflowList().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the List of bean items to show in the Submit list
|
* @return the List of bean items to show in the Submit list
|
||||||
*/
|
*/
|
||||||
@@ -885,7 +882,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
}
|
}
|
||||||
return this.submitItems;
|
return this.submitItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return size of the submit list
|
* @return size of the submit list
|
||||||
*/
|
*/
|
||||||
@@ -893,7 +890,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
return getSubmitItems().size();
|
return getSubmitItems().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the List of bean items to show in the Warning list
|
* @return the List of bean items to show in the Warning list
|
||||||
*/
|
*/
|
||||||
@@ -906,7 +903,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
}
|
}
|
||||||
return this.warningItems;
|
return this.warningItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return size of the warning list
|
* @return size of the warning list
|
||||||
*/
|
*/
|
||||||
@@ -914,20 +911,20 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
return this.getWarningItems().size();
|
return this.getWarningItems().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the lists of Submittable Items, Warning items and the list of available workflows.
|
* Calculate the lists of Submittable Items, Warning items and the list of available workflows.
|
||||||
*/
|
*/
|
||||||
private void calcluateListItemsAndWorkflows()
|
private void calcluateListItemsAndWorkflows()
|
||||||
{
|
{
|
||||||
UserTransaction tx = null;
|
UserTransaction tx = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
FacesContext context = FacesContext.getCurrentInstance();
|
FacesContext context = FacesContext.getCurrentInstance();
|
||||||
tx = Repository.getUserTransaction(context, true);
|
tx = Repository.getUserTransaction(context, true);
|
||||||
tx.begin();
|
tx.begin();
|
||||||
|
|
||||||
List<AVMNodeDescriptor> selected;
|
List<AVMNodeDescriptor> selected;
|
||||||
if (this.loadSelectedNodesFromBrowseBean)
|
if (this.loadSelectedNodesFromBrowseBean)
|
||||||
{
|
{
|
||||||
@@ -960,7 +957,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
selected = new ArrayList<AVMNodeDescriptor>(1);
|
selected = new ArrayList<AVMNodeDescriptor>(1);
|
||||||
selected.add(this.avmService.lookup(-1, this.avmBrowseBean.getAvmActionNode().getPath(), true));
|
selected.add(this.avmService.lookup(-1, this.avmBrowseBean.getAvmActionNode().getPath(), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selected == null)
|
if (selected == null)
|
||||||
{
|
{
|
||||||
this.submitItems = Collections.<ItemWrapper>emptyList();
|
this.submitItems = Collections.<ItemWrapper>emptyList();
|
||||||
@@ -1016,14 +1013,14 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
fid = this.formsService.getFormInstanceData(ref);
|
fid = this.formsService.getFormInstanceData(ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the form instance data file to the list for submission
|
// add the form instance data file to the list for submission
|
||||||
if (!submittedPaths.contains(fid.getPath()))
|
if (!submittedPaths.contains(fid.getPath()))
|
||||||
{
|
{
|
||||||
this.submitItems.add(new ItemWrapper(this.avmService.lookup(-1, fid.getPath())));
|
this.submitItems.add(new ItemWrapper(this.avmService.lookup(-1, fid.getPath())));
|
||||||
submittedPaths.add(fid.getPath());
|
submittedPaths.add(fid.getPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
// locate renditions for this form instance data file and add to list for submission
|
// locate renditions for this form instance data file and add to list for submission
|
||||||
for (final Rendition rendition : fid.getRenditions())
|
for (final Rendition rendition : fid.getRenditions())
|
||||||
{
|
{
|
||||||
@@ -1037,28 +1034,28 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
WorkflowDefinition defaultWfDef = fid.getForm().getDefaultWorkflow();
|
WorkflowDefinition defaultWfDef = fid.getForm().getDefaultWorkflow();
|
||||||
if (defaultWfDef != null)
|
if (defaultWfDef != null)
|
||||||
{
|
{
|
||||||
this.workflows.add(new FormWorkflowWrapper(defaultWfDef.getName(),
|
this.workflows.add(new FormWorkflowWrapper(defaultWfDef.getName(),
|
||||||
fid.getForm().getDefaultWorkflowParameters()));
|
fid.getForm().getDefaultWorkflowParameters()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tx.commit();
|
tx.commit();
|
||||||
}
|
}
|
||||||
catch (Throwable e)
|
catch (Throwable e)
|
||||||
{
|
{
|
||||||
// rollback the transaction on error
|
// rollback the transaction on error
|
||||||
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
|
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
|
||||||
|
|
||||||
// rethrow the exception to highlight the problem
|
// rethrow the exception to highlight the problem
|
||||||
throw (RuntimeException)e;
|
throw (RuntimeException)e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets up the expiration date for the given source path
|
* Sets up the expiration date for the given source path
|
||||||
*
|
*
|
||||||
* @param srcPath The path to set the expiration date for
|
* @param srcPath The path to set the expiration date for
|
||||||
*/
|
*/
|
||||||
private void processExpirationDate(String srcPath)
|
private void processExpirationDate(String srcPath)
|
||||||
@@ -1075,16 +1072,16 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
this.avmService.addAspect(srcPath, WCMAppModel.ASPECT_EXPIRES);
|
this.avmService.addAspect(srcPath, WCMAppModel.ASPECT_EXPIRES);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the expiration date
|
// set the expiration date
|
||||||
this.avmService.setNodeProperty(srcPath, WCMAppModel.PROP_EXPIRATIONDATE,
|
this.avmService.setNodeProperty(srcPath, WCMAppModel.PROP_EXPIRATIONDATE,
|
||||||
new PropertyValue(DataTypeDefinition.DATETIME, expirationDate));
|
new PropertyValue(DataTypeDefinition.DATETIME, expirationDate));
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Set expiration date of " + expirationDate +
|
logger.debug("Set expiration date of " + expirationDate +
|
||||||
" for " + srcPath);
|
" for " + srcPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action method to setup a workflow for dialog context for the current row
|
* Action method to setup a workflow for dialog context for the current row
|
||||||
*/
|
*/
|
||||||
@@ -1102,7 +1099,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Returns the action Workflow for dialog context
|
* @return Returns the action Workflow for dialog context
|
||||||
*/
|
*/
|
||||||
@@ -1118,17 +1115,17 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
this.actionWorkflow = actionWorkflow;
|
this.actionWorkflow = actionWorkflow;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies the entered default date to all modified items
|
* Applies the entered default date to all modified items
|
||||||
*
|
*
|
||||||
* @param event The event
|
* @param event The event
|
||||||
*/
|
*/
|
||||||
public void applyDefaultExpireDateToAll(ActionEvent event)
|
public void applyDefaultExpireDateToAll(ActionEvent event)
|
||||||
{
|
{
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("applying default expiration date of " + this.defaultExpireDate + " to all modified items");
|
logger.debug("applying default expiration date of " + this.defaultExpireDate + " to all modified items");
|
||||||
|
|
||||||
List<ItemWrapper> items = this.getSubmitItems();
|
List<ItemWrapper> items = this.getSubmitItems();
|
||||||
for (ItemWrapper item : items)
|
for (ItemWrapper item : items)
|
||||||
{
|
{
|
||||||
@@ -1140,17 +1137,17 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
|
|
||||||
this.enteringExpireDate = false;
|
this.enteringExpireDate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggles the enteringExpireDate flag
|
* Toggles the enteringExpireDate flag
|
||||||
*
|
*
|
||||||
* @param event The event
|
* @param event The event
|
||||||
*/
|
*/
|
||||||
public void enterExpireDate(ActionEvent event)
|
public void enterExpireDate(ActionEvent event)
|
||||||
{
|
{
|
||||||
this.enteringExpireDate = true;
|
this.enteringExpireDate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple structure class to wrap form workflow name and default parameter values
|
* Simple structure class to wrap form workflow name and default parameter values
|
||||||
*/
|
*/
|
||||||
@@ -1161,13 +1158,13 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
private QName type;
|
private QName type;
|
||||||
private String strFilenamePattern;
|
private String strFilenamePattern;
|
||||||
private Pattern filenamePattern;
|
private Pattern filenamePattern;
|
||||||
|
|
||||||
FormWorkflowWrapper(String name, Map<QName, Serializable> params)
|
FormWorkflowWrapper(String name, Map<QName, Serializable> params)
|
||||||
{
|
{
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.params = params;
|
this.params = params;
|
||||||
}
|
}
|
||||||
|
|
||||||
FormWorkflowWrapper(String name, Map<QName, Serializable> params, String filenamePattern)
|
FormWorkflowWrapper(String name, Map<QName, Serializable> params, String filenamePattern)
|
||||||
{
|
{
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@@ -1179,12 +1176,12 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFilenamePattern()
|
public String getFilenamePattern()
|
||||||
{
|
{
|
||||||
return this.strFilenamePattern;
|
return this.strFilenamePattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFilenamePattern(String pattern)
|
public void setFilenamePattern(String pattern)
|
||||||
{
|
{
|
||||||
if (pattern != null)
|
if (pattern != null)
|
||||||
@@ -1213,7 +1210,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean matchesPath(String path)
|
boolean matchesPath(String path)
|
||||||
{
|
{
|
||||||
return (filenamePattern != null &&
|
return (filenamePattern != null &&
|
||||||
@@ -1233,30 +1230,30 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
this.name.equals(((FormWorkflowWrapper)obj).name));
|
this.name.equals(((FormWorkflowWrapper)obj).name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper class to provide UI RichList component getters for an AVM node descriptor
|
* Wrapper class to provide UI RichList component getters for an AVM node descriptor
|
||||||
*/
|
*/
|
||||||
public class ItemWrapper
|
public class ItemWrapper
|
||||||
{
|
{
|
||||||
private static final String rootPath = '/' + JNDIConstants.DIR_DEFAULT_APPBASE;
|
private static final String rootPath = '/' + JNDIConstants.DIR_DEFAULT_APPBASE;
|
||||||
private AVMNodeDescriptor descriptor;
|
private AVMNodeDescriptor descriptor;
|
||||||
|
|
||||||
public ItemWrapper(AVMNodeDescriptor descriptor)
|
public ItemWrapper(AVMNodeDescriptor descriptor)
|
||||||
{
|
{
|
||||||
this.descriptor = descriptor;
|
this.descriptor = descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getExpirable()
|
public boolean getExpirable()
|
||||||
{
|
{
|
||||||
return this.descriptor.isFile() && (this.descriptor.isDeleted() == false);
|
return this.descriptor.isFile() && (this.descriptor.isDeleted() == false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getDeleted()
|
public boolean getDeleted()
|
||||||
{
|
{
|
||||||
return descriptor.isDeleted();
|
return descriptor.isDeleted();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
String result = descriptor.getName();
|
String result = descriptor.getName();
|
||||||
@@ -1266,25 +1263,25 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getModifiedDate()
|
public String getModifiedDate()
|
||||||
{
|
{
|
||||||
return ISO8601DateFormat.format(new Date(descriptor.getModDate()));
|
return ISO8601DateFormat.format(new Date(descriptor.getModDate()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getExpirationDate()
|
public String getExpirationDate()
|
||||||
{
|
{
|
||||||
String expireDate = null;
|
String expireDate = null;
|
||||||
|
|
||||||
Date date = expirationDates.get(this.descriptor.getPath());
|
Date date = expirationDates.get(this.descriptor.getPath());
|
||||||
if (date != null)
|
if (date != null)
|
||||||
{
|
{
|
||||||
expireDate = ISO8601DateFormat.format(date);
|
expireDate = ISO8601DateFormat.format(date);
|
||||||
}
|
}
|
||||||
|
|
||||||
return expireDate;
|
return expireDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription()
|
public String getDescription()
|
||||||
{
|
{
|
||||||
if (descriptor.isDeleted() == false)
|
if (descriptor.isDeleted() == false)
|
||||||
@@ -1297,23 +1294,23 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPath()
|
public String getPath()
|
||||||
{
|
{
|
||||||
return descriptor.getPath().substring(descriptor.getPath().indexOf(rootPath) + rootPath.length());
|
return descriptor.getPath().substring(descriptor.getPath().indexOf(rootPath) + rootPath.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFullPath()
|
public String getFullPath()
|
||||||
{
|
{
|
||||||
return descriptor.getPath();
|
return descriptor.getPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUrl()
|
public String getUrl()
|
||||||
{
|
{
|
||||||
return DownloadContentServlet.generateBrowserURL(
|
return DownloadContentServlet.generateBrowserURL(
|
||||||
AVMNodeConverter.ToNodeRef(-1, descriptor.getPath()), descriptor.getName());
|
AVMNodeConverter.ToNodeRef(-1, descriptor.getPath()), descriptor.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPreviewUrl()
|
public String getPreviewUrl()
|
||||||
{
|
{
|
||||||
ClientConfigElement config = Application.getClientConfig(FacesContext.getCurrentInstance());
|
ClientConfigElement config = Application.getClientConfig(FacesContext.getCurrentInstance());
|
||||||
@@ -1323,7 +1320,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
config.getWCMPort(),
|
config.getWCMPort(),
|
||||||
dns);
|
dns);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AVMNodeDescriptor getDescriptor()
|
public AVMNodeDescriptor getDescriptor()
|
||||||
{
|
{
|
||||||
return this.descriptor;
|
return this.descriptor;
|
||||||
|
Reference in New Issue
Block a user