mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V2.2 to HEAD
8372: Merged V2.1 to V2.2 8314: Merged V2.0 to V2.1 7750: Fix for ACT-475: ContentStoreCleaner causes OutOfMemoryError 8332: Made content URL column larger to accommodate the extra locale info present in 2.1 8334: Build fix: V2.1 tighter on authentication for getTempWriter 8376: Merged V2.1 to V2.2 8325: Fix for AWC-1089 8361: Workaround for WCM-882: All metadata extracters can now handle zero length files git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8497 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -89,7 +89,7 @@ public class CreateWebContentWizard extends CreateContentWizard
|
||||
{
|
||||
private static final long serialVersionUID = -4090370304405270047L;
|
||||
|
||||
private static final Log LOGGER = LogFactory.getLog(CreateWebContentWizard.class);
|
||||
private static final Log logger = LogFactory.getLog(CreateWebContentWizard.class);
|
||||
|
||||
protected String content = null;
|
||||
transient private List<SelectItem> createMimeTypes;
|
||||
@@ -245,8 +245,8 @@ public class CreateWebContentWizard extends CreateContentWizard
|
||||
{
|
||||
public String execute() throws Throwable
|
||||
{
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("reseting layer " + path);
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("reseting layer " + path);
|
||||
|
||||
// call the actual implementation
|
||||
getAvmSyncService().resetLayer(path);
|
||||
@@ -313,8 +313,8 @@ public class CreateWebContentWizard extends CreateContentWizard
|
||||
{
|
||||
if (formInstanceData != null)
|
||||
{
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("clearing form instance data: " + formInstanceData.getPath());
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("clearing form instance data: " + formInstanceData.getPath());
|
||||
|
||||
getAvmService().removeNode(formInstanceData.getPath());
|
||||
}
|
||||
@@ -371,21 +371,24 @@ public class CreateWebContentWizard extends CreateContentWizard
|
||||
diffList.add(new AVMDifference(-1, path, -1, AVMUtil.getCorrespondingPathInMainStore(path), AVMDifference.NEWER));
|
||||
}
|
||||
|
||||
if (LOGGER.isDebugEnabled())
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
for (final AVMDifference diff : diffList)
|
||||
{
|
||||
LOGGER.debug("updating main store with " + diff.getSourcePath());
|
||||
logger.debug("updating main store with " + diff.getSourcePath());
|
||||
}
|
||||
}
|
||||
this.getAvmSyncService().update(diffList, null, true, true, true, true, null, null);
|
||||
for (final AVMDifference diff : diffList)
|
||||
{
|
||||
final String path = diff.getDestinationPath();
|
||||
if (LOGGER.isDebugEnabled())
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
LOGGER.debug("modifying lock on " + path + ". chaging store from "
|
||||
+ this.getAvmLockingService().getLock(AVMUtil.getStoreId(path), AVMUtil.getStoreRelativePath(path)).getStore() + " to " + AVMUtil.getStoreName(path));
|
||||
logger.debug("modifying lock on " + path +
|
||||
". chaging store from " +
|
||||
this.getAvmLockingService().getLock(AVMUtil.getStoreId(path),
|
||||
AVMUtil.getStoreRelativePath(path)).getStore() +
|
||||
" to " + AVMUtil.getStoreName(path));
|
||||
}
|
||||
this.getAvmLockingService().modifyLock(AVMUtil.getStoreId(path), AVMUtil.getStoreRelativePath(path), null, AVMUtil.getStoreName(path), null, null);
|
||||
}
|
||||
@@ -417,15 +420,16 @@ public class CreateWebContentWizard extends CreateContentWizard
|
||||
{
|
||||
// reset all paths and structures to the main store
|
||||
this.createdPath = AVMUtil.getCorrespondingPathInMainStore(this.createdPath);
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("reset path " + this.createdPath + " to main store");
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("reset path " + this.createdPath + " to main store");
|
||||
|
||||
if (MimetypeMap.MIMETYPE_XML.equals(this.mimeType) && this.formName != null)
|
||||
{
|
||||
this.formInstanceData = getFormsService().getFormInstanceData(-1, this.createdPath);
|
||||
this.renditions = this.formInstanceData.getRenditions();
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("reset form instance data " + this.formInstanceData.getName() + " and " + this.renditions.size() + " to main store");
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("reset form instance data " + this.formInstanceData.getName() +
|
||||
" and " + this.renditions.size() + " rendition(s) to main store");
|
||||
}
|
||||
|
||||
return outcome;
|
||||
@@ -455,8 +459,8 @@ public class CreateWebContentWizard extends CreateContentWizard
|
||||
{
|
||||
// get the parent path of the location to save the content
|
||||
String fileName = this.getFileName();
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("saving file content to " + fileName);
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("saving file content to " + fileName);
|
||||
|
||||
final String cwd = AVMUtil.getCorrespondingPathInPreviewStore(this.avmBrowseBean.getCurrentPath());
|
||||
final Form form = (MimetypeMap.MIMETYPE_XML.equals(this.mimeType) ? this.getForm() : null);
|
||||
@@ -470,13 +474,13 @@ public class CreateWebContentWizard extends CreateContentWizard
|
||||
fileName = sb[1];
|
||||
}
|
||||
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("creating all directories in path " + path);
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("creating all directories in path " + path);
|
||||
|
||||
AVMUtil.makeAllDirectories(path);
|
||||
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("creating file " + fileName + " in " + path);
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("creating file " + fileName + " in " + path);
|
||||
|
||||
// put the content of the file into the AVM store
|
||||
try
|
||||
@@ -608,14 +612,14 @@ public class CreateWebContentWizard extends CreateContentWizard
|
||||
final Config wizardCfg = svc.getConfig("Content Wizards");
|
||||
if (wizardCfg == null)
|
||||
{
|
||||
LOGGER.warn("Could not find 'Content Wizards' configuration section");
|
||||
logger.warn("Could not find 'Content Wizards' configuration section");
|
||||
}
|
||||
else
|
||||
{
|
||||
final ConfigElement typesCfg = wizardCfg.getConfigElement("create-mime-types");
|
||||
if (typesCfg == null)
|
||||
{
|
||||
LOGGER.warn("Could not find 'create-mime-types' configuration element");
|
||||
logger.warn("Could not find 'create-mime-types' configuration element");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -24,69 +24,22 @@
|
||||
*/
|
||||
package org.alfresco.web.bean.wcm;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.Serializable;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.event.ValueChangeEvent;
|
||||
import javax.faces.model.SelectItem;
|
||||
|
||||
import org.alfresco.config.Config;
|
||||
import org.alfresco.config.ConfigElement;
|
||||
import org.alfresco.config.ConfigService;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.model.WCMAppModel;
|
||||
import org.alfresco.model.WCMWorkflowModel;
|
||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.workflow.WorkflowModel;
|
||||
import org.alfresco.service.cmr.avm.AVMExistsException;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.cmr.avm.locking.AVMLock;
|
||||
import org.alfresco.service.cmr.avmsync.AVMDifference;
|
||||
import org.alfresco.service.cmr.avmsync.AVMSyncService;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowDefinition;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowPath;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowService;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowTask;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowTaskState;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.content.BaseContentWizard;
|
||||
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.FormInstanceData;
|
||||
import org.alfresco.web.forms.FormNotFoundException;
|
||||
import org.alfresco.web.forms.FormProcessor;
|
||||
import org.alfresco.web.forms.FormsService;
|
||||
import org.alfresco.web.forms.RenderingEngineTemplate;
|
||||
import org.alfresco.web.forms.Rendition;
|
||||
import org.alfresco.web.forms.XMLUtil;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
import org.alfresco.web.ui.common.component.UIListItem;
|
||||
import org.alfresco.web.ui.wcm.component.UIUserSandboxes;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
/**
|
||||
* Bean implementation for the "Edit Web Content Wizard" dialog
|
||||
@@ -95,11 +48,14 @@ public class EditWebContentWizard extends CreateWebContentWizard
|
||||
{
|
||||
private static final long serialVersionUID = 439996926303151006L;
|
||||
|
||||
private static final Log LOGGER = LogFactory.getLog(EditWebContentWizard.class);
|
||||
private static final Log logger = LogFactory.getLog(EditWebContentWizard.class);
|
||||
|
||||
private AVMNode avmNode;
|
||||
private Form form;
|
||||
|
||||
private boolean wasFormLockPresent = false;
|
||||
private boolean wasRenditionLockPresent = false;
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Wizard implementation
|
||||
|
||||
@@ -112,10 +68,10 @@ public class EditWebContentWizard extends CreateWebContentWizard
|
||||
{
|
||||
throw new IllegalArgumentException("Edit Form wizard requires action node context.");
|
||||
}
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
LOGGER.debug("path is " + this.avmNode.getPath());
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("path is " + this.avmNode.getPath());
|
||||
|
||||
this.createdPath = AVMUtil.getCorrespondingPathInPreviewStore(this.avmNode.getPath());
|
||||
this.formInstanceData = this.getFormsService().getFormInstanceData(-1, this.createdPath);
|
||||
final WebProject webProject = new WebProject(this.createdPath);
|
||||
@@ -131,6 +87,46 @@ public class EditWebContentWizard extends CreateWebContentWizard
|
||||
this.content = this.getAvmService().getContentReader(-1, this.createdPath).getContentString();
|
||||
this.fileName = this.formInstanceData.getName();
|
||||
this.mimeType = MimetypeMap.MIMETYPE_XML;
|
||||
this.wasFormLockPresent = false;
|
||||
this.wasRenditionLockPresent = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String cancel()
|
||||
{
|
||||
if (this.formInstanceData != null && this.renditions != null)
|
||||
{
|
||||
if (this.wasFormLockPresent == false)
|
||||
{
|
||||
// there wasn't a lock on the form at the start of the
|
||||
// wizard so remove the one present now
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("removing form instance data lock from " +
|
||||
AVMUtil.getCorrespondingPathInMainStore(this.createdPath) +
|
||||
" as user chose to cancel");
|
||||
|
||||
this.getAvmLockingService().removeLock(AVMUtil.getStoreId(this.createdPath),
|
||||
AVMUtil.getStoreRelativePath(this.createdPath));
|
||||
}
|
||||
|
||||
if (this.wasRenditionLockPresent == false)
|
||||
{
|
||||
// there weren't locks on renditions at the start of
|
||||
// the wizard so remove the ones present now
|
||||
for (Rendition r : this.renditions)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("removing lock from " +
|
||||
AVMUtil.getCorrespondingPathInMainStore(r.getPath()) +
|
||||
" as user chose to cancel");
|
||||
|
||||
this.getAvmLockingService().removeLock(AVMUtil.getStoreId(r.getPath()),
|
||||
AVMUtil.getStoreRelativePath(r.getPath()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return super.cancel();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -149,22 +145,26 @@ public class EditWebContentWizard extends CreateWebContentWizard
|
||||
protected void saveContent()
|
||||
throws Exception
|
||||
{
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
LOGGER.debug("saving " + this.createdPath);
|
||||
}
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("saving " + this.createdPath);
|
||||
|
||||
AVMLock lock = this.getAvmLockingService().getLock(AVMUtil.getStoreId(this.createdPath),
|
||||
AVMUtil.getStoreRelativePath(this.createdPath));
|
||||
if (lock != null)
|
||||
{
|
||||
LOGGER.debug("transferring lock from " + lock.getStore() +
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("transferring lock from " + lock.getStore() +
|
||||
" to " + AVMUtil.getStoreName(this.createdPath));
|
||||
|
||||
this.getAvmLockingService().modifyLock(AVMUtil.getStoreId(this.createdPath),
|
||||
AVMUtil.getStoreRelativePath(this.createdPath),
|
||||
null,
|
||||
AVMUtil.getStoreName(this.createdPath),
|
||||
null,
|
||||
null);
|
||||
|
||||
// set the lock present flag
|
||||
this.wasFormLockPresent = true;
|
||||
}
|
||||
|
||||
final ContentWriter writer = this.getAvmService().getContentWriter(this.createdPath);
|
||||
@@ -179,14 +179,19 @@ public class EditWebContentWizard extends CreateWebContentWizard
|
||||
AVMUtil.getStoreRelativePath(r.getPath()));
|
||||
if (lock != null)
|
||||
{
|
||||
LOGGER.debug("transferring lock from " + lock.getStore() +
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("transferring lock from " + lock.getStore() +
|
||||
" to " + AVMUtil.getStoreName(r.getPath()));
|
||||
|
||||
this.getAvmLockingService().modifyLock(AVMUtil.getStoreId(r.getPath()),
|
||||
AVMUtil.getStoreRelativePath(r.getPath()),
|
||||
null,
|
||||
AVMUtil.getStoreName(r.getPath()),
|
||||
null,
|
||||
null);
|
||||
|
||||
// set the lock present flag
|
||||
this.wasRenditionLockPresent = true;
|
||||
}
|
||||
}
|
||||
final List<FormInstanceData.RegenerateResult> result = this.formInstanceData.regenerateRenditions();
|
||||
@@ -203,19 +208,24 @@ public class EditWebContentWizard extends CreateWebContentWizard
|
||||
{
|
||||
final Rendition r = rr.getRendition();
|
||||
this.renditions.add(r);
|
||||
LOGGER.debug("transferring lock for " + r.getPath() +
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("transferring lock for " + r.getPath() +
|
||||
" back to " + AVMUtil.getCorrespondingMainStoreName(AVMUtil.getStoreName(r.getPath())));
|
||||
|
||||
this.getAvmLockingService().modifyLock(AVMUtil.getStoreId(r.getPath()),
|
||||
AVMUtil.getStoreRelativePath(r.getPath()),
|
||||
null,
|
||||
AVMUtil.getCorrespondingMainStoreName(AVMUtil.getStoreName(r.getPath())),
|
||||
null,
|
||||
null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
LOGGER.debug("transferring form instance data lock back to " +
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("transferring form instance data lock back to " +
|
||||
AVMUtil.getCorrespondingMainStoreName(AVMUtil.getStoreName(this.createdPath)));
|
||||
|
||||
this.getAvmLockingService().modifyLock(AVMUtil.getStoreId(this.createdPath),
|
||||
AVMUtil.getStoreRelativePath(this.createdPath),
|
||||
null,
|
||||
|
Reference in New Issue
Block a user