mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merged V2.0 to HEAD
5910: Web Services getUsers 5913: Web Services admin user password change 5956: LDAP anon simple bind test 6133: WCM-486 6158: Merged V1.4 to V2.0 5600: Split person bootstrap 5642: AR-439 NetBIOS adaptor status request 6160: VersionHistoryPerformance patch with no versionedNodeId git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6166 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -481,7 +481,14 @@ public class AdministrationWebService extends AbstractWebService implements
|
|||||||
private void changePasswordImpl(String userName, String oldPassword, String newPassword)
|
private void changePasswordImpl(String userName, String oldPassword, String newPassword)
|
||||||
{
|
{
|
||||||
// Update the authentication details
|
// Update the authentication details
|
||||||
this.authenticationService.updateAuthentication(userName, oldPassword.toCharArray(), newPassword.toCharArray());
|
if (this.authenticationService.getCurrentUserName().equals("admin") == true)
|
||||||
|
{
|
||||||
|
this.authenticationService.setAuthentication(userName, newPassword.toCharArray());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.authenticationService.updateAuthentication(userName, oldPassword.toCharArray(), newPassword.toCharArray());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -624,8 +631,36 @@ public class AdministrationWebService extends AbstractWebService implements
|
|||||||
|
|
||||||
Set<NodeRef> nodeRefs = AdministrationWebService.this.personService.getAllPeople();
|
Set<NodeRef> nodeRefs = AdministrationWebService.this.personService.getAllPeople();
|
||||||
|
|
||||||
// TODO do the filter of the resulting list here ....
|
// Filter the results
|
||||||
List<NodeRef> filteredNodeRefs = new ArrayList<NodeRef>(nodeRefs);
|
List<NodeRef> filteredNodeRefs = null;
|
||||||
|
if (filter != null && filter.getUserName() != null && filter.getUserName().length() != 0)
|
||||||
|
{
|
||||||
|
String userNameFilter = filter.getUserName();
|
||||||
|
|
||||||
|
if (logger.isDebugEnabled() == true)
|
||||||
|
{
|
||||||
|
logger.debug("Applying user query filter (" + userNameFilter + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
filteredNodeRefs = new ArrayList<NodeRef>(nodeRefs.size());
|
||||||
|
for (NodeRef nodeRef : nodeRefs)
|
||||||
|
{
|
||||||
|
String userName = (String)AdministrationWebService.this.nodeService.getProperty(nodeRef, ContentModel.PROP_USERNAME);
|
||||||
|
if (userName.matches(userNameFilter) == true)
|
||||||
|
{
|
||||||
|
filteredNodeRefs.add(nodeRef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (logger.isDebugEnabled() == true)
|
||||||
|
{
|
||||||
|
logger.debug("No user filter specified");
|
||||||
|
}
|
||||||
|
|
||||||
|
filteredNodeRefs = new ArrayList<NodeRef>(nodeRefs);
|
||||||
|
}
|
||||||
|
|
||||||
int totalRows = filteredNodeRefs.size();
|
int totalRows = filteredNodeRefs.size();
|
||||||
int lastRow = calculateLastRowIndex(totalRows);
|
int lastRow = calculateLastRowIndex(totalRows);
|
||||||
|
@@ -26,6 +26,7 @@ package org.alfresco.repo.webservice.repository;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.rmi.RemoteException;
|
import java.rmi.RemoteException;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -164,7 +165,7 @@ public class RepositoryWebService extends AbstractWebService implements
|
|||||||
logger.error("Unexpected error occurred", e);
|
logger.error("Unexpected error occurred", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new RepositoryFault(0, e.getMessage());
|
throw new RepositoryFault(0, e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,7 +231,7 @@ public class RepositoryWebService extends AbstractWebService implements
|
|||||||
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
||||||
throw new RepositoryFault(0, e.getMessage());
|
throw new RepositoryFault(0, e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,7 +292,7 @@ public class RepositoryWebService extends AbstractWebService implements
|
|||||||
logger.error("Unexpected error occurred", e);
|
logger.error("Unexpected error occurred", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new RepositoryFault(0, e.getMessage());
|
throw new RepositoryFault(0, e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,7 +346,7 @@ public class RepositoryWebService extends AbstractWebService implements
|
|||||||
logger.error("Unexpected error occurred", e);
|
logger.error("Unexpected error occurred", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new RepositoryFault(0, e.getMessage());
|
throw new RepositoryFault(0, e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -400,7 +401,7 @@ public class RepositoryWebService extends AbstractWebService implements
|
|||||||
logger.error("Unexpected error occurred", e);
|
logger.error("Unexpected error occurred", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new RepositoryFault(0, e.getMessage());
|
throw new RepositoryFault(0, e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -470,7 +471,7 @@ public class RepositoryWebService extends AbstractWebService implements
|
|||||||
logger.error("Unexpected error occurred", e);
|
logger.error("Unexpected error occurred", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new RepositoryFault(0, e.getMessage());
|
throw new RepositoryFault(0, e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -514,7 +515,7 @@ public class RepositoryWebService extends AbstractWebService implements
|
|||||||
logger.error("Unexpected error occurred", e);
|
logger.error("Unexpected error occurred", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new RepositoryFault(0, e.getMessage());
|
throw new RepositoryFault(0, e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -564,7 +565,7 @@ public class RepositoryWebService extends AbstractWebService implements
|
|||||||
logger.error("Unexpected error occurred", e);
|
logger.error("Unexpected error occurred", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new RepositoryFault(0, e.getMessage());
|
throw new RepositoryFault(0, e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -617,10 +618,18 @@ public class RepositoryWebService extends AbstractWebService implements
|
|||||||
|
|
||||||
// Resolve the predicate to a list of node references
|
// Resolve the predicate to a list of node references
|
||||||
List<NodeRef> nodeRefs = Utils.resolvePredicate(where, this.nodeService, this.searchService, this.namespaceService);
|
List<NodeRef> nodeRefs = Utils.resolvePredicate(where, this.nodeService, this.searchService, this.namespaceService);
|
||||||
nodes = new Node[nodeRefs.size()];
|
List<Node> nodeList = new ArrayList<Node>();
|
||||||
int index = 0;
|
|
||||||
for (NodeRef nodeRef : nodeRefs)
|
for (NodeRef nodeRef : nodeRefs)
|
||||||
{
|
{
|
||||||
|
// search can return nodes that no longer exist, so we need to ignore these
|
||||||
|
if(nodeService.exists(nodeRef) == false)
|
||||||
|
{
|
||||||
|
if(logger.isDebugEnabled())
|
||||||
|
{
|
||||||
|
logger.warn("Search returned node that doesn't exist: " + nodeRef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get the nodes reference
|
// Get the nodes reference
|
||||||
Reference reference = Utils.convertToReference(this.nodeService, this.namespaceService, nodeRef);
|
Reference reference = Utils.convertToReference(this.nodeService, this.namespaceService, nodeRef);
|
||||||
|
|
||||||
@@ -649,11 +658,11 @@ public class RepositoryWebService extends AbstractWebService implements
|
|||||||
|
|
||||||
// Create the node and add to the array
|
// Create the node and add to the array
|
||||||
Node node = new Node(reference, type, aspects, properties);
|
Node node = new Node(reference, type, aspects, properties);
|
||||||
nodes[index] = node;
|
nodeList.add(node);
|
||||||
|
|
||||||
index++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nodes = nodeList.toArray(new Node[nodeList.size()]);
|
||||||
|
|
||||||
// commit the transaction
|
// commit the transaction
|
||||||
tx.commit();
|
tx.commit();
|
||||||
}
|
}
|
||||||
@@ -677,7 +686,7 @@ public class RepositoryWebService extends AbstractWebService implements
|
|||||||
logger.error("Unexpected error occurred", e);
|
logger.error("Unexpected error occurred", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new RepositoryFault(0, e.getMessage());
|
throw new RepositoryFault(0, e.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
return nodes;
|
return nodes;
|
||||||
|
@@ -25,6 +25,8 @@
|
|||||||
package org.alfresco.repo.webservice.repository;
|
package org.alfresco.repo.webservice.repository;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.alfresco.repo.webservice.Utils;
|
import org.alfresco.repo.webservice.Utils;
|
||||||
@@ -109,13 +111,24 @@ public class ResultSetQuerySession extends AbstractQuerySession
|
|||||||
logger.debug("Total rows = " + totalRows + ", current batch size = " + currentBatchSize);
|
logger.debug("Total rows = " + totalRows + ", current batch size = " + currentBatchSize);
|
||||||
|
|
||||||
org.alfresco.repo.webservice.types.ResultSet batchResults = new org.alfresco.repo.webservice.types.ResultSet();
|
org.alfresco.repo.webservice.types.ResultSet batchResults = new org.alfresco.repo.webservice.types.ResultSet();
|
||||||
org.alfresco.repo.webservice.types.ResultSetRow[] rows = new org.alfresco.repo.webservice.types.ResultSetRow[currentBatchSize];
|
List<org.alfresco.repo.webservice.types.ResultSetRow> rowList =
|
||||||
|
new ArrayList<org.alfresco.repo.webservice.types.ResultSetRow>();
|
||||||
int arrPos = 0;
|
|
||||||
for (int x = this.position; x < lastRow; x++)
|
for (int x = this.position; x < lastRow; x++)
|
||||||
{
|
{
|
||||||
ResultSetRow origRow = searchResults.getRow(x);
|
ResultSetRow origRow = searchResults.getRow(x);
|
||||||
NodeRef nodeRef = origRow.getNodeRef();
|
NodeRef nodeRef = origRow.getNodeRef();
|
||||||
|
|
||||||
|
// search can return nodes that no longer exist, so we need to ignore these
|
||||||
|
if(nodeService.exists(nodeRef) == false)
|
||||||
|
{
|
||||||
|
if(logger.isDebugEnabled())
|
||||||
|
{
|
||||||
|
logger.warn("Search returned node that doesn't exist: " + nodeRef);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ResultSetRowNode rowNode = createResultSetRowNode(nodeRef, nodeService);
|
ResultSetRowNode rowNode = createResultSetRowNode(nodeRef, nodeService);
|
||||||
|
|
||||||
// get the data for the row and build up the columns structure
|
// get the data for the row and build up the columns structure
|
||||||
@@ -143,15 +156,16 @@ public class ResultSetQuerySession extends AbstractQuerySession
|
|||||||
row.setScore(origRow.getScore());
|
row.setScore(origRow.getScore());
|
||||||
row.setRowIndex(x);
|
row.setRowIndex(x);
|
||||||
row.setNode(rowNode);
|
row.setNode(rowNode);
|
||||||
|
|
||||||
// add the row to the overall results
|
// add the row to the overall results list
|
||||||
rows[arrPos] = row;
|
rowList.add(row);
|
||||||
arrPos++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: build up the meta data data structure if we've been asked to
|
// TODO: build up the meta data data structure if we've been asked to
|
||||||
|
|
||||||
// add the rows to the result set and set the total row count
|
// add the rows to the result set and set the total row count
|
||||||
|
org.alfresco.repo.webservice.types.ResultSetRow[] rows =
|
||||||
|
rowList.toArray(new org.alfresco.repo.webservice.types.ResultSetRow[rowList.size()]);;
|
||||||
batchResults.setRows(rows);
|
batchResults.setRows(rows);
|
||||||
batchResults.setTotalRowCount(totalRows);
|
batchResults.setTotalRowCount(totalRows);
|
||||||
|
|
||||||
|
@@ -145,7 +145,7 @@
|
|||||||
<complexType>
|
<complexType>
|
||||||
<sequence>
|
<sequence>
|
||||||
<element name="userName" type="xsd:string"/>
|
<element name="userName" type="xsd:string"/>
|
||||||
<element name="oldPassword" type="xsd:string"/>
|
<element name="oldPassword" type="xsd:string" nillable="true"/>
|
||||||
<element name="newPassword" type="xsd:string"/>
|
<element name="newPassword" type="xsd:string"/>
|
||||||
</sequence>
|
</sequence>
|
||||||
</complexType>
|
</complexType>
|
||||||
|
Reference in New Issue
Block a user