mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
first pass at add content from xforms ui
- added an add content panel to the file picker which enables browsing the local disk to select content to upload. the file is uploaded without requiring a browser refresh by targeting a hidden iframe. the server response includes a js call which notifies the form that the upload is complete. - added annotations to ajax methods to enable specifying the response mime type of the method. needed for uploadFile which returns html rather than xml - minor cleanup in schemaformbuilder - added mapping between xsl-fo mimetypes and those in mimetype map git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4576 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -84,6 +84,7 @@ public class CreateWebContentWizard extends BaseContentWizard
|
||||
protected FormInstanceData formInstanceData = null;
|
||||
protected boolean formSelectDisabled = false;
|
||||
protected boolean startWorkflow = false;
|
||||
protected String[] uploadedFilePaths = null;
|
||||
|
||||
/** AVM service bean reference */
|
||||
protected AVMService avmService;
|
||||
@@ -144,6 +145,7 @@ public class CreateWebContentWizard extends BaseContentWizard
|
||||
this.formName = null;
|
||||
this.mimeType = MimetypeMap.MIMETYPE_XML;
|
||||
this.formInstanceData = null;
|
||||
this.uploadedFilePaths = null;
|
||||
this.renditions = null;
|
||||
this.startWorkflow = false;
|
||||
|
||||
@@ -161,6 +163,14 @@ public class CreateWebContentWizard extends BaseContentWizard
|
||||
this.formSelectDisabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
// reset the preview layer
|
||||
String path = this.avmBrowseBean.getCurrentPath();
|
||||
path = path.replaceFirst(AVMConstants.STORE_MAIN, AVMConstants.STORE_PREVIEW);
|
||||
path = path.split(":")[0] + ":/" + AVMConstants.DIR_APPBASE;
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("reseting layer " + path);
|
||||
this.avmSyncService.resetLayer(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -190,6 +200,7 @@ public class CreateWebContentWizard extends BaseContentWizard
|
||||
{
|
||||
LOGGER.debug("clearing form instance data");
|
||||
this.formInstanceData = null;
|
||||
this.uploadedFilePaths = null;
|
||||
this.renditions = null;
|
||||
}
|
||||
return super.back();
|
||||
@@ -231,6 +242,23 @@ public class CreateWebContentWizard extends BaseContentWizard
|
||||
AVMConstants.STORE_MAIN),
|
||||
AVMDifference.NEWER));
|
||||
}
|
||||
|
||||
for (String path : this.uploadedFilePaths)
|
||||
{
|
||||
diffList.add(new AVMDifference(-1, path,
|
||||
-1, path.replaceFirst(AVMConstants.STORE_PREVIEW,
|
||||
AVMConstants.STORE_MAIN),
|
||||
AVMDifference.NEWER));
|
||||
}
|
||||
|
||||
if (LOGGER.isDebugEnabled())
|
||||
{
|
||||
for (AVMDifference diff : diffList)
|
||||
{
|
||||
LOGGER.debug("updating " + AVMConstants.STORE_MAIN +
|
||||
" with " + diff.getSourcePath());
|
||||
}
|
||||
}
|
||||
this.avmSyncService.update(diffList, null, true, true, true, true, null, null);
|
||||
|
||||
// reset all paths and structures to the main store
|
||||
@@ -411,11 +439,6 @@ public class CreateWebContentWizard extends BaseContentWizard
|
||||
fileName = sb[1];
|
||||
}
|
||||
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("reseting layer " + path.split(":")[0] + ":/" + AVMConstants.DIR_APPBASE);
|
||||
|
||||
this.avmSyncService.resetLayer(path.split(":")[0] + ":/" + AVMConstants.DIR_APPBASE);
|
||||
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("creating all directories in path " + path);
|
||||
|
||||
@@ -577,7 +600,7 @@ public class CreateWebContentWizard extends BaseContentWizard
|
||||
{
|
||||
private final FormsService ts = FormsService.getInstance();
|
||||
|
||||
public Document getContent()
|
||||
public Document load()
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -591,9 +614,11 @@ public class CreateWebContentWizard extends BaseContentWizard
|
||||
}
|
||||
}
|
||||
|
||||
public void setContent(final Document d)
|
||||
public void save(final Document d,
|
||||
final String[] uploadedFilePaths)
|
||||
{
|
||||
CreateWebContentWizard.this.setContent(ts.writeXMLToString(d));
|
||||
CreateWebContentWizard.this.uploadedFilePaths = uploadedFilePaths;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user