mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -1009,6 +1009,7 @@ public class AdminNodeBrowseBean implements Serializable
|
|||||||
{
|
{
|
||||||
rows.setWrappedData(resultSet.getChildAssocRefs());
|
rows.setWrappedData(resultSet.getChildAssocRefs());
|
||||||
length = resultSet.length();
|
length = resultSet.length();
|
||||||
|
resultSet.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -220,11 +220,19 @@ public class AddUsersDialog extends BaseDialogBean
|
|||||||
query.append("*\" @").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:userName:");
|
query.append("*\" @").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:userName:");
|
||||||
query.append(term);
|
query.append(term);
|
||||||
query.append("*");
|
query.append("*");
|
||||||
|
List<NodeRef> nodes;
|
||||||
ResultSet resultSet = Repository.getServiceRegistry(context).getSearchService().query(
|
ResultSet resultSet = Repository.getServiceRegistry(context).getSearchService().query(
|
||||||
Repository.getStoreRef(),
|
Repository.getStoreRef(),
|
||||||
SearchService.LANGUAGE_LUCENE,
|
SearchService.LANGUAGE_LUCENE,
|
||||||
query.toString());
|
query.toString());
|
||||||
List<NodeRef> nodes = resultSet.getNodeRefs();
|
try
|
||||||
|
{
|
||||||
|
nodes = resultSet.getNodeRefs();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
resultSet.close();
|
||||||
|
}
|
||||||
|
|
||||||
ArrayList<SelectItem> itemList = new ArrayList<SelectItem>(nodes.size());
|
ArrayList<SelectItem> itemList = new ArrayList<SelectItem>(nodes.size());
|
||||||
for (NodeRef personRef : nodes)
|
for (NodeRef personRef : nodes)
|
||||||
|
@@ -37,6 +37,7 @@ import javax.transaction.UserTransaction;
|
|||||||
import org.alfresco.repo.security.authentication.AuthenticationException;
|
import org.alfresco.repo.security.authentication.AuthenticationException;
|
||||||
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
|
import org.alfresco.service.cmr.search.ResultSet;
|
||||||
import org.alfresco.service.cmr.search.SearchParameters;
|
import org.alfresco.service.cmr.search.SearchParameters;
|
||||||
import org.alfresco.service.cmr.search.SearchService;
|
import org.alfresco.service.cmr.search.SearchService;
|
||||||
import org.alfresco.service.cmr.security.AuthenticationService;
|
import org.alfresco.service.cmr.security.AuthenticationService;
|
||||||
@@ -154,7 +155,16 @@ public class DeleteUserDialog extends BaseDialogBean
|
|||||||
params.addStore(Repository.getStoreRef());
|
params.addStore(Repository.getStoreRef());
|
||||||
params.setQuery(query);
|
params.setQuery(query);
|
||||||
|
|
||||||
List<NodeRef> people = this.getSearchService().query(params).getNodeRefs();
|
ResultSet results = this.getSearchService().query(params);
|
||||||
|
List<NodeRef> people;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
people = results.getNodeRefs();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
results.close();
|
||||||
|
}
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Found " + people.size() + " users");
|
logger.debug("Found " + people.size() + " users");
|
||||||
|
@@ -41,6 +41,7 @@ import org.alfresco.repo.search.impl.lucene.QueryParser;
|
|||||||
import org.alfresco.repo.security.authentication.AuthenticationException;
|
import org.alfresco.repo.security.authentication.AuthenticationException;
|
||||||
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
|
import org.alfresco.service.cmr.search.ResultSet;
|
||||||
import org.alfresco.service.cmr.search.SearchParameters;
|
import org.alfresco.service.cmr.search.SearchParameters;
|
||||||
import org.alfresco.service.cmr.search.SearchService;
|
import org.alfresco.service.cmr.search.SearchService;
|
||||||
import org.alfresco.service.namespace.NamespaceService;
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
@@ -343,7 +344,16 @@ public class UsersDialog extends BaseDialogBean implements IContextListener, Cha
|
|||||||
params.addStore(Repository.getStoreRef());
|
params.addStore(Repository.getStoreRef());
|
||||||
params.setQuery(query.toString());
|
params.setQuery(query.toString());
|
||||||
|
|
||||||
List<NodeRef> people = properties.getSearchService().query(params).getNodeRefs();
|
ResultSet results = properties.getSearchService().query(params);
|
||||||
|
List<NodeRef> people;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
people = results.getNodeRefs();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
results.close();
|
||||||
|
}
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Found " + people.size() + " users");
|
logger.debug("Found " + people.size() + " users");
|
||||||
|
@@ -272,6 +272,8 @@ public class EditFormWizard
|
|||||||
for (WebProject wp: webProjects)
|
for (WebProject wp: webProjects)
|
||||||
{
|
{
|
||||||
ResultSet results = searchRenderingEngineTemplateInWebProject(wp, retd.getName());
|
ResultSet results = searchRenderingEngineTemplateInWebProject(wp, retd.getName());
|
||||||
|
try
|
||||||
|
{
|
||||||
for (int i=0; i<results.length(); i++)
|
for (int i=0; i<results.length(); i++)
|
||||||
{
|
{
|
||||||
NodeRef webformTemplateNodeRef = results.getNodeRef(i);
|
NodeRef webformTemplateNodeRef = results.getNodeRef(i);
|
||||||
@@ -281,6 +283,11 @@ public class EditFormWizard
|
|||||||
LOGGER.debug(webformNodeRef);
|
LOGGER.debug(webformNodeRef);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
results.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -324,6 +331,8 @@ public class EditFormWizard
|
|||||||
|
|
||||||
ResultSet webforms = getSearchService().query(wp.getNodeRef().getStoreRef(), SearchService.LANGUAGE_LUCENE, query);
|
ResultSet webforms = getSearchService().query(wp.getNodeRef().getStoreRef(), SearchService.LANGUAGE_LUCENE, query);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
props.clear();
|
props.clear();
|
||||||
props.put(WCMAppModel.PROP_BASE_RENDERING_ENGINE_TEMPLATE_NAME,
|
props.put(WCMAppModel.PROP_BASE_RENDERING_ENGINE_TEMPLATE_NAME,
|
||||||
retd.getName());
|
retd.getName());
|
||||||
@@ -346,6 +355,11 @@ public class EditFormWizard
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
webforms.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -492,6 +492,8 @@ public class RegenerateRenditionsWizard
|
|||||||
LOGGER.debug("running query " + query);
|
LOGGER.debug("running query " + query);
|
||||||
sp.setQuery(query.toString());
|
sp.setQuery(query.toString());
|
||||||
final ResultSet rs = getSearchService().query(sp);
|
final ResultSet rs = getSearchService().query(sp);
|
||||||
|
try
|
||||||
|
{
|
||||||
final List<FormInstanceData> result = new ArrayList<FormInstanceData>(rs.length());
|
final List<FormInstanceData> result = new ArrayList<FormInstanceData>(rs.length());
|
||||||
for (final ResultSetRow row : rs)
|
for (final ResultSetRow row : rs)
|
||||||
{
|
{
|
||||||
@@ -499,8 +501,14 @@ public class RegenerateRenditionsWizard
|
|||||||
final String previewAvmPath = AVMUtil.getCorrespondingPathInPreviewStore(avmPath);
|
final String previewAvmPath = AVMUtil.getCorrespondingPathInPreviewStore(avmPath);
|
||||||
result.add(getFormsService().getFormInstanceData(-1, previewAvmPath));
|
result.add(getFormsService().getFormInstanceData(-1, previewAvmPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
rs.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private List<Rendition> getRelatedRenditions(final WebProject webProject, final RenderingEngineTemplate ret)
|
private List<Rendition> getRelatedRenditions(final WebProject webProject, final RenderingEngineTemplate ret)
|
||||||
{
|
{
|
||||||
@@ -516,6 +524,8 @@ public class RegenerateRenditionsWizard
|
|||||||
LOGGER.debug("running query " + query);
|
LOGGER.debug("running query " + query);
|
||||||
sp.setQuery(query.toString());
|
sp.setQuery(query.toString());
|
||||||
final ResultSet rs = getSearchService().query(sp);
|
final ResultSet rs = getSearchService().query(sp);
|
||||||
|
try
|
||||||
|
{
|
||||||
final List<Rendition> result = new ArrayList<Rendition>(rs.length());
|
final List<Rendition> result = new ArrayList<Rendition>(rs.length());
|
||||||
for (final ResultSetRow row : rs)
|
for (final ResultSetRow row : rs)
|
||||||
{
|
{
|
||||||
@@ -525,6 +535,11 @@ public class RegenerateRenditionsWizard
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
rs.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private List<Rendition> regenerateRenditions()
|
private List<Rendition> regenerateRenditions()
|
||||||
{
|
{
|
||||||
@@ -596,6 +611,8 @@ public class RegenerateRenditionsWizard
|
|||||||
LOGGER.debug("running query " + query);
|
LOGGER.debug("running query " + query);
|
||||||
sp.setQuery(query.toString());
|
sp.setQuery(query.toString());
|
||||||
final ResultSet rs = getSearchService().query(sp);
|
final ResultSet rs = getSearchService().query(sp);
|
||||||
|
try
|
||||||
|
{
|
||||||
if (LOGGER.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
LOGGER.debug("received " + rs.length() + " results");
|
LOGGER.debug("received " + rs.length() + " results");
|
||||||
|
|
||||||
@@ -607,7 +624,7 @@ public class RegenerateRenditionsWizard
|
|||||||
if (this.regenerateScope.equals(REGENERATE_SCOPE_ALL) ||
|
if (this.regenerateScope.equals(REGENERATE_SCOPE_ALL) ||
|
||||||
this.regenerateScope.equals(REGENERATE_SCOPE_FORM))
|
this.regenerateScope.equals(REGENERATE_SCOPE_FORM))
|
||||||
{
|
{
|
||||||
final FormInstanceData fid = getFormsService().getFormInstanceData(-1, previewAvmPath);
|
final FormInstanceData fid = this.formsService.getFormInstanceData(-1, previewAvmPath);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final List<FormInstanceData.RegenerateResult> regenResults = fid.regenerateRenditions();
|
final List<FormInstanceData.RegenerateResult> regenResults = fid.regenerateRenditions();
|
||||||
@@ -626,7 +643,7 @@ public class RegenerateRenditionsWizard
|
|||||||
}
|
}
|
||||||
if (rr.getRendition() != null)
|
if (rr.getRendition() != null)
|
||||||
{
|
{
|
||||||
getAvmLockingService().removeLock(AVMUtil.getStoreId(rr.getRendition().getPath()),
|
this.avmLockingService.removeLock(AVMUtil.getStoreId(rr.getRendition().getPath()),
|
||||||
AVMUtil.getStoreRelativePath(rr.getRendition().getPath()));
|
AVMUtil.getStoreRelativePath(rr.getRendition().getPath()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -640,7 +657,7 @@ public class RegenerateRenditionsWizard
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final Rendition r = getFormsService().getRendition(-1, previewAvmPath);
|
final Rendition r = this.formsService.getRendition(-1, previewAvmPath);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
r.regenerate();
|
r.regenerate();
|
||||||
@@ -657,4 +674,9 @@ public class RegenerateRenditionsWizard
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
rs.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -259,7 +259,15 @@ public class SetPermissionsDialog extends UpdatePermissionsDialog
|
|||||||
query.append(term);
|
query.append(term);
|
||||||
query.append("*");
|
query.append("*");
|
||||||
ResultSet resultSet = Repository.getServiceRegistry(context).getSearchService().query(Repository.getStoreRef(), SearchService.LANGUAGE_LUCENE, query.toString());
|
ResultSet resultSet = Repository.getServiceRegistry(context).getSearchService().query(Repository.getStoreRef(), SearchService.LANGUAGE_LUCENE, query.toString());
|
||||||
List<NodeRef> nodes = resultSet.getNodeRefs();
|
List<NodeRef> nodes;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
nodes = resultSet.getNodeRefs();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
resultSet.close();
|
||||||
|
}
|
||||||
|
|
||||||
for (int index = 0; index < nodes.size(); index++)
|
for (int index = 0; index < nodes.size(); index++)
|
||||||
{
|
{
|
||||||
|
@@ -392,7 +392,15 @@ public abstract class BaseInviteUsersWizard extends BaseWizardBean
|
|||||||
}
|
}
|
||||||
|
|
||||||
ResultSet resultSet = Repository.getServiceRegistry(context).getSearchService().query(searchParams);
|
ResultSet resultSet = Repository.getServiceRegistry(context).getSearchService().query(searchParams);
|
||||||
List<NodeRef> nodes = resultSet.getNodeRefs();
|
List<NodeRef> nodes;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
nodes = resultSet.getNodeRefs();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
resultSet.close();
|
||||||
|
}
|
||||||
|
|
||||||
// set the maximum users returned flag if appropriate
|
// set the maximum users returned flag if appropriate
|
||||||
if (nodes.size() == maxResults)
|
if (nodes.size() == maxResults)
|
||||||
|
@@ -128,6 +128,7 @@ public abstract class BaseReassignDialog extends BaseDialogBean
|
|||||||
SelectItem[] items;
|
SelectItem[] items;
|
||||||
|
|
||||||
UserTransaction tx = null;
|
UserTransaction tx = null;
|
||||||
|
ResultSet resultSet = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
tx = Repository.getUserTransaction(context, true);
|
tx = Repository.getUserTransaction(context, true);
|
||||||
@@ -143,7 +144,7 @@ public abstract class BaseReassignDialog extends BaseDialogBean
|
|||||||
query.append("*\" @").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:userName:");
|
query.append("*\" @").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:userName:");
|
||||||
query.append(term);
|
query.append(term);
|
||||||
query.append("*");
|
query.append("*");
|
||||||
ResultSet resultSet = Repository.getServiceRegistry(context).getSearchService().query(
|
resultSet = Repository.getServiceRegistry(context).getSearchService().query(
|
||||||
Repository.getStoreRef(), SearchService.LANGUAGE_LUCENE, query.toString());
|
Repository.getStoreRef(), SearchService.LANGUAGE_LUCENE, query.toString());
|
||||||
List<NodeRef> nodes = resultSet.getNodeRefs();
|
List<NodeRef> nodes = resultSet.getNodeRefs();
|
||||||
|
|
||||||
@@ -175,6 +176,13 @@ public abstract class BaseReassignDialog extends BaseDialogBean
|
|||||||
|
|
||||||
items = new SelectItem[0];
|
items = new SelectItem[0];
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (resultSet != null)
|
||||||
|
{
|
||||||
|
resultSet.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
@@ -218,6 +218,8 @@ public final class FormsService
|
|||||||
final ResultSet rs = this.searchService.query(Repository.getStoreRef(),
|
final ResultSet rs = this.searchService.query(Repository.getStoreRef(),
|
||||||
SearchService.LANGUAGE_LUCENE,
|
SearchService.LANGUAGE_LUCENE,
|
||||||
query);
|
query);
|
||||||
|
try
|
||||||
|
{
|
||||||
if (LOGGER.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
LOGGER.debug("found " + rs.length() + " form definitions");
|
LOGGER.debug("found " + rs.length() + " form definitions");
|
||||||
final Collection<Form> result = new ArrayList<Form>(rs.length());
|
final Collection<Form> result = new ArrayList<Form>(rs.length());
|
||||||
@@ -230,6 +232,11 @@ public final class FormsService
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
rs.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return the form by name or <tt>null</tt> if not found
|
* return the form by name or <tt>null</tt> if not found
|
||||||
@@ -400,6 +407,8 @@ public final class FormsService
|
|||||||
final ResultSet rs = this.searchService.query(Repository.getStoreRef(),
|
final ResultSet rs = this.searchService.query(Repository.getStoreRef(),
|
||||||
SearchService.LANGUAGE_LUCENE,
|
SearchService.LANGUAGE_LUCENE,
|
||||||
query);
|
query);
|
||||||
|
try
|
||||||
|
{
|
||||||
if (LOGGER.isDebugEnabled())
|
if (LOGGER.isDebugEnabled())
|
||||||
{
|
{
|
||||||
LOGGER.debug("query " + query + " returned " + rs.length() + " results");
|
LOGGER.debug("query " + query + " returned " + rs.length() + " results");
|
||||||
@@ -411,4 +420,9 @@ public final class FormsService
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
rs.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -145,6 +145,8 @@ public class Schema2XFormsProperties
|
|||||||
searchService.query(Repository.getStoreRef(),
|
searchService.query(Repository.getStoreRef(),
|
||||||
SearchService.LANGUAGE_LUCENE,
|
SearchService.LANGUAGE_LUCENE,
|
||||||
"PATH:\"" + name + "\"");
|
"PATH:\"" + name + "\"");
|
||||||
|
try
|
||||||
|
{
|
||||||
LOGGER.debug("search returned " + results.length() +
|
LOGGER.debug("search returned " + results.length() +
|
||||||
" results");
|
" results");
|
||||||
if (results.length() == 1)
|
if (results.length() == 1)
|
||||||
@@ -159,6 +161,11 @@ public class Schema2XFormsProperties
|
|||||||
return super.getResourceAsStream(name);
|
return super.getResourceAsStream(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
results.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if (location.startsWith("classpath:"))
|
else if (location.startsWith("classpath:"))
|
||||||
|
Reference in New Issue
Block a user