mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)
78438: Merged EOL (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud) 77695: ACE-2149 - EOL AVM / WCM. Ripped WCM out of Explorer. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@82564 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -102,7 +102,6 @@ public class AdminNodeBrowseBean implements Serializable
|
||||
transient private DataModel assocs = null;
|
||||
transient private DataModel permissions = null;
|
||||
transient private DataModel permissionMasks = null;
|
||||
transient private DataModel avmStoreProps = null;
|
||||
|
||||
// supporting repository services
|
||||
transient private TransactionService transactionService;
|
||||
@@ -111,8 +110,6 @@ public class AdminNodeBrowseBean implements Serializable
|
||||
transient private SearchService searchService;
|
||||
transient private NamespaceService namespaceService;
|
||||
transient private PermissionService permissionService;
|
||||
// // WCM
|
||||
// transient private AVMService avmService;
|
||||
|
||||
/**
|
||||
* @param transactionService transaction service
|
||||
@@ -216,24 +213,6 @@ public class AdminNodeBrowseBean implements Serializable
|
||||
return permissionService;
|
||||
}
|
||||
|
||||
// // WCM
|
||||
// /**
|
||||
// * @param avmService AVM service
|
||||
// */
|
||||
// public void setAVMService(AVMService avmService)
|
||||
// {
|
||||
// this.avmService = avmService;
|
||||
// }
|
||||
//
|
||||
// private AVMService getAVMService()
|
||||
// {
|
||||
// if (avmService == null)
|
||||
// {
|
||||
// avmService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getAVMService();
|
||||
// }
|
||||
// return avmService;
|
||||
// }
|
||||
//
|
||||
/**
|
||||
* Gets the list of repository stores
|
||||
*
|
||||
@@ -424,18 +403,9 @@ public class AdminNodeBrowseBean implements Serializable
|
||||
{
|
||||
if (permissionMasks == null)
|
||||
{
|
||||
// // WCM
|
||||
// if (nodeRef.getStoreRef().getProtocol().equals(StoreRef.PROTOCOL_AVM))
|
||||
// {
|
||||
// List<AccessPermission> nodePermissions = new ArrayList<AccessPermission>(getPermissionService().getAllSetPermissions(nodeRef.getStoreRef()));
|
||||
// permissionMasks = new ListDataModel(nodePermissions);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
List<NoStoreMask> noReadPermissions = new ArrayList<NoStoreMask>(1);
|
||||
noReadPermissions.add(new NoStoreMask());
|
||||
permissionMasks = new ListDataModel(noReadPermissions);
|
||||
// }
|
||||
List<NoStoreMask> noReadPermissions = new ArrayList<NoStoreMask>(1);
|
||||
noReadPermissions.add(new NoStoreMask());
|
||||
permissionMasks = new ListDataModel(noReadPermissions);
|
||||
}
|
||||
return permissionMasks;
|
||||
}
|
||||
@@ -476,43 +446,6 @@ public class AdminNodeBrowseBean implements Serializable
|
||||
}
|
||||
return assocs;
|
||||
}
|
||||
//
|
||||
// // WCM
|
||||
// public boolean getInAVMStore()
|
||||
// {
|
||||
// return nodeRef.getStoreRef().getProtocol().equals(StoreRef.PROTOCOL_AVM);
|
||||
// }
|
||||
//
|
||||
// // WCM
|
||||
// public DataModel getAVMStoreProperties()
|
||||
// {
|
||||
// if (avmStoreProps == null)
|
||||
// {
|
||||
// // work out the store name from current nodeRef
|
||||
// String store = nodeRef.getStoreRef().getIdentifier();
|
||||
// Map<QName, PropertyValue> props = getAVMService().getStoreProperties(store);
|
||||
// List<Map<String, String>> storeProperties = new ArrayList<Map<String, String>>();
|
||||
//
|
||||
// for (Map.Entry<QName, PropertyValue> property : props.entrySet())
|
||||
// {
|
||||
// Map<String, String> map = new HashMap<String, String>(2);
|
||||
// map.put("name", property.getKey().toString());
|
||||
// map.put("type", property.getValue().getActualTypeString());
|
||||
// String val = property.getValue().getStringValue();
|
||||
// if (val == null)
|
||||
// {
|
||||
// val = "null";
|
||||
// }
|
||||
// map.put("value", val);
|
||||
//
|
||||
// storeProperties.add(map);
|
||||
// }
|
||||
//
|
||||
// avmStoreProps = new ListDataModel(storeProperties);
|
||||
// }
|
||||
//
|
||||
// return avmStoreProps;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Gets the current query language
|
||||
@@ -585,8 +518,6 @@ public class AdminNodeBrowseBean implements Serializable
|
||||
NodeRef rootNode = getNodeService().getRootNode(storeRef);
|
||||
setNodeRef(rootNode);
|
||||
|
||||
this.avmStoreProps = null;
|
||||
|
||||
return "success";
|
||||
}
|
||||
|
||||
|
@@ -59,9 +59,6 @@ abstract class AbstractClipboardItem implements ClipboardItem
|
||||
private QName type;
|
||||
private String icon;
|
||||
|
||||
// // WCM
|
||||
// transient protected AVMService avmService;
|
||||
//
|
||||
private List<String> customPasteViewIds;
|
||||
|
||||
|
||||
@@ -93,21 +90,6 @@ abstract class AbstractClipboardItem implements ClipboardItem
|
||||
this.customPasteViewIds = customPasteViewIds;
|
||||
}
|
||||
|
||||
// // WCM
|
||||
// public void setAvmService(AVMService avmService)
|
||||
// {
|
||||
// this.avmService = avmService;
|
||||
// }
|
||||
//
|
||||
// protected AVMService getAvmService()
|
||||
// {
|
||||
// if (avmService == null)
|
||||
// {
|
||||
// avmService = getServiceRegistry().getAVMLockingAwareService();
|
||||
// }
|
||||
// return avmService;
|
||||
// }
|
||||
//
|
||||
public ClipboardStatus getMode()
|
||||
{
|
||||
return this.mode;
|
||||
@@ -226,29 +208,4 @@ abstract class AbstractClipboardItem implements ClipboardItem
|
||||
|
||||
return (nodeRefs.size() != 0);
|
||||
}
|
||||
//
|
||||
// // WCM
|
||||
// protected void recursiveFormCheck(AVMNodeDescriptor desc)
|
||||
// {
|
||||
// if (desc.isFile())
|
||||
// {
|
||||
// String filePath = desc.getPath();
|
||||
// if (avmService.hasAspect(-1, filePath, WCMAppModel.ASPECT_FORM_INSTANCE_DATA))
|
||||
// {
|
||||
// avmService.removeAspect(filePath, WCMAppModel.ASPECT_FORM_INSTANCE_DATA);
|
||||
// }
|
||||
// if (avmService.hasAspect(-1, filePath, WCMAppModel.ASPECT_RENDITION))
|
||||
// {
|
||||
// avmService.removeAspect(filePath, WCMAppModel.ASPECT_RENDITION);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Map<String, AVMNodeDescriptor> listing = getAvmService().getDirectoryListing(desc);
|
||||
// for (Map.Entry<String, AVMNodeDescriptor> entry : listing.entrySet())
|
||||
// {
|
||||
// recursiveFormCheck(entry.getValue());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
@@ -330,16 +330,6 @@ public class ClipboardBean implements Serializable
|
||||
{
|
||||
item = new WorkspaceClipboardItem(ref, parent, mode, customPasteViewIds);
|
||||
}
|
||||
// // WCM
|
||||
// else if (StoreRef.PROTOCOL_AVM.equals(ref.getStoreRef().getProtocol()))
|
||||
// {
|
||||
// item = new AVMClipboardItem(ref, mode, customPasteViewIds);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// logger.warn("Unable to add item to clipboard - unknown store protocol: " + ref.getStoreRef().getProtocol());
|
||||
// }
|
||||
//
|
||||
if (item != null)
|
||||
{
|
||||
// check for duplicates first
|
||||
@@ -364,8 +354,6 @@ public class ClipboardBean implements Serializable
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
if (Application.getClientConfig(context).isClipboardStatusVisible())
|
||||
{
|
||||
// // WCM
|
||||
// String pattern = Application.getMessage(context, StoreRef.PROTOCOL_AVM.equals(ref.getStoreRef().getProtocol()) ? "node_added_clipboard_avm" : "node_added_clipboard");
|
||||
String pattern = Application.getMessage(context, "node_added_clipboard");
|
||||
String msg = MessageFormat.format(pattern, items.size());
|
||||
FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
|
||||
|
@@ -55,7 +55,6 @@ public class WorkspaceClipboardItem extends AbstractClipboardItem
|
||||
private static final long serialVersionUID = -1686557602737846009L;
|
||||
|
||||
private static final String WORKSPACE_PASTE_VIEW_ID = "/jsp/browse/browse.jsp";
|
||||
// private static final String AVM_PASTE_VIEW_ID = "/jsp/wcm/browse-sandbox.jsp"; // WCM
|
||||
private static final String FORUMS_PASTE_VIEW_ID = "/jsp/forums/forums.jsp";
|
||||
private static final String FORUM_PASTE_VIEW_ID = "/jsp/forums/forum.jsp";
|
||||
|
||||
@@ -96,24 +95,8 @@ public class WorkspaceClipboardItem extends AbstractClipboardItem
|
||||
*/
|
||||
public boolean canCopyToViewId(String viewId)
|
||||
{
|
||||
// // WCM
|
||||
// if (AVM_PASTE_VIEW_ID.equals(viewId))
|
||||
// {
|
||||
// AVMBrowseBean avmBrowseBean = (AVMBrowseBean)FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), AVMBrowseBean.BEAN_NAME);
|
||||
// String destPath = avmBrowseBean.getCurrentPath();
|
||||
//
|
||||
// if (WCMUtil.isStagingStore(WCMUtil.getStoreName(destPath)))
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// return true;
|
||||
// }
|
||||
// else
|
||||
{
|
||||
return super.canCopyToViewId(viewId) || (WORKSPACE_PASTE_VIEW_ID.equals(viewId) || /*AVM_PASTE_VIEW_ID.equals(viewId) || WCM */
|
||||
FORUMS_PASTE_VIEW_ID.equals(viewId) || FORUM_PASTE_VIEW_ID.equals(viewId));
|
||||
}
|
||||
return super.canCopyToViewId(viewId) || (WORKSPACE_PASTE_VIEW_ID.equals(viewId) ||
|
||||
FORUMS_PASTE_VIEW_ID.equals(viewId) || FORUM_PASTE_VIEW_ID.equals(viewId));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -121,8 +104,8 @@ public class WorkspaceClipboardItem extends AbstractClipboardItem
|
||||
*/
|
||||
public boolean canMoveToViewId(String viewId)
|
||||
{
|
||||
return super.canMoveToViewId(viewId) || (WORKSPACE_PASTE_VIEW_ID.equals(viewId) || FORUMS_PASTE_VIEW_ID.equals(viewId) ||
|
||||
FORUM_PASTE_VIEW_ID.equals(viewId));
|
||||
return super.canMoveToViewId(viewId) || (WORKSPACE_PASTE_VIEW_ID.equals(viewId) || FORUMS_PASTE_VIEW_ID.equals(viewId) ||
|
||||
FORUM_PASTE_VIEW_ID.equals(viewId));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -346,75 +329,6 @@ public class WorkspaceClipboardItem extends AbstractClipboardItem
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// // WCM
|
||||
// else if (AVM_PASTE_VIEW_ID.equals(viewId))
|
||||
// {
|
||||
// AVMBrowseBean avmBrowseBean = (AVMBrowseBean)FacesHelper.getManagedBean(fc, AVMBrowseBean.BEAN_NAME);
|
||||
//
|
||||
// final String destPath = avmBrowseBean.getCurrentPath();
|
||||
// final NodeRef destRef = AVMNodeConverter.ToNodeRef(-1, destPath);
|
||||
//
|
||||
// final CrossRepositoryCopyService crossRepoCopyService = getServiceRegistry().getCrossRepositoryCopyService();
|
||||
//
|
||||
// // initial name to attempt the copy of the item with
|
||||
// String name = getName();
|
||||
//
|
||||
// for(;;)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// final String currentName = name;
|
||||
//
|
||||
// // attempt each copy/paste in its own transaction
|
||||
// retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback<Void>()
|
||||
// {
|
||||
// public Void execute() throws Throwable
|
||||
// {
|
||||
// if (getMode() == ClipboardStatus.COPY)
|
||||
// {
|
||||
// // COPY operation
|
||||
// if (logger.isDebugEnabled())
|
||||
// logger.debug("Attempting to copy node: " + getNodeRef() + " into node ID: " + destRef.toString());
|
||||
//
|
||||
// // inter-store copy operation
|
||||
// crossRepoCopyService.copy(getNodeRef(), destRef, currentName);
|
||||
//
|
||||
// if (destRef.getStoreRef().getProtocol().equals(StoreRef.PROTOCOL_AVM))
|
||||
// {
|
||||
// // ETHREEOH-2110
|
||||
// AVMNodeDescriptor desc = getAvmService().lookup(-1, destPath + "/" + currentName);
|
||||
// recursiveFormCheck(desc);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // this should not occur as the canMoveToViewId() will return false
|
||||
// throw new Exception("Move operation not supported between stores.");
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// // We got here without error, so no need to loop with a new name
|
||||
// break;
|
||||
// }
|
||||
// catch (FileExistsException fileExistsErr)
|
||||
// {
|
||||
// // If mode is COPY, have another go around the loop with a new name
|
||||
// if (getMode() == ClipboardStatus.COPY)
|
||||
// {
|
||||
// String copyOf = Application.getMessage(fc, MSG_COPY_OF);
|
||||
// name = copyOf + ' ' + name;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // we should not rename an item when it is being moved - so exit
|
||||
// throw fileExistsErr;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
else
|
||||
{
|
||||
return false;
|
||||
|
@@ -317,24 +317,7 @@ public class CheckinCheckoutDialog extends BaseDialogBean
|
||||
{
|
||||
boolean editingInline = false;
|
||||
Node node = setupContentDocument(id);
|
||||
|
||||
// // WCM
|
||||
// if (node.hasAspect(WCMAppModel.ASPECT_FORM_INSTANCE_DATA))
|
||||
// {
|
||||
// editingInline = true;
|
||||
//
|
||||
// // editable form document
|
||||
// FacesContext fc = FacesContext.getCurrentInstance();
|
||||
// this.navigator.setupDispatchContext(node);
|
||||
//
|
||||
// // TODO - rename editContent Wizard since it only deals with editing form content
|
||||
// fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "wizard:editContent");
|
||||
// }
|
||||
//
|
||||
// // detect the inline editing aspect to see which edit mode to use
|
||||
// else if (node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) &&
|
||||
// node.getProperties().get(ApplicationModel.PROP_EDITINLINE) != null &&
|
||||
// ((Boolean)node.getProperties().get(ApplicationModel.PROP_EDITINLINE)).booleanValue() == true)
|
||||
|
||||
if (node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) &&
|
||||
node.getProperties().get(ApplicationModel.PROP_EDITINLINE) != null &&
|
||||
((Boolean)node.getProperties().get(ApplicationModel.PROP_EDITINLINE)).booleanValue() == true)
|
||||
|
@@ -18,11 +18,8 @@
|
||||
*/
|
||||
package org.alfresco.web.bean.content;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
@@ -31,30 +28,21 @@ import javax.faces.context.FacesContext;
|
||||
import javax.faces.event.ValueChangeEvent;
|
||||
import javax.faces.model.SelectItem;
|
||||
|
||||
import org.springframework.extensions.config.Config;
|
||||
import org.springframework.extensions.config.ConfigElement;
|
||||
import org.springframework.extensions.config.ConfigService;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.service.cmr.model.FileExistsException;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.alfresco.web.data.IDataContainer;
|
||||
import org.alfresco.web.data.QuickSort;
|
||||
import org.alfresco.web.forms.Form;
|
||||
import org.alfresco.web.forms.FormNotFoundException;
|
||||
import org.alfresco.web.forms.FormProcessor;
|
||||
import org.alfresco.web.forms.FormsService;
|
||||
import org.alfresco.util.XMLUtil;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.w3c.dom.Document;
|
||||
import org.springframework.extensions.config.Config;
|
||||
import org.springframework.extensions.config.ConfigElement;
|
||||
import org.springframework.extensions.config.ConfigService;
|
||||
|
||||
/**
|
||||
* Bean implementation for the "Create Content Wizard" dialog
|
||||
@@ -68,35 +56,9 @@ public class CreateContentWizard extends BaseContentWizard
|
||||
protected String content = null;
|
||||
protected List<SelectItem> createMimeTypes;
|
||||
|
||||
transient protected FormsService formsService;
|
||||
protected String formName;
|
||||
protected FormProcessor.Session formProcessorSession = null;
|
||||
transient protected Document instanceDataDocument = null;
|
||||
|
||||
private static Log logger = LogFactory.getLog(CreateContentWizard.class);
|
||||
|
||||
|
||||
/**
|
||||
* @param formsService The FormsService to set.
|
||||
*/
|
||||
public void setFormsService(final FormsService formsService)
|
||||
{
|
||||
this.formsService = formsService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the formsService
|
||||
*/
|
||||
private FormsService getFormsService()
|
||||
{
|
||||
//check for null for cluster environment
|
||||
if (formsService == null)
|
||||
{
|
||||
formsService = (FormsService) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "FormsService");
|
||||
}
|
||||
return formsService;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Wizard implementation
|
||||
|
||||
@@ -104,25 +66,8 @@ public class CreateContentWizard extends BaseContentWizard
|
||||
@Override
|
||||
public String finish()
|
||||
{
|
||||
// if a form is entered, then save the form instance data as XML ...
|
||||
if (this.instanceDataDocument != null)
|
||||
{
|
||||
this.content = XMLUtil.toString(this.instanceDataDocument, true);
|
||||
|
||||
this.mimeType = MimetypeMap.MIMETYPE_XML; // belts & braces - override mimetype (in case is not set to XML)
|
||||
}
|
||||
|
||||
String result = super.finish();
|
||||
|
||||
// // WCM
|
||||
// if ((super.createdNode != null) && (this.instanceDataDocument != null))
|
||||
// {
|
||||
// final Map<QName, Serializable> props = new HashMap<QName, Serializable>(1, 1.0f);
|
||||
// props.put(WCMAppModel.PROP_PARENT_FORM_NAME, getFormName());
|
||||
// props.put(WCMAppModel.PROP_ORIGINAL_PARENT_PATH, "");
|
||||
// getNodeService().addAspect(super.createdNode, WCMAppModel.ASPECT_FORM_INSTANCE_DATA, props);
|
||||
// }
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -144,14 +89,6 @@ public class CreateContentWizard extends BaseContentWizard
|
||||
this.content = null;
|
||||
this.inlineEdit = true;
|
||||
this.mimeType = MimetypeMap.MIMETYPE_HTML;
|
||||
this.formName = "";
|
||||
|
||||
this.instanceDataDocument = null;
|
||||
if (this.formProcessorSession != null)
|
||||
{
|
||||
this.formProcessorSession.destroy();
|
||||
}
|
||||
this.formProcessorSession = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -299,11 +236,6 @@ public class CreateContentWizard extends BaseContentWizard
|
||||
{
|
||||
ResourceBundle bundle = Application.getBundle(FacesContext.getCurrentInstance());
|
||||
|
||||
if (this.instanceDataDocument != null)
|
||||
{
|
||||
this.mimeType = MimetypeMap.MIMETYPE_XML; // belts & braces - override mimetype (in case is not set to XML)
|
||||
}
|
||||
|
||||
// TODO: show first few lines of content here?
|
||||
return buildSummary(
|
||||
new String[] {bundle.getString("file_name"),
|
||||
@@ -313,81 +245,6 @@ public class CreateContentWizard extends BaseContentWizard
|
||||
getSummaryMimeType(this.mimeType)});
|
||||
}
|
||||
|
||||
/**
|
||||
* @return List of UI items to represent the full list of available ECM Forms
|
||||
*/
|
||||
public List<SelectItem> getFormsList()
|
||||
{
|
||||
Collection<Form> forms = this.getFormsService().getForms();
|
||||
List<SelectItem> items = new ArrayList<SelectItem>(forms.size()+1);
|
||||
items.add(new SelectItem("", ""));
|
||||
for (Form form : forms)
|
||||
{
|
||||
items.add(new SelectItem(form.getName(), form.getTitle()));
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
public String getFormName()
|
||||
{
|
||||
return this.formName;
|
||||
}
|
||||
|
||||
public void setFormName(String formName)
|
||||
{
|
||||
this.formName = formName;
|
||||
}
|
||||
|
||||
public Form getForm() throws FormNotFoundException
|
||||
{
|
||||
return (this.getFormName() != null
|
||||
? getFormsService().getForm(formName)
|
||||
: null);
|
||||
}
|
||||
|
||||
public FormProcessor.Session getFormProcessorSession()
|
||||
{
|
||||
return this.formProcessorSession;
|
||||
}
|
||||
|
||||
public void setFormProcessorSession(final FormProcessor.Session formProcessorSession)
|
||||
{
|
||||
this.formProcessorSession = formProcessorSession;
|
||||
}
|
||||
|
||||
public Document getInstanceDataDocument()
|
||||
{
|
||||
if (this.instanceDataDocument == null)
|
||||
{
|
||||
final String content = this.getContent();
|
||||
try
|
||||
{
|
||||
this.instanceDataDocument = (content != null
|
||||
? XMLUtil.parse(content)
|
||||
: XMLUtil.newDocument());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Utils.addErrorMessage("error parsing document", e);
|
||||
this.instanceDataDocument = XMLUtil.newDocument();
|
||||
}
|
||||
}
|
||||
return this.instanceDataDocument;
|
||||
}
|
||||
|
||||
/** Overrides in order to strip an xml extension if the user entered it */
|
||||
// TODO do we need ? it is currently referenced in create-forms.jsp (copied from wcm create-xml.jsp)
|
||||
@Override
|
||||
public String getFileName()
|
||||
{
|
||||
final String result = super.getFileName();
|
||||
return (result != null &&
|
||||
MimetypeMap.MIMETYPE_XML.equals(this.mimeType) &&
|
||||
this.getFormName() != null &&
|
||||
"xml".equals(FilenameUtils.getExtension(result).toLowerCase())
|
||||
? FilenameUtils.removeExtension(result)
|
||||
: result);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Action event handlers
|
||||
|
@@ -28,9 +28,6 @@ import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.forms.Form;
|
||||
import org.alfresco.web.forms.FormNotFoundException;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
|
||||
/**
|
||||
* Bean implementation for the "Edit Content Wizard" dialog
|
||||
@@ -40,7 +37,6 @@ public class EditContentWizard extends CreateContentWizard
|
||||
private static final long serialVersionUID = 1640754719164511019L;
|
||||
|
||||
private NodeRef nodeRef;
|
||||
private Form form;
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Wizard implementation
|
||||
@@ -48,7 +44,6 @@ public class EditContentWizard extends CreateContentWizard
|
||||
@Override
|
||||
public void init(final Map<String, String> parameters)
|
||||
{
|
||||
// TODO - currently assumes this is form content
|
||||
super.init(parameters);
|
||||
Node node = this.navigator.getDispatchContextNode();
|
||||
if (node == null)
|
||||
@@ -56,17 +51,6 @@ public class EditContentWizard extends CreateContentWizard
|
||||
throw new IllegalArgumentException("Edit Form wizard requires action node context.");
|
||||
}
|
||||
this.nodeRef = node.getNodeRef();
|
||||
try
|
||||
{
|
||||
// // WCM
|
||||
// formName = (String)getNodeService().getProperty(nodeRef, WCMAppModel.PROP_PARENT_FORM_NAME); // getFormName() ...
|
||||
form = formsService.getForm(this.formName);
|
||||
}
|
||||
catch (FormNotFoundException fnfe)
|
||||
{
|
||||
Utils.addErrorMessage(fnfe.getMessage(), fnfe);
|
||||
throw new IllegalArgumentException(fnfe);
|
||||
}
|
||||
|
||||
this.content = this.getContentService().getReader(nodeRef, ContentModel.PROP_CONTENT).getContentString();
|
||||
|
||||
@@ -92,10 +76,4 @@ public class EditContentWizard extends CreateContentWizard
|
||||
{
|
||||
return outcome;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Form getForm()
|
||||
{
|
||||
return this.form;
|
||||
}
|
||||
}
|
||||
|
@@ -84,7 +84,6 @@ public class StartWorkflowWizard extends BaseWizardBean
|
||||
transient protected List<SelectItem> availableWorkflows;
|
||||
transient private Map<String, WorkflowDefinition> workflows;
|
||||
|
||||
protected List<String> wcmWorkflows;
|
||||
protected List<String> excludedWorkflows;
|
||||
protected List<String> invitationWorkflows;
|
||||
protected List<String> publishingWorkflows;
|
||||
@@ -570,9 +569,6 @@ public class StartWorkflowWizard extends BaseWizardBean
|
||||
this.availableWorkflows = new ArrayList<SelectItem>(4);
|
||||
this.workflows = new HashMap<String, WorkflowDefinition>(4);
|
||||
|
||||
// get the list of configured WCM workflows and filter these from
|
||||
// the list as these workflows are specific to WCM functionality and AVM stores
|
||||
List<String> configuredWcmWorkflows = this.getWCMWorkflowNames();
|
||||
List<String> configuredInvitationWorkflows = this.getInvitationServiceWorkflowNames();
|
||||
List<String> publishingWorkflows = this.getPublishingWorkflowNames();
|
||||
List<String> excludedWorkflows = this.getExcludedWorkflows();
|
||||
@@ -582,8 +578,7 @@ public class StartWorkflowWizard extends BaseWizardBean
|
||||
{
|
||||
String name = workflowDef.name;
|
||||
|
||||
if (configuredWcmWorkflows.contains(name) == false &&
|
||||
configuredInvitationWorkflows.contains(name) == false &&
|
||||
if (configuredInvitationWorkflows.contains(name) == false &&
|
||||
publishingWorkflows.contains(name) == false &&
|
||||
excludedWorkflows.contains(name) == false)
|
||||
{
|
||||
@@ -736,63 +731,6 @@ public class StartWorkflowWizard extends BaseWizardBean
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Names of the WCM workflows.
|
||||
*
|
||||
* @return The names of the WCM workflows.
|
||||
*/
|
||||
protected List<String> getWCMWorkflowNames()
|
||||
{
|
||||
if ((wcmWorkflows == null) || (Application.isDynamicConfig(FacesContext.getCurrentInstance())))
|
||||
{
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
ConfigElement config = Application.getConfigService(fc).getGlobalConfig().getConfigElement("wcm");
|
||||
if (config != null)
|
||||
{
|
||||
// get the main WCM workflows
|
||||
ConfigElement workflowConfig = config.getChild("workflows");
|
||||
if (workflowConfig != null)
|
||||
{
|
||||
StringTokenizer t = new StringTokenizer(workflowConfig.getValue().trim(), ", ");
|
||||
wcmWorkflows = new ArrayList<String>(t.countTokens());
|
||||
while (t.hasMoreTokens())
|
||||
{
|
||||
String wfName = "jbpm$" + t.nextToken();
|
||||
wcmWorkflows.add(wfName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logger.isWarnEnabled())
|
||||
logger.warn("WARNING: Unable to find WCM 'workflows' config element definition.");
|
||||
}
|
||||
|
||||
// get the admin WCM workflows
|
||||
ConfigElement adminWorkflowConfig = config.getChild("admin-workflows");
|
||||
if (adminWorkflowConfig != null)
|
||||
{
|
||||
StringTokenizer t = new StringTokenizer(adminWorkflowConfig.getValue().trim(), ", ");
|
||||
while (t.hasMoreTokens())
|
||||
{
|
||||
String wfName = "jbpm$" + t.nextToken();
|
||||
wcmWorkflows.add(wfName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logger.isWarnEnabled())
|
||||
logger.warn("WARNING: Unable to find WCM 'admin-workflows' config element definition.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.warn("WARNING: Unable to find 'wcm' config element definition.");
|
||||
}
|
||||
}
|
||||
|
||||
return wcmWorkflows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Names of globally excluded workflow-names.
|
||||
*
|
||||
|
Reference in New Issue
Block a user