diff --git a/source/generated/org/alfresco/repo/webservice/accesscontrol/AccessControlServiceSoapPort.java b/source/generated/org/alfresco/repo/webservice/accesscontrol/AccessControlServiceSoapPort.java index 3f0dc17fc9..d764ca8fa5 100644 --- a/source/generated/org/alfresco/repo/webservice/accesscontrol/AccessControlServiceSoapPort.java +++ b/source/generated/org/alfresco/repo/webservice/accesscontrol/AccessControlServiceSoapPort.java @@ -54,4 +54,44 @@ public interface AccessControlServiceSoapPort extends java.rmi.Remote { * Sets the current node owner. */ public org.alfresco.repo.webservice.accesscontrol.OwnerResult[] setOwners(org.alfresco.repo.webservice.types.Predicate predicate, java.lang.String owner) throws java.rmi.RemoteException, org.alfresco.repo.webservice.accesscontrol.AccessControlFault; + + /** + * Getsl aa the authorities avaialble in the repository. + */ + public java.lang.String[] getAllAuthorities(org.alfresco.repo.webservice.accesscontrol.AuthorityFilter filter) throws java.rmi.RemoteException, org.alfresco.repo.webservice.accesscontrol.AccessControlFault; + + /** + * Ges the authorities for the current user + */ + public java.lang.String[] getAuthorities() throws java.rmi.RemoteException, org.alfresco.repo.webservice.accesscontrol.AccessControlFault; + + /** + * Creates new authorities + */ + public java.lang.String[] createAuthorities(java.lang.String parentAuthority, org.alfresco.repo.webservice.accesscontrol.NewAuthority[] newAuthorites) throws java.rmi.RemoteException, org.alfresco.repo.webservice.accesscontrol.AccessControlFault; + + /** + * Delete authorities + */ + public void deleteAuthorities(java.lang.String[] authorities) throws java.rmi.RemoteException, org.alfresco.repo.webservice.accesscontrol.AccessControlFault; + + /** + * Adds child authorities to a specified parent authority + */ + public java.lang.String[] addChildAuthorities(java.lang.String parentAuthority, java.lang.String[] authorities) throws java.rmi.RemoteException, org.alfresco.repo.webservice.accesscontrol.AccessControlFault; + + /** + * Remove child authorities from the specified parent authority + */ + public void removeChildAuthorities(java.lang.String parentAuthority, java.lang.String[] authorities) throws java.rmi.RemoteException, org.alfresco.repo.webservice.accesscontrol.AccessControlFault; + + /** + * Gets an authorities child authorities + */ + public java.lang.String[] getChildAuthorities(java.lang.String authority, org.alfresco.repo.webservice.accesscontrol.SiblingAuthorityFilter filter) throws java.rmi.RemoteException, org.alfresco.repo.webservice.accesscontrol.AccessControlFault; + + /** + * Gets an authorities parent authorities + */ + public java.lang.String[] getParentAuthorities(java.lang.String authority, org.alfresco.repo.webservice.accesscontrol.SiblingAuthorityFilter filter) throws java.rmi.RemoteException, org.alfresco.repo.webservice.accesscontrol.AccessControlFault; } diff --git a/source/generated/org/alfresco/repo/webservice/accesscontrol/AuthorityFilter.java b/source/generated/org/alfresco/repo/webservice/accesscontrol/AuthorityFilter.java new file mode 100644 index 0000000000..7791866442 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/accesscontrol/AuthorityFilter.java @@ -0,0 +1,151 @@ +/** + * AuthorityFilter.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.accesscontrol; + +public class AuthorityFilter implements java.io.Serializable { + private java.lang.String authorityType; + + private boolean rootOnly; + + public AuthorityFilter() { + } + + public AuthorityFilter( + java.lang.String authorityType, + boolean rootOnly) { + this.authorityType = authorityType; + this.rootOnly = rootOnly; + } + + + /** + * Gets the authorityType value for this AuthorityFilter. + * + * @return authorityType + */ + public java.lang.String getAuthorityType() { + return authorityType; + } + + + /** + * Sets the authorityType value for this AuthorityFilter. + * + * @param authorityType + */ + public void setAuthorityType(java.lang.String authorityType) { + this.authorityType = authorityType; + } + + + /** + * Gets the rootOnly value for this AuthorityFilter. + * + * @return rootOnly + */ + public boolean isRootOnly() { + return rootOnly; + } + + + /** + * Sets the rootOnly value for this AuthorityFilter. + * + * @param rootOnly + */ + public void setRootOnly(boolean rootOnly) { + this.rootOnly = rootOnly; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof AuthorityFilter)) return false; + AuthorityFilter other = (AuthorityFilter) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.authorityType==null && other.getAuthorityType()==null) || + (this.authorityType!=null && + this.authorityType.equals(other.getAuthorityType()))) && + this.rootOnly == other.isRootOnly(); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getAuthorityType() != null) { + _hashCode += getAuthorityType().hashCode(); + } + _hashCode += (isRootOnly() ? Boolean.TRUE : Boolean.FALSE).hashCode(); + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(AuthorityFilter.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/accesscontrol/1.0", "AuthorityFilter")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("authorityType"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/accesscontrol/1.0", "authorityType")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("rootOnly"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/accesscontrol/1.0", "rootOnly")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } + +} diff --git a/source/generated/org/alfresco/repo/webservice/accesscontrol/NewAuthority.java b/source/generated/org/alfresco/repo/webservice/accesscontrol/NewAuthority.java new file mode 100644 index 0000000000..95cd337ecf --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/accesscontrol/NewAuthority.java @@ -0,0 +1,155 @@ +/** + * NewAuthority.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.accesscontrol; + +public class NewAuthority implements java.io.Serializable { + private java.lang.String authorityType; + + private java.lang.String name; + + public NewAuthority() { + } + + public NewAuthority( + java.lang.String authorityType, + java.lang.String name) { + this.authorityType = authorityType; + this.name = name; + } + + + /** + * Gets the authorityType value for this NewAuthority. + * + * @return authorityType + */ + public java.lang.String getAuthorityType() { + return authorityType; + } + + + /** + * Sets the authorityType value for this NewAuthority. + * + * @param authorityType + */ + public void setAuthorityType(java.lang.String authorityType) { + this.authorityType = authorityType; + } + + + /** + * Gets the name value for this NewAuthority. + * + * @return name + */ + public java.lang.String getName() { + return name; + } + + + /** + * Sets the name value for this NewAuthority. + * + * @param name + */ + public void setName(java.lang.String name) { + this.name = name; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof NewAuthority)) return false; + NewAuthority other = (NewAuthority) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.authorityType==null && other.getAuthorityType()==null) || + (this.authorityType!=null && + this.authorityType.equals(other.getAuthorityType()))) && + ((this.name==null && other.getName()==null) || + (this.name!=null && + this.name.equals(other.getName()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getAuthorityType() != null) { + _hashCode += getAuthorityType().hashCode(); + } + if (getName() != null) { + _hashCode += getName().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(NewAuthority.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/accesscontrol/1.0", "NewAuthority")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("authorityType"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/accesscontrol/1.0", "authorityType")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("name"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/accesscontrol/1.0", "name")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } + +} diff --git a/source/generated/org/alfresco/repo/webservice/accesscontrol/SiblingAuthorityFilter.java b/source/generated/org/alfresco/repo/webservice/accesscontrol/SiblingAuthorityFilter.java new file mode 100644 index 0000000000..7854c42921 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/accesscontrol/SiblingAuthorityFilter.java @@ -0,0 +1,151 @@ +/** + * SiblingAuthorityFilter.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.accesscontrol; + +public class SiblingAuthorityFilter implements java.io.Serializable { + private java.lang.String authorityType; + + private boolean immediate; + + public SiblingAuthorityFilter() { + } + + public SiblingAuthorityFilter( + java.lang.String authorityType, + boolean immediate) { + this.authorityType = authorityType; + this.immediate = immediate; + } + + + /** + * Gets the authorityType value for this SiblingAuthorityFilter. + * + * @return authorityType + */ + public java.lang.String getAuthorityType() { + return authorityType; + } + + + /** + * Sets the authorityType value for this SiblingAuthorityFilter. + * + * @param authorityType + */ + public void setAuthorityType(java.lang.String authorityType) { + this.authorityType = authorityType; + } + + + /** + * Gets the immediate value for this SiblingAuthorityFilter. + * + * @return immediate + */ + public boolean isImmediate() { + return immediate; + } + + + /** + * Sets the immediate value for this SiblingAuthorityFilter. + * + * @param immediate + */ + public void setImmediate(boolean immediate) { + this.immediate = immediate; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof SiblingAuthorityFilter)) return false; + SiblingAuthorityFilter other = (SiblingAuthorityFilter) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.authorityType==null && other.getAuthorityType()==null) || + (this.authorityType!=null && + this.authorityType.equals(other.getAuthorityType()))) && + this.immediate == other.isImmediate(); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getAuthorityType() != null) { + _hashCode += getAuthorityType().hashCode(); + } + _hashCode += (isImmediate() ? Boolean.TRUE : Boolean.FALSE).hashCode(); + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(SiblingAuthorityFilter.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/accesscontrol/1.0", "SiblingAuthorityFilter")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("authorityType"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/accesscontrol/1.0", "authorityType")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("immediate"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/accesscontrol/1.0", "immediate")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + } + + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + + /** + * Get Custom Serializer + */ + public static org.apache.axis.encoding.Serializer getSerializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanSerializer( + _javaType, _xmlType, typeDesc); + } + + /** + * Get Custom Deserializer + */ + public static org.apache.axis.encoding.Deserializer getDeserializer( + java.lang.String mechType, + java.lang.Class _javaType, + javax.xml.namespace.QName _xmlType) { + return + new org.apache.axis.encoding.ser.BeanDeserializer( + _javaType, _xmlType, typeDesc); + } + +} diff --git a/source/generated/org/alfresco/repo/webservice/accesscontrol/deploy.wsdd b/source/generated/org/alfresco/repo/webservice/accesscontrol/deploy.wsdd index 705d8b2043..88b781e6d7 100644 --- a/source/generated/org/alfresco/repo/webservice/accesscontrol/deploy.wsdd +++ b/source/generated/org/alfresco/repo/webservice/accesscontrol/deploy.wsdd @@ -62,7 +62,43 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - result = new ArrayList(10); + + AuthorityType authorityType = AuthorityType.valueOf(filter.getAuthorityType()); + if (filter.isRootOnly() == true) + { + result.addAll(this.authorityService.getAllRootAuthorities(authorityType)); + } + else + { + result.addAll(this.authorityService.getAllAuthorities(authorityType)); + } + + return (String[])result.toArray(new String[result.size()]); + } + + /** + * Gets all the authorities that the current user belongs to + * + * @see org.alfresco.repo.webservice.accesscontrol.AccessControlServiceSoapPort#getAuthorities() + */ + public String[] getAuthorities() + throws RemoteException, AccessControlFault + { + Set result = this.authorityService.getAuthorities(); + return (String[])result.toArray(new String[result.size()]); + } + + /** + * Gets all the child authorities of a given authority, taking into account a filter + * + * @see org.alfresco.repo.webservice.accesscontrol.AccessControlServiceSoapPort#getChildAuthorities(java.lang.String, org.alfresco.repo.webservice.accesscontrol.SiblingAuthorityFilter) + */ + public String[] getChildAuthorities(String authority, SiblingAuthorityFilter filter) + throws RemoteException, AccessControlFault + { + AuthorityType authorityType = AuthorityType.valueOf(filter.getAuthorityType()); + Set result = this.authorityService.getContainedAuthorities(authorityType, authority, filter.isImmediate()); + return (String[])result.toArray(new String[result.size()]); + } + + /** + * Gets all the parent authorities of a given authority, taking into account a filter + * + * @see org.alfresco.repo.webservice.accesscontrol.AccessControlServiceSoapPort#getParentAuthorities(java.lang.String, org.alfresco.repo.webservice.accesscontrol.SiblingAuthorityFilter) + */ + public String[] getParentAuthorities(String authority, SiblingAuthorityFilter filter) + throws RemoteException, AccessControlFault + { + AuthorityType authorityType = AuthorityType.valueOf(filter.getAuthorityType()); + Set result = this.authorityService.getContainingAuthorities(authorityType, authority, filter.isImmediate()); + return (String[])result.toArray(new String[result.size()]); + } + + /** + * Remove a child authority + * + * @see org.alfresco.repo.webservice.accesscontrol.AccessControlServiceSoapPort#removeChildAuthorities(java.lang.String, java.lang.String[]) + */ + public void removeChildAuthorities(String parentAuthority, String[] authorities) + throws RemoteException, AccessControlFault + { + for (String authority : authorities) + { + this.authorityService.removeAuthority(parentAuthority, authority); + } + } } diff --git a/source/java/web-services-application-context.xml b/source/java/web-services-application-context.xml index d98f268ddb..e30c3057d5 100644 --- a/source/java/web-services-application-context.xml +++ b/source/java/web-services-application-context.xml @@ -191,6 +191,9 @@ + + + diff --git a/source/web/WEB-INF/server-config.wsdd b/source/web/WEB-INF/server-config.wsdd index 9c51fce62b..cc178f82cf 100644 --- a/source/web/WEB-INF/server-config.wsdd +++ b/source/web/WEB-INF/server-config.wsdd @@ -2276,7 +2276,43 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + @@ -75,7 +83,23 @@ - + + + + + + + + + + + + + + + + + @@ -235,7 +259,134 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -313,6 +464,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -375,6 +590,54 @@ + + Getsl aa the authorities avaialble in the repository. + + + + + + Ges the authorities for the current user + + + + + + Creates new authorities + + + + + + Delete authorities + + + + + + Adds child authorities to a specified parent authority + + + + + + Remove child authorities from the specified parent authority + + + + + + Gets an authorities child authorities + + + + + + Gets an authorities parent authorities + + + + @@ -487,6 +750,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +