mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged up to HEAD.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3129 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -25,6 +25,7 @@ import org.alfresco.repo.webservice.types.NamedValue;
|
||||
import org.alfresco.repo.webservice.types.Reference;
|
||||
import org.alfresco.repo.webservice.types.ResultSetRow;
|
||||
import org.alfresco.repo.webservice.types.ResultSetRowNode;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.AssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
@@ -71,7 +72,7 @@ public class AssociatedQuerySession extends AbstractQuerySession
|
||||
* org.alfresco.service.namespace.NamespaceService)
|
||||
*/
|
||||
public QueryResult getNextResultsBatch(SearchService searchService,
|
||||
NodeService nodeService, NamespaceService namespaceService)
|
||||
NodeService nodeService, NamespaceService namespaceService, DictionaryService dictionaryService)
|
||||
{
|
||||
QueryResult queryResult = null;
|
||||
|
||||
@@ -114,13 +115,7 @@ public class AssociatedQuerySession extends AbstractQuerySession
|
||||
int col = 0;
|
||||
for (QName propName : props.keySet())
|
||||
{
|
||||
String value = null;
|
||||
Serializable valueObj = props.get(propName);
|
||||
if (valueObj != null)
|
||||
{
|
||||
value = valueObj.toString();
|
||||
}
|
||||
columns[col] = new NamedValue(propName.toString(), value);
|
||||
columns[col] = Utils.createNamedValue(dictionaryService, propName, props.get(propName));
|
||||
col++;
|
||||
}
|
||||
|
||||
|
@@ -25,6 +25,7 @@ import org.alfresco.repo.webservice.types.NamedValue;
|
||||
import org.alfresco.repo.webservice.types.Reference;
|
||||
import org.alfresco.repo.webservice.types.ResultSetRow;
|
||||
import org.alfresco.repo.webservice.types.ResultSetRowNode;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
@@ -63,7 +64,7 @@ public class ChildrenQuerySession extends AbstractQuerySession
|
||||
/**
|
||||
* @see org.alfresco.repo.webservice.repository.QuerySession#getNextResultsBatch(org.alfresco.service.cmr.search.SearchService, org.alfresco.service.cmr.repository.NodeService, org.alfresco.service.namespace.NamespaceService)
|
||||
*/
|
||||
public QueryResult getNextResultsBatch(SearchService searchService, NodeService nodeService, NamespaceService namespaceService)
|
||||
public QueryResult getNextResultsBatch(SearchService searchService, NodeService nodeService, NamespaceService namespaceService, DictionaryService dictionaryService)
|
||||
{
|
||||
QueryResult queryResult = null;
|
||||
|
||||
@@ -100,13 +101,7 @@ public class ChildrenQuerySession extends AbstractQuerySession
|
||||
int col = 0;
|
||||
for (QName propName : props.keySet())
|
||||
{
|
||||
String value = null;
|
||||
Serializable valueObj = props.get(propName);
|
||||
if (valueObj != null)
|
||||
{
|
||||
value = valueObj.toString();
|
||||
}
|
||||
columns[col] = new NamedValue(propName.toString(), value);
|
||||
columns[col] = Utils.createNamedValue(dictionaryService, propName, props.get(propName));
|
||||
col++;
|
||||
}
|
||||
|
||||
|
@@ -25,6 +25,7 @@ import org.alfresco.repo.webservice.types.NamedValue;
|
||||
import org.alfresco.repo.webservice.types.Reference;
|
||||
import org.alfresco.repo.webservice.types.ResultSetRow;
|
||||
import org.alfresco.repo.webservice.types.ResultSetRowNode;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
@@ -63,7 +64,7 @@ public class ParentsQuerySession extends AbstractQuerySession
|
||||
/**
|
||||
* @see org.alfresco.repo.webservice.repository.QuerySession#getNextResultsBatch(org.alfresco.service.cmr.search.SearchService, org.alfresco.service.cmr.repository.NodeService, org.alfresco.service.namespace.NamespaceService)
|
||||
*/
|
||||
public QueryResult getNextResultsBatch(SearchService searchService, NodeService nodeService, NamespaceService namespaceService)
|
||||
public QueryResult getNextResultsBatch(SearchService searchService, NodeService nodeService, NamespaceService namespaceService, DictionaryService dictionaryService)
|
||||
{
|
||||
QueryResult queryResult = null;
|
||||
|
||||
@@ -100,13 +101,7 @@ public class ParentsQuerySession extends AbstractQuerySession
|
||||
int col = 0;
|
||||
for (QName propName : props.keySet())
|
||||
{
|
||||
String value = null;
|
||||
Serializable valueObj = props.get(propName);
|
||||
if (valueObj != null)
|
||||
{
|
||||
value = valueObj.toString();
|
||||
}
|
||||
columns[col] = new NamedValue(propName.toString(), value);
|
||||
columns[col] = Utils.createNamedValue(dictionaryService, propName, props.get(propName));
|
||||
col++;
|
||||
}
|
||||
|
||||
|
@@ -18,6 +18,7 @@ package org.alfresco.repo.webservice.repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
@@ -51,6 +52,9 @@ public interface QuerySession extends Serializable
|
||||
* @return QueryResult containing the next batch of results or null if there
|
||||
* are no more results
|
||||
*/
|
||||
public QueryResult getNextResultsBatch(SearchService searchService, NodeService nodeService,
|
||||
NamespaceService namespaceService);
|
||||
public QueryResult getNextResultsBatch(
|
||||
SearchService searchService,
|
||||
NodeService nodeService,
|
||||
NamespaceService namespaceService,
|
||||
DictionaryService dictionaryService);
|
||||
}
|
||||
|
@@ -44,7 +44,6 @@ import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.dictionary.TypeDefinition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.axis.MessageContext;
|
||||
import org.apache.commons.logging.Log;
|
||||
@@ -199,7 +198,7 @@ public class RepositoryWebService extends AbstractWebService implements
|
||||
.getBatchSize(msgContext), store, query, includeMetaData);
|
||||
QueryResult queryResult = querySession
|
||||
.getNextResultsBatch(this.searchService, this.nodeService,
|
||||
this.namespaceService);
|
||||
this.namespaceService, this.dictionaryService);
|
||||
|
||||
// add the session to the cache if there are more results to come
|
||||
if (queryResult.getQuerySession() != null)
|
||||
@@ -255,7 +254,7 @@ public class RepositoryWebService extends AbstractWebService implements
|
||||
.getBatchSize(MessageContext.getCurrentContext()), node);
|
||||
QueryResult queryResult = querySession
|
||||
.getNextResultsBatch(this.searchService, this.nodeService,
|
||||
this.namespaceService);
|
||||
this.namespaceService, this.dictionaryService);
|
||||
|
||||
// add the session to the cache if there are more results to come
|
||||
if (queryResult.getQuerySession() != null)
|
||||
@@ -314,7 +313,7 @@ public class RepositoryWebService extends AbstractWebService implements
|
||||
.getBatchSize(MessageContext.getCurrentContext()), node);
|
||||
QueryResult queryResult = querySession
|
||||
.getNextResultsBatch(this.searchService, this.nodeService,
|
||||
this.namespaceService);
|
||||
this.namespaceService, this.dictionaryService);
|
||||
|
||||
// add the session to the cache if there are more results to come
|
||||
if (queryResult.getQuerySession() != null)
|
||||
@@ -368,7 +367,7 @@ public class RepositoryWebService extends AbstractWebService implements
|
||||
QuerySession querySession = new AssociatedQuerySession(Utils.getBatchSize(MessageContext.getCurrentContext()), node);
|
||||
QueryResult queryResult = querySession
|
||||
.getNextResultsBatch(this.searchService, this.nodeService,
|
||||
this.namespaceService);
|
||||
this.namespaceService, this.dictionaryService);
|
||||
|
||||
// add the session to the cache if there are more results to come
|
||||
if (queryResult.getQuerySession() != null)
|
||||
@@ -435,7 +434,7 @@ public class RepositoryWebService extends AbstractWebService implements
|
||||
|
||||
// get the next batch of results
|
||||
queryResult = session.getNextResultsBatch(this.searchService,
|
||||
this.nodeService, this.namespaceService);
|
||||
this.nodeService, this.namespaceService, this.dictionaryService);
|
||||
|
||||
// remove the QuerySession from the cache if there are no more
|
||||
// results to come
|
||||
@@ -647,17 +646,8 @@ public class RepositoryWebService extends AbstractWebService implements
|
||||
NamedValue[] properties = new NamedValue[propertyMap.size()];
|
||||
int propertyIndex = 0;
|
||||
for (Map.Entry<QName, Serializable> entry : propertyMap.entrySet())
|
||||
{
|
||||
String value = null;
|
||||
try
|
||||
{
|
||||
value = DefaultTypeConverter.INSTANCE.convert(String.class, entry.getValue());
|
||||
}
|
||||
catch (Throwable exception)
|
||||
{
|
||||
value = entry.getValue().toString();
|
||||
}
|
||||
properties[propertyIndex] = new NamedValue(entry.getKey().toString(), value);
|
||||
{
|
||||
properties[propertyIndex] = Utils.createNamedValue(this.dictionaryService, entry.getKey(), entry.getValue());
|
||||
propertyIndex++;
|
||||
}
|
||||
|
||||
|
@@ -24,14 +24,15 @@ import org.alfresco.repo.webservice.types.NamedValue;
|
||||
import org.alfresco.repo.webservice.types.Query;
|
||||
import org.alfresco.repo.webservice.types.ResultSetRowNode;
|
||||
import org.alfresco.repo.webservice.types.Store;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.Path;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
import org.alfresco.service.cmr.search.ResultSet;
|
||||
import org.alfresco.service.cmr.search.ResultSetRow;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
@@ -70,7 +71,7 @@ public class ResultSetQuerySession extends AbstractQuerySession
|
||||
/**
|
||||
* @see org.alfresco.repo.webservice.repository.QuerySession#getNextResultsBatch(org.alfresco.service.cmr.search.SearchService, org.alfresco.service.cmr.repository.NodeService, org.alfresco.service.namespace.NamespaceService)
|
||||
*/
|
||||
public QueryResult getNextResultsBatch(SearchService searchService, NodeService nodeService, NamespaceService namespaceService)
|
||||
public QueryResult getNextResultsBatch(SearchService searchService, NodeService nodeService, NamespaceService namespaceService, DictionaryService dictionaryService)
|
||||
{
|
||||
QueryResult queryResult = null;
|
||||
|
||||
@@ -114,16 +115,6 @@ public class ResultSetQuerySession extends AbstractQuerySession
|
||||
int col = 0;
|
||||
for (Path path : values.keySet())
|
||||
{
|
||||
String value = null;
|
||||
try
|
||||
{
|
||||
value = DefaultTypeConverter.INSTANCE.convert(String.class, values.get(path));
|
||||
}
|
||||
catch (Throwable exception)
|
||||
{
|
||||
value = values.get(path).toString();
|
||||
}
|
||||
|
||||
// Get the attribute QName from the result path
|
||||
String attributeName = path.last().toString();
|
||||
if (attributeName.startsWith("@") == true)
|
||||
@@ -131,7 +122,7 @@ public class ResultSetQuerySession extends AbstractQuerySession
|
||||
attributeName = attributeName.substring(1);
|
||||
}
|
||||
|
||||
columns[col] = new NamedValue(attributeName, value);
|
||||
columns[col] = Utils.createNamedValue(dictionaryService, QName.createQName(attributeName), values.get(path)); //new NamedValue(attributeName, value);
|
||||
col++;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user