mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Added module status to module.properties file saved in WAR for later use. Added contribution to return node path in Reference object. Fixed issues with web service caused by outdated Jars and incorrect AuthenticationService
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4980 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -341,11 +341,11 @@ public class CMLUtil
|
|||||||
}
|
}
|
||||||
if (sourceNodeRef != null)
|
if (sourceNodeRef != null)
|
||||||
{
|
{
|
||||||
result.setSource(Utils.convertToReference(sourceNodeRef));
|
result.setSource(Utils.convertToReference(this.nodeService, sourceNodeRef));
|
||||||
}
|
}
|
||||||
if (destinationNodeRef != null)
|
if (destinationNodeRef != null)
|
||||||
{
|
{
|
||||||
result.setDestination(Utils.convertToReference(destinationNodeRef));
|
result.setDestination(Utils.convertToReference(this.nodeService, destinationNodeRef));
|
||||||
}
|
}
|
||||||
// Sort out the count ???
|
// Sort out the count ???
|
||||||
return result;
|
return result;
|
||||||
|
@@ -359,7 +359,7 @@ public class CMLUtilTest extends BaseSpringTest
|
|||||||
this.nodeService.addChild(this.folderNodeRef, this.nodeRef, ContentModel.ASSOC_CONTAINS, ContentModel.ASSOC_CONTAINS);
|
this.nodeService.addChild(this.folderNodeRef, this.nodeRef, ContentModel.ASSOC_CONTAINS, ContentModel.ASSOC_CONTAINS);
|
||||||
|
|
||||||
CMLRemoveChild removeChild = new CMLRemoveChild();
|
CMLRemoveChild removeChild = new CMLRemoveChild();
|
||||||
removeChild.setFrom(Utils.convertToReference(this.folderNodeRef));
|
removeChild.setFrom(Utils.convertToReference(this.nodeService, this.folderNodeRef));
|
||||||
removeChild.setWhere(createPredicate(this.nodeRef));
|
removeChild.setWhere(createPredicate(this.nodeRef));
|
||||||
|
|
||||||
CML cml = new CML();
|
CML cml = new CML();
|
||||||
@@ -448,7 +448,7 @@ public class CMLUtilTest extends BaseSpringTest
|
|||||||
{
|
{
|
||||||
Predicate predicate = new Predicate();
|
Predicate predicate = new Predicate();
|
||||||
predicate.setStore(Utils.convertToStore(nodeRef.getStoreRef()));
|
predicate.setStore(Utils.convertToStore(nodeRef.getStoreRef()));
|
||||||
predicate.setNodes(new Reference[]{Utils.convertToReference(nodeRef)});
|
predicate.setNodes(new Reference[]{Utils.convertToReference(this.nodeService, nodeRef)});
|
||||||
return predicate;
|
return predicate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -309,12 +309,26 @@ public class Utils
|
|||||||
* The node to create a Reference for
|
* The node to create a Reference for
|
||||||
* @return The Reference
|
* @return The Reference
|
||||||
*/
|
*/
|
||||||
public static Reference convertToReference(NodeRef node)
|
public static Reference convertToReference(NodeService nodeService, NodeRef node)
|
||||||
{
|
{
|
||||||
Reference ref = new Reference();
|
Reference ref = new Reference();
|
||||||
Store store = new Store(node.getStoreRef().getProtocol(), node.getStoreRef().getIdentifier());
|
Store store = new Store(node.getStoreRef().getProtocol(), node.getStoreRef().getIdentifier());
|
||||||
ref.setStore(store);
|
ref.setStore(store);
|
||||||
ref.setUuid(node.getId());
|
ref.setUuid(node.getId());
|
||||||
|
|
||||||
|
// Need to check if node still exists (e.g., after a delete operation) so getPath()
|
||||||
|
// doesn't fail
|
||||||
|
if(nodeService.exists(node) == true)
|
||||||
|
{
|
||||||
|
if (logger.isDebugEnabled())
|
||||||
|
{
|
||||||
|
logger.debug("setting path for reference to: " + nodeService.getPath(node).toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
// so clients can get the path too
|
||||||
|
ref.setPath(nodeService.getPath(node).toString());
|
||||||
|
}
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,12 +338,10 @@ public class Utils
|
|||||||
* @param store
|
* @param store
|
||||||
* The Store to search within
|
* The Store to search within
|
||||||
* @param uuid
|
* @param uuid
|
||||||
* The id of the node, or the id of the starting node if a path
|
* The id of the required node.c
|
||||||
* is also present
|
|
||||||
* @param path
|
* @param path
|
||||||
* The path to the required node, if a uuid is given the search
|
* The path to the required node. If a uuid is given the uuid is used
|
||||||
* starts from that node otherwise the search will start from the
|
+ * to find the node. Otherwise, the path is used.
|
||||||
* root node
|
|
||||||
* @param nodeService
|
* @param nodeService
|
||||||
* NodeService to use
|
* NodeService to use
|
||||||
* @param searchService
|
* @param searchService
|
||||||
@@ -350,19 +362,9 @@ public class Utils
|
|||||||
|
|
||||||
NodeRef nodeRef = null;
|
NodeRef nodeRef = null;
|
||||||
|
|
||||||
// find out where we are starting from, either the root or the node
|
// If uuid is null, then use the path to find the node
|
||||||
// represented by the uuid
|
|
||||||
NodeRef rootNodeRef = null;
|
|
||||||
if (uuid == null || uuid.length() == 0)
|
if (uuid == null || uuid.length() == 0)
|
||||||
{
|
{
|
||||||
rootNodeRef = nodeService.getRootNode(convertToStoreRef(store));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
rootNodeRef = new NodeRef(convertToStoreRef(store), uuid);
|
|
||||||
}
|
|
||||||
|
|
||||||
// see if we have a path to further define the node being requested
|
|
||||||
if (path != null && path.length() != 0)
|
if (path != null && path.length() != 0)
|
||||||
{
|
{
|
||||||
if (logger.isDebugEnabled() == true)
|
if (logger.isDebugEnabled() == true)
|
||||||
@@ -370,6 +372,7 @@ public class Utils
|
|||||||
logger.debug("Resolving path: " + path);
|
logger.debug("Resolving path: " + path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NodeRef rootNodeRef = nodeService.getRootNode(convertToStoreRef(store));
|
||||||
List<NodeRef> nodes = searchService.selectNodes(rootNodeRef, path,
|
List<NodeRef> nodes = searchService.selectNodes(rootNodeRef, path,
|
||||||
null, namespaceService, false);
|
null, namespaceService, false);
|
||||||
|
|
||||||
@@ -390,14 +393,14 @@ public class Utils
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (logger.isDebugEnabled() == true)
|
throw new IllegalArgumentException("A uuid or a path must be supplied to resolve to a NodeRef");
|
||||||
{
|
|
||||||
logger.debug("There was no path to resolve so using root or specified node");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if there is no path just use whatever the rootNodeRef currently
|
|
||||||
// is
|
}
|
||||||
nodeRef = rootNodeRef;
|
else // use the uuid
|
||||||
|
{
|
||||||
|
nodeRef = new NodeRef(convertToStoreRef(store), uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
return nodeRef;
|
return nodeRef;
|
||||||
@@ -556,12 +559,13 @@ public class Utils
|
|||||||
* @return the web service version object
|
* @return the web service version object
|
||||||
*/
|
*/
|
||||||
public static Version convertToVersion(
|
public static Version convertToVersion(
|
||||||
|
NodeService nodeService,
|
||||||
org.alfresco.service.cmr.version.Version version)
|
org.alfresco.service.cmr.version.Version version)
|
||||||
{
|
{
|
||||||
Version webServiceVersion = new Version();
|
Version webServiceVersion = new Version();
|
||||||
|
|
||||||
// Set the basic properties
|
// Set the basic properties
|
||||||
webServiceVersion.setId(Utils.convertToReference(version
|
webServiceVersion.setId(Utils.convertToReference(nodeService, version
|
||||||
.getFrozenStateNodeRef()));
|
.getFrozenStateNodeRef()));
|
||||||
webServiceVersion.setCreator(version.getCreator());
|
webServiceVersion.setCreator(version.getCreator());
|
||||||
webServiceVersion.setLabel(version.getVersionLabel());
|
webServiceVersion.setLabel(version.getVersionLabel());
|
||||||
|
@@ -128,7 +128,7 @@ public class AccessControlWebService extends AbstractWebService implements Acces
|
|||||||
{
|
{
|
||||||
// Create the acl
|
// Create the acl
|
||||||
ACL acl = new ACL();
|
ACL acl = new ACL();
|
||||||
acl.setReference(Utils.convertToReference(node));
|
acl.setReference(Utils.convertToReference(this.nodeService, node));
|
||||||
|
|
||||||
// Set the inhertied value
|
// Set the inhertied value
|
||||||
boolean inheritPermission = this.permissionService.getInheritParentPermissions(node);
|
boolean inheritPermission = this.permissionService.getInheritParentPermissions(node);
|
||||||
@@ -332,7 +332,7 @@ public class AccessControlWebService extends AbstractWebService implements Acces
|
|||||||
|
|
||||||
// Create the permissions result object
|
// Create the permissions result object
|
||||||
GetPermissionsResult result = new GetPermissionsResult();
|
GetPermissionsResult result = new GetPermissionsResult();
|
||||||
result.setReference(Utils.convertToReference(node));
|
result.setReference(Utils.convertToReference(this.nodeService, node));
|
||||||
result.setPermissions((String[])permissions.toArray(new String[permissions.size()]));
|
result.setPermissions((String[])permissions.toArray(new String[permissions.size()]));
|
||||||
|
|
||||||
// Add result to array
|
// Add result to array
|
||||||
@@ -451,7 +451,7 @@ public class AccessControlWebService extends AbstractWebService implements Acces
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add to the results list
|
// Add to the results list
|
||||||
results.add(new HasPermissionsResult(Utils.convertToReference(node), permission, accessState));
|
results.add(new HasPermissionsResult(Utils.convertToReference(this.nodeService, node), permission, accessState));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -556,7 +556,7 @@ public class AccessControlWebService extends AbstractWebService implements Acces
|
|||||||
String owner = this.ownableService.getOwner(node);
|
String owner = this.ownableService.getOwner(node);
|
||||||
|
|
||||||
// Marshal into result
|
// Marshal into result
|
||||||
result[count] = new OwnerResult(Utils.convertToReference(node), owner);
|
result[count] = new OwnerResult(Utils.convertToReference(this.nodeService, node), owner);
|
||||||
count ++;
|
count ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -609,7 +609,7 @@ public class AccessControlWebService extends AbstractWebService implements Acces
|
|||||||
this.ownableService.setOwner(node, owner);
|
this.ownableService.setOwner(node, owner);
|
||||||
|
|
||||||
// Marshal into result
|
// Marshal into result
|
||||||
result[count] = new OwnerResult(Utils.convertToReference(node), owner);
|
result[count] = new OwnerResult(Utils.convertToReference(this.nodeService, node), owner);
|
||||||
count ++;
|
count ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -483,7 +483,7 @@ public class ActionWebService extends AbstractWebService implements ActionServic
|
|||||||
|
|
||||||
// Create the web service action object
|
// Create the web service action object
|
||||||
org.alfresco.repo.webservice.action.Action webServiceAction = new org.alfresco.repo.webservice.action.Action(
|
org.alfresco.repo.webservice.action.Action webServiceAction = new org.alfresco.repo.webservice.action.Action(
|
||||||
Utils.convertToReference(action.getNodeRef()),
|
Utils.convertToReference(this.nodeService, action.getNodeRef()),
|
||||||
action.getId(),
|
action.getId(),
|
||||||
action.getActionDefinitionName(),
|
action.getActionDefinitionName(),
|
||||||
action.getTitle(),
|
action.getTitle(),
|
||||||
@@ -860,7 +860,7 @@ public class ActionWebService extends AbstractWebService implements ActionServic
|
|||||||
{
|
{
|
||||||
// Create the execution result object and set the action reference
|
// Create the execution result object and set the action reference
|
||||||
ActionExecutionResult executionResult = new ActionExecutionResult();
|
ActionExecutionResult executionResult = new ActionExecutionResult();
|
||||||
executionResult.setReference(Utils.convertToReference(nodeRef));
|
executionResult.setReference(Utils.convertToReference(this.nodeService, nodeRef));
|
||||||
|
|
||||||
// Tyr and execute the actions
|
// Tyr and execute the actions
|
||||||
List<org.alfresco.repo.webservice.action.Action> executedActions = new ArrayList<org.alfresco.repo.webservice.action.Action>(10);
|
List<org.alfresco.repo.webservice.action.Action> executedActions = new ArrayList<org.alfresco.repo.webservice.action.Action>(10);
|
||||||
@@ -946,12 +946,12 @@ public class ActionWebService extends AbstractWebService implements ActionServic
|
|||||||
NodeRef owningNodeRef = this.ruleService.getOwningNodeRef(rule);
|
NodeRef owningNodeRef = this.ruleService.getOwningNodeRef(rule);
|
||||||
if (owningNodeRef != null)
|
if (owningNodeRef != null)
|
||||||
{
|
{
|
||||||
owningReference = Utils.convertToReference(owningNodeRef);
|
owningReference = Utils.convertToReference(this.nodeService, owningNodeRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the web service rule object
|
// Create the web service rule object
|
||||||
org.alfresco.repo.webservice.action.Rule webServiceRule = new org.alfresco.repo.webservice.action.Rule(
|
org.alfresco.repo.webservice.action.Rule webServiceRule = new org.alfresco.repo.webservice.action.Rule(
|
||||||
Utils.convertToReference(rule.getNodeRef()),
|
Utils.convertToReference(this.nodeService, rule.getNodeRef()),
|
||||||
owningReference,
|
owningReference,
|
||||||
rule.getRuleTypes().toArray(new String[rule.getRuleTypes().size()]),
|
rule.getRuleTypes().toArray(new String[rule.getRuleTypes().size()]),
|
||||||
rule.getTitle(),
|
rule.getTitle(),
|
||||||
|
@@ -183,8 +183,8 @@ public class AuthoringWebService extends AbstractWebService implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
// store the results
|
// store the results
|
||||||
originals[x] = Utils.convertToReference(original);
|
originals[x] = Utils.convertToReference(AuthoringWebService.this.nodeService, original);
|
||||||
workingCopies[x] = Utils.convertToReference(workingCopy);
|
workingCopies[x] = Utils.convertToReference(AuthoringWebService.this.nodeService, workingCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup the result object
|
// setup the result object
|
||||||
@@ -248,12 +248,12 @@ public class AuthoringWebService extends AbstractWebService implements
|
|||||||
NodeRef checkedInNode = AuthoringWebService.this.cociService.checkin(node, mapComments, null, keepCheckedOut);
|
NodeRef checkedInNode = AuthoringWebService.this.cociService.checkin(node, mapComments, null, keepCheckedOut);
|
||||||
|
|
||||||
// Add the results to the array
|
// Add the results to the array
|
||||||
checkedIn[iIndex] = Utils.convertToReference(checkedInNode);
|
checkedIn[iIndex] = Utils.convertToReference(AuthoringWebService.this.nodeService, checkedInNode);
|
||||||
|
|
||||||
// Only return the working copies if the node is keep checked out otherwise the working copies have been deleted
|
// Only return the working copies if the node is keep checked out otherwise the working copies have been deleted
|
||||||
if (keepCheckedOut == true)
|
if (keepCheckedOut == true)
|
||||||
{
|
{
|
||||||
listWorkingCopies.add(Utils.convertToReference(node));
|
listWorkingCopies.add(Utils.convertToReference(AuthoringWebService.this.nodeService, node));
|
||||||
}
|
}
|
||||||
iIndex++;
|
iIndex++;
|
||||||
}
|
}
|
||||||
@@ -333,7 +333,7 @@ public class AuthoringWebService extends AbstractWebService implements
|
|||||||
contentUrl,
|
contentUrl,
|
||||||
keepCheckedOut);
|
keepCheckedOut);
|
||||||
// Return the orig node ref
|
// Return the orig node ref
|
||||||
return Utils.convertToReference(origNodeRef);
|
return Utils.convertToReference(AuthoringWebService.this.nodeService, origNodeRef);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -380,8 +380,8 @@ public class AuthoringWebService extends AbstractWebService implements
|
|||||||
NodeRef origNode = AuthoringWebService.this.cociService.cancelCheckout(node);
|
NodeRef origNode = AuthoringWebService.this.cociService.cancelCheckout(node);
|
||||||
|
|
||||||
// Set the value in the arrays
|
// Set the value in the arrays
|
||||||
origNodes[iIndex] = Utils.convertToReference(origNode);
|
origNodes[iIndex] = Utils.convertToReference(AuthoringWebService.this.nodeService, origNode);
|
||||||
workingCopies[iIndex] = Utils.convertToReference(node);
|
workingCopies[iIndex] = Utils.convertToReference(AuthoringWebService.this.nodeService, node);
|
||||||
iIndex ++;
|
iIndex ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -433,7 +433,7 @@ public class AuthoringWebService extends AbstractWebService implements
|
|||||||
{
|
{
|
||||||
LockType convertedLockType = convertToLockType(lockType);
|
LockType convertedLockType = convertToLockType(lockType);
|
||||||
AuthoringWebService.this.lockService.lock(node, convertedLockType, 0, lockChildren);
|
AuthoringWebService.this.lockService.lock(node, convertedLockType, 0, lockChildren);
|
||||||
result[iIndex] = Utils.convertToReference(node);
|
result[iIndex] = Utils.convertToReference(AuthoringWebService.this.nodeService, node);
|
||||||
iIndex++;
|
iIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -501,7 +501,7 @@ public class AuthoringWebService extends AbstractWebService implements
|
|||||||
{
|
{
|
||||||
AuthoringWebService.this.lockService.unlock(node, unlockChildren);
|
AuthoringWebService.this.lockService.unlock(node, unlockChildren);
|
||||||
|
|
||||||
result[iIndex] = Utils.convertToReference(node);
|
result[iIndex] = Utils.convertToReference(AuthoringWebService.this.nodeService, node);
|
||||||
iIndex++;
|
iIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -555,7 +555,7 @@ public class AuthoringWebService extends AbstractWebService implements
|
|||||||
LockStatus lockStatus = new LockStatus();
|
LockStatus lockStatus = new LockStatus();
|
||||||
lockStatus.setLockOwner(lockOwner);
|
lockStatus.setLockOwner(lockOwner);
|
||||||
lockStatus.setLockType(lockTypeEnum);
|
lockStatus.setLockType(lockTypeEnum);
|
||||||
lockStatus.setNode(Utils.convertToReference(node));
|
lockStatus.setNode(Utils.convertToReference(AuthoringWebService.this.nodeService, node));
|
||||||
|
|
||||||
result[iIndex] = lockStatus;
|
result[iIndex] = lockStatus;
|
||||||
iIndex++;
|
iIndex++;
|
||||||
@@ -634,8 +634,8 @@ public class AuthoringWebService extends AbstractWebService implements
|
|||||||
Collection<Version> versions = AuthoringWebService.this.versionService.createVersion(node, mapComments, versionChildren);
|
Collection<Version> versions = AuthoringWebService.this.versionService.createVersion(node, mapComments, versionChildren);
|
||||||
for (Version version : versions)
|
for (Version version : versions)
|
||||||
{
|
{
|
||||||
versionedReferences.add(Utils.convertToReference(version.getVersionedNodeRef()));
|
versionedReferences.add(Utils.convertToReference(AuthoringWebService.this.nodeService, version.getVersionedNodeRef()));
|
||||||
webServiceVersions.add(Utils.convertToVersion(version));
|
webServiceVersions.add(Utils.convertToVersion(AuthoringWebService.this.nodeService, version));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -689,7 +689,7 @@ public class AuthoringWebService extends AbstractWebService implements
|
|||||||
int iIndex = 0;
|
int iIndex = 0;
|
||||||
for (Version version : versions)
|
for (Version version : versions)
|
||||||
{
|
{
|
||||||
webServiceVersions[iIndex] = Utils.convertToVersion(version);
|
webServiceVersions[iIndex] = Utils.convertToVersion(AuthoringWebService.this.nodeService, version);
|
||||||
iIndex ++;
|
iIndex ++;
|
||||||
}
|
}
|
||||||
webServiceVersionHistory.setVersions(webServiceVersions);
|
webServiceVersionHistory.setVersions(webServiceVersions);
|
||||||
|
@@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.webservice.classification;
|
package org.alfresco.repo.webservice.classification;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.rmi.RemoteException;
|
import java.rmi.RemoteException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -177,7 +176,7 @@ public class ClassificationWebService extends AbstractWebService implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
Category category = new Category();
|
Category category = new Category();
|
||||||
category.setId(Utils.convertToReference(nodeRef));
|
category.setId(Utils.convertToReference(this.nodeService, nodeRef));
|
||||||
category.setTitle(title);
|
category.setTitle(title);
|
||||||
// TODO need to set the description
|
// TODO need to set the description
|
||||||
return category;
|
return category;
|
||||||
@@ -275,7 +274,7 @@ public class ClassificationWebService extends AbstractWebService implements
|
|||||||
int iIndex = 0;
|
int iIndex = 0;
|
||||||
for (NodeRef categoryNodeRef : categoryNodeRefs)
|
for (NodeRef categoryNodeRef : categoryNodeRefs)
|
||||||
{
|
{
|
||||||
categoryReferences[iIndex] = Utils.convertToReference(categoryNodeRef);
|
categoryReferences[iIndex] = Utils.convertToReference(ClassificationWebService.this.nodeService, categoryNodeRef);
|
||||||
iIndex ++;
|
iIndex ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,7 +291,7 @@ public class ClassificationWebService extends AbstractWebService implements
|
|||||||
|
|
||||||
// Create the category result object
|
// Create the category result object
|
||||||
CategoriesResult categoryResult = new CategoriesResult();
|
CategoriesResult categoryResult = new CategoriesResult();
|
||||||
categoryResult.setNode(Utils.convertToReference(nodeRef));
|
categoryResult.setNode(Utils.convertToReference(ClassificationWebService.this.nodeService, nodeRef));
|
||||||
categoryResult.setCategories(appliedCategories.toArray(new AppliedCategory[appliedCategories.size()]));
|
categoryResult.setCategories(appliedCategories.toArray(new AppliedCategory[appliedCategories.size()]));
|
||||||
|
|
||||||
result.add(categoryResult);
|
result.add(categoryResult);
|
||||||
@@ -401,7 +400,7 @@ public class ClassificationWebService extends AbstractWebService implements
|
|||||||
|
|
||||||
// Create the category result object
|
// Create the category result object
|
||||||
CategoriesResult categoryResult = new CategoriesResult();
|
CategoriesResult categoryResult = new CategoriesResult();
|
||||||
categoryResult.setNode(Utils.convertToReference(nodeRef));
|
categoryResult.setNode(Utils.convertToReference(ClassificationWebService.this.nodeService, nodeRef));
|
||||||
categoryResult.setCategories(appliedCategories.toArray(new AppliedCategory[appliedCategories.size()]));
|
categoryResult.setCategories(appliedCategories.toArray(new AppliedCategory[appliedCategories.size()]));
|
||||||
|
|
||||||
result.add(categoryResult);
|
result.add(categoryResult);
|
||||||
|
@@ -147,7 +147,7 @@ public class ContentWebService extends AbstractWebService implements
|
|||||||
|
|
||||||
// Create the content object
|
// Create the content object
|
||||||
ContentFormat format = new ContentFormat(contentReader.getMimetype(), contentReader.getEncoding());
|
ContentFormat format = new ContentFormat(contentReader.getMimetype(), contentReader.getEncoding());
|
||||||
content = new Content(Utils.convertToReference(nodeRef), property, contentReader.getSize(), format, downloadUrl);
|
content = new Content(Utils.convertToReference(this.nodeService, nodeRef), property, contentReader.getSize(), format, downloadUrl);
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
@@ -163,7 +163,7 @@ public class ContentWebService extends AbstractWebService implements
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Create an empty content object
|
// Create an empty content object
|
||||||
content = new Content(Utils.convertToReference(nodeRef), property, 0, null, null);
|
content = new Content(Utils.convertToReference(this.nodeService, nodeRef), property, 0, null, null);
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
|
@@ -111,7 +111,7 @@ public class AssociatedQuerySession extends AbstractQuerySession
|
|||||||
// get the data for the row and build up the columns structure
|
// get the data for the row and build up the columns structure
|
||||||
Map<QName, Serializable> props = nodeService
|
Map<QName, Serializable> props = nodeService
|
||||||
.getProperties(childNodeRef);
|
.getProperties(childNodeRef);
|
||||||
NamedValue[] columns = new NamedValue[props.size()+1];
|
NamedValue[] columns = new NamedValue[props.size()+2];
|
||||||
int col = 0;
|
int col = 0;
|
||||||
for (QName propName : props.keySet())
|
for (QName propName : props.keySet())
|
||||||
{
|
{
|
||||||
@@ -122,6 +122,10 @@ public class AssociatedQuerySession extends AbstractQuerySession
|
|||||||
// Now add the system columns containing the association details
|
// Now add the system columns containing the association details
|
||||||
columns[col] = new NamedValue(SYS_COL_ASSOC_TYPE, Boolean.FALSE, assoc.getTypeQName().toString(), null);
|
columns[col] = new NamedValue(SYS_COL_ASSOC_TYPE, Boolean.FALSE, assoc.getTypeQName().toString(), null);
|
||||||
|
|
||||||
|
// Add one more column for the node's path
|
||||||
|
col++;
|
||||||
|
columns[col] = Utils.createNamedValue(dictionaryService, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "path"), nodeService.getPath(childNodeRef).toString());
|
||||||
|
|
||||||
ResultSetRow row = new ResultSetRow();
|
ResultSetRow row = new ResultSetRow();
|
||||||
row.setRowIndex(x);
|
row.setRowIndex(x);
|
||||||
row.setNode(rowNode);
|
row.setNode(rowNode);
|
||||||
|
@@ -97,7 +97,7 @@ public class ChildrenQuerySession extends AbstractQuerySession
|
|||||||
// create columns for all the properties of the node
|
// create columns for all the properties of the node
|
||||||
// get the data for the row and build up the columns structure
|
// get the data for the row and build up the columns structure
|
||||||
Map<QName, Serializable> props = nodeService.getProperties(childNodeRef);
|
Map<QName, Serializable> props = nodeService.getProperties(childNodeRef);
|
||||||
NamedValue[] columns = new NamedValue[props.size()+4];
|
NamedValue[] columns = new NamedValue[props.size()+5];
|
||||||
int col = 0;
|
int col = 0;
|
||||||
for (QName propName : props.keySet())
|
for (QName propName : props.keySet())
|
||||||
{
|
{
|
||||||
@@ -114,6 +114,10 @@ public class ChildrenQuerySession extends AbstractQuerySession
|
|||||||
col++;
|
col++;
|
||||||
columns[col] = new NamedValue(SYS_COL_NTH_SIBLING, Boolean.FALSE, Integer.toString(assoc.getNthSibling()), null);
|
columns[col] = new NamedValue(SYS_COL_NTH_SIBLING, Boolean.FALSE, Integer.toString(assoc.getNthSibling()), null);
|
||||||
|
|
||||||
|
// Add one more column for the node's path
|
||||||
|
col++;
|
||||||
|
columns[col] = Utils.createNamedValue(dictionaryService, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "path"), nodeService.getPath(childNodeRef).toString());
|
||||||
|
|
||||||
ResultSetRow row = new ResultSetRow();
|
ResultSetRow row = new ResultSetRow();
|
||||||
row.setRowIndex(x);
|
row.setRowIndex(x);
|
||||||
row.setNode(rowNode);
|
row.setNode(rowNode);
|
||||||
|
@@ -97,7 +97,7 @@ public class ParentsQuerySession extends AbstractQuerySession
|
|||||||
// create columns for all the properties of the node
|
// create columns for all the properties of the node
|
||||||
// get the data for the row and build up the columns structure
|
// get the data for the row and build up the columns structure
|
||||||
Map<QName, Serializable> props = nodeService.getProperties(parentNodeRef);
|
Map<QName, Serializable> props = nodeService.getProperties(parentNodeRef);
|
||||||
NamedValue[] columns = new NamedValue[props.size()+4];
|
NamedValue[] columns = new NamedValue[props.size()+5];
|
||||||
int col = 0;
|
int col = 0;
|
||||||
for (QName propName : props.keySet())
|
for (QName propName : props.keySet())
|
||||||
{
|
{
|
||||||
@@ -113,6 +113,9 @@ public class ParentsQuerySession extends AbstractQuerySession
|
|||||||
columns[col] = new NamedValue(SYS_COL_IS_PRIMARY, Boolean.FALSE, Boolean.toString(assoc.isPrimary()), null);
|
columns[col] = new NamedValue(SYS_COL_IS_PRIMARY, Boolean.FALSE, Boolean.toString(assoc.isPrimary()), null);
|
||||||
col++;
|
col++;
|
||||||
columns[col] = new NamedValue(SYS_COL_NTH_SIBLING, Boolean.FALSE, Integer.toString(assoc.getNthSibling()), null);
|
columns[col] = new NamedValue(SYS_COL_NTH_SIBLING, Boolean.FALSE, Integer.toString(assoc.getNthSibling()), null);
|
||||||
|
// Add one more column for the node's path
|
||||||
|
col++;
|
||||||
|
columns[col] = Utils.createNamedValue(dictionaryService, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "path"), nodeService.getPath(parentNodeRef).toString());
|
||||||
|
|
||||||
ResultSetRow row = new ResultSetRow();
|
ResultSetRow row = new ResultSetRow();
|
||||||
row.setRowIndex(x);
|
row.setRowIndex(x);
|
||||||
|
@@ -614,7 +614,7 @@ public class RepositoryWebService extends AbstractWebService implements
|
|||||||
for (NodeRef nodeRef : nodeRefs)
|
for (NodeRef nodeRef : nodeRefs)
|
||||||
{
|
{
|
||||||
// Get the nodes reference
|
// Get the nodes reference
|
||||||
Reference reference = Utils.convertToReference(nodeRef);
|
Reference reference = Utils.convertToReference(this.nodeService, nodeRef);
|
||||||
|
|
||||||
// Get the nodes type
|
// Get the nodes type
|
||||||
String type = this.nodeService.getType(nodeRef).toString();
|
String type = this.nodeService.getType(nodeRef).toString();
|
||||||
|
@@ -49,6 +49,7 @@ public class ResultSetQuerySession extends AbstractQuerySession
|
|||||||
|
|
||||||
private Store store;
|
private Store store;
|
||||||
private Query query;
|
private Query query;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private boolean includeMetaData;
|
private boolean includeMetaData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -111,7 +112,7 @@ public class ResultSetQuerySession extends AbstractQuerySession
|
|||||||
|
|
||||||
// get the data for the row and build up the columns structure
|
// get the data for the row and build up the columns structure
|
||||||
Map<Path, Serializable> values = origRow.getValues();
|
Map<Path, Serializable> values = origRow.getValues();
|
||||||
NamedValue[] columns = new NamedValue[values.size()];
|
NamedValue[] columns = new NamedValue[values.size() + 1];
|
||||||
int col = 0;
|
int col = 0;
|
||||||
for (Path path : values.keySet())
|
for (Path path : values.keySet())
|
||||||
{
|
{
|
||||||
@@ -126,6 +127,8 @@ public class ResultSetQuerySession extends AbstractQuerySession
|
|||||||
col++;
|
col++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add one extra column for the node's path
|
||||||
|
columns[col] = Utils.createNamedValue(dictionaryService, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "path"), nodeService.getPath(nodeRef).toString());
|
||||||
|
|
||||||
org.alfresco.repo.webservice.types.ResultSetRow row = new org.alfresco.repo.webservice.types.ResultSetRow();
|
org.alfresco.repo.webservice.types.ResultSetRow row = new org.alfresco.repo.webservice.types.ResultSetRow();
|
||||||
row.setColumns(columns);
|
row.setColumns(columns);
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
<!-- Axis handler to validate the ticket sent with the web service request -->
|
<!-- Axis handler to validate the ticket sent with the web service request -->
|
||||||
<bean id="ticketCallbackHandler" class="org.alfresco.repo.webservice.axis.TicketCallbackHandler">
|
<bean id="ticketCallbackHandler" class="org.alfresco.repo.webservice.axis.TicketCallbackHandler">
|
||||||
<property name="authenticationService">
|
<property name="authenticationService">
|
||||||
<ref bean="authenticationService"/>
|
<ref bean="AuthenticationService"/>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user