mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Minor UI modifications for content launch and expiration following UI walkthrough
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6031 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1068,13 +1068,14 @@ sandbox_no_modified_items=No modified items
|
|||||||
sandbox_no_web_forms=No Web Forms available
|
sandbox_no_web_forms=No Web Forms available
|
||||||
sandbox_my_sandbox=My Sandbox
|
sandbox_my_sandbox=My Sandbox
|
||||||
sandbox_user=User
|
sandbox_user=User
|
||||||
pending_submissions=Pending Submissions
|
pending_submissions=Content Awaiting Launch
|
||||||
no_pending_submissions=No pending submissions
|
no_pending_submissions=No content awaiting launch
|
||||||
pending_preview=Preview Contents
|
pending_preview=Preview Contents
|
||||||
pending_details=View Details
|
pending_details=View Details
|
||||||
pending_diff=Visual Difference
|
pending_diff=Visual Comparison
|
||||||
pending_promote=Submit Now
|
pending_promote=Submit Now
|
||||||
pending_abort=Abort Submission
|
pending_abort=Abort Submission
|
||||||
|
task_done_resubmit_all=Task Done & Re-Submit All
|
||||||
|
|
||||||
# Website actions and dialog messages
|
# Website actions and dialog messages
|
||||||
title_import_content=Web Project Bulk Import
|
title_import_content=Web Project Bulk Import
|
||||||
|
@@ -44,11 +44,10 @@ import org.alfresco.service.namespace.QName;
|
|||||||
import org.alfresco.util.Pair;
|
import org.alfresco.util.Pair;
|
||||||
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.app.servlet.FacesHelper;
|
|
||||||
import org.alfresco.web.bean.repository.Repository;
|
import org.alfresco.web.bean.repository.Repository;
|
||||||
import org.alfresco.web.bean.repository.User;
|
|
||||||
import org.alfresco.web.bean.workflow.ManageTaskDialog;
|
import org.alfresco.web.bean.workflow.ManageTaskDialog;
|
||||||
import org.alfresco.web.bean.workflow.WorkflowUtil;
|
import org.alfresco.web.bean.workflow.WorkflowUtil;
|
||||||
|
import org.alfresco.web.config.DialogsConfigElement.DialogButtonConfig;
|
||||||
import org.alfresco.web.ui.common.Utils;
|
import org.alfresco.web.ui.common.Utils;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
@@ -61,29 +60,38 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
*/
|
*/
|
||||||
public class ManageChangeRequestTaskDialog extends ManageTaskDialog
|
public class ManageChangeRequestTaskDialog extends ManageTaskDialog
|
||||||
{
|
{
|
||||||
|
protected boolean doResubmitNow = false;
|
||||||
protected AVMBrowseBean avmBrowseBean;
|
protected AVMBrowseBean avmBrowseBean;
|
||||||
protected AVMSubmittedAspect avmSubmittedAspect;
|
protected AVMSubmittedAspect avmSubmittedAspect;
|
||||||
|
|
||||||
private final static Log logger = LogFactory.getLog(ManageChangeRequestTaskDialog.class);
|
private final static Log logger = LogFactory.getLog(ManageChangeRequestTaskDialog.class);
|
||||||
|
|
||||||
/**
|
// ------------------------------------------------------------------------------
|
||||||
* @param avmBrowseBean AVMBrowseBean instance
|
// Dialog implementation
|
||||||
*/
|
|
||||||
public void setAvmBrowseBean(AVMBrowseBean avmBrowseBean)
|
@Override
|
||||||
|
public void init(Map<String, String> parameters)
|
||||||
{
|
{
|
||||||
this.avmBrowseBean = avmBrowseBean;
|
super.init(parameters);
|
||||||
|
|
||||||
|
// reset the doResubmit flag
|
||||||
|
this.doResubmitNow = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Sets the avm submitted aspect service to use
|
public List<DialogButtonConfig> getAdditionalButtons()
|
||||||
*
|
|
||||||
* @param avmSubmittedAspect AVMSubmittedAspect instance
|
|
||||||
*/
|
|
||||||
public void setAvmSubmittedAspect(AVMSubmittedAspect avmSubmittedAspect)
|
|
||||||
{
|
{
|
||||||
this.avmSubmittedAspect = avmSubmittedAspect;
|
List<DialogButtonConfig> buttons = super.getAdditionalButtons();
|
||||||
|
|
||||||
|
buttons.add(new DialogButtonConfig(ID_PREFIX + "resubmit", null, "task_done_resubmit_all",
|
||||||
|
"#{DialogManager.bean.transitionAndResubmit}", "false", null));
|
||||||
|
|
||||||
|
return buttons;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
// Event handlers
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String transition()
|
public String transition()
|
||||||
{
|
{
|
||||||
@@ -129,6 +137,83 @@ public class ManageChangeRequestTaskDialog extends ManageTaskDialog
|
|||||||
// update the users main store with the changes from the workflow store
|
// update the users main store with the changes from the workflow store
|
||||||
this.avmSyncService.update(diffs, null, false, false, true, true, null, null);
|
this.avmSyncService.update(diffs, null, false, false, true, true, null, null);
|
||||||
|
|
||||||
|
// re-submit all the items now if requested
|
||||||
|
if (this.doResubmitNow)
|
||||||
|
{
|
||||||
|
setupSubmitDialog(context, submitPaths, submitNodes);
|
||||||
|
}
|
||||||
|
|
||||||
|
// signal the default transition to the workflow task
|
||||||
|
this.workflowService.endTask(this.task.id, null);
|
||||||
|
|
||||||
|
// commit the changes
|
||||||
|
tx.commit();
|
||||||
|
|
||||||
|
// if we get this far close the task dialog
|
||||||
|
if (this.doResubmitNow)
|
||||||
|
{
|
||||||
|
// open the submit dialog if re-submitting
|
||||||
|
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME +
|
||||||
|
AlfrescoNavigationHandler.OUTCOME_SEPARATOR +
|
||||||
|
AlfrescoNavigationHandler.DIALOG_PREFIX + "submitSandboxItems";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Throwable e)
|
||||||
|
{
|
||||||
|
// rollback the transaction
|
||||||
|
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
|
||||||
|
Utils.addErrorMessage(formatErrorMessage(e), e);
|
||||||
|
outcome = this.getErrorOutcome(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return outcome;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event handler for the 'Task Done & Re-Submit All' button
|
||||||
|
*/
|
||||||
|
public String transitionAndResubmit()
|
||||||
|
{
|
||||||
|
this.doResubmitNow = true;
|
||||||
|
return this.transition();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
// Setters
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param avmBrowseBean AVMBrowseBean instance
|
||||||
|
*/
|
||||||
|
public void setAvmBrowseBean(AVMBrowseBean avmBrowseBean)
|
||||||
|
{
|
||||||
|
this.avmBrowseBean = avmBrowseBean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the avm submitted aspect service to use
|
||||||
|
*
|
||||||
|
* @param avmSubmittedAspect AVMSubmittedAspect instance
|
||||||
|
*/
|
||||||
|
public void setAvmSubmittedAspect(AVMSubmittedAspect avmSubmittedAspect)
|
||||||
|
{
|
||||||
|
this.avmSubmittedAspect = avmSubmittedAspect;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
// Helper methods
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Submits all the expired items immediately after the task is completed
|
||||||
|
* by launching the submit dialog with the expired items set as the modified
|
||||||
|
* items
|
||||||
|
*
|
||||||
|
* @param context Faces context
|
||||||
|
* @param submitPaths The list of paths being submitted
|
||||||
|
* @param submitNodes Node desriptor for each node being submitted
|
||||||
|
*/
|
||||||
|
protected void setupSubmitDialog(FacesContext context, List<String> submitPaths,
|
||||||
|
List<AVMNodeDescriptor> submitNodes)
|
||||||
|
{
|
||||||
// start the submission dialog with the list of paths to submit
|
// start the submission dialog with the list of paths to submit
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("starting submit dialog with expired paths: " + submitPaths);
|
logger.debug("starting submit dialog with expired paths: " + submitPaths);
|
||||||
@@ -153,26 +238,5 @@ public class ManageChangeRequestTaskDialog extends ManageTaskDialog
|
|||||||
Map<String, String> dialogParams = new HashMap<String, String>(1);
|
Map<String, String> dialogParams = new HashMap<String, String>(1);
|
||||||
dialogParams.put(SubmitDialog.PARAM_STARTED_FROM_WORKFLOW, Boolean.TRUE.toString());
|
dialogParams.put(SubmitDialog.PARAM_STARTED_FROM_WORKFLOW, Boolean.TRUE.toString());
|
||||||
Application.getDialogManager().setupParameters(dialogParams);
|
Application.getDialogManager().setupParameters(dialogParams);
|
||||||
|
|
||||||
// signal the default transition to the workflow task
|
|
||||||
this.workflowService.endTask(this.task.id, null);
|
|
||||||
|
|
||||||
// commit the changes
|
|
||||||
tx.commit();
|
|
||||||
|
|
||||||
// if we get this far close the task dialog and open the submit dialog
|
|
||||||
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME +
|
|
||||||
AlfrescoNavigationHandler.OUTCOME_SEPARATOR +
|
|
||||||
AlfrescoNavigationHandler.DIALOG_PREFIX + "submitSandboxItems";
|
|
||||||
}
|
|
||||||
catch (Throwable e)
|
|
||||||
{
|
|
||||||
// rollback the transaction
|
|
||||||
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
|
|
||||||
Utils.addErrorMessage(formatErrorMessage(e), e);
|
|
||||||
outcome = this.getErrorOutcome(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return outcome;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user