Merged V3.0 to HEAD

11982: Fix for ETHREEOH-906 - Writing the TICKET value directly to the page during template processing is a potential XSS security hole.
   11983: Added back .html suffix to plain HTML form upload api call - added code comment to explain why it's there.
   11984: Added debug/info level logging to Invite process.
   11985: ETHREEOH-184: thumbnail assocs do not double up on check-in and thumbnail updates are done in one action
   11986: Fix for ETHREEOH-905 - missing url encoding step for user password during webscript based login process.
   11995: Unit test fixed up, fallout from runAs merge.
   11998: Part of a fix for ETHREEOH-546 - Cannot save document to the any space for Microsoft Office
   11999: Merged V2.2 to V3.0
      11996: Fix for open Lucene ResultSet memory leaks
   12000: ETHREEOH-692 - It is impossible to login to Alfresco from Microsoft Office add-in using NTLM authentication. ETHREEOH-546 - Cannot save document to the any space for Microsoft Office.
   12001: Paging enabled by default in all Document Libraries

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12494 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2008-12-18 15:08:14 +00:00
parent 26d7b9669f
commit 7bc8557a1e
11 changed files with 232 additions and 122 deletions

View File

@@ -492,14 +492,22 @@ public class RegenerateRenditionsWizard
LOGGER.debug("running query " + query);
sp.setQuery(query.toString());
final ResultSet rs = getSearchService().query(sp);
final List<FormInstanceData> result = new ArrayList<FormInstanceData>(rs.length());
for (final ResultSetRow row : rs)
try
{
final String avmPath = AVMNodeConverter.ToAVMVersionPath(row.getNodeRef()).getSecond();
final String previewAvmPath = AVMUtil.getCorrespondingPathInPreviewStore(avmPath);
result.add(getFormsService().getFormInstanceData(-1, previewAvmPath));
final List<FormInstanceData> result = new ArrayList<FormInstanceData>(rs.length());
for (final ResultSetRow row : rs)
{
final String avmPath = AVMNodeConverter.ToAVMVersionPath(row.getNodeRef()).getSecond();
final String previewAvmPath = AVMUtil.getCorrespondingPathInPreviewStore(avmPath);
result.add(getFormsService().getFormInstanceData(-1, previewAvmPath));
}
return result;
}
finally
{
rs.close();
}
return result;
}
private List<Rendition> getRelatedRenditions(final WebProject webProject, final RenderingEngineTemplate ret)
@@ -516,14 +524,21 @@ public class RegenerateRenditionsWizard
LOGGER.debug("running query " + query);
sp.setQuery(query.toString());
final ResultSet rs = getSearchService().query(sp);
final List<Rendition> result = new ArrayList<Rendition>(rs.length());
for (final ResultSetRow row : rs)
try
{
final String avmPath = AVMNodeConverter.ToAVMVersionPath(row.getNodeRef()).getSecond();
final String previewAvmPath = AVMUtil.getCorrespondingPathInPreviewStore(avmPath);
result.add(getFormsService().getRendition(-1, previewAvmPath));
final List<Rendition> result = new ArrayList<Rendition>(rs.length());
for (final ResultSetRow row : rs)
{
final String avmPath = AVMNodeConverter.ToAVMVersionPath(row.getNodeRef()).getSecond();
final String previewAvmPath = AVMUtil.getCorrespondingPathInPreviewStore(avmPath);
result.add(getFormsService().getRendition(-1, previewAvmPath));
}
return result;
}
finally
{
rs.close();
}
return result;
}
private List<Rendition> regenerateRenditions()
@@ -596,65 +611,72 @@ public class RegenerateRenditionsWizard
LOGGER.debug("running query " + query);
sp.setQuery(query.toString());
final ResultSet rs = getSearchService().query(sp);
if (LOGGER.isDebugEnabled())
LOGGER.debug("received " + rs.length() + " results");
final List<Rendition> result = new ArrayList<Rendition>(rs.length());
for (final ResultSetRow row : rs)
try
{
final String avmPath = AVMNodeConverter.ToAVMVersionPath(row.getNodeRef()).getSecond();
final String previewAvmPath = AVMUtil.getCorrespondingPathInPreviewStore(avmPath);
if (this.regenerateScope.equals(REGENERATE_SCOPE_ALL) ||
this.regenerateScope.equals(REGENERATE_SCOPE_FORM))
if (LOGGER.isDebugEnabled())
LOGGER.debug("received " + rs.length() + " results");
final List<Rendition> result = new ArrayList<Rendition>(rs.length());
for (final ResultSetRow row : rs)
{
final FormInstanceData fid = getFormsService().getFormInstanceData(-1, previewAvmPath);
try
final String avmPath = AVMNodeConverter.ToAVMVersionPath(row.getNodeRef()).getSecond();
final String previewAvmPath = AVMUtil.getCorrespondingPathInPreviewStore(avmPath);
if (this.regenerateScope.equals(REGENERATE_SCOPE_ALL) ||
this.regenerateScope.equals(REGENERATE_SCOPE_FORM))
{
final List<FormInstanceData.RegenerateResult> regenResults = fid.regenerateRenditions();
for (final FormInstanceData.RegenerateResult rr : regenResults)
final FormInstanceData fid = this.formsService.getFormInstanceData(-1, previewAvmPath);
try
{
if (rr.getException() != null)
final List<FormInstanceData.RegenerateResult> regenResults = fid.regenerateRenditions();
for (final FormInstanceData.RegenerateResult rr : regenResults)
{
Utils.addErrorMessage("error regenerating rendition using " +
rr.getRenderingEngineTemplate().getName() +
": " + rr.getException().getMessage(),
rr.getException());
}
else
{
result.add(rr.getRendition());
}
if (rr.getRendition() != null)
{
getAvmLockingService().removeLock(AVMUtil.getStoreId(rr.getRendition().getPath()),
AVMUtil.getStoreRelativePath(rr.getRendition().getPath()));
if (rr.getException() != null)
{
Utils.addErrorMessage("error regenerating rendition using " +
rr.getRenderingEngineTemplate().getName() +
": " + rr.getException().getMessage(),
rr.getException());
}
else
{
result.add(rr.getRendition());
}
if (rr.getRendition() != null)
{
this.avmLockingService.removeLock(AVMUtil.getStoreId(rr.getRendition().getPath()),
AVMUtil.getStoreRelativePath(rr.getRendition().getPath()));
}
}
}
catch (FormNotFoundException fnfe)
{
Utils.addErrorMessage("error regenerating renditions of " + fid.getPath() +
": " + fnfe.getMessage(),
fnfe);
}
}
catch (FormNotFoundException fnfe)
else
{
Utils.addErrorMessage("error regenerating renditions of " + fid.getPath() +
": " + fnfe.getMessage(),
fnfe);
}
}
else
{
final Rendition r = getFormsService().getRendition(-1, previewAvmPath);
try
{
r.regenerate();
result.add(r);
}
catch (Exception e)
{
Utils.addErrorMessage("error regenerating rendition using " +
r.getRenderingEngineTemplate().getName() +
": " + e.getMessage(),
e);
final Rendition r = this.formsService.getRendition(-1, previewAvmPath);
try
{
r.regenerate();
result.add(r);
}
catch (Exception e)
{
Utils.addErrorMessage("error regenerating rendition using " +
r.getRenderingEngineTemplate().getName() +
": " + e.getMessage(),
e);
}
}
}
return result;
}
finally
{
rs.close();
}
return result;
}
}