mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
Merged DEV/SWIFT to HEAD
27168: Added generics for cannedQueryRegistry 27169: Fixed formatting 27170: SOLR queries - ALF-7072 RSOLR 013: Remote API to get ACLs and readers - Queries for ACL ChangeSets and ACLs - WebScripts for AclChangeSetsGet - ALF-7071 and ALF-7072: Fix naming conventions 27171: Fixed MySQL create script (ALF-8336: RSOLR 013: DB upgrade scripts for ACL changes) 27337: Initial draft of the publishing API 27516: Get the basic WCM ML tests working, covering the simpler use cases 27517: More on the WCM-QS multi lingual support, further on the aspect and the unit tests for it 27518: Begin the WCM-QS webscript to return the translation details on a node 27519: Push some WCM-QS ML search logic into SiteHelper, and add a unit test for it 27542: - Initial skeleton of the channel API. - Initial draft of the publishing content model. 27546: ALF-7481: RSOLR 018: Execute query against SOLR - pass authority filter in json body to avoid possible issue over-running the max URL length 27559: Created a Web Site Generator tool which randomly generates WCM QS websites. 27561: Created ChannelServiceImpl and implemented the ChannelType registry. 27577: Start to pull across the WCM-QS ML custom action 27579: More pulling across the WCM-QS ML custom action 27580: More WCM-QS ML ui porting 27588: ALF-8421: RSOLR 037: Encapsulate the CMIS Query Parser 27589: Created a PublishingModel to hold Web Publishing constants. 27610: ALF-7874 Add iWorks mimetype entries 27624: Restructure index tracking 27630: ALF-8182: SVC 03: Object Picker needs to use new NodeLocatorService to resolve startLocation parameter The picker now uses the NodeLocatorService to look up some start locations and most importantly allows custom 'locators' to be used. All the current start location tokens are still supported i.e. {companyhome}, {userhome}, {siteshome}, {doclib}, {self} and {parent}. A new one has been added called {ancestor}, this will allow an ancestor node to be located, the node can be selected by type or aspect, see example below. Some node locators can take parameters, a "startLocationParams" has therefore been added to allow these to be specified. The example below shows how to configure a picker to start in the root folder of the site the node being edited is located within. <field id="fdk:contentMultiple"> <control> <control-param name="startLocation">{ancestor}</control-param> <control-param name="startLocationParams">type=st:site</control-param> </control> </field> 27631: ALF-8182: SVC 03: Object Picker needs to use new NodeLocatorService to resolve startLocation parameter Centralised node locator classes to repo.nodelocator package (moved out of repo.node package as that area is reserved for low level node processing) and made all naming consistent i.e. nodelocator rather than nodelocation. 27633: Fixed cmis:objectTypeId property definition (required = true, see CMIS 1.0 errata 1) 27635: CMIS compliance fixes 27638: - Initial operational publishing context with model bootstrapped. - First implementation of ChannelService.getChannels and ChannelService.createChannel. Test cases to follow imminently... git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28301 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -2,9 +2,10 @@
|
|||||||
<shortname>PickerList</shortname>
|
<shortname>PickerList</shortname>
|
||||||
<description>Service to return metadata of child items in a parent space to display in the object finder.</description>
|
<description>Service to return metadata of child items in a parent space to display in the object finder.</description>
|
||||||
<url>/api/forms/picker/{type}/{store_type}/{store_id}/{id}/children</url>
|
<url>/api/forms/picker/{type}/{store_type}/{store_id}/{id}/children</url>
|
||||||
|
<url>/api/forms/picker/{type}/children</url>
|
||||||
|
<!-- The following 2 URLs are deprectated as of 4.0, the nodelocator service is now used by the picker -->
|
||||||
<url>/api/forms/picker/{type}/{store_type}/{store_id}/{id}/siblings</url>
|
<url>/api/forms/picker/{type}/{store_type}/{store_id}/{id}/siblings</url>
|
||||||
<url>/api/forms/picker/{type}/{store_type}/{store_id}/{id}/doclib</url>
|
<url>/api/forms/picker/{type}/{store_type}/{store_id}/{id}/doclib</url>
|
||||||
<url>/api/forms/picker/{type}/children</url>
|
|
||||||
<format default="json"/>
|
<format default="json"/>
|
||||||
<authentication>user</authentication>
|
<authentication>user</authentication>
|
||||||
<transaction allow="readonly">required</transaction>
|
<transaction allow="readonly">required</transaction>
|
||||||
|
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
data:
|
|
||||||
{
|
|
||||||
<#if nodeRef?? >
|
|
||||||
nodeRef: "${nodeRef}"
|
|
||||||
<#else >
|
|
||||||
nodeRef: null
|
|
||||||
</#if>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@@ -1,5 +1,5 @@
|
|||||||
<webscript>
|
<webscript>
|
||||||
<shortname>Locate Node</shortname>
|
<shortname>Node Locator</shortname>
|
||||||
<description>
|
<description>
|
||||||
Locates a Node in the repository using the specified Node Location strategy.
|
Locates a Node in the repository using the specified Node Location strategy.
|
||||||
</description>
|
</description>
|
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"data":
|
||||||
|
{
|
||||||
|
<#if nodeRef?? >
|
||||||
|
"nodeRef": "${nodeRef}"
|
||||||
|
<#else >
|
||||||
|
"nodeRef": null
|
||||||
|
</#if>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1,10 @@
|
|||||||
|
<webscript>
|
||||||
|
<shortname>Get ACL ChangeSets</shortname>
|
||||||
|
<description>Get the ACL ChangeSets from the given commit time.</description>
|
||||||
|
<url>/api/solr/aclchangesets?fromId={fromId?}&fromTime={fromTime?}&maxResults={maxResults?}</url>
|
||||||
|
<format default="json">argument</format>
|
||||||
|
<authentication>admin</authentication>
|
||||||
|
<transaction allow="readonly">required</transaction>
|
||||||
|
<lifecycle>internal</lifecycle>
|
||||||
|
<family>SOLR</family>
|
||||||
|
</webscript>
|
@@ -0,0 +1,10 @@
|
|||||||
|
<#import "solr.lib.ftl" as solrLib/>
|
||||||
|
{
|
||||||
|
"aclChangeSets" :
|
||||||
|
[
|
||||||
|
<#list aclChangeSets as aclChangeSet>
|
||||||
|
<@solrLib.aclChangeSetJSON aclChangeSet=aclChangeSet/>
|
||||||
|
<#if aclChangeSet_has_next>,</#if>
|
||||||
|
</#list>
|
||||||
|
]
|
||||||
|
}
|
@@ -6,4 +6,5 @@
|
|||||||
<authentication>admin</authentication>
|
<authentication>admin</authentication>
|
||||||
<transaction allow="readonly">required</transaction>
|
<transaction allow="readonly">required</transaction>
|
||||||
<lifecycle>internal</lifecycle>
|
<lifecycle>internal</lifecycle>
|
||||||
|
<family>SOLR</family>
|
||||||
</webscript>
|
</webscript>
|
@@ -6,4 +6,5 @@
|
|||||||
<authentication>admin</authentication>
|
<authentication>admin</authentication>
|
||||||
<transaction allow="readonly">required</transaction>
|
<transaction allow="readonly">required</transaction>
|
||||||
<lifecycle>internal</lifecycle>
|
<lifecycle>internal</lifecycle>
|
||||||
|
<family>SOLR</family>
|
||||||
</webscript>
|
</webscript>
|
@@ -6,4 +6,5 @@
|
|||||||
<authentication>admin</authentication>
|
<authentication>admin</authentication>
|
||||||
<transaction allow="readonly">required</transaction>
|
<transaction allow="readonly">required</transaction>
|
||||||
<lifecycle>internal</lifecycle>
|
<lifecycle>internal</lifecycle>
|
||||||
|
<family>SOLR</family>
|
||||||
</webscript>
|
</webscript>
|
@@ -1,3 +1,11 @@
|
|||||||
|
<#macro aclChangeSetJSON aclChangeSet>
|
||||||
|
{
|
||||||
|
"id": ${aclChangeSet.id?c},
|
||||||
|
"commitTimeMs": ${aclChangeSet.commitTimeMs?c},
|
||||||
|
"aclCount": ${aclChangeSet.aclCount?c}
|
||||||
|
}
|
||||||
|
</#macro>
|
||||||
|
|
||||||
<#macro transactionJSON txn>
|
<#macro transactionJSON txn>
|
||||||
{
|
{
|
||||||
"id": ${txn.id?c},
|
"id": ${txn.id?c},
|
||||||
|
@@ -6,4 +6,5 @@
|
|||||||
<authentication>admin</authentication>
|
<authentication>admin</authentication>
|
||||||
<transaction allow="readonly">required</transaction>
|
<transaction allow="readonly">required</transaction>
|
||||||
<lifecycle>internal</lifecycle>
|
<lifecycle>internal</lifecycle>
|
||||||
|
<family>SOLR</family>
|
||||||
</webscript>
|
</webscript>
|
@@ -1227,27 +1227,33 @@
|
|||||||
<property name="namespaceService" ref="namespaceService"/>
|
<property name="namespaceService" ref="namespaceService"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="webscript.org.alfresco.repository.solr.getTransactions.get"
|
<bean id="webscript.org.alfresco.repository.solr.aclChangeSets.get"
|
||||||
class="org.alfresco.repo.web.scripts.solr.GetTransactions"
|
class="org.alfresco.repo.web.scripts.solr.AclChangeSetsGet"
|
||||||
parent="webscript">
|
parent="webscript">
|
||||||
<property name="solrTrackingComponent" ref="solrTrackingComponent"/>
|
<property name="solrTrackingComponent" ref="solrTrackingComponent"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="webscript.org.alfresco.repository.solr.getNodes.post"
|
<bean id="webscript.org.alfresco.repository.solr.transactions.get"
|
||||||
class="org.alfresco.repo.web.scripts.solr.GetNodes"
|
class="org.alfresco.repo.web.scripts.solr.TransactionsGet"
|
||||||
parent="webscript">
|
parent="webscript">
|
||||||
<property name="solrTrackingComponent" ref="solrTrackingComponent"/>
|
<property name="solrTrackingComponent" ref="solrTrackingComponent"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="webscript.org.alfresco.repository.solr.getNodesMetaData.post"
|
<bean id="webscript.org.alfresco.repository.solr.nodes.post"
|
||||||
class="org.alfresco.repo.web.scripts.solr.GetNodesMetaData"
|
class="org.alfresco.repo.web.scripts.solr.NodesGet"
|
||||||
|
parent="webscript">
|
||||||
|
<property name="solrTrackingComponent" ref="solrTrackingComponent"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean id="webscript.org.alfresco.repository.solr.nodesMetaData.post"
|
||||||
|
class="org.alfresco.repo.web.scripts.solr.NodesMetaDataGet"
|
||||||
parent="webscript">
|
parent="webscript">
|
||||||
<property name="solrTrackingComponent" ref="solrTrackingComponent"/>
|
<property name="solrTrackingComponent" ref="solrTrackingComponent"/>
|
||||||
<property name="solrSerializer" ref="solrSerializer"/>
|
<property name="solrSerializer" ref="solrSerializer"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="webscript.org.alfresco.repository.solr.getNodeContent.get"
|
<bean id="webscript.org.alfresco.repository.solr.nodeContent.get"
|
||||||
class="org.alfresco.repo.web.scripts.solr.GetNodeContent"
|
class="org.alfresco.repo.web.scripts.solr.NodeContentGet"
|
||||||
parent="webscript">
|
parent="webscript">
|
||||||
<property name="contentService" ref="contentService"/>
|
<property name="contentService" ref="contentService"/>
|
||||||
<property name="nodeService" ref="nodeService"/>
|
<property name="nodeService" ref="nodeService"/>
|
||||||
@@ -1259,8 +1265,8 @@
|
|||||||
<!-- -->
|
<!-- -->
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
|
||||||
<bean id="webscript.org.alfresco.repository.nodelocator.node-location.get"
|
<bean id="webscript.org.alfresco.repository.nodelocator.node-locator.get"
|
||||||
class="org.alfresco.repo.web.scripts.nodelocator.NodeLocationGet"
|
class="org.alfresco.repo.web.scripts.nodelocator.NodeLocatorGet"
|
||||||
parent="webscript">
|
parent="webscript">
|
||||||
<property name="nodeLocatorService" ref="nodeLocatorService"/>
|
<property name="nodeLocatorService" ref="nodeLocatorService"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
@@ -25,7 +25,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.alfresco.service.cmr.repository.NodeLocatorService;
|
import org.alfresco.repo.nodelocator.NodeLocatorService;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.springframework.extensions.surf.util.URLDecoder;
|
import org.springframework.extensions.surf.util.URLDecoder;
|
||||||
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||||
@@ -38,7 +38,7 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
|
|||||||
* @since 4.0
|
* @since 4.0
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class NodeLocationGet extends DeclarativeWebScript
|
public class NodeLocatorGet extends DeclarativeWebScript
|
||||||
{
|
{
|
||||||
private static final String NODE_ID = "node_id";
|
private static final String NODE_ID = "node_id";
|
||||||
private static final String STORE_ID = "store_id";
|
private static final String STORE_ID = "store_id";
|
@@ -21,13 +21,13 @@ package org.alfresco.repo.web.scripts.nodelocator;
|
|||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.repo.model.Repository;
|
import org.alfresco.repo.model.Repository;
|
||||||
import org.alfresco.repo.node.locator.AncestorNodeLocator;
|
import org.alfresco.repo.nodelocator.AncestorNodeLocator;
|
||||||
import org.alfresco.repo.node.locator.CompanyHomeNodeLocator;
|
import org.alfresco.repo.nodelocator.CompanyHomeNodeLocator;
|
||||||
import org.alfresco.repo.node.locator.DocLibNodeLocator;
|
import org.alfresco.repo.nodelocator.SitesHomeNodeLocator;
|
||||||
import org.alfresco.repo.node.locator.SitesHomeNodeLocator;
|
import org.alfresco.repo.nodelocator.UserHomeNodeLocator;
|
||||||
import org.alfresco.repo.node.locator.UserHomeNodeLocator;
|
import org.alfresco.repo.nodelocator.XPathNodeLocator;
|
||||||
import org.alfresco.repo.node.locator.XPathNodeLocator;
|
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
|
import org.alfresco.repo.site.DocLibNodeLocator;
|
||||||
import org.alfresco.repo.site.SiteServiceInternal;
|
import org.alfresco.repo.site.SiteServiceInternal;
|
||||||
import org.alfresco.repo.web.scripts.BaseWebScriptTest;
|
import org.alfresco.repo.web.scripts.BaseWebScriptTest;
|
||||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||||
@@ -51,7 +51,7 @@ import org.springframework.extensions.webscripts.TestWebScriptServer.Response;
|
|||||||
* @since 4.0
|
* @since 4.0
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class NodeLocationWebScriptTest extends BaseWebScriptTest
|
public class NodeLocatorWebScriptTest extends BaseWebScriptTest
|
||||||
{
|
{
|
||||||
private static final String baseURL = "api/nodelocator/";
|
private static final String baseURL = "api/nodelocator/";
|
||||||
private SiteServiceInternal siteService;
|
private SiteServiceInternal siteService;
|
@@ -22,8 +22,8 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.alfresco.repo.domain.solr.SOLRDAO;
|
import org.alfresco.repo.solr.AclChangeSet;
|
||||||
import org.alfresco.repo.domain.solr.Transaction;
|
import org.alfresco.repo.solr.SOLRTrackingComponent;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||||
@@ -35,34 +35,31 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
|
|||||||
*
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public class GetAclChangeSets extends DeclarativeWebScript
|
public class AclChangeSetsGet extends DeclarativeWebScript
|
||||||
{
|
{
|
||||||
protected static final Log logger = LogFactory.getLog(GetAclChangeSets.class);
|
protected static final Log logger = LogFactory.getLog(AclChangeSetsGet.class);
|
||||||
|
|
||||||
private SOLRDAO solrDAO;
|
private SOLRTrackingComponent solrTrackingComponent;
|
||||||
|
|
||||||
/**
|
public void setSolrTrackingComponent(SOLRTrackingComponent solrTrackingComponent)
|
||||||
* @param solrDAO the SOLDAO to set
|
|
||||||
*/
|
|
||||||
public void setSolrDAO(SOLRDAO solrDAO)
|
|
||||||
{
|
{
|
||||||
this.solrDAO = solrDAO;
|
this.solrTrackingComponent = solrTrackingComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status)
|
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status)
|
||||||
{
|
{
|
||||||
String minAclChangeSetIdParam = req.getParameter("minAclChangeSetId");
|
String fromIdParam = req.getParameter("fromId");
|
||||||
String fromCommitTimeParam = req.getParameter("fromCommitTime");
|
String fromTimeParam = req.getParameter("fromTime");
|
||||||
String maxResultsParam = req.getParameter("maxResults");
|
String maxResultsParam = req.getParameter("maxResults");
|
||||||
|
|
||||||
Long minAclChangeSetId = (minAclChangeSetIdParam == null ? null : Long.valueOf(minAclChangeSetIdParam));
|
Long fromId = (fromIdParam == null ? null : Long.valueOf(fromIdParam));
|
||||||
Long fromCommitTime = (fromCommitTimeParam == null ? null : Long.valueOf(fromCommitTimeParam));
|
Long fromTime = (fromTimeParam == null ? null : Long.valueOf(fromTimeParam));
|
||||||
int maxResults = (maxResultsParam == null ? 0 : Integer.valueOf(maxResultsParam));
|
int maxResults = (maxResultsParam == null ? 1024 : Integer.valueOf(maxResultsParam));
|
||||||
|
|
||||||
List<Transaction> transactions = solrDAO.getTransactions(minAclChangeSetId, fromCommitTime, maxResults);
|
List<AclChangeSet> changesets = solrTrackingComponent.getAclChangeSets(fromId, fromTime, maxResults);
|
||||||
|
|
||||||
Map<String, Object> model = new HashMap<String, Object>(1, 1.0f);
|
Map<String, Object> model = new HashMap<String, Object>(1, 1.0f);
|
||||||
model.put("transactions", transactions);
|
model.put("aclChangeSets", changesets);
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
{
|
{
|
@@ -51,12 +51,12 @@ import org.springframework.extensions.webscripts.WebScriptResponse;
|
|||||||
*
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public class GetNodeContent extends StreamContent
|
public class NodeContentGet extends StreamContent
|
||||||
{
|
{
|
||||||
private static final String TRANSFORM_STATUS_HEADER = "X-Alfresco-transformStatus";
|
private static final String TRANSFORM_STATUS_HEADER = "X-Alfresco-transformStatus";
|
||||||
private static final String TRANSFORM_EXCEPTION_HEADER = "X-Alfresco-transformException";
|
private static final String TRANSFORM_EXCEPTION_HEADER = "X-Alfresco-transformException";
|
||||||
|
|
||||||
private static final Log logger = LogFactory.getLog(GetNodeContent.class);
|
private static final Log logger = LogFactory.getLog(NodeContentGet.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* format definied by RFC 822, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3
|
* format definied by RFC 822, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3
|
@@ -51,9 +51,9 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
|
|||||||
*
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public class GetNodes extends DeclarativeWebScript
|
public class NodesGet extends DeclarativeWebScript
|
||||||
{
|
{
|
||||||
protected static final Log logger = LogFactory.getLog(GetNodes.class);
|
protected static final Log logger = LogFactory.getLog(NodesGet.class);
|
||||||
|
|
||||||
private SOLRTrackingComponent solrTrackingComponent;
|
private SOLRTrackingComponent solrTrackingComponent;
|
||||||
|
|
@@ -55,9 +55,9 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
|
|||||||
*
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public class GetNodesMetaData extends DeclarativeWebScript
|
public class NodesMetaDataGet extends DeclarativeWebScript
|
||||||
{
|
{
|
||||||
protected static final Log logger = LogFactory.getLog(GetNodesMetaData.class);
|
protected static final Log logger = LogFactory.getLog(NodesMetaDataGet.class);
|
||||||
private static final int INITIAL_DEFAULT_SIZE = 100;
|
private static final int INITIAL_DEFAULT_SIZE = 100;
|
||||||
private static final int BATCH_SIZE = 50;
|
private static final int BATCH_SIZE = 50;
|
||||||
|
|
@@ -23,11 +23,9 @@ import java.io.Serializable;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.repo.domain.node.NodeDAO;
|
import org.alfresco.repo.domain.node.NodeDAO;
|
||||||
@@ -167,6 +165,25 @@ public class SOLRWebScriptTest extends BaseWebScriptTest
|
|||||||
return transactions;
|
return transactions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testAclChangeSetsGet() throws Exception
|
||||||
|
{
|
||||||
|
String url = "/api/solr/aclchangesets?fromTime=" + 0L + "&fromId=" + 0L;
|
||||||
|
TestWebScriptServer.GetRequest req = new TestWebScriptServer.GetRequest(url);
|
||||||
|
long startTime = System.currentTimeMillis();
|
||||||
|
Response response = sendRequest(req, Status.STATUS_OK, admin);
|
||||||
|
long endTime = System.currentTimeMillis();
|
||||||
|
|
||||||
|
if(logger.isDebugEnabled())
|
||||||
|
{
|
||||||
|
logger.debug(response.getContentAsString());
|
||||||
|
}
|
||||||
|
JSONObject json = new JSONObject(response.getContentAsString());
|
||||||
|
|
||||||
|
JSONArray aclChangeSets = json.getJSONArray("aclChangeSets");
|
||||||
|
|
||||||
|
System.out.println("Got " + aclChangeSets.length() + " txns in " + (endTime - startTime) + " ms");
|
||||||
|
}
|
||||||
|
|
||||||
private JSONArray getNodes(GetNodesParameters parameters, int maxResults, int expectedNumNodes) throws Exception
|
private JSONArray getNodes(GetNodesParameters parameters, int maxResults, int expectedNumNodes) throws Exception
|
||||||
{
|
{
|
||||||
StringBuilder url = new StringBuilder("/api/solr/nodes");
|
StringBuilder url = new StringBuilder("/api/solr/nodes");
|
||||||
|
@@ -22,9 +22,8 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.alfresco.repo.domain.solr.SOLRDAO;
|
|
||||||
import org.alfresco.repo.domain.solr.Transaction;
|
|
||||||
import org.alfresco.repo.solr.SOLRTrackingComponent;
|
import org.alfresco.repo.solr.SOLRTrackingComponent;
|
||||||
|
import org.alfresco.repo.solr.Transaction;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
import org.springframework.extensions.webscripts.DeclarativeWebScript;
|
||||||
@@ -36,9 +35,9 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
|
|||||||
*
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public class GetTransactions extends DeclarativeWebScript
|
public class TransactionsGet extends DeclarativeWebScript
|
||||||
{
|
{
|
||||||
protected static final Log logger = LogFactory.getLog(GetTransactions.class);
|
protected static final Log logger = LogFactory.getLog(TransactionsGet.class);
|
||||||
|
|
||||||
private SOLRTrackingComponent solrTrackingComponent;
|
private SOLRTrackingComponent solrTrackingComponent;
|
||||||
|
|
||||||
@@ -55,7 +54,7 @@ public class GetTransactions extends DeclarativeWebScript
|
|||||||
|
|
||||||
Long minTxnId = (minTxnIdParam == null ? null : Long.valueOf(minTxnIdParam));
|
Long minTxnId = (minTxnIdParam == null ? null : Long.valueOf(minTxnIdParam));
|
||||||
Long fromCommitTime = (fromCommitTimeParam == null ? null : Long.valueOf(fromCommitTimeParam));
|
Long fromCommitTime = (fromCommitTimeParam == null ? null : Long.valueOf(fromCommitTimeParam));
|
||||||
int maxResults = (maxResultsParam == null ? 0 : Integer.valueOf(maxResultsParam));
|
int maxResults = (maxResultsParam == null ? 1024 : Integer.valueOf(maxResultsParam));
|
||||||
|
|
||||||
List<Transaction> transactions = solrTrackingComponent.getTransactions(minTxnId, fromCommitTime, maxResults);
|
List<Transaction> transactions = solrTrackingComponent.getTransactions(minTxnId, fromCommitTime, maxResults);
|
||||||
|
|
Reference in New Issue
Block a user