Merged V2.0 to HEAD

5497: cwd variable and forminstancedata
   5512: AR-1303 MLPropertyInterceptor
   5527: CIFS invalid characters


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5543 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-04-25 02:13:55 +00:00
parent 77656d03e1
commit 58bb2adc27
6 changed files with 66 additions and 13 deletions

View File

@@ -21,6 +21,7 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import javax.faces.context.FacesContext;
@@ -590,12 +591,44 @@ public class AVMEditBean
if (LOGGER.isDebugEnabled())
LOGGER.debug("regenerating renditions of " + fid);
String originalParentAvmPath = (String)
this.nodeService.getProperty(((FormInstanceDataImpl)fid).getNodeRef(),
WCMAppModel.PROP_ORIGINAL_PARENT_PATH);
if (originalParentAvmPath == null)
{
originalParentAvmPath = AVMNodeConverter.SplitBase(avmPath)[0];
}
final HashSet<RenderingEngineTemplate> allRets =
new HashSet<RenderingEngineTemplate>(this.getForm().getRenderingEngineTemplates());
for (RenderingEngineTemplate ret : this.getForm().getRenderingEngineTemplates())
// regenerate existing renditions
for (final Rendition r : fid.getRenditions())
{
final RenderingEngineTemplate ret = r.getRenderingEngineTemplate();
if (!allRets.contains(ret))
{
continue;
}
try
{
ret.render(fid, r);
allRets.remove(ret);
}
catch (Exception e)
{
Utils.addErrorMessage("error regenerating rendition using " + ret.getName() +
": " + e.getMessage(),
e);
}
}
// render all renditions for newly added templates
for (final RenderingEngineTemplate ret : allRets)
{
try
{
ret.render(fid);
final String path = ret.getOutputPathForRendition(fid, originalParentAvmPath);
ret.render(fid, path);
}
catch (Exception e)
{

View File

@@ -465,16 +465,16 @@ public class CreateWebContentWizard extends BaseContentWizard
if (LOGGER.isDebugEnabled())
LOGGER.debug("saving file content to " + fileName);
String path = this.avmBrowseBean.getCurrentPath();
path = AVMConstants.getCorrespondingPathInPreviewStore(path);
final String cwd = AVMConstants.getCorrespondingPathInPreviewStore(this.avmBrowseBean.getCurrentPath());
final Form form = (MimetypeMap.MIMETYPE_XML.equals(this.mimeType)
? this.getForm()
: null);
String path = null;
if (form != null)
{
path = form.getOutputPathForFormInstanceData(this.instanceDataDocument,
fileName,
path,
cwd,
this.avmBrowseBean.getWebapp());
this.content = XMLUtil.toString(this.instanceDataDocument, false);
final String[] sb = AVMNodeConverter.SplitBase(path);
@@ -513,6 +513,7 @@ public class CreateWebContentWizard extends BaseContentWizard
};
props.clear();
props.put(WCMAppModel.PROP_PARENT_FORM_NAME, form.getName());
props.put(WCMAppModel.PROP_ORIGINAL_PARENT_PATH, cwd);
this.nodeService.addAspect(formInstanceDataNodeRef, WCMAppModel.ASPECT_FORM_INSTANCE_DATA, props);
this.renditions = new LinkedList<Rendition>();
@@ -520,7 +521,8 @@ public class CreateWebContentWizard extends BaseContentWizard
{
try
{
this.renditions.add(ret.render(this.formInstanceData));
path = ret.getOutputPathForRendition(this.formInstanceData, cwd);
this.renditions.add(ret.render(this.formInstanceData, path));
}
catch (Exception e)
{