mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
. CreateWebContentWizard can now be used to create inline TXT and HTML files again...
. Fix to display of deleted file/folder icons in Submit Dialog git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4575 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -236,9 +236,12 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
// reset all paths and structures to the main store
|
// reset all paths and structures to the main store
|
||||||
this.createdPath = this.createdPath.replaceFirst(AVMConstants.STORE_PREVIEW,
|
this.createdPath = this.createdPath.replaceFirst(AVMConstants.STORE_PREVIEW,
|
||||||
AVMConstants.STORE_MAIN);
|
AVMConstants.STORE_MAIN);
|
||||||
|
boolean form = (MimetypeMap.MIMETYPE_XML.equals(this.mimeType) && this.formName != null);
|
||||||
|
if (form)
|
||||||
|
{
|
||||||
this.formInstanceData = new FormInstanceDataImpl(AVMNodeConverter.ToNodeRef(-1, this.createdPath));
|
this.formInstanceData = new FormInstanceDataImpl(AVMNodeConverter.ToNodeRef(-1, this.createdPath));
|
||||||
this.renditions = this.formInstanceData.getRenditions();
|
this.renditions = this.formInstanceData.getRenditions();
|
||||||
|
}
|
||||||
if (this.startWorkflow)
|
if (this.startWorkflow)
|
||||||
{
|
{
|
||||||
WorkflowDefinition wd = null;
|
WorkflowDefinition wd = null;
|
||||||
@@ -291,10 +294,13 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
String stagingPath = AVMConstants.buildAVMStoreRootPath(this.avmBrowseBean.getStagingStore());
|
String stagingPath = AVMConstants.buildAVMStoreRootPath(this.avmBrowseBean.getStagingStore());
|
||||||
String packagesPath = AVMWorkflowUtil.createAVMLayeredPackage(this.avmService, stagingPath);
|
String packagesPath = AVMWorkflowUtil.createAVMLayeredPackage(this.avmService, stagingPath);
|
||||||
|
|
||||||
|
List<AVMDifference> diffs = new ArrayList<AVMDifference>(8);
|
||||||
// construct diffs for selected items for submission
|
// construct diffs for selected items for submission
|
||||||
String webapp = (String)website.getProperties().get(WCMAppModel.PROP_DEFAULTWEBAPP);
|
String webapp = (String)website.getProperties().get(WCMAppModel.PROP_DEFAULTWEBAPP);
|
||||||
String sandboxPath = AVMConstants.buildAVMStoreRootPath(this.avmBrowseBean.getSandbox());
|
String sandboxPath = AVMConstants.buildAVMStoreRootPath(this.avmBrowseBean.getSandbox());
|
||||||
List<AVMDifference> diffs = new ArrayList<AVMDifference>(8);
|
if (form)
|
||||||
|
{
|
||||||
|
// collect diffs for form data instance and all renditions
|
||||||
for (Rendition rendition : this.getRenditions())
|
for (Rendition rendition : this.getRenditions())
|
||||||
{
|
{
|
||||||
String renditionPath = AVMNodeConverter.ToAVMVersionPath(rendition.getNodeRef()).getSecond();
|
String renditionPath = AVMNodeConverter.ToAVMVersionPath(rendition.getNodeRef()).getSecond();
|
||||||
@@ -312,6 +318,17 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
String destPath = packagesPath + instancePath;
|
String destPath = packagesPath + instancePath;
|
||||||
AVMDifference diff = new AVMDifference(-1, srcPath, -1, destPath, AVMDifference.NEWER);
|
AVMDifference diff = new AVMDifference(-1, srcPath, -1, destPath, AVMDifference.NEWER);
|
||||||
diffs.add(diff);
|
diffs.add(diff);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// diff for txt or html content
|
||||||
|
int webappIndex = this.createdPath.indexOf('/' + webapp);
|
||||||
|
String itemPath = this.createdPath.substring(webappIndex);
|
||||||
|
String srcPath = sandboxPath + itemPath;
|
||||||
|
String destPath = packagesPath + itemPath;
|
||||||
|
AVMDifference diff = new AVMDifference(-1, srcPath, -1, destPath, AVMDifference.NEWER);
|
||||||
|
diffs.add(diff);
|
||||||
|
}
|
||||||
|
|
||||||
// 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, null, null);
|
this.avmSyncService.update(diffs, null, true, true, false, false, null, null);
|
||||||
@@ -323,8 +340,7 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
this.nodeService.setProperty(packageNodeRef, WorkflowModel.PROP_IS_SYSTEM_PACKAGE, true);
|
this.nodeService.setProperty(packageNodeRef, WorkflowModel.PROP_IS_SYSTEM_PACKAGE, true);
|
||||||
parameters.put(WorkflowModel.ASSOC_PACKAGE, packageNodeRef);
|
parameters.put(WorkflowModel.ASSOC_PACKAGE, packageNodeRef);
|
||||||
// TODO: capture label and comment?
|
// TODO: capture label and comment?
|
||||||
// ariel to kev: this.fileName may be inaccurate. use formInstanceData.getName() instead
|
parameters.put(AVMWorkflowUtil.PROP_LABEL, form ? this.formInstanceData.getName() : this.fileName);
|
||||||
parameters.put(AVMWorkflowUtil.PROP_LABEL, this.fileName);
|
|
||||||
parameters.put(AVMWorkflowUtil.PROP_FROM_PATH, AVMConstants.buildAVMStoreRootPath(
|
parameters.put(AVMWorkflowUtil.PROP_FROM_PATH, AVMConstants.buildAVMStoreRootPath(
|
||||||
this.avmBrowseBean.getSandbox()));
|
this.avmBrowseBean.getSandbox()));
|
||||||
|
|
||||||
@@ -396,8 +412,7 @@ public class CreateWebContentWizard extends BaseContentWizard
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
LOGGER.debug("reseting layer " + path.split(":")[0] +
|
LOGGER.debug("reseting layer " + path.split(":")[0] + ":/" + AVMConstants.DIR_APPBASE);
|
||||||
":/" + AVMConstants.DIR_APPBASE);
|
|
||||||
|
|
||||||
this.avmSyncService.resetLayer(path.split(":")[0] + ":/" + AVMConstants.DIR_APPBASE);
|
this.avmSyncService.resetLayer(path.split(":")[0] + ":/" + AVMConstants.DIR_APPBASE);
|
||||||
|
|
||||||
|
@@ -444,12 +444,11 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
{
|
{
|
||||||
// found a generated rendition asset - locate the parent form instance data file
|
// found a generated rendition asset - locate the parent form instance data file
|
||||||
// and use this to find all generated assets that are appropriate
|
// and use this to find all generated assets that are appropriate
|
||||||
// NOTE: this ref will be in the 'preview' store convert back to user store first
|
// NOTE: this path value is store relative
|
||||||
String strFormInstance = (String)this.nodeService.getProperty(
|
String strFormInstance = (String)this.nodeService.getProperty(
|
||||||
ref, WCMAppModel.PROP_PRIMARY_FORM_INSTANCE_DATA);
|
ref, WCMAppModel.PROP_PRIMARY_FORM_INSTANCE_DATA);
|
||||||
strFormInstance = strFormInstance.replaceFirst(AVMConstants.STORE_PREVIEW,
|
strFormInstance = this.avmBrowseBean.getSandbox() + ':' + strFormInstance;
|
||||||
AVMConstants.STORE_MAIN);
|
formInstanceDataRef = AVMNodeConverter.ToNodeRef(-1, strFormInstance);
|
||||||
formInstanceDataRef = new NodeRef(strFormInstance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the form instance data file to the list for submission
|
// add the form instance data file to the list for submission
|
||||||
@@ -674,7 +673,7 @@ public class SubmitDialog extends BaseDialogBean
|
|||||||
|
|
||||||
public String getIcon()
|
public String getIcon()
|
||||||
{
|
{
|
||||||
if (descriptor.isDeletedFile())
|
if (descriptor.isFile() || descriptor.isDeletedFile())
|
||||||
{
|
{
|
||||||
return Utils.getFileTypeImage(descriptor.getName(), true);
|
return Utils.getFileTypeImage(descriptor.getName(), true);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user