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,28 +60,37 @@ 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
|
||||||
|
public List<DialogButtonConfig> getAdditionalButtons()
|
||||||
|
{
|
||||||
|
List<DialogButtonConfig> buttons = super.getAdditionalButtons();
|
||||||
|
|
||||||
|
buttons.add(new DialogButtonConfig(ID_PREFIX + "resubmit", null, "task_done_resubmit_all",
|
||||||
|
"#{DialogManager.bean.transitionAndResubmit}", "false", null));
|
||||||
|
|
||||||
|
return buttons;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// ------------------------------------------------------------------------------
|
||||||
* Sets the avm submitted aspect service to use
|
// Event handlers
|
||||||
*
|
|
||||||
* @param avmSubmittedAspect AVMSubmittedAspect instance
|
|
||||||
*/
|
|
||||||
public void setAvmSubmittedAspect(AVMSubmittedAspect avmSubmittedAspect)
|
|
||||||
{
|
|
||||||
this.avmSubmittedAspect = avmSubmittedAspect;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String transition()
|
public String transition()
|
||||||
@@ -129,30 +137,11 @@ 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);
|
||||||
|
|
||||||
// start the submission dialog with the list of paths to submit
|
// re-submit all the items now if requested
|
||||||
if (logger.isDebugEnabled())
|
if (this.doResubmitNow)
|
||||||
logger.debug("starting submit dialog with expired paths: " + submitPaths);
|
{
|
||||||
|
setupSubmitDialog(context, submitPaths, submitNodes);
|
||||||
// get hold of the node ref that represents the web project the expired items
|
}
|
||||||
// belong to and get the name of the users main store
|
|
||||||
NodeRef userStoreNodeRef = (NodeRef)this.nodeService.getProperty(
|
|
||||||
this.workflowPackage, WCMModel.PROP_AVM_DIR_INDIRECTION);
|
|
||||||
String userStoreAvmPath = AVMNodeConverter.ToAVMVersionPath(userStoreNodeRef).getSecond();
|
|
||||||
String userStoreName = AVMUtil.getStoreName(userStoreAvmPath);
|
|
||||||
String stagingStoreName = this.avmService.getStoreProperty(userStoreName,
|
|
||||||
SandboxConstants.PROP_WEBSITE_NAME).getStringValue();
|
|
||||||
NodeRef webProjectRef = AVMUtil.getWebProjectNodeFromStore(stagingStoreName);
|
|
||||||
|
|
||||||
// update the UI context to the web project
|
|
||||||
this.browseBean.clickSpace(webProjectRef);
|
|
||||||
this.avmBrowseBean.setupSandboxAction(userStoreName,
|
|
||||||
Application.getCurrentUser(context).getUserName());
|
|
||||||
|
|
||||||
// setup the context for the submit dialog and initialise it
|
|
||||||
this.avmBrowseBean.setExpiredNodes(submitNodes);
|
|
||||||
Map<String, String> dialogParams = new HashMap<String, String>(1);
|
|
||||||
dialogParams.put(SubmitDialog.PARAM_STARTED_FROM_WORKFLOW, Boolean.TRUE.toString());
|
|
||||||
Application.getDialogManager().setupParameters(dialogParams);
|
|
||||||
|
|
||||||
// signal the default transition to the workflow task
|
// signal the default transition to the workflow task
|
||||||
this.workflowService.endTask(this.task.id, null);
|
this.workflowService.endTask(this.task.id, null);
|
||||||
@@ -160,10 +149,14 @@ public class ManageChangeRequestTaskDialog extends ManageTaskDialog
|
|||||||
// commit the changes
|
// commit the changes
|
||||||
tx.commit();
|
tx.commit();
|
||||||
|
|
||||||
// if we get this far close the task dialog and open the submit dialog
|
// if we get this far close the task dialog
|
||||||
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME +
|
if (this.doResubmitNow)
|
||||||
AlfrescoNavigationHandler.OUTCOME_SEPARATOR +
|
{
|
||||||
AlfrescoNavigationHandler.DIALOG_PREFIX + "submitSandboxItems";
|
// open the submit dialog if re-submitting
|
||||||
|
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME +
|
||||||
|
AlfrescoNavigationHandler.OUTCOME_SEPARATOR +
|
||||||
|
AlfrescoNavigationHandler.DIALOG_PREFIX + "submitSandboxItems";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Throwable e)
|
catch (Throwable e)
|
||||||
{
|
{
|
||||||
@@ -175,4 +168,75 @@ public class ManageChangeRequestTaskDialog extends ManageTaskDialog
|
|||||||
|
|
||||||
return outcome;
|
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
|
||||||
|
if (logger.isDebugEnabled())
|
||||||
|
logger.debug("starting submit dialog with expired paths: " + submitPaths);
|
||||||
|
|
||||||
|
// get hold of the node ref that represents the web project the expired items
|
||||||
|
// belong to and get the name of the users main store
|
||||||
|
NodeRef userStoreNodeRef = (NodeRef)this.nodeService.getProperty(
|
||||||
|
this.workflowPackage, WCMModel.PROP_AVM_DIR_INDIRECTION);
|
||||||
|
String userStoreAvmPath = AVMNodeConverter.ToAVMVersionPath(userStoreNodeRef).getSecond();
|
||||||
|
String userStoreName = AVMUtil.getStoreName(userStoreAvmPath);
|
||||||
|
String stagingStoreName = this.avmService.getStoreProperty(userStoreName,
|
||||||
|
SandboxConstants.PROP_WEBSITE_NAME).getStringValue();
|
||||||
|
NodeRef webProjectRef = AVMUtil.getWebProjectNodeFromStore(stagingStoreName);
|
||||||
|
|
||||||
|
// update the UI context to the web project
|
||||||
|
this.browseBean.clickSpace(webProjectRef);
|
||||||
|
this.avmBrowseBean.setupSandboxAction(userStoreName,
|
||||||
|
Application.getCurrentUser(context).getUserName());
|
||||||
|
|
||||||
|
// setup the context for the submit dialog and initialise it
|
||||||
|
this.avmBrowseBean.setExpiredNodes(submitNodes);
|
||||||
|
Map<String, String> dialogParams = new HashMap<String, String>(1);
|
||||||
|
dialogParams.put(SubmitDialog.PARAM_STARTED_FROM_WORKFLOW, Boolean.TRUE.toString());
|
||||||
|
Application.getDialogManager().setupParameters(dialogParams);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user