From 3e7141dc1a867c40693b2eebf8074a8a554cd8dc Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Thu, 8 Dec 2005 07:13:07 +0000 Subject: [PATCH] Moving to root below branch label git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2005 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .classpath | 10 + .project | 17 + project-build.xml | 193 ++ project-override.properties | 2 + .../authentication/AuthenticationFault.java | 157 ++ .../authentication/AuthenticationResult.java | 154 ++ .../authentication/AuthenticationService.java | 20 + .../AuthenticationServiceLocator.java | 146 ++ .../AuthenticationServiceSoapBindingStub.java | 246 +++ .../AuthenticationServiceSoapPort.java | 13 + .../webservice/authoring/AuthoringFault.java | 157 ++ .../authoring/AuthoringService.java | 20 + .../authoring/AuthoringServiceLocator.java | 146 ++ .../AuthoringServiceSoapBindingStub.java | 1106 +++++++++++ .../authoring/AuthoringServiceSoapPort.java | 67 + .../authoring/CancelCheckoutResult.java | 190 ++ .../webservice/authoring/CheckinResult.java | 190 ++ .../webservice/authoring/CheckoutResult.java | 190 ++ .../webservice/authoring/LockStatus.java | 191 ++ .../webservice/authoring/LockTypeEnum.java | 70 + .../webservice/authoring/VersionResult.java | 190 ++ .../classification/AppliedCategory.java | 172 ++ .../classification/CategoriesResult.java | 172 ++ .../classification/ClassificationFault.java | 157 ++ .../classification/ClassificationService.java | 20 + .../ClassificationServiceLocator.java | 146 ++ .../ClassificationServiceSoapBindingStub.java | 680 +++++++ .../ClassificationServiceSoapPort.java | 38 + .../example/webservice/content/Content.java | 255 +++ .../webservice/content/ContentFault.java | 157 ++ .../webservice/content/ContentSegment.java | 146 ++ .../webservice/content/ContentService.java | 20 + .../content/ContentServiceLocator.java | 146 ++ .../ContentServiceSoapBindingStub.java | 560 ++++++ .../content/ContentServiceSoapPort.java | 26 + .../webservice/repository/Association.java | 154 ++ .../repository/AssociationDirectionEnum.java | 70 + .../webservice/repository/QueryResult.java | 154 ++ .../repository/RepositoryFault.java | 157 ++ .../repository/RepositoryService.java | 20 + .../repository/RepositoryServiceLocator.java | 146 ++ .../RepositoryServiceSoapBindingStub.java | 1063 +++++++++++ .../repository/RepositoryServiceSoapPort.java | 59 + .../webservice/repository/UpdateResult.java | 224 +++ .../types/AssociationDefinition.java | 329 ++++ .../example/webservice/types/CML.java | 667 +++++++ .../webservice/types/CMLAddAspect.java | 244 +++ .../example/webservice/types/CMLAddChild.java | 299 +++ .../example/webservice/types/CMLCopy.java | 335 ++++ .../example/webservice/types/CMLCreate.java | 244 +++ .../types/CMLCreateAssociation.java | 263 +++ .../example/webservice/types/CMLDelete.java | 119 ++ .../example/webservice/types/CMLMove.java | 299 +++ .../webservice/types/CMLRemoveAspect.java | 191 ++ .../types/CMLRemoveAssociation.java | 263 +++ .../webservice/types/CMLRemoveChild.java | 228 +++ .../example/webservice/types/CMLUpdate.java | 208 ++ .../example/webservice/types/Cardinality.java | 74 + .../example/webservice/types/Category.java | 191 ++ .../webservice/types/ClassDefinition.java | 364 ++++ .../webservice/types/Classification.java | 226 +++ .../webservice/types/ContentFormat.java | 163 ++ .../webservice/types/LocaleConfiguration.java | 120 ++ .../example/webservice/types/NamedValue.java | 154 ++ .../types/NamespaceConfigurationMapping.java | 154 ++ .../example/webservice/types/Node.java | 260 +++ .../webservice/types/NodeDefinition.java | 172 ++ .../webservice/types/ParentReference.java | 156 ++ .../example/webservice/types/Predicate.java | 209 +++ .../webservice/types/PropertyDefinition.java | 182 ++ .../example/webservice/types/Query.java | 154 ++ .../webservice/types/QueryConfiguration.java | 115 ++ .../webservice/types/QueryLanguageEnum.java | 72 + .../example/webservice/types/Reference.java | 191 ++ .../example/webservice/types/ResultSet.java | 204 ++ .../webservice/types/ResultSetMetaData.java | 190 ++ .../webservice/types/ResultSetRow.java | 240 +++ .../webservice/types/ResultSetRowNode.java | 207 ++ .../webservice/types/RoleDefinition.java | 156 ++ .../example/webservice/types/Store.java | 154 ++ .../example/webservice/types/StoreEnum.java | 78 + .../webservice/types/ValueDefinition.java | 226 +++ .../example/webservice/types/Version.java | 311 +++ .../webservice/types/VersionHistory.java | 137 ++ .../authentication/AuthenticationFault.java | 157 ++ .../authentication/AuthenticationResult.java | 154 ++ .../AuthenticationServiceSoapPort.java | 13 + .../webservice/authentication/deploy.wsdd | 50 + .../webservice/authoring/AuthoringFault.java | 157 ++ .../authoring/AuthoringServiceSoapPort.java | 67 + .../authoring/CancelCheckoutResult.java | 190 ++ .../webservice/authoring/CheckinResult.java | 190 ++ .../webservice/authoring/CheckoutResult.java | 190 ++ .../repo/webservice/authoring/LockStatus.java | 191 ++ .../webservice/authoring/LockTypeEnum.java | 70 + .../webservice/authoring/VersionResult.java | 190 ++ .../repo/webservice/authoring/deploy.wsdd | 387 ++++ .../classification/AppliedCategory.java | 172 ++ .../classification/CategoriesResult.java | 172 ++ .../classification/ClassificationFault.java | 157 ++ .../ClassificationServiceSoapPort.java | 38 + .../webservice/classification/deploy.wsdd | 319 ++++ .../repo/webservice/content/Content.java | 255 +++ .../repo/webservice/content/ContentFault.java | 157 ++ .../webservice/content/ContentSegment.java | 146 ++ .../content/ContentServiceSoapPort.java | 26 + .../repo/webservice/content/deploy.wsdd | 315 ++++ .../webservice/repository/Association.java | 154 ++ .../repository/AssociationDirectionEnum.java | 70 + .../webservice/repository/QueryResult.java | 154 ++ .../repository/RepositoryFault.java | 157 ++ .../repository/RepositoryServiceSoapPort.java | 59 + .../webservice/repository/UpdateResult.java | 224 +++ .../repo/webservice/repository/deploy.wsdd | 479 +++++ .../types/AssociationDefinition.java | 329 ++++ .../alfresco/repo/webservice/types/CML.java | 667 +++++++ .../repo/webservice/types/CMLAddAspect.java | 244 +++ .../repo/webservice/types/CMLAddChild.java | 299 +++ .../repo/webservice/types/CMLCopy.java | 335 ++++ .../repo/webservice/types/CMLCreate.java | 244 +++ .../types/CMLCreateAssociation.java | 263 +++ .../repo/webservice/types/CMLDelete.java | 119 ++ .../repo/webservice/types/CMLMove.java | 299 +++ .../webservice/types/CMLRemoveAspect.java | 191 ++ .../types/CMLRemoveAssociation.java | 263 +++ .../repo/webservice/types/CMLRemoveChild.java | 228 +++ .../repo/webservice/types/CMLUpdate.java | 208 ++ .../repo/webservice/types/Cardinality.java | 74 + .../repo/webservice/types/Category.java | 191 ++ .../webservice/types/ClassDefinition.java | 364 ++++ .../repo/webservice/types/Classification.java | 226 +++ .../repo/webservice/types/ContentFormat.java | 163 ++ .../webservice/types/LocaleConfiguration.java | 120 ++ .../repo/webservice/types/NamedValue.java | 154 ++ .../types/NamespaceConfigurationMapping.java | 154 ++ .../alfresco/repo/webservice/types/Node.java | 260 +++ .../repo/webservice/types/NodeDefinition.java | 172 ++ .../webservice/types/ParentReference.java | 156 ++ .../repo/webservice/types/Predicate.java | 209 +++ .../webservice/types/PropertyDefinition.java | 182 ++ .../alfresco/repo/webservice/types/Query.java | 154 ++ .../webservice/types/QueryConfiguration.java | 115 ++ .../webservice/types/QueryLanguageEnum.java | 72 + .../repo/webservice/types/Reference.java | 191 ++ .../repo/webservice/types/ResultSet.java | 204 ++ .../webservice/types/ResultSetMetaData.java | 190 ++ .../repo/webservice/types/ResultSetRow.java | 240 +++ .../webservice/types/ResultSetRowNode.java | 207 ++ .../repo/webservice/types/RoleDefinition.java | 156 ++ .../alfresco/repo/webservice/types/Store.java | 154 ++ .../repo/webservice/types/StoreEnum.java | 78 + .../webservice/types/ValueDefinition.java | 226 +++ .../repo/webservice/types/Version.java | 311 +++ .../repo/webservice/types/VersionHistory.java | 137 ++ .../webservice/BaseWebServiceSystemTest.java | 263 +++ .../example/webservice/TicketHolder.java | 55 + .../WebServiceBootstrapSystemTest.java | 193 ++ .../webservice/WebServiceSuiteSystemTest.java | 43 + .../AuthenticationServiceSystemTest.java | 104 + .../authoring/AuthoringServiceSystemTest.java | 371 ++++ .../ClassificationServiceSystemTest.java | 199 ++ .../content/ContentServiceSystemTest.java | 153 ++ .../RepositoryServiceSystemTest.java | 535 ++++++ .../webservice/sample/WebServiceSample1.java | 142 ++ .../webservice/sample/WebServiceSample2.java | 154 ++ .../webservice/sample/WebServiceSample3.java | 185 ++ .../webservice/sample/WebServiceSample4.java | 120 ++ .../webservice/sample/WebServiceSample5.java | 170 ++ .../webservice/sample/WebServiceSample6.java | 139 ++ .../WebServiceSampleGetRankedContent.java | 263 +++ .../repo/webdav/AbstractMoveOrCopyMethod.java | 146 ++ .../org/alfresco/repo/webdav/CopyMethod.java | 45 + .../alfresco/repo/webdav/DeleteMethod.java | 97 + .../org/alfresco/repo/webdav/GetMethod.java | 478 +++++ .../org/alfresco/repo/webdav/HeadMethod.java | 35 + .../repo/webdav/HierarchicalMethod.java | 217 +++ .../org/alfresco/repo/webdav/LockMethod.java | 297 +++ .../org/alfresco/repo/webdav/MkcolMethod.java | 133 ++ .../org/alfresco/repo/webdav/MoveMethod.java | 44 + .../alfresco/repo/webdav/OptionsMethod.java | 91 + .../org/alfresco/repo/webdav/PostMethod.java | 32 + .../alfresco/repo/webdav/PropFindMethod.java | 905 +++++++++ .../org/alfresco/repo/webdav/PutMethod.java | 158 ++ .../alfresco/repo/webdav/UnlockMethod.java | 176 ++ .../java/org/alfresco/repo/webdav/WebDAV.java | 552 ++++++ .../alfresco/repo/webdav/WebDAVHelper.java | 418 +++++ .../alfresco/repo/webdav/WebDAVMethod.java | 520 +++++ .../alfresco/repo/webdav/WebDAVProperty.java | 156 ++ .../repo/webdav/WebDAVServerException.java | 91 + .../alfresco/repo/webdav/WebDAVServlet.java | 313 ++++ .../webdav/auth/AuthenticationFilter.java | 199 ++ .../alfresco/repo/webdav/auth/WebDAVUser.java | 130 ++ .../repo/webservice/AbstractWebService.java | 77 + .../org/alfresco/repo/webservice/CMLUtil.java | 569 ++++++ .../alfresco/repo/webservice/CMLUtilTest.java | 448 +++++ .../org/alfresco/repo/webservice/Utils.java | 600 ++++++ .../AuthenticationWebService.java | 104 + .../authoring/AuthoringWebService.java | 804 ++++++++ .../webservice/axis/QueryConfigHandler.java | 97 + .../axis/SpringBeanRPCProvider.java | 108 ++ .../axis/TicketCallbackHandler.java | 100 + .../axis/TicketCallbackSpringHandler.java | 62 + .../axis/WSDDSpringBeanRPCProvider.java | 55 + .../ClassificationWebService.java | 454 +++++ .../org/alfresco/repo/webservice/cml-test.xml | 9 + .../webservice/content/ContentWebService.java | 300 +++ .../repository/AbstractQuerySession.java | 92 + .../repository/AssociatedQuerySession.java | 166 ++ .../repository/ChildrenQuerySession.java | 152 ++ .../repository/ParentsQuerySession.java | 152 ++ .../webservice/repository/QuerySession.java | 56 + .../repository/RepositoryWebService.java | 681 +++++++ .../repository/ResultSetQuerySession.java | 188 ++ .../java/web-services-application-context.xml | 138 ++ .../org.apache.axis.deployment.wsdd.Provider | 1 + source/test-resources/client-deploy.wsdd | 13 + source/web/WEB-INF/server-config.wsdd | 1666 +++++++++++++++++ source/wsdl/authentication-service.wsdl | 128 ++ source/wsdl/authoring-service.wsdl | 585 ++++++ source/wsdl/classification-service.wsdl | 277 +++ source/wsdl/cml.xsd | 191 ++ source/wsdl/content-service.wsdl | 198 ++ source/wsdl/headers.xsd | 29 + source/wsdl/repository-service.wsdl | 481 +++++ source/wsdl/types.xsd | 326 ++++ 225 files changed, 48004 insertions(+) create mode 100644 .classpath create mode 100644 .project create mode 100644 project-build.xml create mode 100644 project-override.properties create mode 100644 source/generated/org/alfresco/example/webservice/authentication/AuthenticationFault.java create mode 100644 source/generated/org/alfresco/example/webservice/authentication/AuthenticationResult.java create mode 100644 source/generated/org/alfresco/example/webservice/authentication/AuthenticationService.java create mode 100644 source/generated/org/alfresco/example/webservice/authentication/AuthenticationServiceLocator.java create mode 100644 source/generated/org/alfresco/example/webservice/authentication/AuthenticationServiceSoapBindingStub.java create mode 100644 source/generated/org/alfresco/example/webservice/authentication/AuthenticationServiceSoapPort.java create mode 100644 source/generated/org/alfresco/example/webservice/authoring/AuthoringFault.java create mode 100644 source/generated/org/alfresco/example/webservice/authoring/AuthoringService.java create mode 100644 source/generated/org/alfresco/example/webservice/authoring/AuthoringServiceLocator.java create mode 100644 source/generated/org/alfresco/example/webservice/authoring/AuthoringServiceSoapBindingStub.java create mode 100644 source/generated/org/alfresco/example/webservice/authoring/AuthoringServiceSoapPort.java create mode 100644 source/generated/org/alfresco/example/webservice/authoring/CancelCheckoutResult.java create mode 100644 source/generated/org/alfresco/example/webservice/authoring/CheckinResult.java create mode 100644 source/generated/org/alfresco/example/webservice/authoring/CheckoutResult.java create mode 100644 source/generated/org/alfresco/example/webservice/authoring/LockStatus.java create mode 100644 source/generated/org/alfresco/example/webservice/authoring/LockTypeEnum.java create mode 100644 source/generated/org/alfresco/example/webservice/authoring/VersionResult.java create mode 100644 source/generated/org/alfresco/example/webservice/classification/AppliedCategory.java create mode 100644 source/generated/org/alfresco/example/webservice/classification/CategoriesResult.java create mode 100644 source/generated/org/alfresco/example/webservice/classification/ClassificationFault.java create mode 100644 source/generated/org/alfresco/example/webservice/classification/ClassificationService.java create mode 100644 source/generated/org/alfresco/example/webservice/classification/ClassificationServiceLocator.java create mode 100644 source/generated/org/alfresco/example/webservice/classification/ClassificationServiceSoapBindingStub.java create mode 100644 source/generated/org/alfresco/example/webservice/classification/ClassificationServiceSoapPort.java create mode 100644 source/generated/org/alfresco/example/webservice/content/Content.java create mode 100644 source/generated/org/alfresco/example/webservice/content/ContentFault.java create mode 100644 source/generated/org/alfresco/example/webservice/content/ContentSegment.java create mode 100644 source/generated/org/alfresco/example/webservice/content/ContentService.java create mode 100644 source/generated/org/alfresco/example/webservice/content/ContentServiceLocator.java create mode 100644 source/generated/org/alfresco/example/webservice/content/ContentServiceSoapBindingStub.java create mode 100644 source/generated/org/alfresco/example/webservice/content/ContentServiceSoapPort.java create mode 100644 source/generated/org/alfresco/example/webservice/repository/Association.java create mode 100644 source/generated/org/alfresco/example/webservice/repository/AssociationDirectionEnum.java create mode 100644 source/generated/org/alfresco/example/webservice/repository/QueryResult.java create mode 100644 source/generated/org/alfresco/example/webservice/repository/RepositoryFault.java create mode 100644 source/generated/org/alfresco/example/webservice/repository/RepositoryService.java create mode 100644 source/generated/org/alfresco/example/webservice/repository/RepositoryServiceLocator.java create mode 100644 source/generated/org/alfresco/example/webservice/repository/RepositoryServiceSoapBindingStub.java create mode 100644 source/generated/org/alfresco/example/webservice/repository/RepositoryServiceSoapPort.java create mode 100644 source/generated/org/alfresco/example/webservice/repository/UpdateResult.java create mode 100644 source/generated/org/alfresco/example/webservice/types/AssociationDefinition.java create mode 100644 source/generated/org/alfresco/example/webservice/types/CML.java create mode 100644 source/generated/org/alfresco/example/webservice/types/CMLAddAspect.java create mode 100644 source/generated/org/alfresco/example/webservice/types/CMLAddChild.java create mode 100644 source/generated/org/alfresco/example/webservice/types/CMLCopy.java create mode 100644 source/generated/org/alfresco/example/webservice/types/CMLCreate.java create mode 100644 source/generated/org/alfresco/example/webservice/types/CMLCreateAssociation.java create mode 100644 source/generated/org/alfresco/example/webservice/types/CMLDelete.java create mode 100644 source/generated/org/alfresco/example/webservice/types/CMLMove.java create mode 100644 source/generated/org/alfresco/example/webservice/types/CMLRemoveAspect.java create mode 100644 source/generated/org/alfresco/example/webservice/types/CMLRemoveAssociation.java create mode 100644 source/generated/org/alfresco/example/webservice/types/CMLRemoveChild.java create mode 100644 source/generated/org/alfresco/example/webservice/types/CMLUpdate.java create mode 100644 source/generated/org/alfresco/example/webservice/types/Cardinality.java create mode 100644 source/generated/org/alfresco/example/webservice/types/Category.java create mode 100644 source/generated/org/alfresco/example/webservice/types/ClassDefinition.java create mode 100644 source/generated/org/alfresco/example/webservice/types/Classification.java create mode 100644 source/generated/org/alfresco/example/webservice/types/ContentFormat.java create mode 100644 source/generated/org/alfresco/example/webservice/types/LocaleConfiguration.java create mode 100644 source/generated/org/alfresco/example/webservice/types/NamedValue.java create mode 100644 source/generated/org/alfresco/example/webservice/types/NamespaceConfigurationMapping.java create mode 100644 source/generated/org/alfresco/example/webservice/types/Node.java create mode 100644 source/generated/org/alfresco/example/webservice/types/NodeDefinition.java create mode 100644 source/generated/org/alfresco/example/webservice/types/ParentReference.java create mode 100644 source/generated/org/alfresco/example/webservice/types/Predicate.java create mode 100644 source/generated/org/alfresco/example/webservice/types/PropertyDefinition.java create mode 100644 source/generated/org/alfresco/example/webservice/types/Query.java create mode 100644 source/generated/org/alfresco/example/webservice/types/QueryConfiguration.java create mode 100644 source/generated/org/alfresco/example/webservice/types/QueryLanguageEnum.java create mode 100644 source/generated/org/alfresco/example/webservice/types/Reference.java create mode 100644 source/generated/org/alfresco/example/webservice/types/ResultSet.java create mode 100644 source/generated/org/alfresco/example/webservice/types/ResultSetMetaData.java create mode 100644 source/generated/org/alfresco/example/webservice/types/ResultSetRow.java create mode 100644 source/generated/org/alfresco/example/webservice/types/ResultSetRowNode.java create mode 100644 source/generated/org/alfresco/example/webservice/types/RoleDefinition.java create mode 100644 source/generated/org/alfresco/example/webservice/types/Store.java create mode 100644 source/generated/org/alfresco/example/webservice/types/StoreEnum.java create mode 100644 source/generated/org/alfresco/example/webservice/types/ValueDefinition.java create mode 100644 source/generated/org/alfresco/example/webservice/types/Version.java create mode 100644 source/generated/org/alfresco/example/webservice/types/VersionHistory.java create mode 100644 source/generated/org/alfresco/repo/webservice/authentication/AuthenticationFault.java create mode 100644 source/generated/org/alfresco/repo/webservice/authentication/AuthenticationResult.java create mode 100644 source/generated/org/alfresco/repo/webservice/authentication/AuthenticationServiceSoapPort.java create mode 100644 source/generated/org/alfresco/repo/webservice/authentication/deploy.wsdd create mode 100644 source/generated/org/alfresco/repo/webservice/authoring/AuthoringFault.java create mode 100644 source/generated/org/alfresco/repo/webservice/authoring/AuthoringServiceSoapPort.java create mode 100644 source/generated/org/alfresco/repo/webservice/authoring/CancelCheckoutResult.java create mode 100644 source/generated/org/alfresco/repo/webservice/authoring/CheckinResult.java create mode 100644 source/generated/org/alfresco/repo/webservice/authoring/CheckoutResult.java create mode 100644 source/generated/org/alfresco/repo/webservice/authoring/LockStatus.java create mode 100644 source/generated/org/alfresco/repo/webservice/authoring/LockTypeEnum.java create mode 100644 source/generated/org/alfresco/repo/webservice/authoring/VersionResult.java create mode 100644 source/generated/org/alfresco/repo/webservice/authoring/deploy.wsdd create mode 100644 source/generated/org/alfresco/repo/webservice/classification/AppliedCategory.java create mode 100644 source/generated/org/alfresco/repo/webservice/classification/CategoriesResult.java create mode 100644 source/generated/org/alfresco/repo/webservice/classification/ClassificationFault.java create mode 100644 source/generated/org/alfresco/repo/webservice/classification/ClassificationServiceSoapPort.java create mode 100644 source/generated/org/alfresco/repo/webservice/classification/deploy.wsdd create mode 100644 source/generated/org/alfresco/repo/webservice/content/Content.java create mode 100644 source/generated/org/alfresco/repo/webservice/content/ContentFault.java create mode 100644 source/generated/org/alfresco/repo/webservice/content/ContentSegment.java create mode 100644 source/generated/org/alfresco/repo/webservice/content/ContentServiceSoapPort.java create mode 100644 source/generated/org/alfresco/repo/webservice/content/deploy.wsdd create mode 100644 source/generated/org/alfresco/repo/webservice/repository/Association.java create mode 100644 source/generated/org/alfresco/repo/webservice/repository/AssociationDirectionEnum.java create mode 100644 source/generated/org/alfresco/repo/webservice/repository/QueryResult.java create mode 100644 source/generated/org/alfresco/repo/webservice/repository/RepositoryFault.java create mode 100644 source/generated/org/alfresco/repo/webservice/repository/RepositoryServiceSoapPort.java create mode 100644 source/generated/org/alfresco/repo/webservice/repository/UpdateResult.java create mode 100644 source/generated/org/alfresco/repo/webservice/repository/deploy.wsdd create mode 100644 source/generated/org/alfresco/repo/webservice/types/AssociationDefinition.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/CML.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/CMLAddAspect.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/CMLAddChild.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/CMLCopy.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/CMLCreate.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/CMLCreateAssociation.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/CMLDelete.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/CMLMove.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/CMLRemoveAspect.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/CMLRemoveAssociation.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/CMLRemoveChild.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/CMLUpdate.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/Cardinality.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/Category.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/ClassDefinition.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/Classification.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/ContentFormat.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/LocaleConfiguration.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/NamedValue.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/NamespaceConfigurationMapping.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/Node.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/NodeDefinition.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/ParentReference.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/Predicate.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/PropertyDefinition.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/Query.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/QueryConfiguration.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/QueryLanguageEnum.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/Reference.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/ResultSet.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/ResultSetMetaData.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/ResultSetRow.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/ResultSetRowNode.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/RoleDefinition.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/Store.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/StoreEnum.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/ValueDefinition.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/Version.java create mode 100644 source/generated/org/alfresco/repo/webservice/types/VersionHistory.java create mode 100644 source/java/org/alfresco/example/webservice/BaseWebServiceSystemTest.java create mode 100644 source/java/org/alfresco/example/webservice/TicketHolder.java create mode 100644 source/java/org/alfresco/example/webservice/WebServiceBootstrapSystemTest.java create mode 100644 source/java/org/alfresco/example/webservice/WebServiceSuiteSystemTest.java create mode 100644 source/java/org/alfresco/example/webservice/authentication/AuthenticationServiceSystemTest.java create mode 100644 source/java/org/alfresco/example/webservice/authoring/AuthoringServiceSystemTest.java create mode 100644 source/java/org/alfresco/example/webservice/classification/ClassificationServiceSystemTest.java create mode 100644 source/java/org/alfresco/example/webservice/content/ContentServiceSystemTest.java create mode 100644 source/java/org/alfresco/example/webservice/repository/RepositoryServiceSystemTest.java create mode 100644 source/java/org/alfresco/example/webservice/sample/WebServiceSample1.java create mode 100644 source/java/org/alfresco/example/webservice/sample/WebServiceSample2.java create mode 100644 source/java/org/alfresco/example/webservice/sample/WebServiceSample3.java create mode 100644 source/java/org/alfresco/example/webservice/sample/WebServiceSample4.java create mode 100644 source/java/org/alfresco/example/webservice/sample/WebServiceSample5.java create mode 100644 source/java/org/alfresco/example/webservice/sample/WebServiceSample6.java create mode 100644 source/java/org/alfresco/example/webservice/sample/WebServiceSampleGetRankedContent.java create mode 100644 source/java/org/alfresco/repo/webdav/AbstractMoveOrCopyMethod.java create mode 100644 source/java/org/alfresco/repo/webdav/CopyMethod.java create mode 100644 source/java/org/alfresco/repo/webdav/DeleteMethod.java create mode 100644 source/java/org/alfresco/repo/webdav/GetMethod.java create mode 100644 source/java/org/alfresco/repo/webdav/HeadMethod.java create mode 100644 source/java/org/alfresco/repo/webdav/HierarchicalMethod.java create mode 100644 source/java/org/alfresco/repo/webdav/LockMethod.java create mode 100644 source/java/org/alfresco/repo/webdav/MkcolMethod.java create mode 100644 source/java/org/alfresco/repo/webdav/MoveMethod.java create mode 100644 source/java/org/alfresco/repo/webdav/OptionsMethod.java create mode 100644 source/java/org/alfresco/repo/webdav/PostMethod.java create mode 100644 source/java/org/alfresco/repo/webdav/PropFindMethod.java create mode 100644 source/java/org/alfresco/repo/webdav/PutMethod.java create mode 100644 source/java/org/alfresco/repo/webdav/UnlockMethod.java create mode 100644 source/java/org/alfresco/repo/webdav/WebDAV.java create mode 100644 source/java/org/alfresco/repo/webdav/WebDAVHelper.java create mode 100644 source/java/org/alfresco/repo/webdav/WebDAVMethod.java create mode 100644 source/java/org/alfresco/repo/webdav/WebDAVProperty.java create mode 100644 source/java/org/alfresco/repo/webdav/WebDAVServerException.java create mode 100644 source/java/org/alfresco/repo/webdav/WebDAVServlet.java create mode 100644 source/java/org/alfresco/repo/webdav/auth/AuthenticationFilter.java create mode 100644 source/java/org/alfresco/repo/webdav/auth/WebDAVUser.java create mode 100644 source/java/org/alfresco/repo/webservice/AbstractWebService.java create mode 100644 source/java/org/alfresco/repo/webservice/CMLUtil.java create mode 100644 source/java/org/alfresco/repo/webservice/CMLUtilTest.java create mode 100644 source/java/org/alfresco/repo/webservice/Utils.java create mode 100644 source/java/org/alfresco/repo/webservice/authentication/AuthenticationWebService.java create mode 100644 source/java/org/alfresco/repo/webservice/authoring/AuthoringWebService.java create mode 100644 source/java/org/alfresco/repo/webservice/axis/QueryConfigHandler.java create mode 100644 source/java/org/alfresco/repo/webservice/axis/SpringBeanRPCProvider.java create mode 100644 source/java/org/alfresco/repo/webservice/axis/TicketCallbackHandler.java create mode 100644 source/java/org/alfresco/repo/webservice/axis/TicketCallbackSpringHandler.java create mode 100644 source/java/org/alfresco/repo/webservice/axis/WSDDSpringBeanRPCProvider.java create mode 100644 source/java/org/alfresco/repo/webservice/classification/ClassificationWebService.java create mode 100644 source/java/org/alfresco/repo/webservice/cml-test.xml create mode 100644 source/java/org/alfresco/repo/webservice/content/ContentWebService.java create mode 100644 source/java/org/alfresco/repo/webservice/repository/AbstractQuerySession.java create mode 100644 source/java/org/alfresco/repo/webservice/repository/AssociatedQuerySession.java create mode 100644 source/java/org/alfresco/repo/webservice/repository/ChildrenQuerySession.java create mode 100644 source/java/org/alfresco/repo/webservice/repository/ParentsQuerySession.java create mode 100644 source/java/org/alfresco/repo/webservice/repository/QuerySession.java create mode 100644 source/java/org/alfresco/repo/webservice/repository/RepositoryWebService.java create mode 100644 source/java/org/alfresco/repo/webservice/repository/ResultSetQuerySession.java create mode 100644 source/java/web-services-application-context.xml create mode 100644 source/meta-inf/services/org.apache.axis.deployment.wsdd.Provider create mode 100644 source/test-resources/client-deploy.wsdd create mode 100644 source/web/WEB-INF/server-config.wsdd create mode 100644 source/wsdl/authentication-service.wsdl create mode 100644 source/wsdl/authoring-service.wsdl create mode 100644 source/wsdl/classification-service.wsdl create mode 100644 source/wsdl/cml.xsd create mode 100644 source/wsdl/content-service.wsdl create mode 100644 source/wsdl/headers.xsd create mode 100644 source/wsdl/repository-service.wsdl create mode 100644 source/wsdl/types.xsd diff --git a/.classpath b/.classpath new file mode 100644 index 0000000000..6fa58bd072 --- /dev/null +++ b/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000000..e1490dd472 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + Remote API + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/project-build.xml b/project-build.xml new file mode 100644 index 0000000000..3a8aeb131f --- /dev/null +++ b/project-build.xml @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This project can not produce a WAR file, the Remote API functionality is currently + packaged within the Web Client WAR file. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/project-override.properties b/project-override.properties new file mode 100644 index 0000000000..7975f9545f --- /dev/null +++ b/project-override.properties @@ -0,0 +1,2 @@ +javadoc.title.window=Alfresco Remote Services API +javadoc.title.document=Alfresco Remote Services API Specification \ No newline at end of file diff --git a/source/generated/org/alfresco/example/webservice/authentication/AuthenticationFault.java b/source/generated/org/alfresco/example/webservice/authentication/AuthenticationFault.java new file mode 100644 index 0000000000..1c766b6d14 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/authentication/AuthenticationFault.java @@ -0,0 +1,157 @@ +/** + * AuthenticationFault.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.authentication; + +public class AuthenticationFault extends org.apache.axis.AxisFault implements java.io.Serializable { + private int errorCode; + private java.lang.String message1; + + public AuthenticationFault() { + } + + public AuthenticationFault( + int errorCode, + java.lang.String message1) { + this.errorCode = errorCode; + this.message1 = message1; + } + + + /** + * Gets the errorCode value for this AuthenticationFault. + * + * @return errorCode + */ + public int getErrorCode() { + return errorCode; + } + + + /** + * Sets the errorCode value for this AuthenticationFault. + * + * @param errorCode + */ + public void setErrorCode(int errorCode) { + this.errorCode = errorCode; + } + + + /** + * Gets the message1 value for this AuthenticationFault. + * + * @return message1 + */ + public java.lang.String getMessage1() { + return message1; + } + + + /** + * Sets the message1 value for this AuthenticationFault. + * + * @param message1 + */ + public void setMessage1(java.lang.String message1) { + this.message1 = message1; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof AuthenticationFault)) return false; + AuthenticationFault other = (AuthenticationFault) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + this.errorCode == other.getErrorCode() && + ((this.message1==null && other.getMessage1()==null) || + (this.message1!=null && + this.message1.equals(other.getMessage1()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + _hashCode += getErrorCode(); + if (getMessage1() != null) { + _hashCode += getMessage1().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(AuthenticationFault.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationFault")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("errorCode"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "errorCode")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("message1"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "message")); + 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); + } + + + /** + * Writes the exception data to the faultDetails + */ + public void writeDetails(javax.xml.namespace.QName qname, org.apache.axis.encoding.SerializationContext context) throws java.io.IOException { + context.serialize(qname, null, this); + } +} diff --git a/source/generated/org/alfresco/example/webservice/authentication/AuthenticationResult.java b/source/generated/org/alfresco/example/webservice/authentication/AuthenticationResult.java new file mode 100644 index 0000000000..ff1ef117e8 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/authentication/AuthenticationResult.java @@ -0,0 +1,154 @@ +/** + * AuthenticationResult.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.authentication; + +public class AuthenticationResult implements java.io.Serializable { + private java.lang.String username; + private java.lang.String ticket; + + public AuthenticationResult() { + } + + public AuthenticationResult( + java.lang.String username, + java.lang.String ticket) { + this.username = username; + this.ticket = ticket; + } + + + /** + * Gets the username value for this AuthenticationResult. + * + * @return username + */ + public java.lang.String getUsername() { + return username; + } + + + /** + * Sets the username value for this AuthenticationResult. + * + * @param username + */ + public void setUsername(java.lang.String username) { + this.username = username; + } + + + /** + * Gets the ticket value for this AuthenticationResult. + * + * @return ticket + */ + public java.lang.String getTicket() { + return ticket; + } + + + /** + * Sets the ticket value for this AuthenticationResult. + * + * @param ticket + */ + public void setTicket(java.lang.String ticket) { + this.ticket = ticket; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof AuthenticationResult)) return false; + AuthenticationResult other = (AuthenticationResult) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.username==null && other.getUsername()==null) || + (this.username!=null && + this.username.equals(other.getUsername()))) && + ((this.ticket==null && other.getTicket()==null) || + (this.ticket!=null && + this.ticket.equals(other.getTicket()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getUsername() != null) { + _hashCode += getUsername().hashCode(); + } + if (getTicket() != null) { + _hashCode += getTicket().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(AuthenticationResult.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationResult")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("username"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "username")); + 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("ticket"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "ticket")); + 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/example/webservice/authentication/AuthenticationService.java b/source/generated/org/alfresco/example/webservice/authentication/AuthenticationService.java new file mode 100644 index 0000000000..9b0c0ea50b --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/authentication/AuthenticationService.java @@ -0,0 +1,20 @@ +/** + * AuthenticationService.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.authentication; + +public interface AuthenticationService extends javax.xml.rpc.Service { + +/** + * Provides simple authentication capability. + */ + public java.lang.String getAuthenticationServiceAddress(); + + public org.alfresco.example.webservice.authentication.AuthenticationServiceSoapPort getAuthenticationService() throws javax.xml.rpc.ServiceException; + + public org.alfresco.example.webservice.authentication.AuthenticationServiceSoapPort getAuthenticationService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; +} diff --git a/source/generated/org/alfresco/example/webservice/authentication/AuthenticationServiceLocator.java b/source/generated/org/alfresco/example/webservice/authentication/AuthenticationServiceLocator.java new file mode 100644 index 0000000000..09f6732510 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/authentication/AuthenticationServiceLocator.java @@ -0,0 +1,146 @@ +/** + * AuthenticationServiceLocator.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.authentication; + +public class AuthenticationServiceLocator extends org.apache.axis.client.Service implements org.alfresco.example.webservice.authentication.AuthenticationService { + +/** + * Provides simple authentication capability. + */ + + public AuthenticationServiceLocator() { + } + + + public AuthenticationServiceLocator(org.apache.axis.EngineConfiguration config) { + super(config); + } + + public AuthenticationServiceLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException { + super(wsdlLoc, sName); + } + + // Use to get a proxy class for AuthenticationService + private java.lang.String AuthenticationService_address = "http://localhost:8080/alfresco/api/AuthenticationService"; + + public java.lang.String getAuthenticationServiceAddress() { + return AuthenticationService_address; + } + + // The WSDD service name defaults to the port name. + private java.lang.String AuthenticationServiceWSDDServiceName = "AuthenticationService"; + + public java.lang.String getAuthenticationServiceWSDDServiceName() { + return AuthenticationServiceWSDDServiceName; + } + + public void setAuthenticationServiceWSDDServiceName(java.lang.String name) { + AuthenticationServiceWSDDServiceName = name; + } + + public org.alfresco.example.webservice.authentication.AuthenticationServiceSoapPort getAuthenticationService() throws javax.xml.rpc.ServiceException { + java.net.URL endpoint; + try { + endpoint = new java.net.URL(AuthenticationService_address); + } + catch (java.net.MalformedURLException e) { + throw new javax.xml.rpc.ServiceException(e); + } + return getAuthenticationService(endpoint); + } + + public org.alfresco.example.webservice.authentication.AuthenticationServiceSoapPort getAuthenticationService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException { + try { + org.alfresco.example.webservice.authentication.AuthenticationServiceSoapBindingStub _stub = new org.alfresco.example.webservice.authentication.AuthenticationServiceSoapBindingStub(portAddress, this); + _stub.setPortName(getAuthenticationServiceWSDDServiceName()); + return _stub; + } + catch (org.apache.axis.AxisFault e) { + return null; + } + } + + public void setAuthenticationServiceEndpointAddress(java.lang.String address) { + AuthenticationService_address = address; + } + + /** + * For the given interface, get the stub implementation. + * If this service has no port for the given interface, + * then ServiceException is thrown. + */ + public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { + try { + if (org.alfresco.example.webservice.authentication.AuthenticationServiceSoapPort.class.isAssignableFrom(serviceEndpointInterface)) { + org.alfresco.example.webservice.authentication.AuthenticationServiceSoapBindingStub _stub = new org.alfresco.example.webservice.authentication.AuthenticationServiceSoapBindingStub(new java.net.URL(AuthenticationService_address), this); + _stub.setPortName(getAuthenticationServiceWSDDServiceName()); + return _stub; + } + } + catch (java.lang.Throwable t) { + throw new javax.xml.rpc.ServiceException(t); + } + throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); + } + + /** + * For the given interface, get the stub implementation. + * If this service has no port for the given interface, + * then ServiceException is thrown. + */ + public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { + if (portName == null) { + return getPort(serviceEndpointInterface); + } + java.lang.String inputPortName = portName.getLocalPart(); + if ("AuthenticationService".equals(inputPortName)) { + return getAuthenticationService(); + } + else { + java.rmi.Remote _stub = getPort(serviceEndpointInterface); + ((org.apache.axis.client.Stub) _stub).setPortName(portName); + return _stub; + } + } + + public javax.xml.namespace.QName getServiceName() { + return new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationService"); + } + + private java.util.HashSet ports = null; + + public java.util.Iterator getPorts() { + if (ports == null) { + ports = new java.util.HashSet(); + ports.add(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationService")); + } + return ports.iterator(); + } + + /** + * Set the endpoint address for the specified port name. + */ + public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { + +if ("AuthenticationService".equals(portName)) { + setAuthenticationServiceEndpointAddress(address); + } + else +{ // Unknown Port Name + throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); + } + } + + /** + * Set the endpoint address for the specified port name. + */ + public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException { + setEndpointAddress(portName.getLocalPart(), address); + } + +} diff --git a/source/generated/org/alfresco/example/webservice/authentication/AuthenticationServiceSoapBindingStub.java b/source/generated/org/alfresco/example/webservice/authentication/AuthenticationServiceSoapBindingStub.java new file mode 100644 index 0000000000..122437078a --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/authentication/AuthenticationServiceSoapBindingStub.java @@ -0,0 +1,246 @@ +/** + * AuthenticationServiceSoapBindingStub.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.authentication; + +public class AuthenticationServiceSoapBindingStub extends org.apache.axis.client.Stub implements org.alfresco.example.webservice.authentication.AuthenticationServiceSoapPort { + private java.util.Vector cachedSerClasses = new java.util.Vector(); + private java.util.Vector cachedSerQNames = new java.util.Vector(); + private java.util.Vector cachedSerFactories = new java.util.Vector(); + private java.util.Vector cachedDeserFactories = new java.util.Vector(); + + static org.apache.axis.description.OperationDesc [] _operations; + + static { + _operations = new org.apache.axis.description.OperationDesc[2]; + _initOperationDesc1(); + } + + private static void _initOperationDesc1(){ + org.apache.axis.description.OperationDesc oper; + org.apache.axis.description.ParameterDesc param; + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("startSession"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "username"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "password"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationResult")); + oper.setReturnClass(org.alfresco.example.webservice.authentication.AuthenticationResult.class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "startSessionReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationFault"), + "org.alfresco.example.webservice.authentication.AuthenticationFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationFault"), + true + )); + _operations[0] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("endSession"); + oper.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationFault"), + "org.alfresco.example.webservice.authentication.AuthenticationFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationFault"), + true + )); + _operations[1] = oper; + + } + + public AuthenticationServiceSoapBindingStub() throws org.apache.axis.AxisFault { + this(null); + } + + public AuthenticationServiceSoapBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + this(service); + super.cachedEndpoint = endpointURL; + } + + public AuthenticationServiceSoapBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + if (service == null) { + super.service = new org.apache.axis.client.Service(); + } else { + super.service = service; + } + ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2"); + java.lang.Class cls; + javax.xml.namespace.QName qName; + javax.xml.namespace.QName qName2; + java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class; + java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class; + java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class; + java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class; + java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class; + java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class; + java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class; + java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class; + java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class; + java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class; + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationFault"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.authentication.AuthenticationFault.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationResult"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.authentication.AuthenticationResult.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + } + + protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { + try { + org.apache.axis.client.Call _call = super._createCall(); + if (super.maintainSessionSet) { + _call.setMaintainSession(super.maintainSession); + } + if (super.cachedUsername != null) { + _call.setUsername(super.cachedUsername); + } + if (super.cachedPassword != null) { + _call.setPassword(super.cachedPassword); + } + if (super.cachedEndpoint != null) { + _call.setTargetEndpointAddress(super.cachedEndpoint); + } + if (super.cachedTimeout != null) { + _call.setTimeout(super.cachedTimeout); + } + if (super.cachedPortName != null) { + _call.setPortName(super.cachedPortName); + } + java.util.Enumeration keys = super.cachedProperties.keys(); + while (keys.hasMoreElements()) { + java.lang.String key = (java.lang.String) keys.nextElement(); + _call.setProperty(key, super.cachedProperties.get(key)); + } + // All the type mapping information is registered + // when the first call is made. + // The type mapping information is actually registered in + // the TypeMappingRegistry of the service, which + // is the reason why registration is only needed for the first call. + synchronized (this) { + if (firstCall()) { + // must set encoding style before registering serializers + _call.setEncodingStyle(null); + for (int i = 0; i < cachedSerFactories.size(); ++i) { + java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); + javax.xml.namespace.QName qName = + (javax.xml.namespace.QName) cachedSerQNames.get(i); + java.lang.Object x = cachedSerFactories.get(i); + if (x instanceof Class) { + java.lang.Class sf = (java.lang.Class) + cachedSerFactories.get(i); + java.lang.Class df = (java.lang.Class) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) { + org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory) + cachedSerFactories.get(i); + org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + } + } + } + return _call; + } + catch (java.lang.Throwable _t) { + throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); + } + } + + public org.alfresco.example.webservice.authentication.AuthenticationResult startSession(java.lang.String username, java.lang.String password) throws java.rmi.RemoteException, org.alfresco.example.webservice.authentication.AuthenticationFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[0]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/authentication/1.0/startSession"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "startSession")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {username, password}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.authentication.AuthenticationResult) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.authentication.AuthenticationResult) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.authentication.AuthenticationResult.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.authentication.AuthenticationFault) { + throw (org.alfresco.example.webservice.authentication.AuthenticationFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + public void endSession() throws java.rmi.RemoteException, org.alfresco.example.webservice.authentication.AuthenticationFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[1]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/authentication/1.0/endSession"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authentication/1.0", "endSession")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + extractAttachments(_call); + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.authentication.AuthenticationFault) { + throw (org.alfresco.example.webservice.authentication.AuthenticationFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + +} diff --git a/source/generated/org/alfresco/example/webservice/authentication/AuthenticationServiceSoapPort.java b/source/generated/org/alfresco/example/webservice/authentication/AuthenticationServiceSoapPort.java new file mode 100644 index 0000000000..83e56fe8b8 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/authentication/AuthenticationServiceSoapPort.java @@ -0,0 +1,13 @@ +/** + * AuthenticationServiceSoapPort.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.authentication; + +public interface AuthenticationServiceSoapPort extends java.rmi.Remote { + public org.alfresco.example.webservice.authentication.AuthenticationResult startSession(java.lang.String username, java.lang.String password) throws java.rmi.RemoteException, org.alfresco.example.webservice.authentication.AuthenticationFault; + public void endSession() throws java.rmi.RemoteException, org.alfresco.example.webservice.authentication.AuthenticationFault; +} diff --git a/source/generated/org/alfresco/example/webservice/authoring/AuthoringFault.java b/source/generated/org/alfresco/example/webservice/authoring/AuthoringFault.java new file mode 100644 index 0000000000..67e8f99161 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/authoring/AuthoringFault.java @@ -0,0 +1,157 @@ +/** + * AuthoringFault.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.authoring; + +public class AuthoringFault extends org.apache.axis.AxisFault implements java.io.Serializable { + private int errorCode; + private java.lang.String message1; + + public AuthoringFault() { + } + + public AuthoringFault( + int errorCode, + java.lang.String message1) { + this.errorCode = errorCode; + this.message1 = message1; + } + + + /** + * Gets the errorCode value for this AuthoringFault. + * + * @return errorCode + */ + public int getErrorCode() { + return errorCode; + } + + + /** + * Sets the errorCode value for this AuthoringFault. + * + * @param errorCode + */ + public void setErrorCode(int errorCode) { + this.errorCode = errorCode; + } + + + /** + * Gets the message1 value for this AuthoringFault. + * + * @return message1 + */ + public java.lang.String getMessage1() { + return message1; + } + + + /** + * Sets the message1 value for this AuthoringFault. + * + * @param message1 + */ + public void setMessage1(java.lang.String message1) { + this.message1 = message1; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof AuthoringFault)) return false; + AuthoringFault other = (AuthoringFault) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + this.errorCode == other.getErrorCode() && + ((this.message1==null && other.getMessage1()==null) || + (this.message1!=null && + this.message1.equals(other.getMessage1()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + _hashCode += getErrorCode(); + if (getMessage1() != null) { + _hashCode += getMessage1().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(AuthoringFault.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("errorCode"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "errorCode")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("message1"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "message")); + 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); + } + + + /** + * Writes the exception data to the faultDetails + */ + public void writeDetails(javax.xml.namespace.QName qname, org.apache.axis.encoding.SerializationContext context) throws java.io.IOException { + context.serialize(qname, null, this); + } +} diff --git a/source/generated/org/alfresco/example/webservice/authoring/AuthoringService.java b/source/generated/org/alfresco/example/webservice/authoring/AuthoringService.java new file mode 100644 index 0000000000..814ffb103c --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/authoring/AuthoringService.java @@ -0,0 +1,20 @@ +/** + * AuthoringService.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.authoring; + +public interface AuthoringService extends javax.xml.rpc.Service { + +/** + * Provides support for collaborative editing of content. + */ + public java.lang.String getAuthoringServiceAddress(); + + public org.alfresco.example.webservice.authoring.AuthoringServiceSoapPort getAuthoringService() throws javax.xml.rpc.ServiceException; + + public org.alfresco.example.webservice.authoring.AuthoringServiceSoapPort getAuthoringService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; +} diff --git a/source/generated/org/alfresco/example/webservice/authoring/AuthoringServiceLocator.java b/source/generated/org/alfresco/example/webservice/authoring/AuthoringServiceLocator.java new file mode 100644 index 0000000000..6a33536758 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/authoring/AuthoringServiceLocator.java @@ -0,0 +1,146 @@ +/** + * AuthoringServiceLocator.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.authoring; + +public class AuthoringServiceLocator extends org.apache.axis.client.Service implements org.alfresco.example.webservice.authoring.AuthoringService { + +/** + * Provides support for collaborative editing of content. + */ + + public AuthoringServiceLocator() { + } + + + public AuthoringServiceLocator(org.apache.axis.EngineConfiguration config) { + super(config); + } + + public AuthoringServiceLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException { + super(wsdlLoc, sName); + } + + // Use to get a proxy class for AuthoringService + private java.lang.String AuthoringService_address = "http://localhost:8080/alfresco/api/AuthoringService"; + + public java.lang.String getAuthoringServiceAddress() { + return AuthoringService_address; + } + + // The WSDD service name defaults to the port name. + private java.lang.String AuthoringServiceWSDDServiceName = "AuthoringService"; + + public java.lang.String getAuthoringServiceWSDDServiceName() { + return AuthoringServiceWSDDServiceName; + } + + public void setAuthoringServiceWSDDServiceName(java.lang.String name) { + AuthoringServiceWSDDServiceName = name; + } + + public org.alfresco.example.webservice.authoring.AuthoringServiceSoapPort getAuthoringService() throws javax.xml.rpc.ServiceException { + java.net.URL endpoint; + try { + endpoint = new java.net.URL(AuthoringService_address); + } + catch (java.net.MalformedURLException e) { + throw new javax.xml.rpc.ServiceException(e); + } + return getAuthoringService(endpoint); + } + + public org.alfresco.example.webservice.authoring.AuthoringServiceSoapPort getAuthoringService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException { + try { + org.alfresco.example.webservice.authoring.AuthoringServiceSoapBindingStub _stub = new org.alfresco.example.webservice.authoring.AuthoringServiceSoapBindingStub(portAddress, this); + _stub.setPortName(getAuthoringServiceWSDDServiceName()); + return _stub; + } + catch (org.apache.axis.AxisFault e) { + return null; + } + } + + public void setAuthoringServiceEndpointAddress(java.lang.String address) { + AuthoringService_address = address; + } + + /** + * For the given interface, get the stub implementation. + * If this service has no port for the given interface, + * then ServiceException is thrown. + */ + public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { + try { + if (org.alfresco.example.webservice.authoring.AuthoringServiceSoapPort.class.isAssignableFrom(serviceEndpointInterface)) { + org.alfresco.example.webservice.authoring.AuthoringServiceSoapBindingStub _stub = new org.alfresco.example.webservice.authoring.AuthoringServiceSoapBindingStub(new java.net.URL(AuthoringService_address), this); + _stub.setPortName(getAuthoringServiceWSDDServiceName()); + return _stub; + } + } + catch (java.lang.Throwable t) { + throw new javax.xml.rpc.ServiceException(t); + } + throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); + } + + /** + * For the given interface, get the stub implementation. + * If this service has no port for the given interface, + * then ServiceException is thrown. + */ + public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { + if (portName == null) { + return getPort(serviceEndpointInterface); + } + java.lang.String inputPortName = portName.getLocalPart(); + if ("AuthoringService".equals(inputPortName)) { + return getAuthoringService(); + } + else { + java.rmi.Remote _stub = getPort(serviceEndpointInterface); + ((org.apache.axis.client.Stub) _stub).setPortName(portName); + return _stub; + } + } + + public javax.xml.namespace.QName getServiceName() { + return new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringService"); + } + + private java.util.HashSet ports = null; + + public java.util.Iterator getPorts() { + if (ports == null) { + ports = new java.util.HashSet(); + ports.add(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringService")); + } + return ports.iterator(); + } + + /** + * Set the endpoint address for the specified port name. + */ + public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { + +if ("AuthoringService".equals(portName)) { + setAuthoringServiceEndpointAddress(address); + } + else +{ // Unknown Port Name + throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); + } + } + + /** + * Set the endpoint address for the specified port name. + */ + public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException { + setEndpointAddress(portName.getLocalPart(), address); + } + +} diff --git a/source/generated/org/alfresco/example/webservice/authoring/AuthoringServiceSoapBindingStub.java b/source/generated/org/alfresco/example/webservice/authoring/AuthoringServiceSoapBindingStub.java new file mode 100644 index 0000000000..25973f4ac4 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/authoring/AuthoringServiceSoapBindingStub.java @@ -0,0 +1,1106 @@ +/** + * AuthoringServiceSoapBindingStub.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.authoring; + +public class AuthoringServiceSoapBindingStub extends org.apache.axis.client.Stub implements org.alfresco.example.webservice.authoring.AuthoringServiceSoapPort { + private java.util.Vector cachedSerClasses = new java.util.Vector(); + private java.util.Vector cachedSerQNames = new java.util.Vector(); + private java.util.Vector cachedSerFactories = new java.util.Vector(); + private java.util.Vector cachedDeserFactories = new java.util.Vector(); + + static org.apache.axis.description.OperationDesc [] _operations; + + static { + _operations = new org.apache.axis.description.OperationDesc[11]; + _initOperationDesc1(); + _initOperationDesc2(); + } + + private static void _initOperationDesc1(){ + org.apache.axis.description.OperationDesc oper; + org.apache.axis.description.ParameterDesc param; + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("checkout"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "items"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate"), org.alfresco.example.webservice.types.Predicate.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "destination"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ParentReference"), org.alfresco.example.webservice.types.ParentReference.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "CheckoutResult")); + oper.setReturnClass(org.alfresco.example.webservice.authoring.CheckoutResult.class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "checkoutReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + "org.alfresco.example.webservice.authoring.AuthoringFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + true + )); + _operations[0] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("checkin"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "items"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate"), org.alfresco.example.webservice.types.Predicate.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "comments"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NamedValue"), org.alfresco.example.webservice.types.NamedValue[].class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "keepCheckedOut"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean"), boolean.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "CheckinResult")); + oper.setReturnClass(org.alfresco.example.webservice.authoring.CheckinResult.class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "checkinReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + "org.alfresco.example.webservice.authoring.AuthoringFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + true + )); + _operations[1] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("checkinExternal"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "items"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference"), org.alfresco.example.webservice.types.Reference.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "comments"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NamedValue"), org.alfresco.example.webservice.types.NamedValue[].class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "keepCheckedOut"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean"), boolean.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "format"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ContentFormat"), org.alfresco.example.webservice.types.ContentFormat.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "content"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "base64Binary"), byte[].class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference")); + oper.setReturnClass(org.alfresco.example.webservice.types.Reference.class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "checkinExternalReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + "org.alfresco.example.webservice.authoring.AuthoringFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + true + )); + _operations[2] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("cancelCheckout"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "items"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate"), org.alfresco.example.webservice.types.Predicate.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "CancelCheckoutResult")); + oper.setReturnClass(org.alfresco.example.webservice.authoring.CancelCheckoutResult.class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "cancelCheckoutReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + "org.alfresco.example.webservice.authoring.AuthoringFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + true + )); + _operations[3] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("lock"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "items"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate"), org.alfresco.example.webservice.types.Predicate.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "lockChildren"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean"), boolean.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "lockType"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "LockTypeEnum"), org.alfresco.example.webservice.authoring.LockTypeEnum.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference")); + oper.setReturnClass(org.alfresco.example.webservice.types.Reference[].class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "lockReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + "org.alfresco.example.webservice.authoring.AuthoringFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + true + )); + _operations[4] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("unlock"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "items"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate"), org.alfresco.example.webservice.types.Predicate.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "unlockChildren"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean"), boolean.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference")); + oper.setReturnClass(org.alfresco.example.webservice.types.Reference[].class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "unlockReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + "org.alfresco.example.webservice.authoring.AuthoringFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + true + )); + _operations[5] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("getLockStatus"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "items"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate"), org.alfresco.example.webservice.types.Predicate.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "LockStatus")); + oper.setReturnClass(org.alfresco.example.webservice.authoring.LockStatus[].class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "getLockStatusReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + "org.alfresco.example.webservice.authoring.AuthoringFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + true + )); + _operations[6] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("createVersion"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "items"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate"), org.alfresco.example.webservice.types.Predicate.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "comments"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NamedValue"), org.alfresco.example.webservice.types.NamedValue[].class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "versionChildren"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean"), boolean.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "VersionResult")); + oper.setReturnClass(org.alfresco.example.webservice.authoring.VersionResult.class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "createVersionReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + "org.alfresco.example.webservice.authoring.AuthoringFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + true + )); + _operations[7] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("getVersionHistory"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "node"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference"), org.alfresco.example.webservice.types.Reference.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "VersionHistory")); + oper.setReturnClass(org.alfresco.example.webservice.types.VersionHistory.class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "getVersionHistoryReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + "org.alfresco.example.webservice.authoring.AuthoringFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + true + )); + _operations[8] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("revertVersion"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "node"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference"), org.alfresco.example.webservice.types.Reference.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "versionLabel"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + oper.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + "org.alfresco.example.webservice.authoring.AuthoringFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + true + )); + _operations[9] = oper; + + } + + private static void _initOperationDesc2(){ + org.apache.axis.description.OperationDesc oper; + org.apache.axis.description.ParameterDesc param; + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("deleteAllVersions"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "node"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference"), org.alfresco.example.webservice.types.Reference.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "VersionHistory")); + oper.setReturnClass(org.alfresco.example.webservice.types.VersionHistory.class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "deleteAllVersionsReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + "org.alfresco.example.webservice.authoring.AuthoringFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"), + true + )); + _operations[10] = oper; + + } + + public AuthoringServiceSoapBindingStub() throws org.apache.axis.AxisFault { + this(null); + } + + public AuthoringServiceSoapBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + this(service); + super.cachedEndpoint = endpointURL; + } + + public AuthoringServiceSoapBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + if (service == null) { + super.service = new org.apache.axis.client.Service(); + } else { + super.service = service; + } + ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2"); + java.lang.Class cls; + javax.xml.namespace.QName qName; + javax.xml.namespace.QName qName2; + java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class; + java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class; + java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class; + java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class; + java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class; + java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class; + java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class; + java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class; + java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class; + java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class; + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">ContentFormat>encoding"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">ContentFormat>mimetype"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">ResultSetRow>node"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ResultSetRowNode.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">Store>address"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "AssociationDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.AssociationDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Cardinality"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Cardinality.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Category"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Category.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ClassDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ClassDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Classification"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Classification.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ContentFormat"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ContentFormat.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NamedValue"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.NamedValue.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Node"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Node.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NodeDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.NodeDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ParentReference"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ParentReference.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Path"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Predicate.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "PropertyDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.PropertyDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Query"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Query.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "QueryLanguageEnum"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.QueryLanguageEnum.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Reference.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ResultSet"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ResultSet.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ResultSetMetaData"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ResultSetMetaData.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ResultSetRow"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ResultSetRow.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "RoleDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.RoleDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Store"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Store.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "StoreEnum"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.StoreEnum.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "UUID"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ValueDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ValueDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Version"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Version.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "VersionHistory"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.VersionHistory.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.authoring.AuthoringFault.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "CancelCheckoutResult"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.authoring.CancelCheckoutResult.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "CheckinResult"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.authoring.CheckinResult.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "CheckoutResult"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.authoring.CheckoutResult.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "LockStatus"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.authoring.LockStatus.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "LockTypeEnum"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.authoring.LockTypeEnum.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "VersionResult"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.authoring.VersionResult.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + } + + protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { + try { + org.apache.axis.client.Call _call = super._createCall(); + if (super.maintainSessionSet) { + _call.setMaintainSession(super.maintainSession); + } + if (super.cachedUsername != null) { + _call.setUsername(super.cachedUsername); + } + if (super.cachedPassword != null) { + _call.setPassword(super.cachedPassword); + } + if (super.cachedEndpoint != null) { + _call.setTargetEndpointAddress(super.cachedEndpoint); + } + if (super.cachedTimeout != null) { + _call.setTimeout(super.cachedTimeout); + } + if (super.cachedPortName != null) { + _call.setPortName(super.cachedPortName); + } + java.util.Enumeration keys = super.cachedProperties.keys(); + while (keys.hasMoreElements()) { + java.lang.String key = (java.lang.String) keys.nextElement(); + _call.setProperty(key, super.cachedProperties.get(key)); + } + // All the type mapping information is registered + // when the first call is made. + // The type mapping information is actually registered in + // the TypeMappingRegistry of the service, which + // is the reason why registration is only needed for the first call. + synchronized (this) { + if (firstCall()) { + // must set encoding style before registering serializers + _call.setEncodingStyle(null); + for (int i = 0; i < cachedSerFactories.size(); ++i) { + java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); + javax.xml.namespace.QName qName = + (javax.xml.namespace.QName) cachedSerQNames.get(i); + java.lang.Object x = cachedSerFactories.get(i); + if (x instanceof Class) { + java.lang.Class sf = (java.lang.Class) + cachedSerFactories.get(i); + java.lang.Class df = (java.lang.Class) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) { + org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory) + cachedSerFactories.get(i); + org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + } + } + } + return _call; + } + catch (java.lang.Throwable _t) { + throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); + } + } + + + /** + * Checkout a content resource for editing. + */ + public org.alfresco.example.webservice.authoring.CheckoutResult checkout(org.alfresco.example.webservice.types.Predicate items, org.alfresco.example.webservice.types.ParentReference destination) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[0]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/authoring/1.0/checkout"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "checkout")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {items, destination}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.authoring.CheckoutResult) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.authoring.CheckoutResult) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.authoring.CheckoutResult.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.authoring.AuthoringFault) { + throw (org.alfresco.example.webservice.authoring.AuthoringFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Checkin a content resource. + */ + public org.alfresco.example.webservice.authoring.CheckinResult checkin(org.alfresco.example.webservice.types.Predicate items, org.alfresco.example.webservice.types.NamedValue[] comments, boolean keepCheckedOut) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[1]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/authoring/1.0/checkin"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "checkin")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {items, comments, new java.lang.Boolean(keepCheckedOut)}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.authoring.CheckinResult) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.authoring.CheckinResult) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.authoring.CheckinResult.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.authoring.AuthoringFault) { + throw (org.alfresco.example.webservice.authoring.AuthoringFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Checkin an external content resource thus replacing the existing + * working content. + */ + public org.alfresco.example.webservice.types.Reference checkinExternal(org.alfresco.example.webservice.types.Reference items, org.alfresco.example.webservice.types.NamedValue[] comments, boolean keepCheckedOut, org.alfresco.example.webservice.types.ContentFormat format, byte[] content) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[2]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/authoring/1.0/checkinExternal"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "checkinExternal")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {items, comments, new java.lang.Boolean(keepCheckedOut), format, content}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.types.Reference) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.types.Reference) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.types.Reference.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.authoring.AuthoringFault) { + throw (org.alfresco.example.webservice.authoring.AuthoringFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Cancels the checkout. + */ + public org.alfresco.example.webservice.authoring.CancelCheckoutResult cancelCheckout(org.alfresco.example.webservice.types.Predicate items) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[3]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/authoring/1.0/cancelCheckout"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "cancelCheckout")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {items}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.authoring.CancelCheckoutResult) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.authoring.CancelCheckoutResult) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.authoring.CancelCheckoutResult.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.authoring.AuthoringFault) { + throw (org.alfresco.example.webservice.authoring.AuthoringFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Locks a content resource. + */ + public org.alfresco.example.webservice.types.Reference[] lock(org.alfresco.example.webservice.types.Predicate items, boolean lockChildren, org.alfresco.example.webservice.authoring.LockTypeEnum lockType) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[4]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/authoring/1.0/lock"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "lock")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {items, new java.lang.Boolean(lockChildren), lockType}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.types.Reference[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.types.Reference[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.types.Reference[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.authoring.AuthoringFault) { + throw (org.alfresco.example.webservice.authoring.AuthoringFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Unlocks a content resource. + */ + public org.alfresco.example.webservice.types.Reference[] unlock(org.alfresco.example.webservice.types.Predicate items, boolean unlockChildren) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[5]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/authoring/1.0/unlock"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "unlock")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {items, new java.lang.Boolean(unlockChildren)}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.types.Reference[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.types.Reference[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.types.Reference[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.authoring.AuthoringFault) { + throw (org.alfresco.example.webservice.authoring.AuthoringFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Gets the lock status of the specified nodes. + */ + public org.alfresco.example.webservice.authoring.LockStatus[] getLockStatus(org.alfresco.example.webservice.types.Predicate items) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[6]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/authoring/1.0/getLockStatus"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "getLockStatus")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {items}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.authoring.LockStatus[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.authoring.LockStatus[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.authoring.LockStatus[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.authoring.AuthoringFault) { + throw (org.alfresco.example.webservice.authoring.AuthoringFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Create a snapshot of the specified node(s) in the version store. + */ + public org.alfresco.example.webservice.authoring.VersionResult createVersion(org.alfresco.example.webservice.types.Predicate items, org.alfresco.example.webservice.types.NamedValue[] comments, boolean versionChildren) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[7]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/authoring/1.0/createVersion"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "createVersion")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {items, comments, new java.lang.Boolean(versionChildren)}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.authoring.VersionResult) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.authoring.VersionResult) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.authoring.VersionResult.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.authoring.AuthoringFault) { + throw (org.alfresco.example.webservice.authoring.AuthoringFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Gets the version history for the specfied node. + */ + public org.alfresco.example.webservice.types.VersionHistory getVersionHistory(org.alfresco.example.webservice.types.Reference node) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[8]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/authoring/1.0/getVersionHistory"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "getVersionHistory")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {node}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.types.VersionHistory) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.types.VersionHistory) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.types.VersionHistory.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.authoring.AuthoringFault) { + throw (org.alfresco.example.webservice.authoring.AuthoringFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Revert a node to the snapshot of the specified version. + */ + public void revertVersion(org.alfresco.example.webservice.types.Reference node, java.lang.String versionLabel) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[9]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/authoring/1.0/revertVersion"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "revertVersion")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {node, versionLabel}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + extractAttachments(_call); + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.authoring.AuthoringFault) { + throw (org.alfresco.example.webservice.authoring.AuthoringFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Delete all snapshot versions of the specified node. + */ + public org.alfresco.example.webservice.types.VersionHistory deleteAllVersions(org.alfresco.example.webservice.types.Reference node) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[10]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/authoring/1.0/deleteAllVersions"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "deleteAllVersions")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {node}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.types.VersionHistory) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.types.VersionHistory) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.types.VersionHistory.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.authoring.AuthoringFault) { + throw (org.alfresco.example.webservice.authoring.AuthoringFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + +} diff --git a/source/generated/org/alfresco/example/webservice/authoring/AuthoringServiceSoapPort.java b/source/generated/org/alfresco/example/webservice/authoring/AuthoringServiceSoapPort.java new file mode 100644 index 0000000000..29a6e57d22 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/authoring/AuthoringServiceSoapPort.java @@ -0,0 +1,67 @@ +/** + * AuthoringServiceSoapPort.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.authoring; + +public interface AuthoringServiceSoapPort extends java.rmi.Remote { + + /** + * Checkout a content resource for editing. + */ + public org.alfresco.example.webservice.authoring.CheckoutResult checkout(org.alfresco.example.webservice.types.Predicate items, org.alfresco.example.webservice.types.ParentReference destination) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault; + + /** + * Checkin a content resource. + */ + public org.alfresco.example.webservice.authoring.CheckinResult checkin(org.alfresco.example.webservice.types.Predicate items, org.alfresco.example.webservice.types.NamedValue[] comments, boolean keepCheckedOut) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault; + + /** + * Checkin an external content resource thus replacing the existing + * working content. + */ + public org.alfresco.example.webservice.types.Reference checkinExternal(org.alfresco.example.webservice.types.Reference items, org.alfresco.example.webservice.types.NamedValue[] comments, boolean keepCheckedOut, org.alfresco.example.webservice.types.ContentFormat format, byte[] content) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault; + + /** + * Cancels the checkout. + */ + public org.alfresco.example.webservice.authoring.CancelCheckoutResult cancelCheckout(org.alfresco.example.webservice.types.Predicate items) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault; + + /** + * Locks a content resource. + */ + public org.alfresco.example.webservice.types.Reference[] lock(org.alfresco.example.webservice.types.Predicate items, boolean lockChildren, org.alfresco.example.webservice.authoring.LockTypeEnum lockType) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault; + + /** + * Unlocks a content resource. + */ + public org.alfresco.example.webservice.types.Reference[] unlock(org.alfresco.example.webservice.types.Predicate items, boolean unlockChildren) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault; + + /** + * Gets the lock status of the specified nodes. + */ + public org.alfresco.example.webservice.authoring.LockStatus[] getLockStatus(org.alfresco.example.webservice.types.Predicate items) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault; + + /** + * Create a snapshot of the specified node(s) in the version store. + */ + public org.alfresco.example.webservice.authoring.VersionResult createVersion(org.alfresco.example.webservice.types.Predicate items, org.alfresco.example.webservice.types.NamedValue[] comments, boolean versionChildren) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault; + + /** + * Gets the version history for the specfied node. + */ + public org.alfresco.example.webservice.types.VersionHistory getVersionHistory(org.alfresco.example.webservice.types.Reference node) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault; + + /** + * Revert a node to the snapshot of the specified version. + */ + public void revertVersion(org.alfresco.example.webservice.types.Reference node, java.lang.String versionLabel) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault; + + /** + * Delete all snapshot versions of the specified node. + */ + public org.alfresco.example.webservice.types.VersionHistory deleteAllVersions(org.alfresco.example.webservice.types.Reference node) throws java.rmi.RemoteException, org.alfresco.example.webservice.authoring.AuthoringFault; +} diff --git a/source/generated/org/alfresco/example/webservice/authoring/CancelCheckoutResult.java b/source/generated/org/alfresco/example/webservice/authoring/CancelCheckoutResult.java new file mode 100644 index 0000000000..83d785632c --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/authoring/CancelCheckoutResult.java @@ -0,0 +1,190 @@ +/** + * CancelCheckoutResult.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.authoring; + +public class CancelCheckoutResult implements java.io.Serializable { + private org.alfresco.example.webservice.types.Reference[] workingCopies; + private org.alfresco.example.webservice.types.Reference[] originals; + + public CancelCheckoutResult() { + } + + public CancelCheckoutResult( + org.alfresco.example.webservice.types.Reference[] workingCopies, + org.alfresco.example.webservice.types.Reference[] originals) { + this.workingCopies = workingCopies; + this.originals = originals; + } + + + /** + * Gets the workingCopies value for this CancelCheckoutResult. + * + * @return workingCopies + */ + public org.alfresco.example.webservice.types.Reference[] getWorkingCopies() { + return workingCopies; + } + + + /** + * Sets the workingCopies value for this CancelCheckoutResult. + * + * @param workingCopies + */ + public void setWorkingCopies(org.alfresco.example.webservice.types.Reference[] workingCopies) { + this.workingCopies = workingCopies; + } + + public org.alfresco.example.webservice.types.Reference getWorkingCopies(int i) { + return this.workingCopies[i]; + } + + public void setWorkingCopies(int i, org.alfresco.example.webservice.types.Reference _value) { + this.workingCopies[i] = _value; + } + + + /** + * Gets the originals value for this CancelCheckoutResult. + * + * @return originals + */ + public org.alfresco.example.webservice.types.Reference[] getOriginals() { + return originals; + } + + + /** + * Sets the originals value for this CancelCheckoutResult. + * + * @param originals + */ + public void setOriginals(org.alfresco.example.webservice.types.Reference[] originals) { + this.originals = originals; + } + + public org.alfresco.example.webservice.types.Reference getOriginals(int i) { + return this.originals[i]; + } + + public void setOriginals(int i, org.alfresco.example.webservice.types.Reference _value) { + this.originals[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CancelCheckoutResult)) return false; + CancelCheckoutResult other = (CancelCheckoutResult) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.workingCopies==null && other.getWorkingCopies()==null) || + (this.workingCopies!=null && + java.util.Arrays.equals(this.workingCopies, other.getWorkingCopies()))) && + ((this.originals==null && other.getOriginals()==null) || + (this.originals!=null && + java.util.Arrays.equals(this.originals, other.getOriginals()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getWorkingCopies() != null) { + for (int i=0; + iContentFormat>encoding"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">ContentFormat>mimetype"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">ResultSetRow>node"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ResultSetRowNode.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">Store>address"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "AssociationDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.AssociationDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Cardinality"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Cardinality.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Category"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Category.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ClassDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ClassDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Classification"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Classification.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ContentFormat"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ContentFormat.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NamedValue"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.NamedValue.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Node"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Node.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NodeDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.NodeDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ParentReference"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ParentReference.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Path"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Predicate.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "PropertyDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.PropertyDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Query"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Query.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "QueryLanguageEnum"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.QueryLanguageEnum.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Reference.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ResultSet"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ResultSet.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ResultSetMetaData"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ResultSetMetaData.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ResultSetRow"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ResultSetRow.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "RoleDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.RoleDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Store"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Store.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "StoreEnum"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.StoreEnum.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "UUID"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ValueDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ValueDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Version"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Version.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "VersionHistory"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.VersionHistory.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/classification/1.0", "AppliedCategory"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.classification.AppliedCategory.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/classification/1.0", "CategoriesResult"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.classification.CategoriesResult.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/classification/1.0", "ClassificationFault"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.classification.ClassificationFault.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + } + + protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { + try { + org.apache.axis.client.Call _call = super._createCall(); + if (super.maintainSessionSet) { + _call.setMaintainSession(super.maintainSession); + } + if (super.cachedUsername != null) { + _call.setUsername(super.cachedUsername); + } + if (super.cachedPassword != null) { + _call.setPassword(super.cachedPassword); + } + if (super.cachedEndpoint != null) { + _call.setTargetEndpointAddress(super.cachedEndpoint); + } + if (super.cachedTimeout != null) { + _call.setTimeout(super.cachedTimeout); + } + if (super.cachedPortName != null) { + _call.setPortName(super.cachedPortName); + } + java.util.Enumeration keys = super.cachedProperties.keys(); + while (keys.hasMoreElements()) { + java.lang.String key = (java.lang.String) keys.nextElement(); + _call.setProperty(key, super.cachedProperties.get(key)); + } + // All the type mapping information is registered + // when the first call is made. + // The type mapping information is actually registered in + // the TypeMappingRegistry of the service, which + // is the reason why registration is only needed for the first call. + synchronized (this) { + if (firstCall()) { + // must set encoding style before registering serializers + _call.setEncodingStyle(null); + for (int i = 0; i < cachedSerFactories.size(); ++i) { + java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); + javax.xml.namespace.QName qName = + (javax.xml.namespace.QName) cachedSerQNames.get(i); + java.lang.Object x = cachedSerFactories.get(i); + if (x instanceof Class) { + java.lang.Class sf = (java.lang.Class) + cachedSerFactories.get(i); + java.lang.Class df = (java.lang.Class) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) { + org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory) + cachedSerFactories.get(i); + org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + } + } + } + return _call; + } + catch (java.lang.Throwable _t) { + throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); + } + } + + + /** + * Gets available classifications. + */ + public org.alfresco.example.webservice.types.Classification[] getClassifications(org.alfresco.example.webservice.types.Store store) throws java.rmi.RemoteException, org.alfresco.example.webservice.classification.ClassificationFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[0]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/classification/1.0/getClassifications"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/classification/1.0", "getClassifications")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {store}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.types.Classification[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.types.Classification[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.types.Classification[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.classification.ClassificationFault) { + throw (org.alfresco.example.webservice.classification.ClassificationFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Gets child categories for the specified parent category. + */ + public org.alfresco.example.webservice.types.Category[] getChildCategories(org.alfresco.example.webservice.types.Reference parentCategory) throws java.rmi.RemoteException, org.alfresco.example.webservice.classification.ClassificationFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[1]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/classification/1.0/getChildCategories"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/classification/1.0", "getChildCategories")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {parentCategory}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.types.Category[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.types.Category[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.types.Category[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.classification.ClassificationFault) { + throw (org.alfresco.example.webservice.classification.ClassificationFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Gets the categories applied to the specified content resource. + */ + public org.alfresco.example.webservice.classification.CategoriesResult[] getCategories(org.alfresco.example.webservice.types.Predicate items) throws java.rmi.RemoteException, org.alfresco.example.webservice.classification.ClassificationFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[2]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/classification/1.0/getCategories"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/classification/1.0", "getCategories")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {items}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.classification.CategoriesResult[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.classification.CategoriesResult[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.classification.CategoriesResult[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.classification.ClassificationFault) { + throw (org.alfresco.example.webservice.classification.ClassificationFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Modifies the categories applied to the specified content resource. + */ + public org.alfresco.example.webservice.classification.CategoriesResult[] setCategories(org.alfresco.example.webservice.types.Predicate items, org.alfresco.example.webservice.classification.AppliedCategory[] categories) throws java.rmi.RemoteException, org.alfresco.example.webservice.classification.ClassificationFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[3]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/classification/1.0/setCategories"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/classification/1.0", "setCategories")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {items, categories}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.classification.CategoriesResult[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.classification.CategoriesResult[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.classification.CategoriesResult[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.classification.ClassificationFault) { + throw (org.alfresco.example.webservice.classification.ClassificationFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Describe a classification in terms of how it is represented + * in the meta model i.e. is it an aspect, which property holds the applied + * category. + */ + public org.alfresco.example.webservice.types.ClassDefinition describeClassification(java.lang.String classification) throws java.rmi.RemoteException, org.alfresco.example.webservice.classification.ClassificationFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[4]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/classification/1.0/describeClassification"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/classification/1.0", "describeClassification")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {classification}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.types.ClassDefinition) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.types.ClassDefinition) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.types.ClassDefinition.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.classification.ClassificationFault) { + throw (org.alfresco.example.webservice.classification.ClassificationFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + +} diff --git a/source/generated/org/alfresco/example/webservice/classification/ClassificationServiceSoapPort.java b/source/generated/org/alfresco/example/webservice/classification/ClassificationServiceSoapPort.java new file mode 100644 index 0000000000..b2c2145840 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/classification/ClassificationServiceSoapPort.java @@ -0,0 +1,38 @@ +/** + * ClassificationServiceSoapPort.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.classification; + +public interface ClassificationServiceSoapPort extends java.rmi.Remote { + + /** + * Gets available classifications. + */ + public org.alfresco.example.webservice.types.Classification[] getClassifications(org.alfresco.example.webservice.types.Store store) throws java.rmi.RemoteException, org.alfresco.example.webservice.classification.ClassificationFault; + + /** + * Gets child categories for the specified parent category. + */ + public org.alfresco.example.webservice.types.Category[] getChildCategories(org.alfresco.example.webservice.types.Reference parentCategory) throws java.rmi.RemoteException, org.alfresco.example.webservice.classification.ClassificationFault; + + /** + * Gets the categories applied to the specified content resource. + */ + public org.alfresco.example.webservice.classification.CategoriesResult[] getCategories(org.alfresco.example.webservice.types.Predicate items) throws java.rmi.RemoteException, org.alfresco.example.webservice.classification.ClassificationFault; + + /** + * Modifies the categories applied to the specified content resource. + */ + public org.alfresco.example.webservice.classification.CategoriesResult[] setCategories(org.alfresco.example.webservice.types.Predicate items, org.alfresco.example.webservice.classification.AppliedCategory[] categories) throws java.rmi.RemoteException, org.alfresco.example.webservice.classification.ClassificationFault; + + /** + * Describe a classification in terms of how it is represented + * in the meta model i.e. is it an aspect, which property holds the applied + * category. + */ + public org.alfresco.example.webservice.types.ClassDefinition describeClassification(java.lang.String classification) throws java.rmi.RemoteException, org.alfresco.example.webservice.classification.ClassificationFault; +} diff --git a/source/generated/org/alfresco/example/webservice/content/Content.java b/source/generated/org/alfresco/example/webservice/content/Content.java new file mode 100644 index 0000000000..3087ea4146 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/content/Content.java @@ -0,0 +1,255 @@ +/** + * Content.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.content; + +public class Content implements java.io.Serializable { + private org.alfresco.example.webservice.types.Reference node; + private java.lang.String property; + private long length; + private org.alfresco.example.webservice.types.ContentFormat format; + private java.lang.String url; + + public Content() { + } + + public Content( + org.alfresco.example.webservice.types.Reference node, + java.lang.String property, + long length, + org.alfresco.example.webservice.types.ContentFormat format, + java.lang.String url) { + this.node = node; + this.property = property; + this.length = length; + this.format = format; + this.url = url; + } + + + /** + * Gets the node value for this Content. + * + * @return node + */ + public org.alfresco.example.webservice.types.Reference getNode() { + return node; + } + + + /** + * Sets the node value for this Content. + * + * @param node + */ + public void setNode(org.alfresco.example.webservice.types.Reference node) { + this.node = node; + } + + + /** + * Gets the property value for this Content. + * + * @return property + */ + public java.lang.String getProperty() { + return property; + } + + + /** + * Sets the property value for this Content. + * + * @param property + */ + public void setProperty(java.lang.String property) { + this.property = property; + } + + + /** + * Gets the length value for this Content. + * + * @return length + */ + public long getLength() { + return length; + } + + + /** + * Sets the length value for this Content. + * + * @param length + */ + public void setLength(long length) { + this.length = length; + } + + + /** + * Gets the format value for this Content. + * + * @return format + */ + public org.alfresco.example.webservice.types.ContentFormat getFormat() { + return format; + } + + + /** + * Sets the format value for this Content. + * + * @param format + */ + public void setFormat(org.alfresco.example.webservice.types.ContentFormat format) { + this.format = format; + } + + + /** + * Gets the url value for this Content. + * + * @return url + */ + public java.lang.String getUrl() { + return url; + } + + + /** + * Sets the url value for this Content. + * + * @param url + */ + public void setUrl(java.lang.String url) { + this.url = url; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof Content)) return false; + Content other = (Content) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.node==null && other.getNode()==null) || + (this.node!=null && + this.node.equals(other.getNode()))) && + ((this.property==null && other.getProperty()==null) || + (this.property!=null && + this.property.equals(other.getProperty()))) && + this.length == other.getLength() && + ((this.format==null && other.getFormat()==null) || + (this.format!=null && + this.format.equals(other.getFormat()))) && + ((this.url==null && other.getUrl()==null) || + (this.url!=null && + this.url.equals(other.getUrl()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getNode() != null) { + _hashCode += getNode().hashCode(); + } + if (getProperty() != null) { + _hashCode += getProperty().hashCode(); + } + _hashCode += new Long(getLength()).hashCode(); + if (getFormat() != null) { + _hashCode += getFormat().hashCode(); + } + if (getUrl() != null) { + _hashCode += getUrl().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(Content.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "Content")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("node"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "node")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("property"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "property")); + 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("length"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "length")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("format"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "format")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ContentFormat")); + elemField.setNillable(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("url"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "url")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(true); + 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/example/webservice/content/ContentFault.java b/source/generated/org/alfresco/example/webservice/content/ContentFault.java new file mode 100644 index 0000000000..b22bd24db6 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/content/ContentFault.java @@ -0,0 +1,157 @@ +/** + * ContentFault.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.content; + +public class ContentFault extends org.apache.axis.AxisFault implements java.io.Serializable { + private int errorCode; + private java.lang.String message1; + + public ContentFault() { + } + + public ContentFault( + int errorCode, + java.lang.String message1) { + this.errorCode = errorCode; + this.message1 = message1; + } + + + /** + * Gets the errorCode value for this ContentFault. + * + * @return errorCode + */ + public int getErrorCode() { + return errorCode; + } + + + /** + * Sets the errorCode value for this ContentFault. + * + * @param errorCode + */ + public void setErrorCode(int errorCode) { + this.errorCode = errorCode; + } + + + /** + * Gets the message1 value for this ContentFault. + * + * @return message1 + */ + public java.lang.String getMessage1() { + return message1; + } + + + /** + * Sets the message1 value for this ContentFault. + * + * @param message1 + */ + public void setMessage1(java.lang.String message1) { + this.message1 = message1; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof ContentFault)) return false; + ContentFault other = (ContentFault) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + this.errorCode == other.getErrorCode() && + ((this.message1==null && other.getMessage1()==null) || + (this.message1!=null && + this.message1.equals(other.getMessage1()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + _hashCode += getErrorCode(); + if (getMessage1() != null) { + _hashCode += getMessage1().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(ContentFault.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "ContentFault")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("errorCode"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "errorCode")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("message1"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "message")); + 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); + } + + + /** + * Writes the exception data to the faultDetails + */ + public void writeDetails(javax.xml.namespace.QName qname, org.apache.axis.encoding.SerializationContext context) throws java.io.IOException { + context.serialize(qname, null, this); + } +} diff --git a/source/generated/org/alfresco/example/webservice/content/ContentSegment.java b/source/generated/org/alfresco/example/webservice/content/ContentSegment.java new file mode 100644 index 0000000000..0cf8741606 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/content/ContentSegment.java @@ -0,0 +1,146 @@ +/** + * ContentSegment.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.content; + +public class ContentSegment implements java.io.Serializable { + private long offset; + private long length; + + public ContentSegment() { + } + + public ContentSegment( + long offset, + long length) { + this.offset = offset; + this.length = length; + } + + + /** + * Gets the offset value for this ContentSegment. + * + * @return offset + */ + public long getOffset() { + return offset; + } + + + /** + * Sets the offset value for this ContentSegment. + * + * @param offset + */ + public void setOffset(long offset) { + this.offset = offset; + } + + + /** + * Gets the length value for this ContentSegment. + * + * @return length + */ + public long getLength() { + return length; + } + + + /** + * Sets the length value for this ContentSegment. + * + * @param length + */ + public void setLength(long length) { + this.length = length; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof ContentSegment)) return false; + ContentSegment other = (ContentSegment) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + this.offset == other.getOffset() && + this.length == other.getLength(); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + _hashCode += new Long(getOffset()).hashCode(); + _hashCode += new Long(getLength()).hashCode(); + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(ContentSegment.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "ContentSegment")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("offset"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "offset")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("length"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "length")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long")); + 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/example/webservice/content/ContentService.java b/source/generated/org/alfresco/example/webservice/content/ContentService.java new file mode 100644 index 0000000000..601d296dab --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/content/ContentService.java @@ -0,0 +1,20 @@ +/** + * ContentService.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.content; + +public interface ContentService extends javax.xml.rpc.Service { + +/** + * Provides read and write access to content streams. + */ + public java.lang.String getContentServiceAddress(); + + public org.alfresco.example.webservice.content.ContentServiceSoapPort getContentService() throws javax.xml.rpc.ServiceException; + + public org.alfresco.example.webservice.content.ContentServiceSoapPort getContentService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; +} diff --git a/source/generated/org/alfresco/example/webservice/content/ContentServiceLocator.java b/source/generated/org/alfresco/example/webservice/content/ContentServiceLocator.java new file mode 100644 index 0000000000..5f16a5acdd --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/content/ContentServiceLocator.java @@ -0,0 +1,146 @@ +/** + * ContentServiceLocator.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.content; + +public class ContentServiceLocator extends org.apache.axis.client.Service implements org.alfresco.example.webservice.content.ContentService { + +/** + * Provides read and write access to content streams. + */ + + public ContentServiceLocator() { + } + + + public ContentServiceLocator(org.apache.axis.EngineConfiguration config) { + super(config); + } + + public ContentServiceLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException { + super(wsdlLoc, sName); + } + + // Use to get a proxy class for ContentService + private java.lang.String ContentService_address = "http://localhost:8080/alfresco/api/ContentService"; + + public java.lang.String getContentServiceAddress() { + return ContentService_address; + } + + // The WSDD service name defaults to the port name. + private java.lang.String ContentServiceWSDDServiceName = "ContentService"; + + public java.lang.String getContentServiceWSDDServiceName() { + return ContentServiceWSDDServiceName; + } + + public void setContentServiceWSDDServiceName(java.lang.String name) { + ContentServiceWSDDServiceName = name; + } + + public org.alfresco.example.webservice.content.ContentServiceSoapPort getContentService() throws javax.xml.rpc.ServiceException { + java.net.URL endpoint; + try { + endpoint = new java.net.URL(ContentService_address); + } + catch (java.net.MalformedURLException e) { + throw new javax.xml.rpc.ServiceException(e); + } + return getContentService(endpoint); + } + + public org.alfresco.example.webservice.content.ContentServiceSoapPort getContentService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException { + try { + org.alfresco.example.webservice.content.ContentServiceSoapBindingStub _stub = new org.alfresco.example.webservice.content.ContentServiceSoapBindingStub(portAddress, this); + _stub.setPortName(getContentServiceWSDDServiceName()); + return _stub; + } + catch (org.apache.axis.AxisFault e) { + return null; + } + } + + public void setContentServiceEndpointAddress(java.lang.String address) { + ContentService_address = address; + } + + /** + * For the given interface, get the stub implementation. + * If this service has no port for the given interface, + * then ServiceException is thrown. + */ + public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { + try { + if (org.alfresco.example.webservice.content.ContentServiceSoapPort.class.isAssignableFrom(serviceEndpointInterface)) { + org.alfresco.example.webservice.content.ContentServiceSoapBindingStub _stub = new org.alfresco.example.webservice.content.ContentServiceSoapBindingStub(new java.net.URL(ContentService_address), this); + _stub.setPortName(getContentServiceWSDDServiceName()); + return _stub; + } + } + catch (java.lang.Throwable t) { + throw new javax.xml.rpc.ServiceException(t); + } + throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); + } + + /** + * For the given interface, get the stub implementation. + * If this service has no port for the given interface, + * then ServiceException is thrown. + */ + public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { + if (portName == null) { + return getPort(serviceEndpointInterface); + } + java.lang.String inputPortName = portName.getLocalPart(); + if ("ContentService".equals(inputPortName)) { + return getContentService(); + } + else { + java.rmi.Remote _stub = getPort(serviceEndpointInterface); + ((org.apache.axis.client.Stub) _stub).setPortName(portName); + return _stub; + } + } + + public javax.xml.namespace.QName getServiceName() { + return new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "ContentService"); + } + + private java.util.HashSet ports = null; + + public java.util.Iterator getPorts() { + if (ports == null) { + ports = new java.util.HashSet(); + ports.add(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "ContentService")); + } + return ports.iterator(); + } + + /** + * Set the endpoint address for the specified port name. + */ + public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { + +if ("ContentService".equals(portName)) { + setContentServiceEndpointAddress(address); + } + else +{ // Unknown Port Name + throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); + } + } + + /** + * Set the endpoint address for the specified port name. + */ + public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException { + setEndpointAddress(portName.getLocalPart(), address); + } + +} diff --git a/source/generated/org/alfresco/example/webservice/content/ContentServiceSoapBindingStub.java b/source/generated/org/alfresco/example/webservice/content/ContentServiceSoapBindingStub.java new file mode 100644 index 0000000000..94f8e2f265 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/content/ContentServiceSoapBindingStub.java @@ -0,0 +1,560 @@ +/** + * ContentServiceSoapBindingStub.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.content; + +public class ContentServiceSoapBindingStub extends org.apache.axis.client.Stub implements org.alfresco.example.webservice.content.ContentServiceSoapPort { + private java.util.Vector cachedSerClasses = new java.util.Vector(); + private java.util.Vector cachedSerQNames = new java.util.Vector(); + private java.util.Vector cachedSerFactories = new java.util.Vector(); + private java.util.Vector cachedDeserFactories = new java.util.Vector(); + + static org.apache.axis.description.OperationDesc [] _operations; + + static { + _operations = new org.apache.axis.description.OperationDesc[3]; + _initOperationDesc1(); + } + + private static void _initOperationDesc1(){ + org.apache.axis.description.OperationDesc oper; + org.apache.axis.description.ParameterDesc param; + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("read"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "items"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate"), org.alfresco.example.webservice.types.Predicate.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "property"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "Content")); + oper.setReturnClass(org.alfresco.example.webservice.content.Content[].class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "content")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "ContentFault"), + "org.alfresco.example.webservice.content.ContentFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "ContentFault"), + true + )); + _operations[0] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("write"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "node"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference"), org.alfresco.example.webservice.types.Reference.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "property"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "content"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "base64Binary"), byte[].class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "format"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ContentFormat"), org.alfresco.example.webservice.types.ContentFormat.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "Content")); + oper.setReturnClass(org.alfresco.example.webservice.content.Content.class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "content")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "ContentFault"), + "org.alfresco.example.webservice.content.ContentFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "ContentFault"), + true + )); + _operations[1] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("clear"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "items"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate"), org.alfresco.example.webservice.types.Predicate.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "property"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "Content")); + oper.setReturnClass(org.alfresco.example.webservice.content.Content[].class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "content")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "ContentFault"), + "org.alfresco.example.webservice.content.ContentFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "ContentFault"), + true + )); + _operations[2] = oper; + + } + + public ContentServiceSoapBindingStub() throws org.apache.axis.AxisFault { + this(null); + } + + public ContentServiceSoapBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + this(service); + super.cachedEndpoint = endpointURL; + } + + public ContentServiceSoapBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + if (service == null) { + super.service = new org.apache.axis.client.Service(); + } else { + super.service = service; + } + ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2"); + java.lang.Class cls; + javax.xml.namespace.QName qName; + javax.xml.namespace.QName qName2; + java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class; + java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class; + java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class; + java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class; + java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class; + java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class; + java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class; + java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class; + java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class; + java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class; + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">ContentFormat>encoding"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">ContentFormat>mimetype"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">ResultSetRow>node"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ResultSetRowNode.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">Store>address"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "AssociationDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.AssociationDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Cardinality"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Cardinality.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Category"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Category.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ClassDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ClassDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Classification"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Classification.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ContentFormat"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ContentFormat.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NamedValue"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.NamedValue.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Node"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Node.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NodeDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.NodeDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ParentReference"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ParentReference.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Path"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Predicate.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "PropertyDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.PropertyDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Query"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Query.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "QueryLanguageEnum"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.QueryLanguageEnum.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Reference.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ResultSet"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ResultSet.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ResultSetMetaData"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ResultSetMetaData.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ResultSetRow"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ResultSetRow.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "RoleDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.RoleDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Store"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Store.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "StoreEnum"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.StoreEnum.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "UUID"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ValueDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ValueDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Version"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Version.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "VersionHistory"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.VersionHistory.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "Content"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.content.Content.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "ContentFault"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.content.ContentFault.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "ContentSegment"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.content.ContentSegment.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + } + + protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { + try { + org.apache.axis.client.Call _call = super._createCall(); + if (super.maintainSessionSet) { + _call.setMaintainSession(super.maintainSession); + } + if (super.cachedUsername != null) { + _call.setUsername(super.cachedUsername); + } + if (super.cachedPassword != null) { + _call.setPassword(super.cachedPassword); + } + if (super.cachedEndpoint != null) { + _call.setTargetEndpointAddress(super.cachedEndpoint); + } + if (super.cachedTimeout != null) { + _call.setTimeout(super.cachedTimeout); + } + if (super.cachedPortName != null) { + _call.setPortName(super.cachedPortName); + } + java.util.Enumeration keys = super.cachedProperties.keys(); + while (keys.hasMoreElements()) { + java.lang.String key = (java.lang.String) keys.nextElement(); + _call.setProperty(key, super.cachedProperties.get(key)); + } + // All the type mapping information is registered + // when the first call is made. + // The type mapping information is actually registered in + // the TypeMappingRegistry of the service, which + // is the reason why registration is only needed for the first call. + synchronized (this) { + if (firstCall()) { + // must set encoding style before registering serializers + _call.setEncodingStyle(null); + for (int i = 0; i < cachedSerFactories.size(); ++i) { + java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); + javax.xml.namespace.QName qName = + (javax.xml.namespace.QName) cachedSerQNames.get(i); + java.lang.Object x = cachedSerFactories.get(i); + if (x instanceof Class) { + java.lang.Class sf = (java.lang.Class) + cachedSerFactories.get(i); + java.lang.Class df = (java.lang.Class) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) { + org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory) + cachedSerFactories.get(i); + org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + } + } + } + return _call; + } + catch (java.lang.Throwable _t) { + throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); + } + } + + + /** + * Retrieves content from the repository. + */ + public org.alfresco.example.webservice.content.Content[] read(org.alfresco.example.webservice.types.Predicate items, java.lang.String property) throws java.rmi.RemoteException, org.alfresco.example.webservice.content.ContentFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[0]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/content/1.0/read"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "read")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {items, property}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.content.Content[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.content.Content[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.content.Content[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.content.ContentFault) { + throw (org.alfresco.example.webservice.content.ContentFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Writes content to the repository. + */ + public org.alfresco.example.webservice.content.Content write(org.alfresco.example.webservice.types.Reference node, java.lang.String property, byte[] content, org.alfresco.example.webservice.types.ContentFormat format) throws java.rmi.RemoteException, org.alfresco.example.webservice.content.ContentFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[1]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/content/1.0/write"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "write")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {node, property, content, format}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.content.Content) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.content.Content) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.content.Content.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.content.ContentFault) { + throw (org.alfresco.example.webservice.content.ContentFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Clears content from the repository. + */ + public org.alfresco.example.webservice.content.Content[] clear(org.alfresco.example.webservice.types.Predicate items, java.lang.String property) throws java.rmi.RemoteException, org.alfresco.example.webservice.content.ContentFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[2]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/content/1.0/clear"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "clear")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {items, property}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.content.Content[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.content.Content[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.content.Content[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.content.ContentFault) { + throw (org.alfresco.example.webservice.content.ContentFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + +} diff --git a/source/generated/org/alfresco/example/webservice/content/ContentServiceSoapPort.java b/source/generated/org/alfresco/example/webservice/content/ContentServiceSoapPort.java new file mode 100644 index 0000000000..e87c52b3b4 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/content/ContentServiceSoapPort.java @@ -0,0 +1,26 @@ +/** + * ContentServiceSoapPort.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.content; + +public interface ContentServiceSoapPort extends java.rmi.Remote { + + /** + * Retrieves content from the repository. + */ + public org.alfresco.example.webservice.content.Content[] read(org.alfresco.example.webservice.types.Predicate items, java.lang.String property) throws java.rmi.RemoteException, org.alfresco.example.webservice.content.ContentFault; + + /** + * Writes content to the repository. + */ + public org.alfresco.example.webservice.content.Content write(org.alfresco.example.webservice.types.Reference node, java.lang.String property, byte[] content, org.alfresco.example.webservice.types.ContentFormat format) throws java.rmi.RemoteException, org.alfresco.example.webservice.content.ContentFault; + + /** + * Clears content from the repository. + */ + public org.alfresco.example.webservice.content.Content[] clear(org.alfresco.example.webservice.types.Predicate items, java.lang.String property) throws java.rmi.RemoteException, org.alfresco.example.webservice.content.ContentFault; +} diff --git a/source/generated/org/alfresco/example/webservice/repository/Association.java b/source/generated/org/alfresco/example/webservice/repository/Association.java new file mode 100644 index 0000000000..a9a2d80ba3 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/repository/Association.java @@ -0,0 +1,154 @@ +/** + * Association.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.repository; + +public class Association implements java.io.Serializable { + private java.lang.String associationType; + private org.alfresco.example.webservice.repository.AssociationDirectionEnum direction; + + public Association() { + } + + public Association( + java.lang.String associationType, + org.alfresco.example.webservice.repository.AssociationDirectionEnum direction) { + this.associationType = associationType; + this.direction = direction; + } + + + /** + * Gets the associationType value for this Association. + * + * @return associationType + */ + public java.lang.String getAssociationType() { + return associationType; + } + + + /** + * Sets the associationType value for this Association. + * + * @param associationType + */ + public void setAssociationType(java.lang.String associationType) { + this.associationType = associationType; + } + + + /** + * Gets the direction value for this Association. + * + * @return direction + */ + public org.alfresco.example.webservice.repository.AssociationDirectionEnum getDirection() { + return direction; + } + + + /** + * Sets the direction value for this Association. + * + * @param direction + */ + public void setDirection(org.alfresco.example.webservice.repository.AssociationDirectionEnum direction) { + this.direction = direction; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof Association)) return false; + Association other = (Association) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.associationType==null && other.getAssociationType()==null) || + (this.associationType!=null && + this.associationType.equals(other.getAssociationType()))) && + ((this.direction==null && other.getDirection()==null) || + (this.direction!=null && + this.direction.equals(other.getDirection()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getAssociationType() != null) { + _hashCode += getAssociationType().hashCode(); + } + if (getDirection() != null) { + _hashCode += getDirection().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(Association.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "Association")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("associationType"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "associationType")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("direction"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "direction")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "AssociationDirectionEnum")); + 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/example/webservice/repository/AssociationDirectionEnum.java b/source/generated/org/alfresco/example/webservice/repository/AssociationDirectionEnum.java new file mode 100644 index 0000000000..0ad2510754 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/repository/AssociationDirectionEnum.java @@ -0,0 +1,70 @@ +/** + * AssociationDirectionEnum.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.repository; + +public class AssociationDirectionEnum implements java.io.Serializable { + private java.lang.String _value_; + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + protected AssociationDirectionEnum(java.lang.String value) { + _value_ = value; + _table_.put(_value_,this); + } + + public static final java.lang.String _source = "source"; + public static final java.lang.String _target = "target"; + public static final AssociationDirectionEnum source = new AssociationDirectionEnum(_source); + public static final AssociationDirectionEnum target = new AssociationDirectionEnum(_target); + public java.lang.String getValue() { return _value_;} + public static AssociationDirectionEnum fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + AssociationDirectionEnum enumeration = (AssociationDirectionEnum) + _table_.get(value); + if (enumeration==null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + public static AssociationDirectionEnum fromString(java.lang.String value) + throws java.lang.IllegalArgumentException { + return fromValue(value); + } + public boolean equals(java.lang.Object obj) {return (obj == this);} + public int hashCode() { return toString().hashCode();} + public java.lang.String toString() { return _value_;} + public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} + 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.EnumSerializer( + _javaType, _xmlType); + } + 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.EnumDeserializer( + _javaType, _xmlType); + } + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(AssociationDirectionEnum.class); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "AssociationDirectionEnum")); + } + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + +} diff --git a/source/generated/org/alfresco/example/webservice/repository/QueryResult.java b/source/generated/org/alfresco/example/webservice/repository/QueryResult.java new file mode 100644 index 0000000000..868378e5fc --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/repository/QueryResult.java @@ -0,0 +1,154 @@ +/** + * QueryResult.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.repository; + +public class QueryResult implements java.io.Serializable { + private java.lang.String querySession; + private org.alfresco.example.webservice.types.ResultSet resultSet; + + public QueryResult() { + } + + public QueryResult( + java.lang.String querySession, + org.alfresco.example.webservice.types.ResultSet resultSet) { + this.querySession = querySession; + this.resultSet = resultSet; + } + + + /** + * Gets the querySession value for this QueryResult. + * + * @return querySession + */ + public java.lang.String getQuerySession() { + return querySession; + } + + + /** + * Sets the querySession value for this QueryResult. + * + * @param querySession + */ + public void setQuerySession(java.lang.String querySession) { + this.querySession = querySession; + } + + + /** + * Gets the resultSet value for this QueryResult. + * + * @return resultSet + */ + public org.alfresco.example.webservice.types.ResultSet getResultSet() { + return resultSet; + } + + + /** + * Sets the resultSet value for this QueryResult. + * + * @param resultSet + */ + public void setResultSet(org.alfresco.example.webservice.types.ResultSet resultSet) { + this.resultSet = resultSet; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof QueryResult)) return false; + QueryResult other = (QueryResult) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.querySession==null && other.getQuerySession()==null) || + (this.querySession!=null && + this.querySession.equals(other.getQuerySession()))) && + ((this.resultSet==null && other.getResultSet()==null) || + (this.resultSet!=null && + this.resultSet.equals(other.getResultSet()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getQuerySession() != null) { + _hashCode += getQuerySession().hashCode(); + } + if (getResultSet() != null) { + _hashCode += getResultSet().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(QueryResult.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "QueryResult")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("querySession"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "querySession")); + 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("resultSet"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "resultSet")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ResultSet")); + 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/example/webservice/repository/RepositoryFault.java b/source/generated/org/alfresco/example/webservice/repository/RepositoryFault.java new file mode 100644 index 0000000000..aa93f367ec --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/repository/RepositoryFault.java @@ -0,0 +1,157 @@ +/** + * RepositoryFault.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.repository; + +public class RepositoryFault extends org.apache.axis.AxisFault implements java.io.Serializable { + private int errorCode; + private java.lang.String message1; + + public RepositoryFault() { + } + + public RepositoryFault( + int errorCode, + java.lang.String message1) { + this.errorCode = errorCode; + this.message1 = message1; + } + + + /** + * Gets the errorCode value for this RepositoryFault. + * + * @return errorCode + */ + public int getErrorCode() { + return errorCode; + } + + + /** + * Sets the errorCode value for this RepositoryFault. + * + * @param errorCode + */ + public void setErrorCode(int errorCode) { + this.errorCode = errorCode; + } + + + /** + * Gets the message1 value for this RepositoryFault. + * + * @return message1 + */ + public java.lang.String getMessage1() { + return message1; + } + + + /** + * Sets the message1 value for this RepositoryFault. + * + * @param message1 + */ + public void setMessage1(java.lang.String message1) { + this.message1 = message1; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof RepositoryFault)) return false; + RepositoryFault other = (RepositoryFault) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + this.errorCode == other.getErrorCode() && + ((this.message1==null && other.getMessage1()==null) || + (this.message1!=null && + this.message1.equals(other.getMessage1()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + _hashCode += getErrorCode(); + if (getMessage1() != null) { + _hashCode += getMessage1().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(RepositoryFault.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("errorCode"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "errorCode")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("message1"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "message")); + 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); + } + + + /** + * Writes the exception data to the faultDetails + */ + public void writeDetails(javax.xml.namespace.QName qname, org.apache.axis.encoding.SerializationContext context) throws java.io.IOException { + context.serialize(qname, null, this); + } +} diff --git a/source/generated/org/alfresco/example/webservice/repository/RepositoryService.java b/source/generated/org/alfresco/example/webservice/repository/RepositoryService.java new file mode 100644 index 0000000000..72864c6cef --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/repository/RepositoryService.java @@ -0,0 +1,20 @@ +/** + * RepositoryService.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.repository; + +public interface RepositoryService extends javax.xml.rpc.Service { + +/** + * Provides read and write operations against a repository. + */ + public java.lang.String getRepositoryServiceAddress(); + + public org.alfresco.example.webservice.repository.RepositoryServiceSoapPort getRepositoryService() throws javax.xml.rpc.ServiceException; + + public org.alfresco.example.webservice.repository.RepositoryServiceSoapPort getRepositoryService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; +} diff --git a/source/generated/org/alfresco/example/webservice/repository/RepositoryServiceLocator.java b/source/generated/org/alfresco/example/webservice/repository/RepositoryServiceLocator.java new file mode 100644 index 0000000000..af6409909f --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/repository/RepositoryServiceLocator.java @@ -0,0 +1,146 @@ +/** + * RepositoryServiceLocator.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.repository; + +public class RepositoryServiceLocator extends org.apache.axis.client.Service implements org.alfresco.example.webservice.repository.RepositoryService { + +/** + * Provides read and write operations against a repository. + */ + + public RepositoryServiceLocator() { + } + + + public RepositoryServiceLocator(org.apache.axis.EngineConfiguration config) { + super(config); + } + + public RepositoryServiceLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException { + super(wsdlLoc, sName); + } + + // Use to get a proxy class for RepositoryService + private java.lang.String RepositoryService_address = "http://localhost:8080/alfresco/api/RepositoryService"; + + public java.lang.String getRepositoryServiceAddress() { + return RepositoryService_address; + } + + // The WSDD service name defaults to the port name. + private java.lang.String RepositoryServiceWSDDServiceName = "RepositoryService"; + + public java.lang.String getRepositoryServiceWSDDServiceName() { + return RepositoryServiceWSDDServiceName; + } + + public void setRepositoryServiceWSDDServiceName(java.lang.String name) { + RepositoryServiceWSDDServiceName = name; + } + + public org.alfresco.example.webservice.repository.RepositoryServiceSoapPort getRepositoryService() throws javax.xml.rpc.ServiceException { + java.net.URL endpoint; + try { + endpoint = new java.net.URL(RepositoryService_address); + } + catch (java.net.MalformedURLException e) { + throw new javax.xml.rpc.ServiceException(e); + } + return getRepositoryService(endpoint); + } + + public org.alfresco.example.webservice.repository.RepositoryServiceSoapPort getRepositoryService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException { + try { + org.alfresco.example.webservice.repository.RepositoryServiceSoapBindingStub _stub = new org.alfresco.example.webservice.repository.RepositoryServiceSoapBindingStub(portAddress, this); + _stub.setPortName(getRepositoryServiceWSDDServiceName()); + return _stub; + } + catch (org.apache.axis.AxisFault e) { + return null; + } + } + + public void setRepositoryServiceEndpointAddress(java.lang.String address) { + RepositoryService_address = address; + } + + /** + * For the given interface, get the stub implementation. + * If this service has no port for the given interface, + * then ServiceException is thrown. + */ + public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { + try { + if (org.alfresco.example.webservice.repository.RepositoryServiceSoapPort.class.isAssignableFrom(serviceEndpointInterface)) { + org.alfresco.example.webservice.repository.RepositoryServiceSoapBindingStub _stub = new org.alfresco.example.webservice.repository.RepositoryServiceSoapBindingStub(new java.net.URL(RepositoryService_address), this); + _stub.setPortName(getRepositoryServiceWSDDServiceName()); + return _stub; + } + } + catch (java.lang.Throwable t) { + throw new javax.xml.rpc.ServiceException(t); + } + throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); + } + + /** + * For the given interface, get the stub implementation. + * If this service has no port for the given interface, + * then ServiceException is thrown. + */ + public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { + if (portName == null) { + return getPort(serviceEndpointInterface); + } + java.lang.String inputPortName = portName.getLocalPart(); + if ("RepositoryService".equals(inputPortName)) { + return getRepositoryService(); + } + else { + java.rmi.Remote _stub = getPort(serviceEndpointInterface); + ((org.apache.axis.client.Stub) _stub).setPortName(portName); + return _stub; + } + } + + public javax.xml.namespace.QName getServiceName() { + return new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryService"); + } + + private java.util.HashSet ports = null; + + public java.util.Iterator getPorts() { + if (ports == null) { + ports = new java.util.HashSet(); + ports.add(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryService")); + } + return ports.iterator(); + } + + /** + * Set the endpoint address for the specified port name. + */ + public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { + +if ("RepositoryService".equals(portName)) { + setRepositoryServiceEndpointAddress(address); + } + else +{ // Unknown Port Name + throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); + } + } + + /** + * Set the endpoint address for the specified port name. + */ + public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException { + setEndpointAddress(portName.getLocalPart(), address); + } + +} diff --git a/source/generated/org/alfresco/example/webservice/repository/RepositoryServiceSoapBindingStub.java b/source/generated/org/alfresco/example/webservice/repository/RepositoryServiceSoapBindingStub.java new file mode 100644 index 0000000000..23f3f92389 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/repository/RepositoryServiceSoapBindingStub.java @@ -0,0 +1,1063 @@ +/** + * RepositoryServiceSoapBindingStub.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.repository; + +public class RepositoryServiceSoapBindingStub extends org.apache.axis.client.Stub implements org.alfresco.example.webservice.repository.RepositoryServiceSoapPort { + private java.util.Vector cachedSerClasses = new java.util.Vector(); + private java.util.Vector cachedSerQNames = new java.util.Vector(); + private java.util.Vector cachedSerFactories = new java.util.Vector(); + private java.util.Vector cachedDeserFactories = new java.util.Vector(); + + static org.apache.axis.description.OperationDesc [] _operations; + + static { + _operations = new org.apache.axis.description.OperationDesc[9]; + _initOperationDesc1(); + } + + private static void _initOperationDesc1(){ + org.apache.axis.description.OperationDesc oper; + org.apache.axis.description.ParameterDesc param; + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("getStores"); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Store")); + oper.setReturnClass(org.alfresco.example.webservice.types.Store[].class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "getStoresReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + "org.alfresco.example.webservice.repository.RepositoryFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + true + )); + _operations[0] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("query"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "store"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Store"), org.alfresco.example.webservice.types.Store.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "query"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Query"), org.alfresco.example.webservice.types.Query.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "includeMetaData"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean"), boolean.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "QueryResult")); + oper.setReturnClass(org.alfresco.example.webservice.repository.QueryResult.class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "queryReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + "org.alfresco.example.webservice.repository.RepositoryFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + true + )); + _operations[1] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("queryChildren"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "node"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference"), org.alfresco.example.webservice.types.Reference.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "QueryResult")); + oper.setReturnClass(org.alfresco.example.webservice.repository.QueryResult.class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "queryReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + "org.alfresco.example.webservice.repository.RepositoryFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + true + )); + _operations[2] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("queryParents"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "node"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference"), org.alfresco.example.webservice.types.Reference.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "QueryResult")); + oper.setReturnClass(org.alfresco.example.webservice.repository.QueryResult.class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "queryReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + "org.alfresco.example.webservice.repository.RepositoryFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + true + )); + _operations[3] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("queryAssociated"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "node"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference"), org.alfresco.example.webservice.types.Reference.class, false, false); + oper.addParameter(param); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "association"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "Association"), org.alfresco.example.webservice.repository.Association[].class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "QueryResult")); + oper.setReturnClass(org.alfresco.example.webservice.repository.QueryResult.class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "queryReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + "org.alfresco.example.webservice.repository.RepositoryFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + true + )); + _operations[4] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("fetchMore"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "querySession"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "QueryResult")); + oper.setReturnClass(org.alfresco.example.webservice.repository.QueryResult.class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "queryReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + "org.alfresco.example.webservice.repository.RepositoryFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + true + )); + _operations[5] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("update"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "statements"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "CML"), org.alfresco.example.webservice.types.CML.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "UpdateResult")); + oper.setReturnClass(org.alfresco.example.webservice.repository.UpdateResult[].class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "updateReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + "org.alfresco.example.webservice.repository.RepositoryFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + true + )); + _operations[6] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("describe"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "items"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate"), org.alfresco.example.webservice.types.Predicate.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NodeDefinition")); + oper.setReturnClass(org.alfresco.example.webservice.types.NodeDefinition[].class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "describeReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + "org.alfresco.example.webservice.repository.RepositoryFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + true + )); + _operations[7] = oper; + + oper = new org.apache.axis.description.OperationDesc(); + oper.setName("get"); + param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "where"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate"), org.alfresco.example.webservice.types.Predicate.class, false, false); + oper.addParameter(param); + oper.setReturnType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Node")); + oper.setReturnClass(org.alfresco.example.webservice.types.Node[].class); + oper.setReturnQName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "getReturn")); + oper.setStyle(org.apache.axis.constants.Style.WRAPPED); + oper.setUse(org.apache.axis.constants.Use.LITERAL); + oper.addFault(new org.apache.axis.description.FaultDesc( + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + "org.alfresco.example.webservice.repository.RepositoryFault", + new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"), + true + )); + _operations[8] = oper; + + } + + public RepositoryServiceSoapBindingStub() throws org.apache.axis.AxisFault { + this(null); + } + + public RepositoryServiceSoapBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + this(service); + super.cachedEndpoint = endpointURL; + } + + public RepositoryServiceSoapBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { + if (service == null) { + super.service = new org.apache.axis.client.Service(); + } else { + super.service = service; + } + ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2"); + java.lang.Class cls; + javax.xml.namespace.QName qName; + javax.xml.namespace.QName qName2; + java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class; + java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class; + java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class; + java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class; + java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class; + java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class; + java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class; + java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class; + java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class; + java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class; + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>addAspect"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.CMLAddAspect.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>addChild"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.CMLAddChild.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>copy"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.CMLCopy.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>create"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.CMLCreate.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>createAssociation"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.CMLCreateAssociation.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>delete"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.CMLDelete.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>move"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.CMLMove.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>removeAspect"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.CMLRemoveAspect.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>removeAssociation"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.CMLRemoveAssociation.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>removeChild"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.CMLRemoveChild.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>update"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.CMLUpdate.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "CML"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.CML.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/headers/1.0", ">NamespaceConfiguration>mapping"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.NamespaceConfigurationMapping.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/headers/1.0", "LocaleConfiguration"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.LocaleConfiguration.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/headers/1.0", "NamespaceConfiguration"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.NamespaceConfigurationMapping[].class; + cachedSerClasses.add(cls); + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/headers/1.0", ">NamespaceConfiguration>mapping"); + qName2 = new javax.xml.namespace.QName("http://www.alfresco.org/ws/headers/1.0", "mapping"); + cachedSerFactories.add(new org.apache.axis.encoding.ser.ArraySerializerFactory(qName, qName2)); + cachedDeserFactories.add(new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/headers/1.0", "QueryConfiguration"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.QueryConfiguration.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">ContentFormat>encoding"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">ContentFormat>mimetype"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">ResultSetRow>node"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ResultSetRowNode.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">Store>address"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "AssociationDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.AssociationDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Cardinality"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Cardinality.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Category"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Category.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ClassDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ClassDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Classification"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Classification.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ContentFormat"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ContentFormat.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NamedValue"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.NamedValue.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Node"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Node.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NodeDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.NodeDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ParentReference"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ParentReference.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Path"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Predicate.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "PropertyDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.PropertyDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Query"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Query.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "QueryLanguageEnum"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.QueryLanguageEnum.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Reference.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ResultSet"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ResultSet.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ResultSetMetaData"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ResultSetMetaData.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ResultSetRow"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ResultSetRow.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "RoleDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.RoleDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Store"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Store.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "StoreEnum"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.StoreEnum.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "UUID"); + cachedSerQNames.add(qName); + cls = java.lang.String.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(simplesf); + cachedDeserFactories.add(simpledf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ValueDefinition"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.ValueDefinition.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Version"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.Version.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "VersionHistory"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.types.VersionHistory.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "Association"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.repository.Association.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "AssociationDirectionEnum"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.repository.AssociationDirectionEnum.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(enumsf); + cachedDeserFactories.add(enumdf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "QueryResult"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.repository.QueryResult.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.repository.RepositoryFault.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + qName = new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "UpdateResult"); + cachedSerQNames.add(qName); + cls = org.alfresco.example.webservice.repository.UpdateResult.class; + cachedSerClasses.add(cls); + cachedSerFactories.add(beansf); + cachedDeserFactories.add(beandf); + + } + + protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { + try { + org.apache.axis.client.Call _call = super._createCall(); + if (super.maintainSessionSet) { + _call.setMaintainSession(super.maintainSession); + } + if (super.cachedUsername != null) { + _call.setUsername(super.cachedUsername); + } + if (super.cachedPassword != null) { + _call.setPassword(super.cachedPassword); + } + if (super.cachedEndpoint != null) { + _call.setTargetEndpointAddress(super.cachedEndpoint); + } + if (super.cachedTimeout != null) { + _call.setTimeout(super.cachedTimeout); + } + if (super.cachedPortName != null) { + _call.setPortName(super.cachedPortName); + } + java.util.Enumeration keys = super.cachedProperties.keys(); + while (keys.hasMoreElements()) { + java.lang.String key = (java.lang.String) keys.nextElement(); + _call.setProperty(key, super.cachedProperties.get(key)); + } + // All the type mapping information is registered + // when the first call is made. + // The type mapping information is actually registered in + // the TypeMappingRegistry of the service, which + // is the reason why registration is only needed for the first call. + synchronized (this) { + if (firstCall()) { + // must set encoding style before registering serializers + _call.setEncodingStyle(null); + for (int i = 0; i < cachedSerFactories.size(); ++i) { + java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i); + javax.xml.namespace.QName qName = + (javax.xml.namespace.QName) cachedSerQNames.get(i); + java.lang.Object x = cachedSerFactories.get(i); + if (x instanceof Class) { + java.lang.Class sf = (java.lang.Class) + cachedSerFactories.get(i); + java.lang.Class df = (java.lang.Class) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) { + org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory) + cachedSerFactories.get(i); + org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory) + cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + } + } + } + return _call; + } + catch (java.lang.Throwable _t) { + throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); + } + } + + + /** + * Retrieves a list of stores where content resources are held. + */ + public org.alfresco.example.webservice.types.Store[] getStores() throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[0]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/repository/1.0/getStores"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "getStores")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.types.Store[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.types.Store[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.types.Store[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.repository.RepositoryFault) { + throw (org.alfresco.example.webservice.repository.RepositoryFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Executes a query against a store + */ + public org.alfresco.example.webservice.repository.QueryResult query(org.alfresco.example.webservice.types.Store store, org.alfresco.example.webservice.types.Query query, boolean includeMetaData) throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[1]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/repository/1.0/query"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "query")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {store, query, new java.lang.Boolean(includeMetaData)}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.repository.QueryResult) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.repository.QueryResult) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.repository.QueryResult.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.repository.RepositoryFault) { + throw (org.alfresco.example.webservice.repository.RepositoryFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Executes a query to retrieve the children of the specified + * resource. + */ + public org.alfresco.example.webservice.repository.QueryResult queryChildren(org.alfresco.example.webservice.types.Reference node) throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[2]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/repository/1.0/queryChildren"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "queryChildren")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {node}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.repository.QueryResult) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.repository.QueryResult) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.repository.QueryResult.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.repository.RepositoryFault) { + throw (org.alfresco.example.webservice.repository.RepositoryFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Executes a query to retrieve the parents of the specified resource. + */ + public org.alfresco.example.webservice.repository.QueryResult queryParents(org.alfresco.example.webservice.types.Reference node) throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[3]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/repository/1.0/queryParents"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "queryParents")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {node}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.repository.QueryResult) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.repository.QueryResult) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.repository.QueryResult.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.repository.RepositoryFault) { + throw (org.alfresco.example.webservice.repository.RepositoryFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Executes a query to retrieve associated resources of the specified + * resource. + */ + public org.alfresco.example.webservice.repository.QueryResult queryAssociated(org.alfresco.example.webservice.types.Reference node, org.alfresco.example.webservice.repository.Association[] association) throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[4]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/repository/1.0/queryAssociated"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "queryAssociated")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {node, association}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.repository.QueryResult) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.repository.QueryResult) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.repository.QueryResult.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.repository.RepositoryFault) { + throw (org.alfresco.example.webservice.repository.RepositoryFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Fetches the next batch of query results. + */ + public org.alfresco.example.webservice.repository.QueryResult fetchMore(java.lang.String querySession) throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[5]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/repository/1.0/fetchMore"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "fetchMore")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {querySession}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.repository.QueryResult) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.repository.QueryResult) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.repository.QueryResult.class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.repository.RepositoryFault) { + throw (org.alfresco.example.webservice.repository.RepositoryFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Executes a CML script to manipulate the contents of a Repository + * store. + */ + public org.alfresco.example.webservice.repository.UpdateResult[] update(org.alfresco.example.webservice.types.CML statements) throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[6]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/repository/1.0/update"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "update")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {statements}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.repository.UpdateResult[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.repository.UpdateResult[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.repository.UpdateResult[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.repository.RepositoryFault) { + throw (org.alfresco.example.webservice.repository.RepositoryFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Describes a content resource. + */ + public org.alfresco.example.webservice.types.NodeDefinition[] describe(org.alfresco.example.webservice.types.Predicate items) throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[7]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/repository/1.0/describe"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "describe")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {items}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.types.NodeDefinition[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.types.NodeDefinition[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.types.NodeDefinition[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.repository.RepositoryFault) { + throw (org.alfresco.example.webservice.repository.RepositoryFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + + + /** + * Gets a resource from the respository. + */ + public org.alfresco.example.webservice.types.Node[] get(org.alfresco.example.webservice.types.Predicate where) throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault { + if (super.cachedEndpoint == null) { + throw new org.apache.axis.NoEndPointException(); + } + org.apache.axis.client.Call _call = createCall(); + _call.setOperation(_operations[8]); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI("http://www.alfresco.org/ws/service/repository/1.0/get"); + _call.setEncodingStyle(null); + _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "get")); + + setRequestHeaders(_call); + setAttachments(_call); + try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {where}); + + if (_resp instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException)_resp; + } + else { + extractAttachments(_call); + try { + return (org.alfresco.example.webservice.types.Node[]) _resp; + } catch (java.lang.Exception _exception) { + return (org.alfresco.example.webservice.types.Node[]) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.types.Node[].class); + } + } + } catch (org.apache.axis.AxisFault axisFaultException) { + if (axisFaultException.detail != null) { + if (axisFaultException.detail instanceof java.rmi.RemoteException) { + throw (java.rmi.RemoteException) axisFaultException.detail; + } + if (axisFaultException.detail instanceof org.alfresco.example.webservice.repository.RepositoryFault) { + throw (org.alfresco.example.webservice.repository.RepositoryFault) axisFaultException.detail; + } + } + throw axisFaultException; +} + } + +} diff --git a/source/generated/org/alfresco/example/webservice/repository/RepositoryServiceSoapPort.java b/source/generated/org/alfresco/example/webservice/repository/RepositoryServiceSoapPort.java new file mode 100644 index 0000000000..776d6ef8cc --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/repository/RepositoryServiceSoapPort.java @@ -0,0 +1,59 @@ +/** + * RepositoryServiceSoapPort.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.repository; + +public interface RepositoryServiceSoapPort extends java.rmi.Remote { + + /** + * Retrieves a list of stores where content resources are held. + */ + public org.alfresco.example.webservice.types.Store[] getStores() throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault; + + /** + * Executes a query against a store. + */ + public org.alfresco.example.webservice.repository.QueryResult query(org.alfresco.example.webservice.types.Store store, org.alfresco.example.webservice.types.Query query, boolean includeMetaData) throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault; + + /** + * Executes a query to retrieve the children of the specified + * resource. + */ + public org.alfresco.example.webservice.repository.QueryResult queryChildren(org.alfresco.example.webservice.types.Reference node) throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault; + + /** + * Executes a query to retrieve the parents of the specified resource. + */ + public org.alfresco.example.webservice.repository.QueryResult queryParents(org.alfresco.example.webservice.types.Reference node) throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault; + + /** + * Executes a query to retrieve associated resources of the specified + * resource. + */ + public org.alfresco.example.webservice.repository.QueryResult queryAssociated(org.alfresco.example.webservice.types.Reference node, org.alfresco.example.webservice.repository.Association[] association) throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault; + + /** + * Fetches the next batch of query results. + */ + public org.alfresco.example.webservice.repository.QueryResult fetchMore(java.lang.String querySession) throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault; + + /** + * Executes a CML script to manipulate the contents of a Repository + * store. + */ + public org.alfresco.example.webservice.repository.UpdateResult[] update(org.alfresco.example.webservice.types.CML statements) throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault; + + /** + * Describes a content resource. + */ + public org.alfresco.example.webservice.types.NodeDefinition[] describe(org.alfresco.example.webservice.types.Predicate items) throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault; + + /** + * Gets a resource from the repository. + */ + public org.alfresco.example.webservice.types.Node[] get(org.alfresco.example.webservice.types.Predicate where) throws java.rmi.RemoteException, org.alfresco.example.webservice.repository.RepositoryFault; +} diff --git a/source/generated/org/alfresco/example/webservice/repository/UpdateResult.java b/source/generated/org/alfresco/example/webservice/repository/UpdateResult.java new file mode 100644 index 0000000000..8683693298 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/repository/UpdateResult.java @@ -0,0 +1,224 @@ +/** + * UpdateResult.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.repository; + +public class UpdateResult implements java.io.Serializable { + private java.lang.String statement; + private org.alfresco.example.webservice.types.ResultSet updateCount; + private org.alfresco.example.webservice.types.Reference source; + private org.alfresco.example.webservice.types.Reference destination; + + public UpdateResult() { + } + + public UpdateResult( + java.lang.String statement, + org.alfresco.example.webservice.types.ResultSet updateCount, + org.alfresco.example.webservice.types.Reference source, + org.alfresco.example.webservice.types.Reference destination) { + this.statement = statement; + this.updateCount = updateCount; + this.source = source; + this.destination = destination; + } + + + /** + * Gets the statement value for this UpdateResult. + * + * @return statement + */ + public java.lang.String getStatement() { + return statement; + } + + + /** + * Sets the statement value for this UpdateResult. + * + * @param statement + */ + public void setStatement(java.lang.String statement) { + this.statement = statement; + } + + + /** + * Gets the updateCount value for this UpdateResult. + * + * @return updateCount + */ + public org.alfresco.example.webservice.types.ResultSet getUpdateCount() { + return updateCount; + } + + + /** + * Sets the updateCount value for this UpdateResult. + * + * @param updateCount + */ + public void setUpdateCount(org.alfresco.example.webservice.types.ResultSet updateCount) { + this.updateCount = updateCount; + } + + + /** + * Gets the source value for this UpdateResult. + * + * @return source + */ + public org.alfresco.example.webservice.types.Reference getSource() { + return source; + } + + + /** + * Sets the source value for this UpdateResult. + * + * @param source + */ + public void setSource(org.alfresco.example.webservice.types.Reference source) { + this.source = source; + } + + + /** + * Gets the destination value for this UpdateResult. + * + * @return destination + */ + public org.alfresco.example.webservice.types.Reference getDestination() { + return destination; + } + + + /** + * Sets the destination value for this UpdateResult. + * + * @param destination + */ + public void setDestination(org.alfresco.example.webservice.types.Reference destination) { + this.destination = destination; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof UpdateResult)) return false; + UpdateResult other = (UpdateResult) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.statement==null && other.getStatement()==null) || + (this.statement!=null && + this.statement.equals(other.getStatement()))) && + ((this.updateCount==null && other.getUpdateCount()==null) || + (this.updateCount!=null && + this.updateCount.equals(other.getUpdateCount()))) && + ((this.source==null && other.getSource()==null) || + (this.source!=null && + this.source.equals(other.getSource()))) && + ((this.destination==null && other.getDestination()==null) || + (this.destination!=null && + this.destination.equals(other.getDestination()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getStatement() != null) { + _hashCode += getStatement().hashCode(); + } + if (getUpdateCount() != null) { + _hashCode += getUpdateCount().hashCode(); + } + if (getSource() != null) { + _hashCode += getSource().hashCode(); + } + if (getDestination() != null) { + _hashCode += getDestination().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(UpdateResult.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "UpdateResult")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("statement"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "statement")); + 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("updateCount"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "updateCount")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ResultSet")); + elemField.setNillable(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("source"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "source")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference")); + elemField.setNillable(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("destination"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "destination")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference")); + elemField.setNillable(true); + 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/example/webservice/types/AssociationDefinition.java b/source/generated/org/alfresco/example/webservice/types/AssociationDefinition.java new file mode 100644 index 0000000000..94233d38dd --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/AssociationDefinition.java @@ -0,0 +1,329 @@ +/** + * AssociationDefinition.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class AssociationDefinition implements java.io.Serializable { + private java.lang.String name; + private java.lang.String title; + private java.lang.String description; + private boolean isChild; + private org.alfresco.example.webservice.types.RoleDefinition sourceRole; + private org.alfresco.example.webservice.types.RoleDefinition targetRole; + private java.lang.String targetClass; + + public AssociationDefinition() { + } + + public AssociationDefinition( + java.lang.String name, + java.lang.String title, + java.lang.String description, + boolean isChild, + org.alfresco.example.webservice.types.RoleDefinition sourceRole, + org.alfresco.example.webservice.types.RoleDefinition targetRole, + java.lang.String targetClass) { + this.name = name; + this.title = title; + this.description = description; + this.isChild = isChild; + this.sourceRole = sourceRole; + this.targetRole = targetRole; + this.targetClass = targetClass; + } + + + /** + * Gets the name value for this AssociationDefinition. + * + * @return name + */ + public java.lang.String getName() { + return name; + } + + + /** + * Sets the name value for this AssociationDefinition. + * + * @param name + */ + public void setName(java.lang.String name) { + this.name = name; + } + + + /** + * Gets the title value for this AssociationDefinition. + * + * @return title + */ + public java.lang.String getTitle() { + return title; + } + + + /** + * Sets the title value for this AssociationDefinition. + * + * @param title + */ + public void setTitle(java.lang.String title) { + this.title = title; + } + + + /** + * Gets the description value for this AssociationDefinition. + * + * @return description + */ + public java.lang.String getDescription() { + return description; + } + + + /** + * Sets the description value for this AssociationDefinition. + * + * @param description + */ + public void setDescription(java.lang.String description) { + this.description = description; + } + + + /** + * Gets the isChild value for this AssociationDefinition. + * + * @return isChild + */ + public boolean isIsChild() { + return isChild; + } + + + /** + * Sets the isChild value for this AssociationDefinition. + * + * @param isChild + */ + public void setIsChild(boolean isChild) { + this.isChild = isChild; + } + + + /** + * Gets the sourceRole value for this AssociationDefinition. + * + * @return sourceRole + */ + public org.alfresco.example.webservice.types.RoleDefinition getSourceRole() { + return sourceRole; + } + + + /** + * Sets the sourceRole value for this AssociationDefinition. + * + * @param sourceRole + */ + public void setSourceRole(org.alfresco.example.webservice.types.RoleDefinition sourceRole) { + this.sourceRole = sourceRole; + } + + + /** + * Gets the targetRole value for this AssociationDefinition. + * + * @return targetRole + */ + public org.alfresco.example.webservice.types.RoleDefinition getTargetRole() { + return targetRole; + } + + + /** + * Sets the targetRole value for this AssociationDefinition. + * + * @param targetRole + */ + public void setTargetRole(org.alfresco.example.webservice.types.RoleDefinition targetRole) { + this.targetRole = targetRole; + } + + + /** + * Gets the targetClass value for this AssociationDefinition. + * + * @return targetClass + */ + public java.lang.String getTargetClass() { + return targetClass; + } + + + /** + * Sets the targetClass value for this AssociationDefinition. + * + * @param targetClass + */ + public void setTargetClass(java.lang.String targetClass) { + this.targetClass = targetClass; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof AssociationDefinition)) return false; + AssociationDefinition other = (AssociationDefinition) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.name==null && other.getName()==null) || + (this.name!=null && + this.name.equals(other.getName()))) && + ((this.title==null && other.getTitle()==null) || + (this.title!=null && + this.title.equals(other.getTitle()))) && + ((this.description==null && other.getDescription()==null) || + (this.description!=null && + this.description.equals(other.getDescription()))) && + this.isChild == other.isIsChild() && + ((this.sourceRole==null && other.getSourceRole()==null) || + (this.sourceRole!=null && + this.sourceRole.equals(other.getSourceRole()))) && + ((this.targetRole==null && other.getTargetRole()==null) || + (this.targetRole!=null && + this.targetRole.equals(other.getTargetRole()))) && + ((this.targetClass==null && other.getTargetClass()==null) || + (this.targetClass!=null && + this.targetClass.equals(other.getTargetClass()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getName() != null) { + _hashCode += getName().hashCode(); + } + if (getTitle() != null) { + _hashCode += getTitle().hashCode(); + } + if (getDescription() != null) { + _hashCode += getDescription().hashCode(); + } + _hashCode += (isIsChild() ? Boolean.TRUE : Boolean.FALSE).hashCode(); + if (getSourceRole() != null) { + _hashCode += getSourceRole().hashCode(); + } + if (getTargetRole() != null) { + _hashCode += getTargetRole().hashCode(); + } + if (getTargetClass() != null) { + _hashCode += getTargetClass().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(AssociationDefinition.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "AssociationDefinition")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("name"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "name")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("title"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "title")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("description"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "description")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("isChild"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "isChild")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("sourceRole"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "sourceRole")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "RoleDefinition")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("targetRole"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "targetRole")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "RoleDefinition")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("targetClass"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "targetClass")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + 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/example/webservice/types/CML.java b/source/generated/org/alfresco/example/webservice/types/CML.java new file mode 100644 index 0000000000..22bc086307 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/CML.java @@ -0,0 +1,667 @@ +/** + * CML.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class CML implements java.io.Serializable { + private org.alfresco.example.webservice.types.CMLCreate[] create; + private org.alfresco.example.webservice.types.CMLAddAspect[] addAspect; + private org.alfresco.example.webservice.types.CMLRemoveAspect[] removeAspect; + private org.alfresco.example.webservice.types.CMLUpdate[] update; + private org.alfresco.example.webservice.types.CMLDelete[] delete; + private org.alfresco.example.webservice.types.CMLMove[] move; + private org.alfresco.example.webservice.types.CMLCopy[] copy; + private org.alfresco.example.webservice.types.CMLAddChild[] addChild; + private org.alfresco.example.webservice.types.CMLRemoveChild[] removeChild; + private org.alfresco.example.webservice.types.CMLCreateAssociation[] createAssociation; + private org.alfresco.example.webservice.types.CMLRemoveAssociation[] removeAssociation; + + public CML() { + } + + public CML( + org.alfresco.example.webservice.types.CMLCreate[] create, + org.alfresco.example.webservice.types.CMLAddAspect[] addAspect, + org.alfresco.example.webservice.types.CMLRemoveAspect[] removeAspect, + org.alfresco.example.webservice.types.CMLUpdate[] update, + org.alfresco.example.webservice.types.CMLDelete[] delete, + org.alfresco.example.webservice.types.CMLMove[] move, + org.alfresco.example.webservice.types.CMLCopy[] copy, + org.alfresco.example.webservice.types.CMLAddChild[] addChild, + org.alfresco.example.webservice.types.CMLRemoveChild[] removeChild, + org.alfresco.example.webservice.types.CMLCreateAssociation[] createAssociation, + org.alfresco.example.webservice.types.CMLRemoveAssociation[] removeAssociation) { + this.create = create; + this.addAspect = addAspect; + this.removeAspect = removeAspect; + this.update = update; + this.delete = delete; + this.move = move; + this.copy = copy; + this.addChild = addChild; + this.removeChild = removeChild; + this.createAssociation = createAssociation; + this.removeAssociation = removeAssociation; + } + + + /** + * Gets the create value for this CML. + * + * @return create + */ + public org.alfresco.example.webservice.types.CMLCreate[] getCreate() { + return create; + } + + + /** + * Sets the create value for this CML. + * + * @param create + */ + public void setCreate(org.alfresco.example.webservice.types.CMLCreate[] create) { + this.create = create; + } + + public org.alfresco.example.webservice.types.CMLCreate getCreate(int i) { + return this.create[i]; + } + + public void setCreate(int i, org.alfresco.example.webservice.types.CMLCreate _value) { + this.create[i] = _value; + } + + + /** + * Gets the addAspect value for this CML. + * + * @return addAspect + */ + public org.alfresco.example.webservice.types.CMLAddAspect[] getAddAspect() { + return addAspect; + } + + + /** + * Sets the addAspect value for this CML. + * + * @param addAspect + */ + public void setAddAspect(org.alfresco.example.webservice.types.CMLAddAspect[] addAspect) { + this.addAspect = addAspect; + } + + public org.alfresco.example.webservice.types.CMLAddAspect getAddAspect(int i) { + return this.addAspect[i]; + } + + public void setAddAspect(int i, org.alfresco.example.webservice.types.CMLAddAspect _value) { + this.addAspect[i] = _value; + } + + + /** + * Gets the removeAspect value for this CML. + * + * @return removeAspect + */ + public org.alfresco.example.webservice.types.CMLRemoveAspect[] getRemoveAspect() { + return removeAspect; + } + + + /** + * Sets the removeAspect value for this CML. + * + * @param removeAspect + */ + public void setRemoveAspect(org.alfresco.example.webservice.types.CMLRemoveAspect[] removeAspect) { + this.removeAspect = removeAspect; + } + + public org.alfresco.example.webservice.types.CMLRemoveAspect getRemoveAspect(int i) { + return this.removeAspect[i]; + } + + public void setRemoveAspect(int i, org.alfresco.example.webservice.types.CMLRemoveAspect _value) { + this.removeAspect[i] = _value; + } + + + /** + * Gets the update value for this CML. + * + * @return update + */ + public org.alfresco.example.webservice.types.CMLUpdate[] getUpdate() { + return update; + } + + + /** + * Sets the update value for this CML. + * + * @param update + */ + public void setUpdate(org.alfresco.example.webservice.types.CMLUpdate[] update) { + this.update = update; + } + + public org.alfresco.example.webservice.types.CMLUpdate getUpdate(int i) { + return this.update[i]; + } + + public void setUpdate(int i, org.alfresco.example.webservice.types.CMLUpdate _value) { + this.update[i] = _value; + } + + + /** + * Gets the delete value for this CML. + * + * @return delete + */ + public org.alfresco.example.webservice.types.CMLDelete[] getDelete() { + return delete; + } + + + /** + * Sets the delete value for this CML. + * + * @param delete + */ + public void setDelete(org.alfresco.example.webservice.types.CMLDelete[] delete) { + this.delete = delete; + } + + public org.alfresco.example.webservice.types.CMLDelete getDelete(int i) { + return this.delete[i]; + } + + public void setDelete(int i, org.alfresco.example.webservice.types.CMLDelete _value) { + this.delete[i] = _value; + } + + + /** + * Gets the move value for this CML. + * + * @return move + */ + public org.alfresco.example.webservice.types.CMLMove[] getMove() { + return move; + } + + + /** + * Sets the move value for this CML. + * + * @param move + */ + public void setMove(org.alfresco.example.webservice.types.CMLMove[] move) { + this.move = move; + } + + public org.alfresco.example.webservice.types.CMLMove getMove(int i) { + return this.move[i]; + } + + public void setMove(int i, org.alfresco.example.webservice.types.CMLMove _value) { + this.move[i] = _value; + } + + + /** + * Gets the copy value for this CML. + * + * @return copy + */ + public org.alfresco.example.webservice.types.CMLCopy[] getCopy() { + return copy; + } + + + /** + * Sets the copy value for this CML. + * + * @param copy + */ + public void setCopy(org.alfresco.example.webservice.types.CMLCopy[] copy) { + this.copy = copy; + } + + public org.alfresco.example.webservice.types.CMLCopy getCopy(int i) { + return this.copy[i]; + } + + public void setCopy(int i, org.alfresco.example.webservice.types.CMLCopy _value) { + this.copy[i] = _value; + } + + + /** + * Gets the addChild value for this CML. + * + * @return addChild + */ + public org.alfresco.example.webservice.types.CMLAddChild[] getAddChild() { + return addChild; + } + + + /** + * Sets the addChild value for this CML. + * + * @param addChild + */ + public void setAddChild(org.alfresco.example.webservice.types.CMLAddChild[] addChild) { + this.addChild = addChild; + } + + public org.alfresco.example.webservice.types.CMLAddChild getAddChild(int i) { + return this.addChild[i]; + } + + public void setAddChild(int i, org.alfresco.example.webservice.types.CMLAddChild _value) { + this.addChild[i] = _value; + } + + + /** + * Gets the removeChild value for this CML. + * + * @return removeChild + */ + public org.alfresco.example.webservice.types.CMLRemoveChild[] getRemoveChild() { + return removeChild; + } + + + /** + * Sets the removeChild value for this CML. + * + * @param removeChild + */ + public void setRemoveChild(org.alfresco.example.webservice.types.CMLRemoveChild[] removeChild) { + this.removeChild = removeChild; + } + + public org.alfresco.example.webservice.types.CMLRemoveChild getRemoveChild(int i) { + return this.removeChild[i]; + } + + public void setRemoveChild(int i, org.alfresco.example.webservice.types.CMLRemoveChild _value) { + this.removeChild[i] = _value; + } + + + /** + * Gets the createAssociation value for this CML. + * + * @return createAssociation + */ + public org.alfresco.example.webservice.types.CMLCreateAssociation[] getCreateAssociation() { + return createAssociation; + } + + + /** + * Sets the createAssociation value for this CML. + * + * @param createAssociation + */ + public void setCreateAssociation(org.alfresco.example.webservice.types.CMLCreateAssociation[] createAssociation) { + this.createAssociation = createAssociation; + } + + public org.alfresco.example.webservice.types.CMLCreateAssociation getCreateAssociation(int i) { + return this.createAssociation[i]; + } + + public void setCreateAssociation(int i, org.alfresco.example.webservice.types.CMLCreateAssociation _value) { + this.createAssociation[i] = _value; + } + + + /** + * Gets the removeAssociation value for this CML. + * + * @return removeAssociation + */ + public org.alfresco.example.webservice.types.CMLRemoveAssociation[] getRemoveAssociation() { + return removeAssociation; + } + + + /** + * Sets the removeAssociation value for this CML. + * + * @param removeAssociation + */ + public void setRemoveAssociation(org.alfresco.example.webservice.types.CMLRemoveAssociation[] removeAssociation) { + this.removeAssociation = removeAssociation; + } + + public org.alfresco.example.webservice.types.CMLRemoveAssociation getRemoveAssociation(int i) { + return this.removeAssociation[i]; + } + + public void setRemoveAssociation(int i, org.alfresco.example.webservice.types.CMLRemoveAssociation _value) { + this.removeAssociation[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CML)) return false; + CML other = (CML) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.create==null && other.getCreate()==null) || + (this.create!=null && + java.util.Arrays.equals(this.create, other.getCreate()))) && + ((this.addAspect==null && other.getAddAspect()==null) || + (this.addAspect!=null && + java.util.Arrays.equals(this.addAspect, other.getAddAspect()))) && + ((this.removeAspect==null && other.getRemoveAspect()==null) || + (this.removeAspect!=null && + java.util.Arrays.equals(this.removeAspect, other.getRemoveAspect()))) && + ((this.update==null && other.getUpdate()==null) || + (this.update!=null && + java.util.Arrays.equals(this.update, other.getUpdate()))) && + ((this.delete==null && other.getDelete()==null) || + (this.delete!=null && + java.util.Arrays.equals(this.delete, other.getDelete()))) && + ((this.move==null && other.getMove()==null) || + (this.move!=null && + java.util.Arrays.equals(this.move, other.getMove()))) && + ((this.copy==null && other.getCopy()==null) || + (this.copy!=null && + java.util.Arrays.equals(this.copy, other.getCopy()))) && + ((this.addChild==null && other.getAddChild()==null) || + (this.addChild!=null && + java.util.Arrays.equals(this.addChild, other.getAddChild()))) && + ((this.removeChild==null && other.getRemoveChild()==null) || + (this.removeChild!=null && + java.util.Arrays.equals(this.removeChild, other.getRemoveChild()))) && + ((this.createAssociation==null && other.getCreateAssociation()==null) || + (this.createAssociation!=null && + java.util.Arrays.equals(this.createAssociation, other.getCreateAssociation()))) && + ((this.removeAssociation==null && other.getRemoveAssociation()==null) || + (this.removeAssociation!=null && + java.util.Arrays.equals(this.removeAssociation, other.getRemoveAssociation()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getCreate() != null) { + for (int i=0; + iCML>create")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("addAspect"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "addAspect")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>addAspect")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("removeAspect"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "removeAspect")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>removeAspect")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("update"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "update")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>update")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("delete"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "delete")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>delete")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("move"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "move")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>move")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("copy"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "copy")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>copy")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("addChild"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "addChild")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>addChild")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("removeChild"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "removeChild")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>removeChild")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("createAssociation"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "createAssociation")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>createAssociation")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("removeAssociation"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "removeAssociation")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>removeAssociation")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + 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/example/webservice/types/CMLAddAspect.java b/source/generated/org/alfresco/example/webservice/types/CMLAddAspect.java new file mode 100644 index 0000000000..cd17d56934 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/CMLAddAspect.java @@ -0,0 +1,244 @@ +/** + * CMLAddAspect.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class CMLAddAspect implements java.io.Serializable { + private java.lang.String aspect; + private org.alfresco.example.webservice.types.NamedValue[] property; + private org.alfresco.example.webservice.types.Predicate where; + private java.lang.String where_id; + + public CMLAddAspect() { + } + + public CMLAddAspect( + java.lang.String aspect, + org.alfresco.example.webservice.types.NamedValue[] property, + org.alfresco.example.webservice.types.Predicate where, + java.lang.String where_id) { + this.aspect = aspect; + this.property = property; + this.where = where; + this.where_id = where_id; + } + + + /** + * Gets the aspect value for this CMLAddAspect. + * + * @return aspect + */ + public java.lang.String getAspect() { + return aspect; + } + + + /** + * Sets the aspect value for this CMLAddAspect. + * + * @param aspect + */ + public void setAspect(java.lang.String aspect) { + this.aspect = aspect; + } + + + /** + * Gets the property value for this CMLAddAspect. + * + * @return property + */ + public org.alfresco.example.webservice.types.NamedValue[] getProperty() { + return property; + } + + + /** + * Sets the property value for this CMLAddAspect. + * + * @param property + */ + public void setProperty(org.alfresco.example.webservice.types.NamedValue[] property) { + this.property = property; + } + + public org.alfresco.example.webservice.types.NamedValue getProperty(int i) { + return this.property[i]; + } + + public void setProperty(int i, org.alfresco.example.webservice.types.NamedValue _value) { + this.property[i] = _value; + } + + + /** + * Gets the where value for this CMLAddAspect. + * + * @return where + */ + public org.alfresco.example.webservice.types.Predicate getWhere() { + return where; + } + + + /** + * Sets the where value for this CMLAddAspect. + * + * @param where + */ + public void setWhere(org.alfresco.example.webservice.types.Predicate where) { + this.where = where; + } + + + /** + * Gets the where_id value for this CMLAddAspect. + * + * @return where_id + */ + public java.lang.String getWhere_id() { + return where_id; + } + + + /** + * Sets the where_id value for this CMLAddAspect. + * + * @param where_id + */ + public void setWhere_id(java.lang.String where_id) { + this.where_id = where_id; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLAddAspect)) return false; + CMLAddAspect other = (CMLAddAspect) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.aspect==null && other.getAspect()==null) || + (this.aspect!=null && + this.aspect.equals(other.getAspect()))) && + ((this.property==null && other.getProperty()==null) || + (this.property!=null && + java.util.Arrays.equals(this.property, other.getProperty()))) && + ((this.where==null && other.getWhere()==null) || + (this.where!=null && + this.where.equals(other.getWhere()))) && + ((this.where_id==null && other.getWhere_id()==null) || + (this.where_id!=null && + this.where_id.equals(other.getWhere_id()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getAspect() != null) { + _hashCode += getAspect().hashCode(); + } + if (getProperty() != null) { + for (int i=0; + iCML>addAspect")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("aspect"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "aspect")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("property"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "property")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NamedValue")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + 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/example/webservice/types/CMLAddChild.java b/source/generated/org/alfresco/example/webservice/types/CMLAddChild.java new file mode 100644 index 0000000000..7f4b992c87 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/CMLAddChild.java @@ -0,0 +1,299 @@ +/** + * CMLAddChild.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class CMLAddChild implements java.io.Serializable { + private org.alfresco.example.webservice.types.ParentReference to; + private java.lang.String to_id; + private java.lang.String associationType; + private java.lang.String childName; + private org.alfresco.example.webservice.types.Predicate where; + private java.lang.String where_id; + + public CMLAddChild() { + } + + public CMLAddChild( + org.alfresco.example.webservice.types.ParentReference to, + java.lang.String to_id, + java.lang.String associationType, + java.lang.String childName, + org.alfresco.example.webservice.types.Predicate where, + java.lang.String where_id) { + this.to = to; + this.to_id = to_id; + this.associationType = associationType; + this.childName = childName; + this.where = where; + this.where_id = where_id; + } + + + /** + * Gets the to value for this CMLAddChild. + * + * @return to + */ + public org.alfresco.example.webservice.types.ParentReference getTo() { + return to; + } + + + /** + * Sets the to value for this CMLAddChild. + * + * @param to + */ + public void setTo(org.alfresco.example.webservice.types.ParentReference to) { + this.to = to; + } + + + /** + * Gets the to_id value for this CMLAddChild. + * + * @return to_id + */ + public java.lang.String getTo_id() { + return to_id; + } + + + /** + * Sets the to_id value for this CMLAddChild. + * + * @param to_id + */ + public void setTo_id(java.lang.String to_id) { + this.to_id = to_id; + } + + + /** + * Gets the associationType value for this CMLAddChild. + * + * @return associationType + */ + public java.lang.String getAssociationType() { + return associationType; + } + + + /** + * Sets the associationType value for this CMLAddChild. + * + * @param associationType + */ + public void setAssociationType(java.lang.String associationType) { + this.associationType = associationType; + } + + + /** + * Gets the childName value for this CMLAddChild. + * + * @return childName + */ + public java.lang.String getChildName() { + return childName; + } + + + /** + * Sets the childName value for this CMLAddChild. + * + * @param childName + */ + public void setChildName(java.lang.String childName) { + this.childName = childName; + } + + + /** + * Gets the where value for this CMLAddChild. + * + * @return where + */ + public org.alfresco.example.webservice.types.Predicate getWhere() { + return where; + } + + + /** + * Sets the where value for this CMLAddChild. + * + * @param where + */ + public void setWhere(org.alfresco.example.webservice.types.Predicate where) { + this.where = where; + } + + + /** + * Gets the where_id value for this CMLAddChild. + * + * @return where_id + */ + public java.lang.String getWhere_id() { + return where_id; + } + + + /** + * Sets the where_id value for this CMLAddChild. + * + * @param where_id + */ + public void setWhere_id(java.lang.String where_id) { + this.where_id = where_id; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLAddChild)) return false; + CMLAddChild other = (CMLAddChild) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.to==null && other.getTo()==null) || + (this.to!=null && + this.to.equals(other.getTo()))) && + ((this.to_id==null && other.getTo_id()==null) || + (this.to_id!=null && + this.to_id.equals(other.getTo_id()))) && + ((this.associationType==null && other.getAssociationType()==null) || + (this.associationType!=null && + this.associationType.equals(other.getAssociationType()))) && + ((this.childName==null && other.getChildName()==null) || + (this.childName!=null && + this.childName.equals(other.getChildName()))) && + ((this.where==null && other.getWhere()==null) || + (this.where!=null && + this.where.equals(other.getWhere()))) && + ((this.where_id==null && other.getWhere_id()==null) || + (this.where_id!=null && + this.where_id.equals(other.getWhere_id()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getTo() != null) { + _hashCode += getTo().hashCode(); + } + if (getTo_id() != null) { + _hashCode += getTo_id().hashCode(); + } + if (getAssociationType() != null) { + _hashCode += getAssociationType().hashCode(); + } + if (getChildName() != null) { + _hashCode += getChildName().hashCode(); + } + if (getWhere() != null) { + _hashCode += getWhere().hashCode(); + } + if (getWhere_id() != null) { + _hashCode += getWhere_id().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(CMLAddChild.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>addChild")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ParentReference")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to_id")); + 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("associationType"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "associationType")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("childName"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "childName")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + 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/example/webservice/types/CMLCopy.java b/source/generated/org/alfresco/example/webservice/types/CMLCopy.java new file mode 100644 index 0000000000..795f2f7b95 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/CMLCopy.java @@ -0,0 +1,335 @@ +/** + * CMLCopy.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class CMLCopy implements java.io.Serializable { + private org.alfresco.example.webservice.types.ParentReference to; + private java.lang.String to_id; + private java.lang.String associationType; + private java.lang.String childName; + private org.alfresco.example.webservice.types.Predicate where; + private java.lang.String where_id; + private java.lang.Boolean children; + + public CMLCopy() { + } + + public CMLCopy( + org.alfresco.example.webservice.types.ParentReference to, + java.lang.String to_id, + java.lang.String associationType, + java.lang.String childName, + org.alfresco.example.webservice.types.Predicate where, + java.lang.String where_id, + java.lang.Boolean children) { + this.to = to; + this.to_id = to_id; + this.associationType = associationType; + this.childName = childName; + this.where = where; + this.where_id = where_id; + this.children = children; + } + + + /** + * Gets the to value for this CMLCopy. + * + * @return to + */ + public org.alfresco.example.webservice.types.ParentReference getTo() { + return to; + } + + + /** + * Sets the to value for this CMLCopy. + * + * @param to + */ + public void setTo(org.alfresco.example.webservice.types.ParentReference to) { + this.to = to; + } + + + /** + * Gets the to_id value for this CMLCopy. + * + * @return to_id + */ + public java.lang.String getTo_id() { + return to_id; + } + + + /** + * Sets the to_id value for this CMLCopy. + * + * @param to_id + */ + public void setTo_id(java.lang.String to_id) { + this.to_id = to_id; + } + + + /** + * Gets the associationType value for this CMLCopy. + * + * @return associationType + */ + public java.lang.String getAssociationType() { + return associationType; + } + + + /** + * Sets the associationType value for this CMLCopy. + * + * @param associationType + */ + public void setAssociationType(java.lang.String associationType) { + this.associationType = associationType; + } + + + /** + * Gets the childName value for this CMLCopy. + * + * @return childName + */ + public java.lang.String getChildName() { + return childName; + } + + + /** + * Sets the childName value for this CMLCopy. + * + * @param childName + */ + public void setChildName(java.lang.String childName) { + this.childName = childName; + } + + + /** + * Gets the where value for this CMLCopy. + * + * @return where + */ + public org.alfresco.example.webservice.types.Predicate getWhere() { + return where; + } + + + /** + * Sets the where value for this CMLCopy. + * + * @param where + */ + public void setWhere(org.alfresco.example.webservice.types.Predicate where) { + this.where = where; + } + + + /** + * Gets the where_id value for this CMLCopy. + * + * @return where_id + */ + public java.lang.String getWhere_id() { + return where_id; + } + + + /** + * Sets the where_id value for this CMLCopy. + * + * @param where_id + */ + public void setWhere_id(java.lang.String where_id) { + this.where_id = where_id; + } + + + /** + * Gets the children value for this CMLCopy. + * + * @return children + */ + public java.lang.Boolean getChildren() { + return children; + } + + + /** + * Sets the children value for this CMLCopy. + * + * @param children + */ + public void setChildren(java.lang.Boolean children) { + this.children = children; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLCopy)) return false; + CMLCopy other = (CMLCopy) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.to==null && other.getTo()==null) || + (this.to!=null && + this.to.equals(other.getTo()))) && + ((this.to_id==null && other.getTo_id()==null) || + (this.to_id!=null && + this.to_id.equals(other.getTo_id()))) && + ((this.associationType==null && other.getAssociationType()==null) || + (this.associationType!=null && + this.associationType.equals(other.getAssociationType()))) && + ((this.childName==null && other.getChildName()==null) || + (this.childName!=null && + this.childName.equals(other.getChildName()))) && + ((this.where==null && other.getWhere()==null) || + (this.where!=null && + this.where.equals(other.getWhere()))) && + ((this.where_id==null && other.getWhere_id()==null) || + (this.where_id!=null && + this.where_id.equals(other.getWhere_id()))) && + ((this.children==null && other.getChildren()==null) || + (this.children!=null && + this.children.equals(other.getChildren()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getTo() != null) { + _hashCode += getTo().hashCode(); + } + if (getTo_id() != null) { + _hashCode += getTo_id().hashCode(); + } + if (getAssociationType() != null) { + _hashCode += getAssociationType().hashCode(); + } + if (getChildName() != null) { + _hashCode += getChildName().hashCode(); + } + if (getWhere() != null) { + _hashCode += getWhere().hashCode(); + } + if (getWhere_id() != null) { + _hashCode += getWhere_id().hashCode(); + } + if (getChildren() != null) { + _hashCode += getChildren().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(CMLCopy.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>copy")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ParentReference")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to_id")); + 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("associationType"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "associationType")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("childName"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "childName")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("children"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "children")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean")); + elemField.setMinOccurs(0); + 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/example/webservice/types/CMLCreate.java b/source/generated/org/alfresco/example/webservice/types/CMLCreate.java new file mode 100644 index 0000000000..9db8c1e2ea --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/CMLCreate.java @@ -0,0 +1,244 @@ +/** + * CMLCreate.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class CMLCreate implements java.io.Serializable { + private java.lang.String id; + private org.alfresco.example.webservice.types.ParentReference parent; + private java.lang.String type; + private org.alfresco.example.webservice.types.NamedValue[] property; + + public CMLCreate() { + } + + public CMLCreate( + java.lang.String id, + org.alfresco.example.webservice.types.ParentReference parent, + java.lang.String type, + org.alfresco.example.webservice.types.NamedValue[] property) { + this.id = id; + this.parent = parent; + this.type = type; + this.property = property; + } + + + /** + * Gets the id value for this CMLCreate. + * + * @return id + */ + public java.lang.String getId() { + return id; + } + + + /** + * Sets the id value for this CMLCreate. + * + * @param id + */ + public void setId(java.lang.String id) { + this.id = id; + } + + + /** + * Gets the parent value for this CMLCreate. + * + * @return parent + */ + public org.alfresco.example.webservice.types.ParentReference getParent() { + return parent; + } + + + /** + * Sets the parent value for this CMLCreate. + * + * @param parent + */ + public void setParent(org.alfresco.example.webservice.types.ParentReference parent) { + this.parent = parent; + } + + + /** + * Gets the type value for this CMLCreate. + * + * @return type + */ + public java.lang.String getType() { + return type; + } + + + /** + * Sets the type value for this CMLCreate. + * + * @param type + */ + public void setType(java.lang.String type) { + this.type = type; + } + + + /** + * Gets the property value for this CMLCreate. + * + * @return property + */ + public org.alfresco.example.webservice.types.NamedValue[] getProperty() { + return property; + } + + + /** + * Sets the property value for this CMLCreate. + * + * @param property + */ + public void setProperty(org.alfresco.example.webservice.types.NamedValue[] property) { + this.property = property; + } + + public org.alfresco.example.webservice.types.NamedValue getProperty(int i) { + return this.property[i]; + } + + public void setProperty(int i, org.alfresco.example.webservice.types.NamedValue _value) { + this.property[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLCreate)) return false; + CMLCreate other = (CMLCreate) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.id==null && other.getId()==null) || + (this.id!=null && + this.id.equals(other.getId()))) && + ((this.parent==null && other.getParent()==null) || + (this.parent!=null && + this.parent.equals(other.getParent()))) && + ((this.type==null && other.getType()==null) || + (this.type!=null && + this.type.equals(other.getType()))) && + ((this.property==null && other.getProperty()==null) || + (this.property!=null && + java.util.Arrays.equals(this.property, other.getProperty()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getId() != null) { + _hashCode += getId().hashCode(); + } + if (getParent() != null) { + _hashCode += getParent().hashCode(); + } + if (getType() != null) { + _hashCode += getType().hashCode(); + } + if (getProperty() != null) { + for (int i=0; + iCML>create")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("parent"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "parent")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ParentReference")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("type"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "type")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("property"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "property")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NamedValue")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + 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/example/webservice/types/CMLCreateAssociation.java b/source/generated/org/alfresco/example/webservice/types/CMLCreateAssociation.java new file mode 100644 index 0000000000..31052f9d17 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/CMLCreateAssociation.java @@ -0,0 +1,263 @@ +/** + * CMLCreateAssociation.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class CMLCreateAssociation implements java.io.Serializable { + private org.alfresco.example.webservice.types.Predicate from; + private java.lang.String from_id; + private org.alfresco.example.webservice.types.Predicate to; + private java.lang.String to_id; + private java.lang.String association; + + public CMLCreateAssociation() { + } + + public CMLCreateAssociation( + org.alfresco.example.webservice.types.Predicate from, + java.lang.String from_id, + org.alfresco.example.webservice.types.Predicate to, + java.lang.String to_id, + java.lang.String association) { + this.from = from; + this.from_id = from_id; + this.to = to; + this.to_id = to_id; + this.association = association; + } + + + /** + * Gets the from value for this CMLCreateAssociation. + * + * @return from + */ + public org.alfresco.example.webservice.types.Predicate getFrom() { + return from; + } + + + /** + * Sets the from value for this CMLCreateAssociation. + * + * @param from + */ + public void setFrom(org.alfresco.example.webservice.types.Predicate from) { + this.from = from; + } + + + /** + * Gets the from_id value for this CMLCreateAssociation. + * + * @return from_id + */ + public java.lang.String getFrom_id() { + return from_id; + } + + + /** + * Sets the from_id value for this CMLCreateAssociation. + * + * @param from_id + */ + public void setFrom_id(java.lang.String from_id) { + this.from_id = from_id; + } + + + /** + * Gets the to value for this CMLCreateAssociation. + * + * @return to + */ + public org.alfresco.example.webservice.types.Predicate getTo() { + return to; + } + + + /** + * Sets the to value for this CMLCreateAssociation. + * + * @param to + */ + public void setTo(org.alfresco.example.webservice.types.Predicate to) { + this.to = to; + } + + + /** + * Gets the to_id value for this CMLCreateAssociation. + * + * @return to_id + */ + public java.lang.String getTo_id() { + return to_id; + } + + + /** + * Sets the to_id value for this CMLCreateAssociation. + * + * @param to_id + */ + public void setTo_id(java.lang.String to_id) { + this.to_id = to_id; + } + + + /** + * Gets the association value for this CMLCreateAssociation. + * + * @return association + */ + public java.lang.String getAssociation() { + return association; + } + + + /** + * Sets the association value for this CMLCreateAssociation. + * + * @param association + */ + public void setAssociation(java.lang.String association) { + this.association = association; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLCreateAssociation)) return false; + CMLCreateAssociation other = (CMLCreateAssociation) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.from==null && other.getFrom()==null) || + (this.from!=null && + this.from.equals(other.getFrom()))) && + ((this.from_id==null && other.getFrom_id()==null) || + (this.from_id!=null && + this.from_id.equals(other.getFrom_id()))) && + ((this.to==null && other.getTo()==null) || + (this.to!=null && + this.to.equals(other.getTo()))) && + ((this.to_id==null && other.getTo_id()==null) || + (this.to_id!=null && + this.to_id.equals(other.getTo_id()))) && + ((this.association==null && other.getAssociation()==null) || + (this.association!=null && + this.association.equals(other.getAssociation()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getFrom() != null) { + _hashCode += getFrom().hashCode(); + } + if (getFrom_id() != null) { + _hashCode += getFrom_id().hashCode(); + } + if (getTo() != null) { + _hashCode += getTo().hashCode(); + } + if (getTo_id() != null) { + _hashCode += getTo_id().hashCode(); + } + if (getAssociation() != null) { + _hashCode += getAssociation().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(CMLCreateAssociation.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>createAssociation")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("from"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "from")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("from_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "from_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("association"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "association")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + 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/example/webservice/types/CMLDelete.java b/source/generated/org/alfresco/example/webservice/types/CMLDelete.java new file mode 100644 index 0000000000..c3254814d4 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/CMLDelete.java @@ -0,0 +1,119 @@ +/** + * CMLDelete.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class CMLDelete implements java.io.Serializable { + private org.alfresco.example.webservice.types.Predicate where; + + public CMLDelete() { + } + + public CMLDelete( + org.alfresco.example.webservice.types.Predicate where) { + this.where = where; + } + + + /** + * Gets the where value for this CMLDelete. + * + * @return where + */ + public org.alfresco.example.webservice.types.Predicate getWhere() { + return where; + } + + + /** + * Sets the where value for this CMLDelete. + * + * @param where + */ + public void setWhere(org.alfresco.example.webservice.types.Predicate where) { + this.where = where; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLDelete)) return false; + CMLDelete other = (CMLDelete) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.where==null && other.getWhere()==null) || + (this.where!=null && + this.where.equals(other.getWhere()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getWhere() != null) { + _hashCode += getWhere().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(CMLDelete.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>delete")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + 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/example/webservice/types/CMLMove.java b/source/generated/org/alfresco/example/webservice/types/CMLMove.java new file mode 100644 index 0000000000..f06d8b94ee --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/CMLMove.java @@ -0,0 +1,299 @@ +/** + * CMLMove.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class CMLMove implements java.io.Serializable { + private org.alfresco.example.webservice.types.ParentReference to; + private java.lang.String to_id; + private java.lang.String associationType; + private java.lang.String childName; + private org.alfresco.example.webservice.types.Predicate where; + private java.lang.String where_id; + + public CMLMove() { + } + + public CMLMove( + org.alfresco.example.webservice.types.ParentReference to, + java.lang.String to_id, + java.lang.String associationType, + java.lang.String childName, + org.alfresco.example.webservice.types.Predicate where, + java.lang.String where_id) { + this.to = to; + this.to_id = to_id; + this.associationType = associationType; + this.childName = childName; + this.where = where; + this.where_id = where_id; + } + + + /** + * Gets the to value for this CMLMove. + * + * @return to + */ + public org.alfresco.example.webservice.types.ParentReference getTo() { + return to; + } + + + /** + * Sets the to value for this CMLMove. + * + * @param to + */ + public void setTo(org.alfresco.example.webservice.types.ParentReference to) { + this.to = to; + } + + + /** + * Gets the to_id value for this CMLMove. + * + * @return to_id + */ + public java.lang.String getTo_id() { + return to_id; + } + + + /** + * Sets the to_id value for this CMLMove. + * + * @param to_id + */ + public void setTo_id(java.lang.String to_id) { + this.to_id = to_id; + } + + + /** + * Gets the associationType value for this CMLMove. + * + * @return associationType + */ + public java.lang.String getAssociationType() { + return associationType; + } + + + /** + * Sets the associationType value for this CMLMove. + * + * @param associationType + */ + public void setAssociationType(java.lang.String associationType) { + this.associationType = associationType; + } + + + /** + * Gets the childName value for this CMLMove. + * + * @return childName + */ + public java.lang.String getChildName() { + return childName; + } + + + /** + * Sets the childName value for this CMLMove. + * + * @param childName + */ + public void setChildName(java.lang.String childName) { + this.childName = childName; + } + + + /** + * Gets the where value for this CMLMove. + * + * @return where + */ + public org.alfresco.example.webservice.types.Predicate getWhere() { + return where; + } + + + /** + * Sets the where value for this CMLMove. + * + * @param where + */ + public void setWhere(org.alfresco.example.webservice.types.Predicate where) { + this.where = where; + } + + + /** + * Gets the where_id value for this CMLMove. + * + * @return where_id + */ + public java.lang.String getWhere_id() { + return where_id; + } + + + /** + * Sets the where_id value for this CMLMove. + * + * @param where_id + */ + public void setWhere_id(java.lang.String where_id) { + this.where_id = where_id; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLMove)) return false; + CMLMove other = (CMLMove) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.to==null && other.getTo()==null) || + (this.to!=null && + this.to.equals(other.getTo()))) && + ((this.to_id==null && other.getTo_id()==null) || + (this.to_id!=null && + this.to_id.equals(other.getTo_id()))) && + ((this.associationType==null && other.getAssociationType()==null) || + (this.associationType!=null && + this.associationType.equals(other.getAssociationType()))) && + ((this.childName==null && other.getChildName()==null) || + (this.childName!=null && + this.childName.equals(other.getChildName()))) && + ((this.where==null && other.getWhere()==null) || + (this.where!=null && + this.where.equals(other.getWhere()))) && + ((this.where_id==null && other.getWhere_id()==null) || + (this.where_id!=null && + this.where_id.equals(other.getWhere_id()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getTo() != null) { + _hashCode += getTo().hashCode(); + } + if (getTo_id() != null) { + _hashCode += getTo_id().hashCode(); + } + if (getAssociationType() != null) { + _hashCode += getAssociationType().hashCode(); + } + if (getChildName() != null) { + _hashCode += getChildName().hashCode(); + } + if (getWhere() != null) { + _hashCode += getWhere().hashCode(); + } + if (getWhere_id() != null) { + _hashCode += getWhere_id().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(CMLMove.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>move")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ParentReference")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to_id")); + 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("associationType"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "associationType")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("childName"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "childName")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + 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/example/webservice/types/CMLRemoveAspect.java b/source/generated/org/alfresco/example/webservice/types/CMLRemoveAspect.java new file mode 100644 index 0000000000..39d5b4efdc --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/CMLRemoveAspect.java @@ -0,0 +1,191 @@ +/** + * CMLRemoveAspect.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class CMLRemoveAspect implements java.io.Serializable { + private java.lang.String aspect; + private org.alfresco.example.webservice.types.Predicate where; + private java.lang.String where_id; + + public CMLRemoveAspect() { + } + + public CMLRemoveAspect( + java.lang.String aspect, + org.alfresco.example.webservice.types.Predicate where, + java.lang.String where_id) { + this.aspect = aspect; + this.where = where; + this.where_id = where_id; + } + + + /** + * Gets the aspect value for this CMLRemoveAspect. + * + * @return aspect + */ + public java.lang.String getAspect() { + return aspect; + } + + + /** + * Sets the aspect value for this CMLRemoveAspect. + * + * @param aspect + */ + public void setAspect(java.lang.String aspect) { + this.aspect = aspect; + } + + + /** + * Gets the where value for this CMLRemoveAspect. + * + * @return where + */ + public org.alfresco.example.webservice.types.Predicate getWhere() { + return where; + } + + + /** + * Sets the where value for this CMLRemoveAspect. + * + * @param where + */ + public void setWhere(org.alfresco.example.webservice.types.Predicate where) { + this.where = where; + } + + + /** + * Gets the where_id value for this CMLRemoveAspect. + * + * @return where_id + */ + public java.lang.String getWhere_id() { + return where_id; + } + + + /** + * Sets the where_id value for this CMLRemoveAspect. + * + * @param where_id + */ + public void setWhere_id(java.lang.String where_id) { + this.where_id = where_id; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLRemoveAspect)) return false; + CMLRemoveAspect other = (CMLRemoveAspect) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.aspect==null && other.getAspect()==null) || + (this.aspect!=null && + this.aspect.equals(other.getAspect()))) && + ((this.where==null && other.getWhere()==null) || + (this.where!=null && + this.where.equals(other.getWhere()))) && + ((this.where_id==null && other.getWhere_id()==null) || + (this.where_id!=null && + this.where_id.equals(other.getWhere_id()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getAspect() != null) { + _hashCode += getAspect().hashCode(); + } + if (getWhere() != null) { + _hashCode += getWhere().hashCode(); + } + if (getWhere_id() != null) { + _hashCode += getWhere_id().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(CMLRemoveAspect.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>removeAspect")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("aspect"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "aspect")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + 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/example/webservice/types/CMLRemoveAssociation.java b/source/generated/org/alfresco/example/webservice/types/CMLRemoveAssociation.java new file mode 100644 index 0000000000..8f66e08fa6 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/CMLRemoveAssociation.java @@ -0,0 +1,263 @@ +/** + * CMLRemoveAssociation.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class CMLRemoveAssociation implements java.io.Serializable { + private org.alfresco.example.webservice.types.Predicate from; + private java.lang.String from_id; + private org.alfresco.example.webservice.types.Predicate to; + private java.lang.String to_id; + private java.lang.String association; + + public CMLRemoveAssociation() { + } + + public CMLRemoveAssociation( + org.alfresco.example.webservice.types.Predicate from, + java.lang.String from_id, + org.alfresco.example.webservice.types.Predicate to, + java.lang.String to_id, + java.lang.String association) { + this.from = from; + this.from_id = from_id; + this.to = to; + this.to_id = to_id; + this.association = association; + } + + + /** + * Gets the from value for this CMLRemoveAssociation. + * + * @return from + */ + public org.alfresco.example.webservice.types.Predicate getFrom() { + return from; + } + + + /** + * Sets the from value for this CMLRemoveAssociation. + * + * @param from + */ + public void setFrom(org.alfresco.example.webservice.types.Predicate from) { + this.from = from; + } + + + /** + * Gets the from_id value for this CMLRemoveAssociation. + * + * @return from_id + */ + public java.lang.String getFrom_id() { + return from_id; + } + + + /** + * Sets the from_id value for this CMLRemoveAssociation. + * + * @param from_id + */ + public void setFrom_id(java.lang.String from_id) { + this.from_id = from_id; + } + + + /** + * Gets the to value for this CMLRemoveAssociation. + * + * @return to + */ + public org.alfresco.example.webservice.types.Predicate getTo() { + return to; + } + + + /** + * Sets the to value for this CMLRemoveAssociation. + * + * @param to + */ + public void setTo(org.alfresco.example.webservice.types.Predicate to) { + this.to = to; + } + + + /** + * Gets the to_id value for this CMLRemoveAssociation. + * + * @return to_id + */ + public java.lang.String getTo_id() { + return to_id; + } + + + /** + * Sets the to_id value for this CMLRemoveAssociation. + * + * @param to_id + */ + public void setTo_id(java.lang.String to_id) { + this.to_id = to_id; + } + + + /** + * Gets the association value for this CMLRemoveAssociation. + * + * @return association + */ + public java.lang.String getAssociation() { + return association; + } + + + /** + * Sets the association value for this CMLRemoveAssociation. + * + * @param association + */ + public void setAssociation(java.lang.String association) { + this.association = association; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLRemoveAssociation)) return false; + CMLRemoveAssociation other = (CMLRemoveAssociation) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.from==null && other.getFrom()==null) || + (this.from!=null && + this.from.equals(other.getFrom()))) && + ((this.from_id==null && other.getFrom_id()==null) || + (this.from_id!=null && + this.from_id.equals(other.getFrom_id()))) && + ((this.to==null && other.getTo()==null) || + (this.to!=null && + this.to.equals(other.getTo()))) && + ((this.to_id==null && other.getTo_id()==null) || + (this.to_id!=null && + this.to_id.equals(other.getTo_id()))) && + ((this.association==null && other.getAssociation()==null) || + (this.association!=null && + this.association.equals(other.getAssociation()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getFrom() != null) { + _hashCode += getFrom().hashCode(); + } + if (getFrom_id() != null) { + _hashCode += getFrom_id().hashCode(); + } + if (getTo() != null) { + _hashCode += getTo().hashCode(); + } + if (getTo_id() != null) { + _hashCode += getTo_id().hashCode(); + } + if (getAssociation() != null) { + _hashCode += getAssociation().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(CMLRemoveAssociation.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>removeAssociation")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("from"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "from")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("from_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "from_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("association"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "association")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + 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/example/webservice/types/CMLRemoveChild.java b/source/generated/org/alfresco/example/webservice/types/CMLRemoveChild.java new file mode 100644 index 0000000000..4bfc1c47b1 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/CMLRemoveChild.java @@ -0,0 +1,228 @@ +/** + * CMLRemoveChild.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class CMLRemoveChild implements java.io.Serializable { + private org.alfresco.example.webservice.types.Reference from; + private java.lang.String from_id; + private org.alfresco.example.webservice.types.Predicate where; + private java.lang.String where_id; + + public CMLRemoveChild() { + } + + public CMLRemoveChild( + org.alfresco.example.webservice.types.Reference from, + java.lang.String from_id, + org.alfresco.example.webservice.types.Predicate where, + java.lang.String where_id) { + this.from = from; + this.from_id = from_id; + this.where = where; + this.where_id = where_id; + } + + + /** + * Gets the from value for this CMLRemoveChild. + * + * @return from + */ + public org.alfresco.example.webservice.types.Reference getFrom() { + return from; + } + + + /** + * Sets the from value for this CMLRemoveChild. + * + * @param from + */ + public void setFrom(org.alfresco.example.webservice.types.Reference from) { + this.from = from; + } + + + /** + * Gets the from_id value for this CMLRemoveChild. + * + * @return from_id + */ + public java.lang.String getFrom_id() { + return from_id; + } + + + /** + * Sets the from_id value for this CMLRemoveChild. + * + * @param from_id + */ + public void setFrom_id(java.lang.String from_id) { + this.from_id = from_id; + } + + + /** + * Gets the where value for this CMLRemoveChild. + * + * @return where + */ + public org.alfresco.example.webservice.types.Predicate getWhere() { + return where; + } + + + /** + * Sets the where value for this CMLRemoveChild. + * + * @param where + */ + public void setWhere(org.alfresco.example.webservice.types.Predicate where) { + this.where = where; + } + + + /** + * Gets the where_id value for this CMLRemoveChild. + * + * @return where_id + */ + public java.lang.String getWhere_id() { + return where_id; + } + + + /** + * Sets the where_id value for this CMLRemoveChild. + * + * @param where_id + */ + public void setWhere_id(java.lang.String where_id) { + this.where_id = where_id; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLRemoveChild)) return false; + CMLRemoveChild other = (CMLRemoveChild) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.from==null && other.getFrom()==null) || + (this.from!=null && + this.from.equals(other.getFrom()))) && + ((this.from_id==null && other.getFrom_id()==null) || + (this.from_id!=null && + this.from_id.equals(other.getFrom_id()))) && + ((this.where==null && other.getWhere()==null) || + (this.where!=null && + this.where.equals(other.getWhere()))) && + ((this.where_id==null && other.getWhere_id()==null) || + (this.where_id!=null && + this.where_id.equals(other.getWhere_id()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getFrom() != null) { + _hashCode += getFrom().hashCode(); + } + if (getFrom_id() != null) { + _hashCode += getFrom_id().hashCode(); + } + if (getWhere() != null) { + _hashCode += getWhere().hashCode(); + } + if (getWhere_id() != null) { + _hashCode += getWhere_id().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(CMLRemoveChild.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>removeChild")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("from"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "from")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("from_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "from_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + 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/example/webservice/types/CMLUpdate.java b/source/generated/org/alfresco/example/webservice/types/CMLUpdate.java new file mode 100644 index 0000000000..928ea5c53d --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/CMLUpdate.java @@ -0,0 +1,208 @@ +/** + * CMLUpdate.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class CMLUpdate implements java.io.Serializable { + private org.alfresco.example.webservice.types.NamedValue[] property; + private org.alfresco.example.webservice.types.Predicate where; + private java.lang.String where_id; + + public CMLUpdate() { + } + + public CMLUpdate( + org.alfresco.example.webservice.types.NamedValue[] property, + org.alfresco.example.webservice.types.Predicate where, + java.lang.String where_id) { + this.property = property; + this.where = where; + this.where_id = where_id; + } + + + /** + * Gets the property value for this CMLUpdate. + * + * @return property + */ + public org.alfresco.example.webservice.types.NamedValue[] getProperty() { + return property; + } + + + /** + * Sets the property value for this CMLUpdate. + * + * @param property + */ + public void setProperty(org.alfresco.example.webservice.types.NamedValue[] property) { + this.property = property; + } + + public org.alfresco.example.webservice.types.NamedValue getProperty(int i) { + return this.property[i]; + } + + public void setProperty(int i, org.alfresco.example.webservice.types.NamedValue _value) { + this.property[i] = _value; + } + + + /** + * Gets the where value for this CMLUpdate. + * + * @return where + */ + public org.alfresco.example.webservice.types.Predicate getWhere() { + return where; + } + + + /** + * Sets the where value for this CMLUpdate. + * + * @param where + */ + public void setWhere(org.alfresco.example.webservice.types.Predicate where) { + this.where = where; + } + + + /** + * Gets the where_id value for this CMLUpdate. + * + * @return where_id + */ + public java.lang.String getWhere_id() { + return where_id; + } + + + /** + * Sets the where_id value for this CMLUpdate. + * + * @param where_id + */ + public void setWhere_id(java.lang.String where_id) { + this.where_id = where_id; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLUpdate)) return false; + CMLUpdate other = (CMLUpdate) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.property==null && other.getProperty()==null) || + (this.property!=null && + java.util.Arrays.equals(this.property, other.getProperty()))) && + ((this.where==null && other.getWhere()==null) || + (this.where!=null && + this.where.equals(other.getWhere()))) && + ((this.where_id==null && other.getWhere_id()==null) || + (this.where_id!=null && + this.where_id.equals(other.getWhere_id()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getProperty() != null) { + for (int i=0; + iCML>update")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("property"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "property")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NamedValue")); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + 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/example/webservice/types/Cardinality.java b/source/generated/org/alfresco/example/webservice/types/Cardinality.java new file mode 100644 index 0000000000..4f09186857 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/Cardinality.java @@ -0,0 +1,74 @@ +/** + * Cardinality.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class Cardinality implements java.io.Serializable { + private java.lang.String _value_; + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + protected Cardinality(java.lang.String value) { + _value_ = value; + _table_.put(_value_,this); + } + + public static final java.lang.String _value1 = "0..1"; + public static final java.lang.String _value2 = "1"; + public static final java.lang.String _value3 = "*"; + public static final java.lang.String _value4 = "1..*"; + public static final Cardinality value1 = new Cardinality(_value1); + public static final Cardinality value2 = new Cardinality(_value2); + public static final Cardinality value3 = new Cardinality(_value3); + public static final Cardinality value4 = new Cardinality(_value4); + public java.lang.String getValue() { return _value_;} + public static Cardinality fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + Cardinality enumeration = (Cardinality) + _table_.get(value); + if (enumeration==null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + public static Cardinality fromString(java.lang.String value) + throws java.lang.IllegalArgumentException { + return fromValue(value); + } + public boolean equals(java.lang.Object obj) {return (obj == this);} + public int hashCode() { return toString().hashCode();} + public java.lang.String toString() { return _value_;} + public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} + 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.EnumSerializer( + _javaType, _xmlType); + } + 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.EnumDeserializer( + _javaType, _xmlType); + } + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(Cardinality.class); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Cardinality")); + } + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + +} diff --git a/source/generated/org/alfresco/example/webservice/types/Category.java b/source/generated/org/alfresco/example/webservice/types/Category.java new file mode 100644 index 0000000000..4381f0c3cf --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/Category.java @@ -0,0 +1,191 @@ +/** + * Category.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class Category implements java.io.Serializable { + private org.alfresco.example.webservice.types.Reference id; + private java.lang.String title; + private java.lang.String description; + + public Category() { + } + + public Category( + org.alfresco.example.webservice.types.Reference id, + java.lang.String title, + java.lang.String description) { + this.id = id; + this.title = title; + this.description = description; + } + + + /** + * Gets the id value for this Category. + * + * @return id + */ + public org.alfresco.example.webservice.types.Reference getId() { + return id; + } + + + /** + * Sets the id value for this Category. + * + * @param id + */ + public void setId(org.alfresco.example.webservice.types.Reference id) { + this.id = id; + } + + + /** + * Gets the title value for this Category. + * + * @return title + */ + public java.lang.String getTitle() { + return title; + } + + + /** + * Sets the title value for this Category. + * + * @param title + */ + public void setTitle(java.lang.String title) { + this.title = title; + } + + + /** + * Gets the description value for this Category. + * + * @return description + */ + public java.lang.String getDescription() { + return description; + } + + + /** + * Sets the description value for this Category. + * + * @param description + */ + public void setDescription(java.lang.String description) { + this.description = description; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof Category)) return false; + Category other = (Category) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.id==null && other.getId()==null) || + (this.id!=null && + this.id.equals(other.getId()))) && + ((this.title==null && other.getTitle()==null) || + (this.title!=null && + this.title.equals(other.getTitle()))) && + ((this.description==null && other.getDescription()==null) || + (this.description!=null && + this.description.equals(other.getDescription()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getId() != null) { + _hashCode += getId().hashCode(); + } + if (getTitle() != null) { + _hashCode += getTitle().hashCode(); + } + if (getDescription() != null) { + _hashCode += getDescription().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(Category.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Category")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("title"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "title")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("description"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "description")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + 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/example/webservice/types/ClassDefinition.java b/source/generated/org/alfresco/example/webservice/types/ClassDefinition.java new file mode 100644 index 0000000000..10b405aa67 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/ClassDefinition.java @@ -0,0 +1,364 @@ +/** + * ClassDefinition.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class ClassDefinition implements java.io.Serializable { + private java.lang.String name; + private java.lang.String title; + private java.lang.String description; + private java.lang.String superClass; + private boolean isAspect; + private org.alfresco.example.webservice.types.PropertyDefinition[] properties; + private org.alfresco.example.webservice.types.AssociationDefinition[] associations; + + public ClassDefinition() { + } + + public ClassDefinition( + java.lang.String name, + java.lang.String title, + java.lang.String description, + java.lang.String superClass, + boolean isAspect, + org.alfresco.example.webservice.types.PropertyDefinition[] properties, + org.alfresco.example.webservice.types.AssociationDefinition[] associations) { + this.name = name; + this.title = title; + this.description = description; + this.superClass = superClass; + this.isAspect = isAspect; + this.properties = properties; + this.associations = associations; + } + + + /** + * Gets the name value for this ClassDefinition. + * + * @return name + */ + public java.lang.String getName() { + return name; + } + + + /** + * Sets the name value for this ClassDefinition. + * + * @param name + */ + public void setName(java.lang.String name) { + this.name = name; + } + + + /** + * Gets the title value for this ClassDefinition. + * + * @return title + */ + public java.lang.String getTitle() { + return title; + } + + + /** + * Sets the title value for this ClassDefinition. + * + * @param title + */ + public void setTitle(java.lang.String title) { + this.title = title; + } + + + /** + * Gets the description value for this ClassDefinition. + * + * @return description + */ + public java.lang.String getDescription() { + return description; + } + + + /** + * Sets the description value for this ClassDefinition. + * + * @param description + */ + public void setDescription(java.lang.String description) { + this.description = description; + } + + + /** + * Gets the superClass value for this ClassDefinition. + * + * @return superClass + */ + public java.lang.String getSuperClass() { + return superClass; + } + + + /** + * Sets the superClass value for this ClassDefinition. + * + * @param superClass + */ + public void setSuperClass(java.lang.String superClass) { + this.superClass = superClass; + } + + + /** + * Gets the isAspect value for this ClassDefinition. + * + * @return isAspect + */ + public boolean isIsAspect() { + return isAspect; + } + + + /** + * Sets the isAspect value for this ClassDefinition. + * + * @param isAspect + */ + public void setIsAspect(boolean isAspect) { + this.isAspect = isAspect; + } + + + /** + * Gets the properties value for this ClassDefinition. + * + * @return properties + */ + public org.alfresco.example.webservice.types.PropertyDefinition[] getProperties() { + return properties; + } + + + /** + * Sets the properties value for this ClassDefinition. + * + * @param properties + */ + public void setProperties(org.alfresco.example.webservice.types.PropertyDefinition[] properties) { + this.properties = properties; + } + + public org.alfresco.example.webservice.types.PropertyDefinition getProperties(int i) { + return this.properties[i]; + } + + public void setProperties(int i, org.alfresco.example.webservice.types.PropertyDefinition _value) { + this.properties[i] = _value; + } + + + /** + * Gets the associations value for this ClassDefinition. + * + * @return associations + */ + public org.alfresco.example.webservice.types.AssociationDefinition[] getAssociations() { + return associations; + } + + + /** + * Sets the associations value for this ClassDefinition. + * + * @param associations + */ + public void setAssociations(org.alfresco.example.webservice.types.AssociationDefinition[] associations) { + this.associations = associations; + } + + public org.alfresco.example.webservice.types.AssociationDefinition getAssociations(int i) { + return this.associations[i]; + } + + public void setAssociations(int i, org.alfresco.example.webservice.types.AssociationDefinition _value) { + this.associations[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof ClassDefinition)) return false; + ClassDefinition other = (ClassDefinition) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.name==null && other.getName()==null) || + (this.name!=null && + this.name.equals(other.getName()))) && + ((this.title==null && other.getTitle()==null) || + (this.title!=null && + this.title.equals(other.getTitle()))) && + ((this.description==null && other.getDescription()==null) || + (this.description!=null && + this.description.equals(other.getDescription()))) && + ((this.superClass==null && other.getSuperClass()==null) || + (this.superClass!=null && + this.superClass.equals(other.getSuperClass()))) && + this.isAspect == other.isIsAspect() && + ((this.properties==null && other.getProperties()==null) || + (this.properties!=null && + java.util.Arrays.equals(this.properties, other.getProperties()))) && + ((this.associations==null && other.getAssociations()==null) || + (this.associations!=null && + java.util.Arrays.equals(this.associations, other.getAssociations()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getName() != null) { + _hashCode += getName().hashCode(); + } + if (getTitle() != null) { + _hashCode += getTitle().hashCode(); + } + if (getDescription() != null) { + _hashCode += getDescription().hashCode(); + } + if (getSuperClass() != null) { + _hashCode += getSuperClass().hashCode(); + } + _hashCode += (isIsAspect() ? Boolean.TRUE : Boolean.FALSE).hashCode(); + if (getProperties() != null) { + for (int i=0; + iContentFormat>mimetype")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("encoding"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "encoding")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">ContentFormat>encoding")); + elemField.setMinOccurs(0); + 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/example/webservice/types/LocaleConfiguration.java b/source/generated/org/alfresco/example/webservice/types/LocaleConfiguration.java new file mode 100644 index 0000000000..7af3b08d20 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/LocaleConfiguration.java @@ -0,0 +1,120 @@ +/** + * LocaleConfiguration.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class LocaleConfiguration implements java.io.Serializable { + private java.lang.String locale; + + public LocaleConfiguration() { + } + + public LocaleConfiguration( + java.lang.String locale) { + this.locale = locale; + } + + + /** + * Gets the locale value for this LocaleConfiguration. + * + * @return locale + */ + public java.lang.String getLocale() { + return locale; + } + + + /** + * Sets the locale value for this LocaleConfiguration. + * + * @param locale + */ + public void setLocale(java.lang.String locale) { + this.locale = locale; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof LocaleConfiguration)) return false; + LocaleConfiguration other = (LocaleConfiguration) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.locale==null && other.getLocale()==null) || + (this.locale!=null && + this.locale.equals(other.getLocale()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getLocale() != null) { + _hashCode += getLocale().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(LocaleConfiguration.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/headers/1.0", "LocaleConfiguration")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("locale"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/headers/1.0", "locale")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + 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/example/webservice/types/NamedValue.java b/source/generated/org/alfresco/example/webservice/types/NamedValue.java new file mode 100644 index 0000000000..494119cf54 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/NamedValue.java @@ -0,0 +1,154 @@ +/** + * NamedValue.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class NamedValue implements java.io.Serializable { + private java.lang.String name; + private java.lang.String value; + + public NamedValue() { + } + + public NamedValue( + java.lang.String name, + java.lang.String value) { + this.name = name; + this.value = value; + } + + + /** + * Gets the name value for this NamedValue. + * + * @return name + */ + public java.lang.String getName() { + return name; + } + + + /** + * Sets the name value for this NamedValue. + * + * @param name + */ + public void setName(java.lang.String name) { + this.name = name; + } + + + /** + * Gets the value value for this NamedValue. + * + * @return value + */ + public java.lang.String getValue() { + return value; + } + + + /** + * Sets the value value for this NamedValue. + * + * @param value + */ + public void setValue(java.lang.String value) { + this.value = value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof NamedValue)) return false; + NamedValue other = (NamedValue) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.name==null && other.getName()==null) || + (this.name!=null && + this.name.equals(other.getName()))) && + ((this.value==null && other.getValue()==null) || + (this.value!=null && + this.value.equals(other.getValue()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getName() != null) { + _hashCode += getName().hashCode(); + } + if (getValue() != null) { + _hashCode += getValue().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(NamedValue.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NamedValue")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("name"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "name")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("value"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "value")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(true); + 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/example/webservice/types/NamespaceConfigurationMapping.java b/source/generated/org/alfresco/example/webservice/types/NamespaceConfigurationMapping.java new file mode 100644 index 0000000000..ef68a793ce --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/NamespaceConfigurationMapping.java @@ -0,0 +1,154 @@ +/** + * NamespaceConfigurationMapping.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class NamespaceConfigurationMapping implements java.io.Serializable { + private org.apache.axis.types.NCName prefix; + private java.lang.String uri; + + public NamespaceConfigurationMapping() { + } + + public NamespaceConfigurationMapping( + org.apache.axis.types.NCName prefix, + java.lang.String uri) { + this.prefix = prefix; + this.uri = uri; + } + + + /** + * Gets the prefix value for this NamespaceConfigurationMapping. + * + * @return prefix + */ + public org.apache.axis.types.NCName getPrefix() { + return prefix; + } + + + /** + * Sets the prefix value for this NamespaceConfigurationMapping. + * + * @param prefix + */ + public void setPrefix(org.apache.axis.types.NCName prefix) { + this.prefix = prefix; + } + + + /** + * Gets the uri value for this NamespaceConfigurationMapping. + * + * @return uri + */ + public java.lang.String getUri() { + return uri; + } + + + /** + * Sets the uri value for this NamespaceConfigurationMapping. + * + * @param uri + */ + public void setUri(java.lang.String uri) { + this.uri = uri; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof NamespaceConfigurationMapping)) return false; + NamespaceConfigurationMapping other = (NamespaceConfigurationMapping) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.prefix==null && other.getPrefix()==null) || + (this.prefix!=null && + this.prefix.equals(other.getPrefix()))) && + ((this.uri==null && other.getUri()==null) || + (this.uri!=null && + this.uri.equals(other.getUri()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getPrefix() != null) { + _hashCode += getPrefix().hashCode(); + } + if (getUri() != null) { + _hashCode += getUri().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(NamespaceConfigurationMapping.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/headers/1.0", ">NamespaceConfiguration>mapping")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("prefix"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/headers/1.0", "prefix")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "NCName")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("uri"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/headers/1.0", "uri")); + 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/example/webservice/types/Node.java b/source/generated/org/alfresco/example/webservice/types/Node.java new file mode 100644 index 0000000000..28ba676cf6 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/Node.java @@ -0,0 +1,260 @@ +/** + * Node.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class Node implements java.io.Serializable { + private org.alfresco.example.webservice.types.Reference reference; + private java.lang.String type; + private java.lang.String[] aspects; + private org.alfresco.example.webservice.types.NamedValue[] properties; + + public Node() { + } + + public Node( + org.alfresco.example.webservice.types.Reference reference, + java.lang.String type, + java.lang.String[] aspects, + org.alfresco.example.webservice.types.NamedValue[] properties) { + this.reference = reference; + this.type = type; + this.aspects = aspects; + this.properties = properties; + } + + + /** + * Gets the reference value for this Node. + * + * @return reference + */ + public org.alfresco.example.webservice.types.Reference getReference() { + return reference; + } + + + /** + * Sets the reference value for this Node. + * + * @param reference + */ + public void setReference(org.alfresco.example.webservice.types.Reference reference) { + this.reference = reference; + } + + + /** + * Gets the type value for this Node. + * + * @return type + */ + public java.lang.String getType() { + return type; + } + + + /** + * Sets the type value for this Node. + * + * @param type + */ + public void setType(java.lang.String type) { + this.type = type; + } + + + /** + * Gets the aspects value for this Node. + * + * @return aspects + */ + public java.lang.String[] getAspects() { + return aspects; + } + + + /** + * Sets the aspects value for this Node. + * + * @param aspects + */ + public void setAspects(java.lang.String[] aspects) { + this.aspects = aspects; + } + + public java.lang.String getAspects(int i) { + return this.aspects[i]; + } + + public void setAspects(int i, java.lang.String _value) { + this.aspects[i] = _value; + } + + + /** + * Gets the properties value for this Node. + * + * @return properties + */ + public org.alfresco.example.webservice.types.NamedValue[] getProperties() { + return properties; + } + + + /** + * Sets the properties value for this Node. + * + * @param properties + */ + public void setProperties(org.alfresco.example.webservice.types.NamedValue[] properties) { + this.properties = properties; + } + + public org.alfresco.example.webservice.types.NamedValue getProperties(int i) { + return this.properties[i]; + } + + public void setProperties(int i, org.alfresco.example.webservice.types.NamedValue _value) { + this.properties[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof Node)) return false; + Node other = (Node) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.reference==null && other.getReference()==null) || + (this.reference!=null && + this.reference.equals(other.getReference()))) && + ((this.type==null && other.getType()==null) || + (this.type!=null && + this.type.equals(other.getType()))) && + ((this.aspects==null && other.getAspects()==null) || + (this.aspects!=null && + java.util.Arrays.equals(this.aspects, other.getAspects()))) && + ((this.properties==null && other.getProperties()==null) || + (this.properties!=null && + java.util.Arrays.equals(this.properties, other.getProperties()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getReference() != null) { + _hashCode += getReference().hashCode(); + } + if (getType() != null) { + _hashCode += getType().hashCode(); + } + if (getAspects() != null) { + for (int i=0; + iResultSetRow>node")); + elemField.setMinOccurs(0); + 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/example/webservice/types/ResultSetRowNode.java b/source/generated/org/alfresco/example/webservice/types/ResultSetRowNode.java new file mode 100644 index 0000000000..4be46ed83c --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/ResultSetRowNode.java @@ -0,0 +1,207 @@ +/** + * ResultSetRowNode.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class ResultSetRowNode implements java.io.Serializable { + private java.lang.String id; + private java.lang.String type; + private java.lang.String[] aspects; + + public ResultSetRowNode() { + } + + public ResultSetRowNode( + java.lang.String id, + java.lang.String type, + java.lang.String[] aspects) { + this.id = id; + this.type = type; + this.aspects = aspects; + } + + + /** + * Gets the id value for this ResultSetRowNode. + * + * @return id + */ + public java.lang.String getId() { + return id; + } + + + /** + * Sets the id value for this ResultSetRowNode. + * + * @param id + */ + public void setId(java.lang.String id) { + this.id = id; + } + + + /** + * Gets the type value for this ResultSetRowNode. + * + * @return type + */ + public java.lang.String getType() { + return type; + } + + + /** + * Sets the type value for this ResultSetRowNode. + * + * @param type + */ + public void setType(java.lang.String type) { + this.type = type; + } + + + /** + * Gets the aspects value for this ResultSetRowNode. + * + * @return aspects + */ + public java.lang.String[] getAspects() { + return aspects; + } + + + /** + * Sets the aspects value for this ResultSetRowNode. + * + * @param aspects + */ + public void setAspects(java.lang.String[] aspects) { + this.aspects = aspects; + } + + public java.lang.String getAspects(int i) { + return this.aspects[i]; + } + + public void setAspects(int i, java.lang.String _value) { + this.aspects[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof ResultSetRowNode)) return false; + ResultSetRowNode other = (ResultSetRowNode) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.id==null && other.getId()==null) || + (this.id!=null && + this.id.equals(other.getId()))) && + ((this.type==null && other.getType()==null) || + (this.type!=null && + this.type.equals(other.getType()))) && + ((this.aspects==null && other.getAspects()==null) || + (this.aspects!=null && + java.util.Arrays.equals(this.aspects, other.getAspects()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getId() != null) { + _hashCode += getId().hashCode(); + } + if (getType() != null) { + _hashCode += getType().hashCode(); + } + if (getAspects() != null) { + for (int i=0; + iResultSetRow>node")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "UUID")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("type"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "type")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("aspects"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "aspects")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + 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/example/webservice/types/RoleDefinition.java b/source/generated/org/alfresco/example/webservice/types/RoleDefinition.java new file mode 100644 index 0000000000..63d0279eb2 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/RoleDefinition.java @@ -0,0 +1,156 @@ +/** + * RoleDefinition.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class RoleDefinition implements java.io.Serializable { + private java.lang.String name; + private org.alfresco.example.webservice.types.Cardinality cardinality; + + public RoleDefinition() { + } + + public RoleDefinition( + java.lang.String name, + org.alfresco.example.webservice.types.Cardinality cardinality) { + this.name = name; + this.cardinality = cardinality; + } + + + /** + * Gets the name value for this RoleDefinition. + * + * @return name + */ + public java.lang.String getName() { + return name; + } + + + /** + * Sets the name value for this RoleDefinition. + * + * @param name + */ + public void setName(java.lang.String name) { + this.name = name; + } + + + /** + * Gets the cardinality value for this RoleDefinition. + * + * @return cardinality + */ + public org.alfresco.example.webservice.types.Cardinality getCardinality() { + return cardinality; + } + + + /** + * Sets the cardinality value for this RoleDefinition. + * + * @param cardinality + */ + public void setCardinality(org.alfresco.example.webservice.types.Cardinality cardinality) { + this.cardinality = cardinality; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof RoleDefinition)) return false; + RoleDefinition other = (RoleDefinition) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.name==null && other.getName()==null) || + (this.name!=null && + this.name.equals(other.getName()))) && + ((this.cardinality==null && other.getCardinality()==null) || + (this.cardinality!=null && + this.cardinality.equals(other.getCardinality()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getName() != null) { + _hashCode += getName().hashCode(); + } + if (getCardinality() != null) { + _hashCode += getCardinality().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(RoleDefinition.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "RoleDefinition")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("name"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "name")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("cardinality"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "cardinality")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Cardinality")); + elemField.setMinOccurs(0); + 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/example/webservice/types/Store.java b/source/generated/org/alfresco/example/webservice/types/Store.java new file mode 100644 index 0000000000..5a79441d25 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/Store.java @@ -0,0 +1,154 @@ +/** + * Store.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class Store implements java.io.Serializable { + private org.alfresco.example.webservice.types.StoreEnum scheme; + private java.lang.String address; + + public Store() { + } + + public Store( + org.alfresco.example.webservice.types.StoreEnum scheme, + java.lang.String address) { + this.scheme = scheme; + this.address = address; + } + + + /** + * Gets the scheme value for this Store. + * + * @return scheme + */ + public org.alfresco.example.webservice.types.StoreEnum getScheme() { + return scheme; + } + + + /** + * Sets the scheme value for this Store. + * + * @param scheme + */ + public void setScheme(org.alfresco.example.webservice.types.StoreEnum scheme) { + this.scheme = scheme; + } + + + /** + * Gets the address value for this Store. + * + * @return address + */ + public java.lang.String getAddress() { + return address; + } + + + /** + * Sets the address value for this Store. + * + * @param address + */ + public void setAddress(java.lang.String address) { + this.address = address; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof Store)) return false; + Store other = (Store) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.scheme==null && other.getScheme()==null) || + (this.scheme!=null && + this.scheme.equals(other.getScheme()))) && + ((this.address==null && other.getAddress()==null) || + (this.address!=null && + this.address.equals(other.getAddress()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getScheme() != null) { + _hashCode += getScheme().hashCode(); + } + if (getAddress() != null) { + _hashCode += getAddress().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(Store.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Store")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("scheme"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "scheme")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "StoreEnum")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("address"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "address")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">Store>address")); + 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/example/webservice/types/StoreEnum.java b/source/generated/org/alfresco/example/webservice/types/StoreEnum.java new file mode 100644 index 0000000000..5bfd84f910 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/StoreEnum.java @@ -0,0 +1,78 @@ +/** + * StoreEnum.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class StoreEnum implements java.io.Serializable { + private java.lang.String _value_; + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + protected StoreEnum(java.lang.String value) { + _value_ = value; + _table_.put(_value_,this); + } + + public static final java.lang.String _workspace = "workspace"; + public static final java.lang.String _versionStore = "versionStore"; + public static final java.lang.String _user = "user"; + public static final java.lang.String _search = "search"; + public static final java.lang.String _http = "http"; + public static final java.lang.String _system = "system"; + public static final StoreEnum workspace = new StoreEnum(_workspace); + public static final StoreEnum versionStore = new StoreEnum(_versionStore); + public static final StoreEnum user = new StoreEnum(_user); + public static final StoreEnum search = new StoreEnum(_search); + public static final StoreEnum http = new StoreEnum(_http); + public static final StoreEnum system = new StoreEnum(_system); + public java.lang.String getValue() { return _value_;} + public static StoreEnum fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + StoreEnum enumeration = (StoreEnum) + _table_.get(value); + if (enumeration==null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + public static StoreEnum fromString(java.lang.String value) + throws java.lang.IllegalArgumentException { + return fromValue(value); + } + public boolean equals(java.lang.Object obj) {return (obj == this);} + public int hashCode() { return toString().hashCode();} + public java.lang.String toString() { return _value_;} + public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} + 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.EnumSerializer( + _javaType, _xmlType); + } + 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.EnumDeserializer( + _javaType, _xmlType); + } + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(StoreEnum.class); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "StoreEnum")); + } + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + +} diff --git a/source/generated/org/alfresco/example/webservice/types/ValueDefinition.java b/source/generated/org/alfresco/example/webservice/types/ValueDefinition.java new file mode 100644 index 0000000000..c5483093e6 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/ValueDefinition.java @@ -0,0 +1,226 @@ +/** + * ValueDefinition.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class ValueDefinition implements java.io.Serializable { + private java.lang.String name; + private java.lang.String title; + private java.lang.String description; + private java.lang.String dataType; + + public ValueDefinition() { + } + + public ValueDefinition( + java.lang.String name, + java.lang.String title, + java.lang.String description, + java.lang.String dataType) { + this.name = name; + this.title = title; + this.description = description; + this.dataType = dataType; + } + + + /** + * Gets the name value for this ValueDefinition. + * + * @return name + */ + public java.lang.String getName() { + return name; + } + + + /** + * Sets the name value for this ValueDefinition. + * + * @param name + */ + public void setName(java.lang.String name) { + this.name = name; + } + + + /** + * Gets the title value for this ValueDefinition. + * + * @return title + */ + public java.lang.String getTitle() { + return title; + } + + + /** + * Sets the title value for this ValueDefinition. + * + * @param title + */ + public void setTitle(java.lang.String title) { + this.title = title; + } + + + /** + * Gets the description value for this ValueDefinition. + * + * @return description + */ + public java.lang.String getDescription() { + return description; + } + + + /** + * Sets the description value for this ValueDefinition. + * + * @param description + */ + public void setDescription(java.lang.String description) { + this.description = description; + } + + + /** + * Gets the dataType value for this ValueDefinition. + * + * @return dataType + */ + public java.lang.String getDataType() { + return dataType; + } + + + /** + * Sets the dataType value for this ValueDefinition. + * + * @param dataType + */ + public void setDataType(java.lang.String dataType) { + this.dataType = dataType; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof ValueDefinition)) return false; + ValueDefinition other = (ValueDefinition) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.name==null && other.getName()==null) || + (this.name!=null && + this.name.equals(other.getName()))) && + ((this.title==null && other.getTitle()==null) || + (this.title!=null && + this.title.equals(other.getTitle()))) && + ((this.description==null && other.getDescription()==null) || + (this.description!=null && + this.description.equals(other.getDescription()))) && + ((this.dataType==null && other.getDataType()==null) || + (this.dataType!=null && + this.dataType.equals(other.getDataType()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getName() != null) { + _hashCode += getName().hashCode(); + } + if (getTitle() != null) { + _hashCode += getTitle().hashCode(); + } + if (getDescription() != null) { + _hashCode += getDescription().hashCode(); + } + if (getDataType() != null) { + _hashCode += getDataType().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(ValueDefinition.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ValueDefinition")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("name"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "name")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("title"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "title")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("description"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "description")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("dataType"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "dataType")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + 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/example/webservice/types/Version.java b/source/generated/org/alfresco/example/webservice/types/Version.java new file mode 100644 index 0000000000..69839645e0 --- /dev/null +++ b/source/generated/org/alfresco/example/webservice/types/Version.java @@ -0,0 +1,311 @@ +/** + * Version.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.example.webservice.types; + +public class Version implements java.io.Serializable { + private org.alfresco.example.webservice.types.Reference id; + private java.util.Calendar created; + private java.lang.String creator; + private java.lang.String label; + private boolean major; + private org.alfresco.example.webservice.types.NamedValue[] commentaries; + + public Version() { + } + + public Version( + org.alfresco.example.webservice.types.Reference id, + java.util.Calendar created, + java.lang.String creator, + java.lang.String label, + boolean major, + org.alfresco.example.webservice.types.NamedValue[] commentaries) { + this.id = id; + this.created = created; + this.creator = creator; + this.label = label; + this.major = major; + this.commentaries = commentaries; + } + + + /** + * Gets the id value for this Version. + * + * @return id + */ + public org.alfresco.example.webservice.types.Reference getId() { + return id; + } + + + /** + * Sets the id value for this Version. + * + * @param id + */ + public void setId(org.alfresco.example.webservice.types.Reference id) { + this.id = id; + } + + + /** + * Gets the created value for this Version. + * + * @return created + */ + public java.util.Calendar getCreated() { + return created; + } + + + /** + * Sets the created value for this Version. + * + * @param created + */ + public void setCreated(java.util.Calendar created) { + this.created = created; + } + + + /** + * Gets the creator value for this Version. + * + * @return creator + */ + public java.lang.String getCreator() { + return creator; + } + + + /** + * Sets the creator value for this Version. + * + * @param creator + */ + public void setCreator(java.lang.String creator) { + this.creator = creator; + } + + + /** + * Gets the label value for this Version. + * + * @return label + */ + public java.lang.String getLabel() { + return label; + } + + + /** + * Sets the label value for this Version. + * + * @param label + */ + public void setLabel(java.lang.String label) { + this.label = label; + } + + + /** + * Gets the major value for this Version. + * + * @return major + */ + public boolean isMajor() { + return major; + } + + + /** + * Sets the major value for this Version. + * + * @param major + */ + public void setMajor(boolean major) { + this.major = major; + } + + + /** + * Gets the commentaries value for this Version. + * + * @return commentaries + */ + public org.alfresco.example.webservice.types.NamedValue[] getCommentaries() { + return commentaries; + } + + + /** + * Sets the commentaries value for this Version. + * + * @param commentaries + */ + public void setCommentaries(org.alfresco.example.webservice.types.NamedValue[] commentaries) { + this.commentaries = commentaries; + } + + public org.alfresco.example.webservice.types.NamedValue getCommentaries(int i) { + return this.commentaries[i]; + } + + public void setCommentaries(int i, org.alfresco.example.webservice.types.NamedValue _value) { + this.commentaries[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof Version)) return false; + Version other = (Version) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.id==null && other.getId()==null) || + (this.id!=null && + this.id.equals(other.getId()))) && + ((this.created==null && other.getCreated()==null) || + (this.created!=null && + this.created.equals(other.getCreated()))) && + ((this.creator==null && other.getCreator()==null) || + (this.creator!=null && + this.creator.equals(other.getCreator()))) && + ((this.label==null && other.getLabel()==null) || + (this.label!=null && + this.label.equals(other.getLabel()))) && + this.major == other.isMajor() && + ((this.commentaries==null && other.getCommentaries()==null) || + (this.commentaries!=null && + java.util.Arrays.equals(this.commentaries, other.getCommentaries()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getId() != null) { + _hashCode += getId().hashCode(); + } + if (getCreated() != null) { + _hashCode += getCreated().hashCode(); + } + if (getCreator() != null) { + _hashCode += getCreator().hashCode(); + } + if (getLabel() != null) { + _hashCode += getLabel().hashCode(); + } + _hashCode += (isMajor() ? Boolean.TRUE : Boolean.FALSE).hashCode(); + if (getCommentaries() != null) { + for (int i=0; + i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/generated/org/alfresco/repo/webservice/authoring/AuthoringFault.java b/source/generated/org/alfresco/repo/webservice/authoring/AuthoringFault.java new file mode 100644 index 0000000000..96cd0af47d --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/authoring/AuthoringFault.java @@ -0,0 +1,157 @@ +/** + * AuthoringFault.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.authoring; + +public class AuthoringFault extends org.apache.axis.AxisFault implements java.io.Serializable { + private int errorCode; + private java.lang.String message1; + + public AuthoringFault() { + } + + public AuthoringFault( + int errorCode, + java.lang.String message1) { + this.errorCode = errorCode; + this.message1 = message1; + } + + + /** + * Gets the errorCode value for this AuthoringFault. + * + * @return errorCode + */ + public int getErrorCode() { + return errorCode; + } + + + /** + * Sets the errorCode value for this AuthoringFault. + * + * @param errorCode + */ + public void setErrorCode(int errorCode) { + this.errorCode = errorCode; + } + + + /** + * Gets the message1 value for this AuthoringFault. + * + * @return message1 + */ + public java.lang.String getMessage1() { + return message1; + } + + + /** + * Sets the message1 value for this AuthoringFault. + * + * @param message1 + */ + public void setMessage1(java.lang.String message1) { + this.message1 = message1; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof AuthoringFault)) return false; + AuthoringFault other = (AuthoringFault) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + this.errorCode == other.getErrorCode() && + ((this.message1==null && other.getMessage1()==null) || + (this.message1!=null && + this.message1.equals(other.getMessage1()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + _hashCode += getErrorCode(); + if (getMessage1() != null) { + _hashCode += getMessage1().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(AuthoringFault.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "AuthoringFault")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("errorCode"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "errorCode")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("message1"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/authoring/1.0", "message")); + 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); + } + + + /** + * Writes the exception data to the faultDetails + */ + public void writeDetails(javax.xml.namespace.QName qname, org.apache.axis.encoding.SerializationContext context) throws java.io.IOException { + context.serialize(qname, null, this); + } +} diff --git a/source/generated/org/alfresco/repo/webservice/authoring/AuthoringServiceSoapPort.java b/source/generated/org/alfresco/repo/webservice/authoring/AuthoringServiceSoapPort.java new file mode 100644 index 0000000000..00df25a44f --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/authoring/AuthoringServiceSoapPort.java @@ -0,0 +1,67 @@ +/** + * AuthoringServiceSoapPort.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.authoring; + +public interface AuthoringServiceSoapPort extends java.rmi.Remote { + + /** + * Checkout a content resource for editing. + */ + public org.alfresco.repo.webservice.authoring.CheckoutResult checkout(org.alfresco.repo.webservice.types.Predicate items, org.alfresco.repo.webservice.types.ParentReference destination) throws java.rmi.RemoteException, org.alfresco.repo.webservice.authoring.AuthoringFault; + + /** + * Checkin a content resource. + */ + public org.alfresco.repo.webservice.authoring.CheckinResult checkin(org.alfresco.repo.webservice.types.Predicate items, org.alfresco.repo.webservice.types.NamedValue[] comments, boolean keepCheckedOut) throws java.rmi.RemoteException, org.alfresco.repo.webservice.authoring.AuthoringFault; + + /** + * Checkin an external content resource thus replacing the existing + * working content. + */ + public org.alfresco.repo.webservice.types.Reference checkinExternal(org.alfresco.repo.webservice.types.Reference items, org.alfresco.repo.webservice.types.NamedValue[] comments, boolean keepCheckedOut, org.alfresco.repo.webservice.types.ContentFormat format, byte[] content) throws java.rmi.RemoteException, org.alfresco.repo.webservice.authoring.AuthoringFault; + + /** + * Cancels the checkout. + */ + public org.alfresco.repo.webservice.authoring.CancelCheckoutResult cancelCheckout(org.alfresco.repo.webservice.types.Predicate items) throws java.rmi.RemoteException, org.alfresco.repo.webservice.authoring.AuthoringFault; + + /** + * Locks a content resource. + */ + public org.alfresco.repo.webservice.types.Reference[] lock(org.alfresco.repo.webservice.types.Predicate items, boolean lockChildren, org.alfresco.repo.webservice.authoring.LockTypeEnum lockType) throws java.rmi.RemoteException, org.alfresco.repo.webservice.authoring.AuthoringFault; + + /** + * Unlocks a content resource. + */ + public org.alfresco.repo.webservice.types.Reference[] unlock(org.alfresco.repo.webservice.types.Predicate items, boolean unlockChildren) throws java.rmi.RemoteException, org.alfresco.repo.webservice.authoring.AuthoringFault; + + /** + * Gets the lock status of the specified nodes. + */ + public org.alfresco.repo.webservice.authoring.LockStatus[] getLockStatus(org.alfresco.repo.webservice.types.Predicate items) throws java.rmi.RemoteException, org.alfresco.repo.webservice.authoring.AuthoringFault; + + /** + * Create a snapshot of the specified node(s) in the version store. + */ + public org.alfresco.repo.webservice.authoring.VersionResult createVersion(org.alfresco.repo.webservice.types.Predicate items, org.alfresco.repo.webservice.types.NamedValue[] comments, boolean versionChildren) throws java.rmi.RemoteException, org.alfresco.repo.webservice.authoring.AuthoringFault; + + /** + * Gets the version history for the specfied node. + */ + public org.alfresco.repo.webservice.types.VersionHistory getVersionHistory(org.alfresco.repo.webservice.types.Reference node) throws java.rmi.RemoteException, org.alfresco.repo.webservice.authoring.AuthoringFault; + + /** + * Revert a node to the snapshot of the specified version. + */ + public void revertVersion(org.alfresco.repo.webservice.types.Reference node, java.lang.String versionLabel) throws java.rmi.RemoteException, org.alfresco.repo.webservice.authoring.AuthoringFault; + + /** + * Delete all snapshot versions of the specified node. + */ + public org.alfresco.repo.webservice.types.VersionHistory deleteAllVersions(org.alfresco.repo.webservice.types.Reference node) throws java.rmi.RemoteException, org.alfresco.repo.webservice.authoring.AuthoringFault; +} diff --git a/source/generated/org/alfresco/repo/webservice/authoring/CancelCheckoutResult.java b/source/generated/org/alfresco/repo/webservice/authoring/CancelCheckoutResult.java new file mode 100644 index 0000000000..2ea961e270 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/authoring/CancelCheckoutResult.java @@ -0,0 +1,190 @@ +/** + * CancelCheckoutResult.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.authoring; + +public class CancelCheckoutResult implements java.io.Serializable { + private org.alfresco.repo.webservice.types.Reference[] workingCopies; + private org.alfresco.repo.webservice.types.Reference[] originals; + + public CancelCheckoutResult() { + } + + public CancelCheckoutResult( + org.alfresco.repo.webservice.types.Reference[] workingCopies, + org.alfresco.repo.webservice.types.Reference[] originals) { + this.workingCopies = workingCopies; + this.originals = originals; + } + + + /** + * Gets the workingCopies value for this CancelCheckoutResult. + * + * @return workingCopies + */ + public org.alfresco.repo.webservice.types.Reference[] getWorkingCopies() { + return workingCopies; + } + + + /** + * Sets the workingCopies value for this CancelCheckoutResult. + * + * @param workingCopies + */ + public void setWorkingCopies(org.alfresco.repo.webservice.types.Reference[] workingCopies) { + this.workingCopies = workingCopies; + } + + public org.alfresco.repo.webservice.types.Reference getWorkingCopies(int i) { + return this.workingCopies[i]; + } + + public void setWorkingCopies(int i, org.alfresco.repo.webservice.types.Reference _value) { + this.workingCopies[i] = _value; + } + + + /** + * Gets the originals value for this CancelCheckoutResult. + * + * @return originals + */ + public org.alfresco.repo.webservice.types.Reference[] getOriginals() { + return originals; + } + + + /** + * Sets the originals value for this CancelCheckoutResult. + * + * @param originals + */ + public void setOriginals(org.alfresco.repo.webservice.types.Reference[] originals) { + this.originals = originals; + } + + public org.alfresco.repo.webservice.types.Reference getOriginals(int i) { + return this.originals[i]; + } + + public void setOriginals(int i, org.alfresco.repo.webservice.types.Reference _value) { + this.originals[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CancelCheckoutResult)) return false; + CancelCheckoutResult other = (CancelCheckoutResult) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.workingCopies==null && other.getWorkingCopies()==null) || + (this.workingCopies!=null && + java.util.Arrays.equals(this.workingCopies, other.getWorkingCopies()))) && + ((this.originals==null && other.getOriginals()==null) || + (this.originals!=null && + java.util.Arrays.equals(this.originals, other.getOriginals()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getWorkingCopies() != null) { + for (int i=0; + i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/generated/org/alfresco/repo/webservice/classification/AppliedCategory.java b/source/generated/org/alfresco/repo/webservice/classification/AppliedCategory.java new file mode 100644 index 0000000000..2a3e769b4a --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/classification/AppliedCategory.java @@ -0,0 +1,172 @@ +/** + * AppliedCategory.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.classification; + +public class AppliedCategory implements java.io.Serializable { + private java.lang.String classification; + private org.alfresco.repo.webservice.types.Reference[] categories; + + public AppliedCategory() { + } + + public AppliedCategory( + java.lang.String classification, + org.alfresco.repo.webservice.types.Reference[] categories) { + this.classification = classification; + this.categories = categories; + } + + + /** + * Gets the classification value for this AppliedCategory. + * + * @return classification + */ + public java.lang.String getClassification() { + return classification; + } + + + /** + * Sets the classification value for this AppliedCategory. + * + * @param classification + */ + public void setClassification(java.lang.String classification) { + this.classification = classification; + } + + + /** + * Gets the categories value for this AppliedCategory. + * + * @return categories + */ + public org.alfresco.repo.webservice.types.Reference[] getCategories() { + return categories; + } + + + /** + * Sets the categories value for this AppliedCategory. + * + * @param categories + */ + public void setCategories(org.alfresco.repo.webservice.types.Reference[] categories) { + this.categories = categories; + } + + public org.alfresco.repo.webservice.types.Reference getCategories(int i) { + return this.categories[i]; + } + + public void setCategories(int i, org.alfresco.repo.webservice.types.Reference _value) { + this.categories[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof AppliedCategory)) return false; + AppliedCategory other = (AppliedCategory) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.classification==null && other.getClassification()==null) || + (this.classification!=null && + this.classification.equals(other.getClassification()))) && + ((this.categories==null && other.getCategories()==null) || + (this.categories!=null && + java.util.Arrays.equals(this.categories, other.getCategories()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getClassification() != null) { + _hashCode += getClassification().hashCode(); + } + if (getCategories() != null) { + for (int i=0; + i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/generated/org/alfresco/repo/webservice/content/Content.java b/source/generated/org/alfresco/repo/webservice/content/Content.java new file mode 100644 index 0000000000..34b66fc4f0 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/content/Content.java @@ -0,0 +1,255 @@ +/** + * Content.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.content; + +public class Content implements java.io.Serializable { + private org.alfresco.repo.webservice.types.Reference node; + private java.lang.String property; + private long length; + private org.alfresco.repo.webservice.types.ContentFormat format; + private java.lang.String url; + + public Content() { + } + + public Content( + org.alfresco.repo.webservice.types.Reference node, + java.lang.String property, + long length, + org.alfresco.repo.webservice.types.ContentFormat format, + java.lang.String url) { + this.node = node; + this.property = property; + this.length = length; + this.format = format; + this.url = url; + } + + + /** + * Gets the node value for this Content. + * + * @return node + */ + public org.alfresco.repo.webservice.types.Reference getNode() { + return node; + } + + + /** + * Sets the node value for this Content. + * + * @param node + */ + public void setNode(org.alfresco.repo.webservice.types.Reference node) { + this.node = node; + } + + + /** + * Gets the property value for this Content. + * + * @return property + */ + public java.lang.String getProperty() { + return property; + } + + + /** + * Sets the property value for this Content. + * + * @param property + */ + public void setProperty(java.lang.String property) { + this.property = property; + } + + + /** + * Gets the length value for this Content. + * + * @return length + */ + public long getLength() { + return length; + } + + + /** + * Sets the length value for this Content. + * + * @param length + */ + public void setLength(long length) { + this.length = length; + } + + + /** + * Gets the format value for this Content. + * + * @return format + */ + public org.alfresco.repo.webservice.types.ContentFormat getFormat() { + return format; + } + + + /** + * Sets the format value for this Content. + * + * @param format + */ + public void setFormat(org.alfresco.repo.webservice.types.ContentFormat format) { + this.format = format; + } + + + /** + * Gets the url value for this Content. + * + * @return url + */ + public java.lang.String getUrl() { + return url; + } + + + /** + * Sets the url value for this Content. + * + * @param url + */ + public void setUrl(java.lang.String url) { + this.url = url; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof Content)) return false; + Content other = (Content) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.node==null && other.getNode()==null) || + (this.node!=null && + this.node.equals(other.getNode()))) && + ((this.property==null && other.getProperty()==null) || + (this.property!=null && + this.property.equals(other.getProperty()))) && + this.length == other.getLength() && + ((this.format==null && other.getFormat()==null) || + (this.format!=null && + this.format.equals(other.getFormat()))) && + ((this.url==null && other.getUrl()==null) || + (this.url!=null && + this.url.equals(other.getUrl()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getNode() != null) { + _hashCode += getNode().hashCode(); + } + if (getProperty() != null) { + _hashCode += getProperty().hashCode(); + } + _hashCode += new Long(getLength()).hashCode(); + if (getFormat() != null) { + _hashCode += getFormat().hashCode(); + } + if (getUrl() != null) { + _hashCode += getUrl().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(Content.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "Content")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("node"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "node")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("property"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "property")); + 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("length"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "length")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("format"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "format")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ContentFormat")); + elemField.setNillable(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("url"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "url")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(true); + 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/content/ContentFault.java b/source/generated/org/alfresco/repo/webservice/content/ContentFault.java new file mode 100644 index 0000000000..5669140c12 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/content/ContentFault.java @@ -0,0 +1,157 @@ +/** + * ContentFault.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.content; + +public class ContentFault extends org.apache.axis.AxisFault implements java.io.Serializable { + private int errorCode; + private java.lang.String message1; + + public ContentFault() { + } + + public ContentFault( + int errorCode, + java.lang.String message1) { + this.errorCode = errorCode; + this.message1 = message1; + } + + + /** + * Gets the errorCode value for this ContentFault. + * + * @return errorCode + */ + public int getErrorCode() { + return errorCode; + } + + + /** + * Sets the errorCode value for this ContentFault. + * + * @param errorCode + */ + public void setErrorCode(int errorCode) { + this.errorCode = errorCode; + } + + + /** + * Gets the message1 value for this ContentFault. + * + * @return message1 + */ + public java.lang.String getMessage1() { + return message1; + } + + + /** + * Sets the message1 value for this ContentFault. + * + * @param message1 + */ + public void setMessage1(java.lang.String message1) { + this.message1 = message1; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof ContentFault)) return false; + ContentFault other = (ContentFault) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + this.errorCode == other.getErrorCode() && + ((this.message1==null && other.getMessage1()==null) || + (this.message1!=null && + this.message1.equals(other.getMessage1()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + _hashCode += getErrorCode(); + if (getMessage1() != null) { + _hashCode += getMessage1().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(ContentFault.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "ContentFault")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("errorCode"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "errorCode")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("message1"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "message")); + 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); + } + + + /** + * Writes the exception data to the faultDetails + */ + public void writeDetails(javax.xml.namespace.QName qname, org.apache.axis.encoding.SerializationContext context) throws java.io.IOException { + context.serialize(qname, null, this); + } +} diff --git a/source/generated/org/alfresco/repo/webservice/content/ContentSegment.java b/source/generated/org/alfresco/repo/webservice/content/ContentSegment.java new file mode 100644 index 0000000000..5bf5c681e0 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/content/ContentSegment.java @@ -0,0 +1,146 @@ +/** + * ContentSegment.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.content; + +public class ContentSegment implements java.io.Serializable { + private long offset; + private long length; + + public ContentSegment() { + } + + public ContentSegment( + long offset, + long length) { + this.offset = offset; + this.length = length; + } + + + /** + * Gets the offset value for this ContentSegment. + * + * @return offset + */ + public long getOffset() { + return offset; + } + + + /** + * Sets the offset value for this ContentSegment. + * + * @param offset + */ + public void setOffset(long offset) { + this.offset = offset; + } + + + /** + * Gets the length value for this ContentSegment. + * + * @return length + */ + public long getLength() { + return length; + } + + + /** + * Sets the length value for this ContentSegment. + * + * @param length + */ + public void setLength(long length) { + this.length = length; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof ContentSegment)) return false; + ContentSegment other = (ContentSegment) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + this.offset == other.getOffset() && + this.length == other.getLength(); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + _hashCode += new Long(getOffset()).hashCode(); + _hashCode += new Long(getLength()).hashCode(); + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(ContentSegment.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "ContentSegment")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("offset"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "offset")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("length"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/content/1.0", "length")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long")); + 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/content/ContentServiceSoapPort.java b/source/generated/org/alfresco/repo/webservice/content/ContentServiceSoapPort.java new file mode 100644 index 0000000000..6286ed7ecc --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/content/ContentServiceSoapPort.java @@ -0,0 +1,26 @@ +/** + * ContentServiceSoapPort.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.content; + +public interface ContentServiceSoapPort extends java.rmi.Remote { + + /** + * Retrieves content from the repository. + */ + public org.alfresco.repo.webservice.content.Content[] read(org.alfresco.repo.webservice.types.Predicate items, java.lang.String property) throws java.rmi.RemoteException, org.alfresco.repo.webservice.content.ContentFault; + + /** + * Writes content to the repository. + */ + public org.alfresco.repo.webservice.content.Content write(org.alfresco.repo.webservice.types.Reference node, java.lang.String property, byte[] content, org.alfresco.repo.webservice.types.ContentFormat format) throws java.rmi.RemoteException, org.alfresco.repo.webservice.content.ContentFault; + + /** + * Clears content from the repository. + */ + public org.alfresco.repo.webservice.content.Content[] clear(org.alfresco.repo.webservice.types.Predicate items, java.lang.String property) throws java.rmi.RemoteException, org.alfresco.repo.webservice.content.ContentFault; +} diff --git a/source/generated/org/alfresco/repo/webservice/content/deploy.wsdd b/source/generated/org/alfresco/repo/webservice/content/deploy.wsdd new file mode 100644 index 0000000000..49c9dc68ab --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/content/deploy.wsdd @@ -0,0 +1,315 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/generated/org/alfresco/repo/webservice/repository/Association.java b/source/generated/org/alfresco/repo/webservice/repository/Association.java new file mode 100644 index 0000000000..49dc7aeec9 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/repository/Association.java @@ -0,0 +1,154 @@ +/** + * Association.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.repository; + +public class Association implements java.io.Serializable { + private java.lang.String associationType; + private org.alfresco.repo.webservice.repository.AssociationDirectionEnum direction; + + public Association() { + } + + public Association( + java.lang.String associationType, + org.alfresco.repo.webservice.repository.AssociationDirectionEnum direction) { + this.associationType = associationType; + this.direction = direction; + } + + + /** + * Gets the associationType value for this Association. + * + * @return associationType + */ + public java.lang.String getAssociationType() { + return associationType; + } + + + /** + * Sets the associationType value for this Association. + * + * @param associationType + */ + public void setAssociationType(java.lang.String associationType) { + this.associationType = associationType; + } + + + /** + * Gets the direction value for this Association. + * + * @return direction + */ + public org.alfresco.repo.webservice.repository.AssociationDirectionEnum getDirection() { + return direction; + } + + + /** + * Sets the direction value for this Association. + * + * @param direction + */ + public void setDirection(org.alfresco.repo.webservice.repository.AssociationDirectionEnum direction) { + this.direction = direction; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof Association)) return false; + Association other = (Association) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.associationType==null && other.getAssociationType()==null) || + (this.associationType!=null && + this.associationType.equals(other.getAssociationType()))) && + ((this.direction==null && other.getDirection()==null) || + (this.direction!=null && + this.direction.equals(other.getDirection()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getAssociationType() != null) { + _hashCode += getAssociationType().hashCode(); + } + if (getDirection() != null) { + _hashCode += getDirection().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(Association.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "Association")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("associationType"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "associationType")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("direction"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "direction")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "AssociationDirectionEnum")); + 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/repository/AssociationDirectionEnum.java b/source/generated/org/alfresco/repo/webservice/repository/AssociationDirectionEnum.java new file mode 100644 index 0000000000..47a69823e6 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/repository/AssociationDirectionEnum.java @@ -0,0 +1,70 @@ +/** + * AssociationDirectionEnum.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.repository; + +public class AssociationDirectionEnum implements java.io.Serializable { + private java.lang.String _value_; + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + protected AssociationDirectionEnum(java.lang.String value) { + _value_ = value; + _table_.put(_value_,this); + } + + public static final java.lang.String _source = "source"; + public static final java.lang.String _target = "target"; + public static final AssociationDirectionEnum source = new AssociationDirectionEnum(_source); + public static final AssociationDirectionEnum target = new AssociationDirectionEnum(_target); + public java.lang.String getValue() { return _value_;} + public static AssociationDirectionEnum fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + AssociationDirectionEnum enumeration = (AssociationDirectionEnum) + _table_.get(value); + if (enumeration==null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + public static AssociationDirectionEnum fromString(java.lang.String value) + throws java.lang.IllegalArgumentException { + return fromValue(value); + } + public boolean equals(java.lang.Object obj) {return (obj == this);} + public int hashCode() { return toString().hashCode();} + public java.lang.String toString() { return _value_;} + public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} + 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.EnumSerializer( + _javaType, _xmlType); + } + 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.EnumDeserializer( + _javaType, _xmlType); + } + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(AssociationDirectionEnum.class); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "AssociationDirectionEnum")); + } + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + +} diff --git a/source/generated/org/alfresco/repo/webservice/repository/QueryResult.java b/source/generated/org/alfresco/repo/webservice/repository/QueryResult.java new file mode 100644 index 0000000000..6077250a7a --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/repository/QueryResult.java @@ -0,0 +1,154 @@ +/** + * QueryResult.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.repository; + +public class QueryResult implements java.io.Serializable { + private java.lang.String querySession; + private org.alfresco.repo.webservice.types.ResultSet resultSet; + + public QueryResult() { + } + + public QueryResult( + java.lang.String querySession, + org.alfresco.repo.webservice.types.ResultSet resultSet) { + this.querySession = querySession; + this.resultSet = resultSet; + } + + + /** + * Gets the querySession value for this QueryResult. + * + * @return querySession + */ + public java.lang.String getQuerySession() { + return querySession; + } + + + /** + * Sets the querySession value for this QueryResult. + * + * @param querySession + */ + public void setQuerySession(java.lang.String querySession) { + this.querySession = querySession; + } + + + /** + * Gets the resultSet value for this QueryResult. + * + * @return resultSet + */ + public org.alfresco.repo.webservice.types.ResultSet getResultSet() { + return resultSet; + } + + + /** + * Sets the resultSet value for this QueryResult. + * + * @param resultSet + */ + public void setResultSet(org.alfresco.repo.webservice.types.ResultSet resultSet) { + this.resultSet = resultSet; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof QueryResult)) return false; + QueryResult other = (QueryResult) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.querySession==null && other.getQuerySession()==null) || + (this.querySession!=null && + this.querySession.equals(other.getQuerySession()))) && + ((this.resultSet==null && other.getResultSet()==null) || + (this.resultSet!=null && + this.resultSet.equals(other.getResultSet()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getQuerySession() != null) { + _hashCode += getQuerySession().hashCode(); + } + if (getResultSet() != null) { + _hashCode += getResultSet().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(QueryResult.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "QueryResult")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("querySession"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "querySession")); + 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("resultSet"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "resultSet")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ResultSet")); + 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/repository/RepositoryFault.java b/source/generated/org/alfresco/repo/webservice/repository/RepositoryFault.java new file mode 100644 index 0000000000..842f645828 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/repository/RepositoryFault.java @@ -0,0 +1,157 @@ +/** + * RepositoryFault.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.repository; + +public class RepositoryFault extends org.apache.axis.AxisFault implements java.io.Serializable { + private int errorCode; + private java.lang.String message1; + + public RepositoryFault() { + } + + public RepositoryFault( + int errorCode, + java.lang.String message1) { + this.errorCode = errorCode; + this.message1 = message1; + } + + + /** + * Gets the errorCode value for this RepositoryFault. + * + * @return errorCode + */ + public int getErrorCode() { + return errorCode; + } + + + /** + * Sets the errorCode value for this RepositoryFault. + * + * @param errorCode + */ + public void setErrorCode(int errorCode) { + this.errorCode = errorCode; + } + + + /** + * Gets the message1 value for this RepositoryFault. + * + * @return message1 + */ + public java.lang.String getMessage1() { + return message1; + } + + + /** + * Sets the message1 value for this RepositoryFault. + * + * @param message1 + */ + public void setMessage1(java.lang.String message1) { + this.message1 = message1; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof RepositoryFault)) return false; + RepositoryFault other = (RepositoryFault) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + this.errorCode == other.getErrorCode() && + ((this.message1==null && other.getMessage1()==null) || + (this.message1!=null && + this.message1.equals(other.getMessage1()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + _hashCode += getErrorCode(); + if (getMessage1() != null) { + _hashCode += getMessage1().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(RepositoryFault.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryFault")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("errorCode"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "errorCode")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("message1"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "message")); + 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); + } + + + /** + * Writes the exception data to the faultDetails + */ + public void writeDetails(javax.xml.namespace.QName qname, org.apache.axis.encoding.SerializationContext context) throws java.io.IOException { + context.serialize(qname, null, this); + } +} diff --git a/source/generated/org/alfresco/repo/webservice/repository/RepositoryServiceSoapPort.java b/source/generated/org/alfresco/repo/webservice/repository/RepositoryServiceSoapPort.java new file mode 100644 index 0000000000..9ef61ff0d4 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/repository/RepositoryServiceSoapPort.java @@ -0,0 +1,59 @@ +/** + * RepositoryServiceSoapPort.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.repository; + +public interface RepositoryServiceSoapPort extends java.rmi.Remote { + + /** + * Retrieves a list of stores where content resources are held. + */ + public org.alfresco.repo.webservice.types.Store[] getStores() throws java.rmi.RemoteException, org.alfresco.repo.webservice.repository.RepositoryFault; + + /** + * Executes a query against a store. + */ + public org.alfresco.repo.webservice.repository.QueryResult query(org.alfresco.repo.webservice.types.Store store, org.alfresco.repo.webservice.types.Query query, boolean includeMetaData) throws java.rmi.RemoteException, org.alfresco.repo.webservice.repository.RepositoryFault; + + /** + * Executes a query to retrieve the children of the specified + * resource. + */ + public org.alfresco.repo.webservice.repository.QueryResult queryChildren(org.alfresco.repo.webservice.types.Reference node) throws java.rmi.RemoteException, org.alfresco.repo.webservice.repository.RepositoryFault; + + /** + * Executes a query to retrieve the parents of the specified resource. + */ + public org.alfresco.repo.webservice.repository.QueryResult queryParents(org.alfresco.repo.webservice.types.Reference node) throws java.rmi.RemoteException, org.alfresco.repo.webservice.repository.RepositoryFault; + + /** + * Executes a query to retrieve associated resources of the specified + * resource. + */ + public org.alfresco.repo.webservice.repository.QueryResult queryAssociated(org.alfresco.repo.webservice.types.Reference node, org.alfresco.repo.webservice.repository.Association[] association) throws java.rmi.RemoteException, org.alfresco.repo.webservice.repository.RepositoryFault; + + /** + * Fetches the next batch of query results. + */ + public org.alfresco.repo.webservice.repository.QueryResult fetchMore(java.lang.String querySession) throws java.rmi.RemoteException, org.alfresco.repo.webservice.repository.RepositoryFault; + + /** + * Executes a CML script to manipulate the contents of a Repository + * store. + */ + public org.alfresco.repo.webservice.repository.UpdateResult[] update(org.alfresco.repo.webservice.types.CML statements) throws java.rmi.RemoteException, org.alfresco.repo.webservice.repository.RepositoryFault; + + /** + * Describes a content resource. + */ + public org.alfresco.repo.webservice.types.NodeDefinition[] describe(org.alfresco.repo.webservice.types.Predicate items) throws java.rmi.RemoteException, org.alfresco.repo.webservice.repository.RepositoryFault; + + /** + * Gets a resource from the repository. + */ + public org.alfresco.repo.webservice.types.Node[] get(org.alfresco.repo.webservice.types.Predicate where) throws java.rmi.RemoteException, org.alfresco.repo.webservice.repository.RepositoryFault; +} diff --git a/source/generated/org/alfresco/repo/webservice/repository/UpdateResult.java b/source/generated/org/alfresco/repo/webservice/repository/UpdateResult.java new file mode 100644 index 0000000000..946002abda --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/repository/UpdateResult.java @@ -0,0 +1,224 @@ +/** + * UpdateResult.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.repository; + +public class UpdateResult implements java.io.Serializable { + private java.lang.String statement; + private org.alfresco.repo.webservice.types.ResultSet updateCount; + private org.alfresco.repo.webservice.types.Reference source; + private org.alfresco.repo.webservice.types.Reference destination; + + public UpdateResult() { + } + + public UpdateResult( + java.lang.String statement, + org.alfresco.repo.webservice.types.ResultSet updateCount, + org.alfresco.repo.webservice.types.Reference source, + org.alfresco.repo.webservice.types.Reference destination) { + this.statement = statement; + this.updateCount = updateCount; + this.source = source; + this.destination = destination; + } + + + /** + * Gets the statement value for this UpdateResult. + * + * @return statement + */ + public java.lang.String getStatement() { + return statement; + } + + + /** + * Sets the statement value for this UpdateResult. + * + * @param statement + */ + public void setStatement(java.lang.String statement) { + this.statement = statement; + } + + + /** + * Gets the updateCount value for this UpdateResult. + * + * @return updateCount + */ + public org.alfresco.repo.webservice.types.ResultSet getUpdateCount() { + return updateCount; + } + + + /** + * Sets the updateCount value for this UpdateResult. + * + * @param updateCount + */ + public void setUpdateCount(org.alfresco.repo.webservice.types.ResultSet updateCount) { + this.updateCount = updateCount; + } + + + /** + * Gets the source value for this UpdateResult. + * + * @return source + */ + public org.alfresco.repo.webservice.types.Reference getSource() { + return source; + } + + + /** + * Sets the source value for this UpdateResult. + * + * @param source + */ + public void setSource(org.alfresco.repo.webservice.types.Reference source) { + this.source = source; + } + + + /** + * Gets the destination value for this UpdateResult. + * + * @return destination + */ + public org.alfresco.repo.webservice.types.Reference getDestination() { + return destination; + } + + + /** + * Sets the destination value for this UpdateResult. + * + * @param destination + */ + public void setDestination(org.alfresco.repo.webservice.types.Reference destination) { + this.destination = destination; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof UpdateResult)) return false; + UpdateResult other = (UpdateResult) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.statement==null && other.getStatement()==null) || + (this.statement!=null && + this.statement.equals(other.getStatement()))) && + ((this.updateCount==null && other.getUpdateCount()==null) || + (this.updateCount!=null && + this.updateCount.equals(other.getUpdateCount()))) && + ((this.source==null && other.getSource()==null) || + (this.source!=null && + this.source.equals(other.getSource()))) && + ((this.destination==null && other.getDestination()==null) || + (this.destination!=null && + this.destination.equals(other.getDestination()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getStatement() != null) { + _hashCode += getStatement().hashCode(); + } + if (getUpdateCount() != null) { + _hashCode += getUpdateCount().hashCode(); + } + if (getSource() != null) { + _hashCode += getSource().hashCode(); + } + if (getDestination() != null) { + _hashCode += getDestination().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(UpdateResult.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "UpdateResult")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("statement"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "statement")); + 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("updateCount"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "updateCount")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ResultSet")); + elemField.setNillable(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("source"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "source")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference")); + elemField.setNillable(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("destination"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/service/repository/1.0", "destination")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference")); + elemField.setNillable(true); + 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/repository/deploy.wsdd b/source/generated/org/alfresco/repo/webservice/repository/deploy.wsdd new file mode 100644 index 0000000000..1197feab41 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/repository/deploy.wsdd @@ -0,0 +1,479 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/generated/org/alfresco/repo/webservice/types/AssociationDefinition.java b/source/generated/org/alfresco/repo/webservice/types/AssociationDefinition.java new file mode 100644 index 0000000000..7f5f5be3c5 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/AssociationDefinition.java @@ -0,0 +1,329 @@ +/** + * AssociationDefinition.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class AssociationDefinition implements java.io.Serializable { + private java.lang.String name; + private java.lang.String title; + private java.lang.String description; + private boolean isChild; + private org.alfresco.repo.webservice.types.RoleDefinition sourceRole; + private org.alfresco.repo.webservice.types.RoleDefinition targetRole; + private java.lang.String targetClass; + + public AssociationDefinition() { + } + + public AssociationDefinition( + java.lang.String name, + java.lang.String title, + java.lang.String description, + boolean isChild, + org.alfresco.repo.webservice.types.RoleDefinition sourceRole, + org.alfresco.repo.webservice.types.RoleDefinition targetRole, + java.lang.String targetClass) { + this.name = name; + this.title = title; + this.description = description; + this.isChild = isChild; + this.sourceRole = sourceRole; + this.targetRole = targetRole; + this.targetClass = targetClass; + } + + + /** + * Gets the name value for this AssociationDefinition. + * + * @return name + */ + public java.lang.String getName() { + return name; + } + + + /** + * Sets the name value for this AssociationDefinition. + * + * @param name + */ + public void setName(java.lang.String name) { + this.name = name; + } + + + /** + * Gets the title value for this AssociationDefinition. + * + * @return title + */ + public java.lang.String getTitle() { + return title; + } + + + /** + * Sets the title value for this AssociationDefinition. + * + * @param title + */ + public void setTitle(java.lang.String title) { + this.title = title; + } + + + /** + * Gets the description value for this AssociationDefinition. + * + * @return description + */ + public java.lang.String getDescription() { + return description; + } + + + /** + * Sets the description value for this AssociationDefinition. + * + * @param description + */ + public void setDescription(java.lang.String description) { + this.description = description; + } + + + /** + * Gets the isChild value for this AssociationDefinition. + * + * @return isChild + */ + public boolean isIsChild() { + return isChild; + } + + + /** + * Sets the isChild value for this AssociationDefinition. + * + * @param isChild + */ + public void setIsChild(boolean isChild) { + this.isChild = isChild; + } + + + /** + * Gets the sourceRole value for this AssociationDefinition. + * + * @return sourceRole + */ + public org.alfresco.repo.webservice.types.RoleDefinition getSourceRole() { + return sourceRole; + } + + + /** + * Sets the sourceRole value for this AssociationDefinition. + * + * @param sourceRole + */ + public void setSourceRole(org.alfresco.repo.webservice.types.RoleDefinition sourceRole) { + this.sourceRole = sourceRole; + } + + + /** + * Gets the targetRole value for this AssociationDefinition. + * + * @return targetRole + */ + public org.alfresco.repo.webservice.types.RoleDefinition getTargetRole() { + return targetRole; + } + + + /** + * Sets the targetRole value for this AssociationDefinition. + * + * @param targetRole + */ + public void setTargetRole(org.alfresco.repo.webservice.types.RoleDefinition targetRole) { + this.targetRole = targetRole; + } + + + /** + * Gets the targetClass value for this AssociationDefinition. + * + * @return targetClass + */ + public java.lang.String getTargetClass() { + return targetClass; + } + + + /** + * Sets the targetClass value for this AssociationDefinition. + * + * @param targetClass + */ + public void setTargetClass(java.lang.String targetClass) { + this.targetClass = targetClass; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof AssociationDefinition)) return false; + AssociationDefinition other = (AssociationDefinition) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.name==null && other.getName()==null) || + (this.name!=null && + this.name.equals(other.getName()))) && + ((this.title==null && other.getTitle()==null) || + (this.title!=null && + this.title.equals(other.getTitle()))) && + ((this.description==null && other.getDescription()==null) || + (this.description!=null && + this.description.equals(other.getDescription()))) && + this.isChild == other.isIsChild() && + ((this.sourceRole==null && other.getSourceRole()==null) || + (this.sourceRole!=null && + this.sourceRole.equals(other.getSourceRole()))) && + ((this.targetRole==null && other.getTargetRole()==null) || + (this.targetRole!=null && + this.targetRole.equals(other.getTargetRole()))) && + ((this.targetClass==null && other.getTargetClass()==null) || + (this.targetClass!=null && + this.targetClass.equals(other.getTargetClass()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getName() != null) { + _hashCode += getName().hashCode(); + } + if (getTitle() != null) { + _hashCode += getTitle().hashCode(); + } + if (getDescription() != null) { + _hashCode += getDescription().hashCode(); + } + _hashCode += (isIsChild() ? Boolean.TRUE : Boolean.FALSE).hashCode(); + if (getSourceRole() != null) { + _hashCode += getSourceRole().hashCode(); + } + if (getTargetRole() != null) { + _hashCode += getTargetRole().hashCode(); + } + if (getTargetClass() != null) { + _hashCode += getTargetClass().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(AssociationDefinition.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "AssociationDefinition")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("name"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "name")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("title"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "title")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("description"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "description")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("isChild"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "isChild")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("sourceRole"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "sourceRole")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "RoleDefinition")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("targetRole"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "targetRole")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "RoleDefinition")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("targetClass"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "targetClass")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + 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/types/CML.java b/source/generated/org/alfresco/repo/webservice/types/CML.java new file mode 100644 index 0000000000..99fdfea435 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/CML.java @@ -0,0 +1,667 @@ +/** + * CML.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class CML implements java.io.Serializable { + private org.alfresco.repo.webservice.types.CMLCreate[] create; + private org.alfresco.repo.webservice.types.CMLAddAspect[] addAspect; + private org.alfresco.repo.webservice.types.CMLRemoveAspect[] removeAspect; + private org.alfresco.repo.webservice.types.CMLUpdate[] update; + private org.alfresco.repo.webservice.types.CMLDelete[] delete; + private org.alfresco.repo.webservice.types.CMLMove[] move; + private org.alfresco.repo.webservice.types.CMLCopy[] copy; + private org.alfresco.repo.webservice.types.CMLAddChild[] addChild; + private org.alfresco.repo.webservice.types.CMLRemoveChild[] removeChild; + private org.alfresco.repo.webservice.types.CMLCreateAssociation[] createAssociation; + private org.alfresco.repo.webservice.types.CMLRemoveAssociation[] removeAssociation; + + public CML() { + } + + public CML( + org.alfresco.repo.webservice.types.CMLCreate[] create, + org.alfresco.repo.webservice.types.CMLAddAspect[] addAspect, + org.alfresco.repo.webservice.types.CMLRemoveAspect[] removeAspect, + org.alfresco.repo.webservice.types.CMLUpdate[] update, + org.alfresco.repo.webservice.types.CMLDelete[] delete, + org.alfresco.repo.webservice.types.CMLMove[] move, + org.alfresco.repo.webservice.types.CMLCopy[] copy, + org.alfresco.repo.webservice.types.CMLAddChild[] addChild, + org.alfresco.repo.webservice.types.CMLRemoveChild[] removeChild, + org.alfresco.repo.webservice.types.CMLCreateAssociation[] createAssociation, + org.alfresco.repo.webservice.types.CMLRemoveAssociation[] removeAssociation) { + this.create = create; + this.addAspect = addAspect; + this.removeAspect = removeAspect; + this.update = update; + this.delete = delete; + this.move = move; + this.copy = copy; + this.addChild = addChild; + this.removeChild = removeChild; + this.createAssociation = createAssociation; + this.removeAssociation = removeAssociation; + } + + + /** + * Gets the create value for this CML. + * + * @return create + */ + public org.alfresco.repo.webservice.types.CMLCreate[] getCreate() { + return create; + } + + + /** + * Sets the create value for this CML. + * + * @param create + */ + public void setCreate(org.alfresco.repo.webservice.types.CMLCreate[] create) { + this.create = create; + } + + public org.alfresco.repo.webservice.types.CMLCreate getCreate(int i) { + return this.create[i]; + } + + public void setCreate(int i, org.alfresco.repo.webservice.types.CMLCreate _value) { + this.create[i] = _value; + } + + + /** + * Gets the addAspect value for this CML. + * + * @return addAspect + */ + public org.alfresco.repo.webservice.types.CMLAddAspect[] getAddAspect() { + return addAspect; + } + + + /** + * Sets the addAspect value for this CML. + * + * @param addAspect + */ + public void setAddAspect(org.alfresco.repo.webservice.types.CMLAddAspect[] addAspect) { + this.addAspect = addAspect; + } + + public org.alfresco.repo.webservice.types.CMLAddAspect getAddAspect(int i) { + return this.addAspect[i]; + } + + public void setAddAspect(int i, org.alfresco.repo.webservice.types.CMLAddAspect _value) { + this.addAspect[i] = _value; + } + + + /** + * Gets the removeAspect value for this CML. + * + * @return removeAspect + */ + public org.alfresco.repo.webservice.types.CMLRemoveAspect[] getRemoveAspect() { + return removeAspect; + } + + + /** + * Sets the removeAspect value for this CML. + * + * @param removeAspect + */ + public void setRemoveAspect(org.alfresco.repo.webservice.types.CMLRemoveAspect[] removeAspect) { + this.removeAspect = removeAspect; + } + + public org.alfresco.repo.webservice.types.CMLRemoveAspect getRemoveAspect(int i) { + return this.removeAspect[i]; + } + + public void setRemoveAspect(int i, org.alfresco.repo.webservice.types.CMLRemoveAspect _value) { + this.removeAspect[i] = _value; + } + + + /** + * Gets the update value for this CML. + * + * @return update + */ + public org.alfresco.repo.webservice.types.CMLUpdate[] getUpdate() { + return update; + } + + + /** + * Sets the update value for this CML. + * + * @param update + */ + public void setUpdate(org.alfresco.repo.webservice.types.CMLUpdate[] update) { + this.update = update; + } + + public org.alfresco.repo.webservice.types.CMLUpdate getUpdate(int i) { + return this.update[i]; + } + + public void setUpdate(int i, org.alfresco.repo.webservice.types.CMLUpdate _value) { + this.update[i] = _value; + } + + + /** + * Gets the delete value for this CML. + * + * @return delete + */ + public org.alfresco.repo.webservice.types.CMLDelete[] getDelete() { + return delete; + } + + + /** + * Sets the delete value for this CML. + * + * @param delete + */ + public void setDelete(org.alfresco.repo.webservice.types.CMLDelete[] delete) { + this.delete = delete; + } + + public org.alfresco.repo.webservice.types.CMLDelete getDelete(int i) { + return this.delete[i]; + } + + public void setDelete(int i, org.alfresco.repo.webservice.types.CMLDelete _value) { + this.delete[i] = _value; + } + + + /** + * Gets the move value for this CML. + * + * @return move + */ + public org.alfresco.repo.webservice.types.CMLMove[] getMove() { + return move; + } + + + /** + * Sets the move value for this CML. + * + * @param move + */ + public void setMove(org.alfresco.repo.webservice.types.CMLMove[] move) { + this.move = move; + } + + public org.alfresco.repo.webservice.types.CMLMove getMove(int i) { + return this.move[i]; + } + + public void setMove(int i, org.alfresco.repo.webservice.types.CMLMove _value) { + this.move[i] = _value; + } + + + /** + * Gets the copy value for this CML. + * + * @return copy + */ + public org.alfresco.repo.webservice.types.CMLCopy[] getCopy() { + return copy; + } + + + /** + * Sets the copy value for this CML. + * + * @param copy + */ + public void setCopy(org.alfresco.repo.webservice.types.CMLCopy[] copy) { + this.copy = copy; + } + + public org.alfresco.repo.webservice.types.CMLCopy getCopy(int i) { + return this.copy[i]; + } + + public void setCopy(int i, org.alfresco.repo.webservice.types.CMLCopy _value) { + this.copy[i] = _value; + } + + + /** + * Gets the addChild value for this CML. + * + * @return addChild + */ + public org.alfresco.repo.webservice.types.CMLAddChild[] getAddChild() { + return addChild; + } + + + /** + * Sets the addChild value for this CML. + * + * @param addChild + */ + public void setAddChild(org.alfresco.repo.webservice.types.CMLAddChild[] addChild) { + this.addChild = addChild; + } + + public org.alfresco.repo.webservice.types.CMLAddChild getAddChild(int i) { + return this.addChild[i]; + } + + public void setAddChild(int i, org.alfresco.repo.webservice.types.CMLAddChild _value) { + this.addChild[i] = _value; + } + + + /** + * Gets the removeChild value for this CML. + * + * @return removeChild + */ + public org.alfresco.repo.webservice.types.CMLRemoveChild[] getRemoveChild() { + return removeChild; + } + + + /** + * Sets the removeChild value for this CML. + * + * @param removeChild + */ + public void setRemoveChild(org.alfresco.repo.webservice.types.CMLRemoveChild[] removeChild) { + this.removeChild = removeChild; + } + + public org.alfresco.repo.webservice.types.CMLRemoveChild getRemoveChild(int i) { + return this.removeChild[i]; + } + + public void setRemoveChild(int i, org.alfresco.repo.webservice.types.CMLRemoveChild _value) { + this.removeChild[i] = _value; + } + + + /** + * Gets the createAssociation value for this CML. + * + * @return createAssociation + */ + public org.alfresco.repo.webservice.types.CMLCreateAssociation[] getCreateAssociation() { + return createAssociation; + } + + + /** + * Sets the createAssociation value for this CML. + * + * @param createAssociation + */ + public void setCreateAssociation(org.alfresco.repo.webservice.types.CMLCreateAssociation[] createAssociation) { + this.createAssociation = createAssociation; + } + + public org.alfresco.repo.webservice.types.CMLCreateAssociation getCreateAssociation(int i) { + return this.createAssociation[i]; + } + + public void setCreateAssociation(int i, org.alfresco.repo.webservice.types.CMLCreateAssociation _value) { + this.createAssociation[i] = _value; + } + + + /** + * Gets the removeAssociation value for this CML. + * + * @return removeAssociation + */ + public org.alfresco.repo.webservice.types.CMLRemoveAssociation[] getRemoveAssociation() { + return removeAssociation; + } + + + /** + * Sets the removeAssociation value for this CML. + * + * @param removeAssociation + */ + public void setRemoveAssociation(org.alfresco.repo.webservice.types.CMLRemoveAssociation[] removeAssociation) { + this.removeAssociation = removeAssociation; + } + + public org.alfresco.repo.webservice.types.CMLRemoveAssociation getRemoveAssociation(int i) { + return this.removeAssociation[i]; + } + + public void setRemoveAssociation(int i, org.alfresco.repo.webservice.types.CMLRemoveAssociation _value) { + this.removeAssociation[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CML)) return false; + CML other = (CML) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.create==null && other.getCreate()==null) || + (this.create!=null && + java.util.Arrays.equals(this.create, other.getCreate()))) && + ((this.addAspect==null && other.getAddAspect()==null) || + (this.addAspect!=null && + java.util.Arrays.equals(this.addAspect, other.getAddAspect()))) && + ((this.removeAspect==null && other.getRemoveAspect()==null) || + (this.removeAspect!=null && + java.util.Arrays.equals(this.removeAspect, other.getRemoveAspect()))) && + ((this.update==null && other.getUpdate()==null) || + (this.update!=null && + java.util.Arrays.equals(this.update, other.getUpdate()))) && + ((this.delete==null && other.getDelete()==null) || + (this.delete!=null && + java.util.Arrays.equals(this.delete, other.getDelete()))) && + ((this.move==null && other.getMove()==null) || + (this.move!=null && + java.util.Arrays.equals(this.move, other.getMove()))) && + ((this.copy==null && other.getCopy()==null) || + (this.copy!=null && + java.util.Arrays.equals(this.copy, other.getCopy()))) && + ((this.addChild==null && other.getAddChild()==null) || + (this.addChild!=null && + java.util.Arrays.equals(this.addChild, other.getAddChild()))) && + ((this.removeChild==null && other.getRemoveChild()==null) || + (this.removeChild!=null && + java.util.Arrays.equals(this.removeChild, other.getRemoveChild()))) && + ((this.createAssociation==null && other.getCreateAssociation()==null) || + (this.createAssociation!=null && + java.util.Arrays.equals(this.createAssociation, other.getCreateAssociation()))) && + ((this.removeAssociation==null && other.getRemoveAssociation()==null) || + (this.removeAssociation!=null && + java.util.Arrays.equals(this.removeAssociation, other.getRemoveAssociation()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getCreate() != null) { + for (int i=0; + iCML>create")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("addAspect"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "addAspect")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>addAspect")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("removeAspect"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "removeAspect")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>removeAspect")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("update"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "update")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>update")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("delete"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "delete")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>delete")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("move"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "move")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>move")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("copy"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "copy")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>copy")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("addChild"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "addChild")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>addChild")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("removeChild"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "removeChild")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>removeChild")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("createAssociation"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "createAssociation")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>createAssociation")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("removeAssociation"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "removeAssociation")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>removeAssociation")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + 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/types/CMLAddAspect.java b/source/generated/org/alfresco/repo/webservice/types/CMLAddAspect.java new file mode 100644 index 0000000000..9db09b6548 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/CMLAddAspect.java @@ -0,0 +1,244 @@ +/** + * CMLAddAspect.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class CMLAddAspect implements java.io.Serializable { + private java.lang.String aspect; + private org.alfresco.repo.webservice.types.NamedValue[] property; + private org.alfresco.repo.webservice.types.Predicate where; + private java.lang.String where_id; + + public CMLAddAspect() { + } + + public CMLAddAspect( + java.lang.String aspect, + org.alfresco.repo.webservice.types.NamedValue[] property, + org.alfresco.repo.webservice.types.Predicate where, + java.lang.String where_id) { + this.aspect = aspect; + this.property = property; + this.where = where; + this.where_id = where_id; + } + + + /** + * Gets the aspect value for this CMLAddAspect. + * + * @return aspect + */ + public java.lang.String getAspect() { + return aspect; + } + + + /** + * Sets the aspect value for this CMLAddAspect. + * + * @param aspect + */ + public void setAspect(java.lang.String aspect) { + this.aspect = aspect; + } + + + /** + * Gets the property value for this CMLAddAspect. + * + * @return property + */ + public org.alfresco.repo.webservice.types.NamedValue[] getProperty() { + return property; + } + + + /** + * Sets the property value for this CMLAddAspect. + * + * @param property + */ + public void setProperty(org.alfresco.repo.webservice.types.NamedValue[] property) { + this.property = property; + } + + public org.alfresco.repo.webservice.types.NamedValue getProperty(int i) { + return this.property[i]; + } + + public void setProperty(int i, org.alfresco.repo.webservice.types.NamedValue _value) { + this.property[i] = _value; + } + + + /** + * Gets the where value for this CMLAddAspect. + * + * @return where + */ + public org.alfresco.repo.webservice.types.Predicate getWhere() { + return where; + } + + + /** + * Sets the where value for this CMLAddAspect. + * + * @param where + */ + public void setWhere(org.alfresco.repo.webservice.types.Predicate where) { + this.where = where; + } + + + /** + * Gets the where_id value for this CMLAddAspect. + * + * @return where_id + */ + public java.lang.String getWhere_id() { + return where_id; + } + + + /** + * Sets the where_id value for this CMLAddAspect. + * + * @param where_id + */ + public void setWhere_id(java.lang.String where_id) { + this.where_id = where_id; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLAddAspect)) return false; + CMLAddAspect other = (CMLAddAspect) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.aspect==null && other.getAspect()==null) || + (this.aspect!=null && + this.aspect.equals(other.getAspect()))) && + ((this.property==null && other.getProperty()==null) || + (this.property!=null && + java.util.Arrays.equals(this.property, other.getProperty()))) && + ((this.where==null && other.getWhere()==null) || + (this.where!=null && + this.where.equals(other.getWhere()))) && + ((this.where_id==null && other.getWhere_id()==null) || + (this.where_id!=null && + this.where_id.equals(other.getWhere_id()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getAspect() != null) { + _hashCode += getAspect().hashCode(); + } + if (getProperty() != null) { + for (int i=0; + iCML>addAspect")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("aspect"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "aspect")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("property"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "property")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NamedValue")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + 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/types/CMLAddChild.java b/source/generated/org/alfresco/repo/webservice/types/CMLAddChild.java new file mode 100644 index 0000000000..760d652ff3 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/CMLAddChild.java @@ -0,0 +1,299 @@ +/** + * CMLAddChild.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class CMLAddChild implements java.io.Serializable { + private org.alfresco.repo.webservice.types.ParentReference to; + private java.lang.String to_id; + private java.lang.String associationType; + private java.lang.String childName; + private org.alfresco.repo.webservice.types.Predicate where; + private java.lang.String where_id; + + public CMLAddChild() { + } + + public CMLAddChild( + org.alfresco.repo.webservice.types.ParentReference to, + java.lang.String to_id, + java.lang.String associationType, + java.lang.String childName, + org.alfresco.repo.webservice.types.Predicate where, + java.lang.String where_id) { + this.to = to; + this.to_id = to_id; + this.associationType = associationType; + this.childName = childName; + this.where = where; + this.where_id = where_id; + } + + + /** + * Gets the to value for this CMLAddChild. + * + * @return to + */ + public org.alfresco.repo.webservice.types.ParentReference getTo() { + return to; + } + + + /** + * Sets the to value for this CMLAddChild. + * + * @param to + */ + public void setTo(org.alfresco.repo.webservice.types.ParentReference to) { + this.to = to; + } + + + /** + * Gets the to_id value for this CMLAddChild. + * + * @return to_id + */ + public java.lang.String getTo_id() { + return to_id; + } + + + /** + * Sets the to_id value for this CMLAddChild. + * + * @param to_id + */ + public void setTo_id(java.lang.String to_id) { + this.to_id = to_id; + } + + + /** + * Gets the associationType value for this CMLAddChild. + * + * @return associationType + */ + public java.lang.String getAssociationType() { + return associationType; + } + + + /** + * Sets the associationType value for this CMLAddChild. + * + * @param associationType + */ + public void setAssociationType(java.lang.String associationType) { + this.associationType = associationType; + } + + + /** + * Gets the childName value for this CMLAddChild. + * + * @return childName + */ + public java.lang.String getChildName() { + return childName; + } + + + /** + * Sets the childName value for this CMLAddChild. + * + * @param childName + */ + public void setChildName(java.lang.String childName) { + this.childName = childName; + } + + + /** + * Gets the where value for this CMLAddChild. + * + * @return where + */ + public org.alfresco.repo.webservice.types.Predicate getWhere() { + return where; + } + + + /** + * Sets the where value for this CMLAddChild. + * + * @param where + */ + public void setWhere(org.alfresco.repo.webservice.types.Predicate where) { + this.where = where; + } + + + /** + * Gets the where_id value for this CMLAddChild. + * + * @return where_id + */ + public java.lang.String getWhere_id() { + return where_id; + } + + + /** + * Sets the where_id value for this CMLAddChild. + * + * @param where_id + */ + public void setWhere_id(java.lang.String where_id) { + this.where_id = where_id; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLAddChild)) return false; + CMLAddChild other = (CMLAddChild) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.to==null && other.getTo()==null) || + (this.to!=null && + this.to.equals(other.getTo()))) && + ((this.to_id==null && other.getTo_id()==null) || + (this.to_id!=null && + this.to_id.equals(other.getTo_id()))) && + ((this.associationType==null && other.getAssociationType()==null) || + (this.associationType!=null && + this.associationType.equals(other.getAssociationType()))) && + ((this.childName==null && other.getChildName()==null) || + (this.childName!=null && + this.childName.equals(other.getChildName()))) && + ((this.where==null && other.getWhere()==null) || + (this.where!=null && + this.where.equals(other.getWhere()))) && + ((this.where_id==null && other.getWhere_id()==null) || + (this.where_id!=null && + this.where_id.equals(other.getWhere_id()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getTo() != null) { + _hashCode += getTo().hashCode(); + } + if (getTo_id() != null) { + _hashCode += getTo_id().hashCode(); + } + if (getAssociationType() != null) { + _hashCode += getAssociationType().hashCode(); + } + if (getChildName() != null) { + _hashCode += getChildName().hashCode(); + } + if (getWhere() != null) { + _hashCode += getWhere().hashCode(); + } + if (getWhere_id() != null) { + _hashCode += getWhere_id().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(CMLAddChild.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>addChild")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ParentReference")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to_id")); + 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("associationType"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "associationType")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("childName"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "childName")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + 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/types/CMLCopy.java b/source/generated/org/alfresco/repo/webservice/types/CMLCopy.java new file mode 100644 index 0000000000..1513c3c90a --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/CMLCopy.java @@ -0,0 +1,335 @@ +/** + * CMLCopy.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class CMLCopy implements java.io.Serializable { + private org.alfresco.repo.webservice.types.ParentReference to; + private java.lang.String to_id; + private java.lang.String associationType; + private java.lang.String childName; + private org.alfresco.repo.webservice.types.Predicate where; + private java.lang.String where_id; + private java.lang.Boolean children; + + public CMLCopy() { + } + + public CMLCopy( + org.alfresco.repo.webservice.types.ParentReference to, + java.lang.String to_id, + java.lang.String associationType, + java.lang.String childName, + org.alfresco.repo.webservice.types.Predicate where, + java.lang.String where_id, + java.lang.Boolean children) { + this.to = to; + this.to_id = to_id; + this.associationType = associationType; + this.childName = childName; + this.where = where; + this.where_id = where_id; + this.children = children; + } + + + /** + * Gets the to value for this CMLCopy. + * + * @return to + */ + public org.alfresco.repo.webservice.types.ParentReference getTo() { + return to; + } + + + /** + * Sets the to value for this CMLCopy. + * + * @param to + */ + public void setTo(org.alfresco.repo.webservice.types.ParentReference to) { + this.to = to; + } + + + /** + * Gets the to_id value for this CMLCopy. + * + * @return to_id + */ + public java.lang.String getTo_id() { + return to_id; + } + + + /** + * Sets the to_id value for this CMLCopy. + * + * @param to_id + */ + public void setTo_id(java.lang.String to_id) { + this.to_id = to_id; + } + + + /** + * Gets the associationType value for this CMLCopy. + * + * @return associationType + */ + public java.lang.String getAssociationType() { + return associationType; + } + + + /** + * Sets the associationType value for this CMLCopy. + * + * @param associationType + */ + public void setAssociationType(java.lang.String associationType) { + this.associationType = associationType; + } + + + /** + * Gets the childName value for this CMLCopy. + * + * @return childName + */ + public java.lang.String getChildName() { + return childName; + } + + + /** + * Sets the childName value for this CMLCopy. + * + * @param childName + */ + public void setChildName(java.lang.String childName) { + this.childName = childName; + } + + + /** + * Gets the where value for this CMLCopy. + * + * @return where + */ + public org.alfresco.repo.webservice.types.Predicate getWhere() { + return where; + } + + + /** + * Sets the where value for this CMLCopy. + * + * @param where + */ + public void setWhere(org.alfresco.repo.webservice.types.Predicate where) { + this.where = where; + } + + + /** + * Gets the where_id value for this CMLCopy. + * + * @return where_id + */ + public java.lang.String getWhere_id() { + return where_id; + } + + + /** + * Sets the where_id value for this CMLCopy. + * + * @param where_id + */ + public void setWhere_id(java.lang.String where_id) { + this.where_id = where_id; + } + + + /** + * Gets the children value for this CMLCopy. + * + * @return children + */ + public java.lang.Boolean getChildren() { + return children; + } + + + /** + * Sets the children value for this CMLCopy. + * + * @param children + */ + public void setChildren(java.lang.Boolean children) { + this.children = children; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLCopy)) return false; + CMLCopy other = (CMLCopy) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.to==null && other.getTo()==null) || + (this.to!=null && + this.to.equals(other.getTo()))) && + ((this.to_id==null && other.getTo_id()==null) || + (this.to_id!=null && + this.to_id.equals(other.getTo_id()))) && + ((this.associationType==null && other.getAssociationType()==null) || + (this.associationType!=null && + this.associationType.equals(other.getAssociationType()))) && + ((this.childName==null && other.getChildName()==null) || + (this.childName!=null && + this.childName.equals(other.getChildName()))) && + ((this.where==null && other.getWhere()==null) || + (this.where!=null && + this.where.equals(other.getWhere()))) && + ((this.where_id==null && other.getWhere_id()==null) || + (this.where_id!=null && + this.where_id.equals(other.getWhere_id()))) && + ((this.children==null && other.getChildren()==null) || + (this.children!=null && + this.children.equals(other.getChildren()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getTo() != null) { + _hashCode += getTo().hashCode(); + } + if (getTo_id() != null) { + _hashCode += getTo_id().hashCode(); + } + if (getAssociationType() != null) { + _hashCode += getAssociationType().hashCode(); + } + if (getChildName() != null) { + _hashCode += getChildName().hashCode(); + } + if (getWhere() != null) { + _hashCode += getWhere().hashCode(); + } + if (getWhere_id() != null) { + _hashCode += getWhere_id().hashCode(); + } + if (getChildren() != null) { + _hashCode += getChildren().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(CMLCopy.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>copy")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ParentReference")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to_id")); + 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("associationType"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "associationType")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("childName"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "childName")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("children"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "children")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean")); + elemField.setMinOccurs(0); + 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/types/CMLCreate.java b/source/generated/org/alfresco/repo/webservice/types/CMLCreate.java new file mode 100644 index 0000000000..cdcb8e486e --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/CMLCreate.java @@ -0,0 +1,244 @@ +/** + * CMLCreate.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class CMLCreate implements java.io.Serializable { + private java.lang.String id; + private org.alfresco.repo.webservice.types.ParentReference parent; + private java.lang.String type; + private org.alfresco.repo.webservice.types.NamedValue[] property; + + public CMLCreate() { + } + + public CMLCreate( + java.lang.String id, + org.alfresco.repo.webservice.types.ParentReference parent, + java.lang.String type, + org.alfresco.repo.webservice.types.NamedValue[] property) { + this.id = id; + this.parent = parent; + this.type = type; + this.property = property; + } + + + /** + * Gets the id value for this CMLCreate. + * + * @return id + */ + public java.lang.String getId() { + return id; + } + + + /** + * Sets the id value for this CMLCreate. + * + * @param id + */ + public void setId(java.lang.String id) { + this.id = id; + } + + + /** + * Gets the parent value for this CMLCreate. + * + * @return parent + */ + public org.alfresco.repo.webservice.types.ParentReference getParent() { + return parent; + } + + + /** + * Sets the parent value for this CMLCreate. + * + * @param parent + */ + public void setParent(org.alfresco.repo.webservice.types.ParentReference parent) { + this.parent = parent; + } + + + /** + * Gets the type value for this CMLCreate. + * + * @return type + */ + public java.lang.String getType() { + return type; + } + + + /** + * Sets the type value for this CMLCreate. + * + * @param type + */ + public void setType(java.lang.String type) { + this.type = type; + } + + + /** + * Gets the property value for this CMLCreate. + * + * @return property + */ + public org.alfresco.repo.webservice.types.NamedValue[] getProperty() { + return property; + } + + + /** + * Sets the property value for this CMLCreate. + * + * @param property + */ + public void setProperty(org.alfresco.repo.webservice.types.NamedValue[] property) { + this.property = property; + } + + public org.alfresco.repo.webservice.types.NamedValue getProperty(int i) { + return this.property[i]; + } + + public void setProperty(int i, org.alfresco.repo.webservice.types.NamedValue _value) { + this.property[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLCreate)) return false; + CMLCreate other = (CMLCreate) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.id==null && other.getId()==null) || + (this.id!=null && + this.id.equals(other.getId()))) && + ((this.parent==null && other.getParent()==null) || + (this.parent!=null && + this.parent.equals(other.getParent()))) && + ((this.type==null && other.getType()==null) || + (this.type!=null && + this.type.equals(other.getType()))) && + ((this.property==null && other.getProperty()==null) || + (this.property!=null && + java.util.Arrays.equals(this.property, other.getProperty()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getId() != null) { + _hashCode += getId().hashCode(); + } + if (getParent() != null) { + _hashCode += getParent().hashCode(); + } + if (getType() != null) { + _hashCode += getType().hashCode(); + } + if (getProperty() != null) { + for (int i=0; + iCML>create")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("parent"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "parent")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ParentReference")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("type"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "type")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("property"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "property")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NamedValue")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + 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/types/CMLCreateAssociation.java b/source/generated/org/alfresco/repo/webservice/types/CMLCreateAssociation.java new file mode 100644 index 0000000000..2b24bbef94 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/CMLCreateAssociation.java @@ -0,0 +1,263 @@ +/** + * CMLCreateAssociation.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class CMLCreateAssociation implements java.io.Serializable { + private org.alfresco.repo.webservice.types.Predicate from; + private java.lang.String from_id; + private org.alfresco.repo.webservice.types.Predicate to; + private java.lang.String to_id; + private java.lang.String association; + + public CMLCreateAssociation() { + } + + public CMLCreateAssociation( + org.alfresco.repo.webservice.types.Predicate from, + java.lang.String from_id, + org.alfresco.repo.webservice.types.Predicate to, + java.lang.String to_id, + java.lang.String association) { + this.from = from; + this.from_id = from_id; + this.to = to; + this.to_id = to_id; + this.association = association; + } + + + /** + * Gets the from value for this CMLCreateAssociation. + * + * @return from + */ + public org.alfresco.repo.webservice.types.Predicate getFrom() { + return from; + } + + + /** + * Sets the from value for this CMLCreateAssociation. + * + * @param from + */ + public void setFrom(org.alfresco.repo.webservice.types.Predicate from) { + this.from = from; + } + + + /** + * Gets the from_id value for this CMLCreateAssociation. + * + * @return from_id + */ + public java.lang.String getFrom_id() { + return from_id; + } + + + /** + * Sets the from_id value for this CMLCreateAssociation. + * + * @param from_id + */ + public void setFrom_id(java.lang.String from_id) { + this.from_id = from_id; + } + + + /** + * Gets the to value for this CMLCreateAssociation. + * + * @return to + */ + public org.alfresco.repo.webservice.types.Predicate getTo() { + return to; + } + + + /** + * Sets the to value for this CMLCreateAssociation. + * + * @param to + */ + public void setTo(org.alfresco.repo.webservice.types.Predicate to) { + this.to = to; + } + + + /** + * Gets the to_id value for this CMLCreateAssociation. + * + * @return to_id + */ + public java.lang.String getTo_id() { + return to_id; + } + + + /** + * Sets the to_id value for this CMLCreateAssociation. + * + * @param to_id + */ + public void setTo_id(java.lang.String to_id) { + this.to_id = to_id; + } + + + /** + * Gets the association value for this CMLCreateAssociation. + * + * @return association + */ + public java.lang.String getAssociation() { + return association; + } + + + /** + * Sets the association value for this CMLCreateAssociation. + * + * @param association + */ + public void setAssociation(java.lang.String association) { + this.association = association; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLCreateAssociation)) return false; + CMLCreateAssociation other = (CMLCreateAssociation) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.from==null && other.getFrom()==null) || + (this.from!=null && + this.from.equals(other.getFrom()))) && + ((this.from_id==null && other.getFrom_id()==null) || + (this.from_id!=null && + this.from_id.equals(other.getFrom_id()))) && + ((this.to==null && other.getTo()==null) || + (this.to!=null && + this.to.equals(other.getTo()))) && + ((this.to_id==null && other.getTo_id()==null) || + (this.to_id!=null && + this.to_id.equals(other.getTo_id()))) && + ((this.association==null && other.getAssociation()==null) || + (this.association!=null && + this.association.equals(other.getAssociation()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getFrom() != null) { + _hashCode += getFrom().hashCode(); + } + if (getFrom_id() != null) { + _hashCode += getFrom_id().hashCode(); + } + if (getTo() != null) { + _hashCode += getTo().hashCode(); + } + if (getTo_id() != null) { + _hashCode += getTo_id().hashCode(); + } + if (getAssociation() != null) { + _hashCode += getAssociation().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(CMLCreateAssociation.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>createAssociation")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("from"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "from")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("from_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "from_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("association"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "association")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + 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/types/CMLDelete.java b/source/generated/org/alfresco/repo/webservice/types/CMLDelete.java new file mode 100644 index 0000000000..134998a41b --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/CMLDelete.java @@ -0,0 +1,119 @@ +/** + * CMLDelete.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class CMLDelete implements java.io.Serializable { + private org.alfresco.repo.webservice.types.Predicate where; + + public CMLDelete() { + } + + public CMLDelete( + org.alfresco.repo.webservice.types.Predicate where) { + this.where = where; + } + + + /** + * Gets the where value for this CMLDelete. + * + * @return where + */ + public org.alfresco.repo.webservice.types.Predicate getWhere() { + return where; + } + + + /** + * Sets the where value for this CMLDelete. + * + * @param where + */ + public void setWhere(org.alfresco.repo.webservice.types.Predicate where) { + this.where = where; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLDelete)) return false; + CMLDelete other = (CMLDelete) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.where==null && other.getWhere()==null) || + (this.where!=null && + this.where.equals(other.getWhere()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getWhere() != null) { + _hashCode += getWhere().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(CMLDelete.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>delete")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + 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/types/CMLMove.java b/source/generated/org/alfresco/repo/webservice/types/CMLMove.java new file mode 100644 index 0000000000..f929e47102 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/CMLMove.java @@ -0,0 +1,299 @@ +/** + * CMLMove.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class CMLMove implements java.io.Serializable { + private org.alfresco.repo.webservice.types.ParentReference to; + private java.lang.String to_id; + private java.lang.String associationType; + private java.lang.String childName; + private org.alfresco.repo.webservice.types.Predicate where; + private java.lang.String where_id; + + public CMLMove() { + } + + public CMLMove( + org.alfresco.repo.webservice.types.ParentReference to, + java.lang.String to_id, + java.lang.String associationType, + java.lang.String childName, + org.alfresco.repo.webservice.types.Predicate where, + java.lang.String where_id) { + this.to = to; + this.to_id = to_id; + this.associationType = associationType; + this.childName = childName; + this.where = where; + this.where_id = where_id; + } + + + /** + * Gets the to value for this CMLMove. + * + * @return to + */ + public org.alfresco.repo.webservice.types.ParentReference getTo() { + return to; + } + + + /** + * Sets the to value for this CMLMove. + * + * @param to + */ + public void setTo(org.alfresco.repo.webservice.types.ParentReference to) { + this.to = to; + } + + + /** + * Gets the to_id value for this CMLMove. + * + * @return to_id + */ + public java.lang.String getTo_id() { + return to_id; + } + + + /** + * Sets the to_id value for this CMLMove. + * + * @param to_id + */ + public void setTo_id(java.lang.String to_id) { + this.to_id = to_id; + } + + + /** + * Gets the associationType value for this CMLMove. + * + * @return associationType + */ + public java.lang.String getAssociationType() { + return associationType; + } + + + /** + * Sets the associationType value for this CMLMove. + * + * @param associationType + */ + public void setAssociationType(java.lang.String associationType) { + this.associationType = associationType; + } + + + /** + * Gets the childName value for this CMLMove. + * + * @return childName + */ + public java.lang.String getChildName() { + return childName; + } + + + /** + * Sets the childName value for this CMLMove. + * + * @param childName + */ + public void setChildName(java.lang.String childName) { + this.childName = childName; + } + + + /** + * Gets the where value for this CMLMove. + * + * @return where + */ + public org.alfresco.repo.webservice.types.Predicate getWhere() { + return where; + } + + + /** + * Sets the where value for this CMLMove. + * + * @param where + */ + public void setWhere(org.alfresco.repo.webservice.types.Predicate where) { + this.where = where; + } + + + /** + * Gets the where_id value for this CMLMove. + * + * @return where_id + */ + public java.lang.String getWhere_id() { + return where_id; + } + + + /** + * Sets the where_id value for this CMLMove. + * + * @param where_id + */ + public void setWhere_id(java.lang.String where_id) { + this.where_id = where_id; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLMove)) return false; + CMLMove other = (CMLMove) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.to==null && other.getTo()==null) || + (this.to!=null && + this.to.equals(other.getTo()))) && + ((this.to_id==null && other.getTo_id()==null) || + (this.to_id!=null && + this.to_id.equals(other.getTo_id()))) && + ((this.associationType==null && other.getAssociationType()==null) || + (this.associationType!=null && + this.associationType.equals(other.getAssociationType()))) && + ((this.childName==null && other.getChildName()==null) || + (this.childName!=null && + this.childName.equals(other.getChildName()))) && + ((this.where==null && other.getWhere()==null) || + (this.where!=null && + this.where.equals(other.getWhere()))) && + ((this.where_id==null && other.getWhere_id()==null) || + (this.where_id!=null && + this.where_id.equals(other.getWhere_id()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getTo() != null) { + _hashCode += getTo().hashCode(); + } + if (getTo_id() != null) { + _hashCode += getTo_id().hashCode(); + } + if (getAssociationType() != null) { + _hashCode += getAssociationType().hashCode(); + } + if (getChildName() != null) { + _hashCode += getChildName().hashCode(); + } + if (getWhere() != null) { + _hashCode += getWhere().hashCode(); + } + if (getWhere_id() != null) { + _hashCode += getWhere_id().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(CMLMove.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>move")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ParentReference")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to_id")); + 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("associationType"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "associationType")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("childName"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "childName")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + 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/types/CMLRemoveAspect.java b/source/generated/org/alfresco/repo/webservice/types/CMLRemoveAspect.java new file mode 100644 index 0000000000..6611dca8c4 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/CMLRemoveAspect.java @@ -0,0 +1,191 @@ +/** + * CMLRemoveAspect.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class CMLRemoveAspect implements java.io.Serializable { + private java.lang.String aspect; + private org.alfresco.repo.webservice.types.Predicate where; + private java.lang.String where_id; + + public CMLRemoveAspect() { + } + + public CMLRemoveAspect( + java.lang.String aspect, + org.alfresco.repo.webservice.types.Predicate where, + java.lang.String where_id) { + this.aspect = aspect; + this.where = where; + this.where_id = where_id; + } + + + /** + * Gets the aspect value for this CMLRemoveAspect. + * + * @return aspect + */ + public java.lang.String getAspect() { + return aspect; + } + + + /** + * Sets the aspect value for this CMLRemoveAspect. + * + * @param aspect + */ + public void setAspect(java.lang.String aspect) { + this.aspect = aspect; + } + + + /** + * Gets the where value for this CMLRemoveAspect. + * + * @return where + */ + public org.alfresco.repo.webservice.types.Predicate getWhere() { + return where; + } + + + /** + * Sets the where value for this CMLRemoveAspect. + * + * @param where + */ + public void setWhere(org.alfresco.repo.webservice.types.Predicate where) { + this.where = where; + } + + + /** + * Gets the where_id value for this CMLRemoveAspect. + * + * @return where_id + */ + public java.lang.String getWhere_id() { + return where_id; + } + + + /** + * Sets the where_id value for this CMLRemoveAspect. + * + * @param where_id + */ + public void setWhere_id(java.lang.String where_id) { + this.where_id = where_id; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLRemoveAspect)) return false; + CMLRemoveAspect other = (CMLRemoveAspect) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.aspect==null && other.getAspect()==null) || + (this.aspect!=null && + this.aspect.equals(other.getAspect()))) && + ((this.where==null && other.getWhere()==null) || + (this.where!=null && + this.where.equals(other.getWhere()))) && + ((this.where_id==null && other.getWhere_id()==null) || + (this.where_id!=null && + this.where_id.equals(other.getWhere_id()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getAspect() != null) { + _hashCode += getAspect().hashCode(); + } + if (getWhere() != null) { + _hashCode += getWhere().hashCode(); + } + if (getWhere_id() != null) { + _hashCode += getWhere_id().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(CMLRemoveAspect.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>removeAspect")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("aspect"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "aspect")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + 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/types/CMLRemoveAssociation.java b/source/generated/org/alfresco/repo/webservice/types/CMLRemoveAssociation.java new file mode 100644 index 0000000000..87f71d92fe --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/CMLRemoveAssociation.java @@ -0,0 +1,263 @@ +/** + * CMLRemoveAssociation.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class CMLRemoveAssociation implements java.io.Serializable { + private org.alfresco.repo.webservice.types.Predicate from; + private java.lang.String from_id; + private org.alfresco.repo.webservice.types.Predicate to; + private java.lang.String to_id; + private java.lang.String association; + + public CMLRemoveAssociation() { + } + + public CMLRemoveAssociation( + org.alfresco.repo.webservice.types.Predicate from, + java.lang.String from_id, + org.alfresco.repo.webservice.types.Predicate to, + java.lang.String to_id, + java.lang.String association) { + this.from = from; + this.from_id = from_id; + this.to = to; + this.to_id = to_id; + this.association = association; + } + + + /** + * Gets the from value for this CMLRemoveAssociation. + * + * @return from + */ + public org.alfresco.repo.webservice.types.Predicate getFrom() { + return from; + } + + + /** + * Sets the from value for this CMLRemoveAssociation. + * + * @param from + */ + public void setFrom(org.alfresco.repo.webservice.types.Predicate from) { + this.from = from; + } + + + /** + * Gets the from_id value for this CMLRemoveAssociation. + * + * @return from_id + */ + public java.lang.String getFrom_id() { + return from_id; + } + + + /** + * Sets the from_id value for this CMLRemoveAssociation. + * + * @param from_id + */ + public void setFrom_id(java.lang.String from_id) { + this.from_id = from_id; + } + + + /** + * Gets the to value for this CMLRemoveAssociation. + * + * @return to + */ + public org.alfresco.repo.webservice.types.Predicate getTo() { + return to; + } + + + /** + * Sets the to value for this CMLRemoveAssociation. + * + * @param to + */ + public void setTo(org.alfresco.repo.webservice.types.Predicate to) { + this.to = to; + } + + + /** + * Gets the to_id value for this CMLRemoveAssociation. + * + * @return to_id + */ + public java.lang.String getTo_id() { + return to_id; + } + + + /** + * Sets the to_id value for this CMLRemoveAssociation. + * + * @param to_id + */ + public void setTo_id(java.lang.String to_id) { + this.to_id = to_id; + } + + + /** + * Gets the association value for this CMLRemoveAssociation. + * + * @return association + */ + public java.lang.String getAssociation() { + return association; + } + + + /** + * Sets the association value for this CMLRemoveAssociation. + * + * @param association + */ + public void setAssociation(java.lang.String association) { + this.association = association; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLRemoveAssociation)) return false; + CMLRemoveAssociation other = (CMLRemoveAssociation) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.from==null && other.getFrom()==null) || + (this.from!=null && + this.from.equals(other.getFrom()))) && + ((this.from_id==null && other.getFrom_id()==null) || + (this.from_id!=null && + this.from_id.equals(other.getFrom_id()))) && + ((this.to==null && other.getTo()==null) || + (this.to!=null && + this.to.equals(other.getTo()))) && + ((this.to_id==null && other.getTo_id()==null) || + (this.to_id!=null && + this.to_id.equals(other.getTo_id()))) && + ((this.association==null && other.getAssociation()==null) || + (this.association!=null && + this.association.equals(other.getAssociation()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getFrom() != null) { + _hashCode += getFrom().hashCode(); + } + if (getFrom_id() != null) { + _hashCode += getFrom_id().hashCode(); + } + if (getTo() != null) { + _hashCode += getTo().hashCode(); + } + if (getTo_id() != null) { + _hashCode += getTo_id().hashCode(); + } + if (getAssociation() != null) { + _hashCode += getAssociation().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(CMLRemoveAssociation.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>removeAssociation")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("from"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "from")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("from_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "from_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("to_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "to_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("association"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "association")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + 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/types/CMLRemoveChild.java b/source/generated/org/alfresco/repo/webservice/types/CMLRemoveChild.java new file mode 100644 index 0000000000..e42fd357a7 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/CMLRemoveChild.java @@ -0,0 +1,228 @@ +/** + * CMLRemoveChild.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class CMLRemoveChild implements java.io.Serializable { + private org.alfresco.repo.webservice.types.Reference from; + private java.lang.String from_id; + private org.alfresco.repo.webservice.types.Predicate where; + private java.lang.String where_id; + + public CMLRemoveChild() { + } + + public CMLRemoveChild( + org.alfresco.repo.webservice.types.Reference from, + java.lang.String from_id, + org.alfresco.repo.webservice.types.Predicate where, + java.lang.String where_id) { + this.from = from; + this.from_id = from_id; + this.where = where; + this.where_id = where_id; + } + + + /** + * Gets the from value for this CMLRemoveChild. + * + * @return from + */ + public org.alfresco.repo.webservice.types.Reference getFrom() { + return from; + } + + + /** + * Sets the from value for this CMLRemoveChild. + * + * @param from + */ + public void setFrom(org.alfresco.repo.webservice.types.Reference from) { + this.from = from; + } + + + /** + * Gets the from_id value for this CMLRemoveChild. + * + * @return from_id + */ + public java.lang.String getFrom_id() { + return from_id; + } + + + /** + * Sets the from_id value for this CMLRemoveChild. + * + * @param from_id + */ + public void setFrom_id(java.lang.String from_id) { + this.from_id = from_id; + } + + + /** + * Gets the where value for this CMLRemoveChild. + * + * @return where + */ + public org.alfresco.repo.webservice.types.Predicate getWhere() { + return where; + } + + + /** + * Sets the where value for this CMLRemoveChild. + * + * @param where + */ + public void setWhere(org.alfresco.repo.webservice.types.Predicate where) { + this.where = where; + } + + + /** + * Gets the where_id value for this CMLRemoveChild. + * + * @return where_id + */ + public java.lang.String getWhere_id() { + return where_id; + } + + + /** + * Sets the where_id value for this CMLRemoveChild. + * + * @param where_id + */ + public void setWhere_id(java.lang.String where_id) { + this.where_id = where_id; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLRemoveChild)) return false; + CMLRemoveChild other = (CMLRemoveChild) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.from==null && other.getFrom()==null) || + (this.from!=null && + this.from.equals(other.getFrom()))) && + ((this.from_id==null && other.getFrom_id()==null) || + (this.from_id!=null && + this.from_id.equals(other.getFrom_id()))) && + ((this.where==null && other.getWhere()==null) || + (this.where!=null && + this.where.equals(other.getWhere()))) && + ((this.where_id==null && other.getWhere_id()==null) || + (this.where_id!=null && + this.where_id.equals(other.getWhere_id()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getFrom() != null) { + _hashCode += getFrom().hashCode(); + } + if (getFrom_id() != null) { + _hashCode += getFrom_id().hashCode(); + } + if (getWhere() != null) { + _hashCode += getWhere().hashCode(); + } + if (getWhere_id() != null) { + _hashCode += getWhere_id().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(CMLRemoveChild.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", ">CML>removeChild")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("from"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "from")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("from_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "from_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + 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/types/CMLUpdate.java b/source/generated/org/alfresco/repo/webservice/types/CMLUpdate.java new file mode 100644 index 0000000000..e75b0406c7 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/CMLUpdate.java @@ -0,0 +1,208 @@ +/** + * CMLUpdate.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class CMLUpdate implements java.io.Serializable { + private org.alfresco.repo.webservice.types.NamedValue[] property; + private org.alfresco.repo.webservice.types.Predicate where; + private java.lang.String where_id; + + public CMLUpdate() { + } + + public CMLUpdate( + org.alfresco.repo.webservice.types.NamedValue[] property, + org.alfresco.repo.webservice.types.Predicate where, + java.lang.String where_id) { + this.property = property; + this.where = where; + this.where_id = where_id; + } + + + /** + * Gets the property value for this CMLUpdate. + * + * @return property + */ + public org.alfresco.repo.webservice.types.NamedValue[] getProperty() { + return property; + } + + + /** + * Sets the property value for this CMLUpdate. + * + * @param property + */ + public void setProperty(org.alfresco.repo.webservice.types.NamedValue[] property) { + this.property = property; + } + + public org.alfresco.repo.webservice.types.NamedValue getProperty(int i) { + return this.property[i]; + } + + public void setProperty(int i, org.alfresco.repo.webservice.types.NamedValue _value) { + this.property[i] = _value; + } + + + /** + * Gets the where value for this CMLUpdate. + * + * @return where + */ + public org.alfresco.repo.webservice.types.Predicate getWhere() { + return where; + } + + + /** + * Sets the where value for this CMLUpdate. + * + * @param where + */ + public void setWhere(org.alfresco.repo.webservice.types.Predicate where) { + this.where = where; + } + + + /** + * Gets the where_id value for this CMLUpdate. + * + * @return where_id + */ + public java.lang.String getWhere_id() { + return where_id; + } + + + /** + * Sets the where_id value for this CMLUpdate. + * + * @param where_id + */ + public void setWhere_id(java.lang.String where_id) { + this.where_id = where_id; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof CMLUpdate)) return false; + CMLUpdate other = (CMLUpdate) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.property==null && other.getProperty()==null) || + (this.property!=null && + java.util.Arrays.equals(this.property, other.getProperty()))) && + ((this.where==null && other.getWhere()==null) || + (this.where!=null && + this.where.equals(other.getWhere()))) && + ((this.where_id==null && other.getWhere_id()==null) || + (this.where_id!=null && + this.where_id.equals(other.getWhere_id()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getProperty() != null) { + for (int i=0; + iCML>update")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("property"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "property")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NamedValue")); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Predicate")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("where_id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/cml/1.0", "where_id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + 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/types/Cardinality.java b/source/generated/org/alfresco/repo/webservice/types/Cardinality.java new file mode 100644 index 0000000000..8223c8aeab --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/Cardinality.java @@ -0,0 +1,74 @@ +/** + * Cardinality.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class Cardinality implements java.io.Serializable { + private java.lang.String _value_; + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + protected Cardinality(java.lang.String value) { + _value_ = value; + _table_.put(_value_,this); + } + + public static final java.lang.String _value1 = "0..1"; + public static final java.lang.String _value2 = "1"; + public static final java.lang.String _value3 = "*"; + public static final java.lang.String _value4 = "1..*"; + public static final Cardinality value1 = new Cardinality(_value1); + public static final Cardinality value2 = new Cardinality(_value2); + public static final Cardinality value3 = new Cardinality(_value3); + public static final Cardinality value4 = new Cardinality(_value4); + public java.lang.String getValue() { return _value_;} + public static Cardinality fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + Cardinality enumeration = (Cardinality) + _table_.get(value); + if (enumeration==null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + public static Cardinality fromString(java.lang.String value) + throws java.lang.IllegalArgumentException { + return fromValue(value); + } + public boolean equals(java.lang.Object obj) {return (obj == this);} + public int hashCode() { return toString().hashCode();} + public java.lang.String toString() { return _value_;} + public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} + 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.EnumSerializer( + _javaType, _xmlType); + } + 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.EnumDeserializer( + _javaType, _xmlType); + } + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(Cardinality.class); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Cardinality")); + } + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + +} diff --git a/source/generated/org/alfresco/repo/webservice/types/Category.java b/source/generated/org/alfresco/repo/webservice/types/Category.java new file mode 100644 index 0000000000..d2527a733c --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/Category.java @@ -0,0 +1,191 @@ +/** + * Category.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class Category implements java.io.Serializable { + private org.alfresco.repo.webservice.types.Reference id; + private java.lang.String title; + private java.lang.String description; + + public Category() { + } + + public Category( + org.alfresco.repo.webservice.types.Reference id, + java.lang.String title, + java.lang.String description) { + this.id = id; + this.title = title; + this.description = description; + } + + + /** + * Gets the id value for this Category. + * + * @return id + */ + public org.alfresco.repo.webservice.types.Reference getId() { + return id; + } + + + /** + * Sets the id value for this Category. + * + * @param id + */ + public void setId(org.alfresco.repo.webservice.types.Reference id) { + this.id = id; + } + + + /** + * Gets the title value for this Category. + * + * @return title + */ + public java.lang.String getTitle() { + return title; + } + + + /** + * Sets the title value for this Category. + * + * @param title + */ + public void setTitle(java.lang.String title) { + this.title = title; + } + + + /** + * Gets the description value for this Category. + * + * @return description + */ + public java.lang.String getDescription() { + return description; + } + + + /** + * Sets the description value for this Category. + * + * @param description + */ + public void setDescription(java.lang.String description) { + this.description = description; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof Category)) return false; + Category other = (Category) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.id==null && other.getId()==null) || + (this.id!=null && + this.id.equals(other.getId()))) && + ((this.title==null && other.getTitle()==null) || + (this.title!=null && + this.title.equals(other.getTitle()))) && + ((this.description==null && other.getDescription()==null) || + (this.description!=null && + this.description.equals(other.getDescription()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getId() != null) { + _hashCode += getId().hashCode(); + } + if (getTitle() != null) { + _hashCode += getTitle().hashCode(); + } + if (getDescription() != null) { + _hashCode += getDescription().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(Category.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Category")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Reference")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("title"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "title")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("description"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "description")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + 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/types/ClassDefinition.java b/source/generated/org/alfresco/repo/webservice/types/ClassDefinition.java new file mode 100644 index 0000000000..94596374ac --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/ClassDefinition.java @@ -0,0 +1,364 @@ +/** + * ClassDefinition.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class ClassDefinition implements java.io.Serializable { + private java.lang.String name; + private java.lang.String title; + private java.lang.String description; + private java.lang.String superClass; + private boolean isAspect; + private org.alfresco.repo.webservice.types.PropertyDefinition[] properties; + private org.alfresco.repo.webservice.types.AssociationDefinition[] associations; + + public ClassDefinition() { + } + + public ClassDefinition( + java.lang.String name, + java.lang.String title, + java.lang.String description, + java.lang.String superClass, + boolean isAspect, + org.alfresco.repo.webservice.types.PropertyDefinition[] properties, + org.alfresco.repo.webservice.types.AssociationDefinition[] associations) { + this.name = name; + this.title = title; + this.description = description; + this.superClass = superClass; + this.isAspect = isAspect; + this.properties = properties; + this.associations = associations; + } + + + /** + * Gets the name value for this ClassDefinition. + * + * @return name + */ + public java.lang.String getName() { + return name; + } + + + /** + * Sets the name value for this ClassDefinition. + * + * @param name + */ + public void setName(java.lang.String name) { + this.name = name; + } + + + /** + * Gets the title value for this ClassDefinition. + * + * @return title + */ + public java.lang.String getTitle() { + return title; + } + + + /** + * Sets the title value for this ClassDefinition. + * + * @param title + */ + public void setTitle(java.lang.String title) { + this.title = title; + } + + + /** + * Gets the description value for this ClassDefinition. + * + * @return description + */ + public java.lang.String getDescription() { + return description; + } + + + /** + * Sets the description value for this ClassDefinition. + * + * @param description + */ + public void setDescription(java.lang.String description) { + this.description = description; + } + + + /** + * Gets the superClass value for this ClassDefinition. + * + * @return superClass + */ + public java.lang.String getSuperClass() { + return superClass; + } + + + /** + * Sets the superClass value for this ClassDefinition. + * + * @param superClass + */ + public void setSuperClass(java.lang.String superClass) { + this.superClass = superClass; + } + + + /** + * Gets the isAspect value for this ClassDefinition. + * + * @return isAspect + */ + public boolean isIsAspect() { + return isAspect; + } + + + /** + * Sets the isAspect value for this ClassDefinition. + * + * @param isAspect + */ + public void setIsAspect(boolean isAspect) { + this.isAspect = isAspect; + } + + + /** + * Gets the properties value for this ClassDefinition. + * + * @return properties + */ + public org.alfresco.repo.webservice.types.PropertyDefinition[] getProperties() { + return properties; + } + + + /** + * Sets the properties value for this ClassDefinition. + * + * @param properties + */ + public void setProperties(org.alfresco.repo.webservice.types.PropertyDefinition[] properties) { + this.properties = properties; + } + + public org.alfresco.repo.webservice.types.PropertyDefinition getProperties(int i) { + return this.properties[i]; + } + + public void setProperties(int i, org.alfresco.repo.webservice.types.PropertyDefinition _value) { + this.properties[i] = _value; + } + + + /** + * Gets the associations value for this ClassDefinition. + * + * @return associations + */ + public org.alfresco.repo.webservice.types.AssociationDefinition[] getAssociations() { + return associations; + } + + + /** + * Sets the associations value for this ClassDefinition. + * + * @param associations + */ + public void setAssociations(org.alfresco.repo.webservice.types.AssociationDefinition[] associations) { + this.associations = associations; + } + + public org.alfresco.repo.webservice.types.AssociationDefinition getAssociations(int i) { + return this.associations[i]; + } + + public void setAssociations(int i, org.alfresco.repo.webservice.types.AssociationDefinition _value) { + this.associations[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof ClassDefinition)) return false; + ClassDefinition other = (ClassDefinition) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.name==null && other.getName()==null) || + (this.name!=null && + this.name.equals(other.getName()))) && + ((this.title==null && other.getTitle()==null) || + (this.title!=null && + this.title.equals(other.getTitle()))) && + ((this.description==null && other.getDescription()==null) || + (this.description!=null && + this.description.equals(other.getDescription()))) && + ((this.superClass==null && other.getSuperClass()==null) || + (this.superClass!=null && + this.superClass.equals(other.getSuperClass()))) && + this.isAspect == other.isIsAspect() && + ((this.properties==null && other.getProperties()==null) || + (this.properties!=null && + java.util.Arrays.equals(this.properties, other.getProperties()))) && + ((this.associations==null && other.getAssociations()==null) || + (this.associations!=null && + java.util.Arrays.equals(this.associations, other.getAssociations()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getName() != null) { + _hashCode += getName().hashCode(); + } + if (getTitle() != null) { + _hashCode += getTitle().hashCode(); + } + if (getDescription() != null) { + _hashCode += getDescription().hashCode(); + } + if (getSuperClass() != null) { + _hashCode += getSuperClass().hashCode(); + } + _hashCode += (isIsAspect() ? Boolean.TRUE : Boolean.FALSE).hashCode(); + if (getProperties() != null) { + for (int i=0; + iContentFormat>mimetype")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("encoding"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "encoding")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">ContentFormat>encoding")); + elemField.setMinOccurs(0); + 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/types/LocaleConfiguration.java b/source/generated/org/alfresco/repo/webservice/types/LocaleConfiguration.java new file mode 100644 index 0000000000..7dd93eb3ae --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/LocaleConfiguration.java @@ -0,0 +1,120 @@ +/** + * LocaleConfiguration.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class LocaleConfiguration implements java.io.Serializable { + private java.lang.String locale; + + public LocaleConfiguration() { + } + + public LocaleConfiguration( + java.lang.String locale) { + this.locale = locale; + } + + + /** + * Gets the locale value for this LocaleConfiguration. + * + * @return locale + */ + public java.lang.String getLocale() { + return locale; + } + + + /** + * Sets the locale value for this LocaleConfiguration. + * + * @param locale + */ + public void setLocale(java.lang.String locale) { + this.locale = locale; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof LocaleConfiguration)) return false; + LocaleConfiguration other = (LocaleConfiguration) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.locale==null && other.getLocale()==null) || + (this.locale!=null && + this.locale.equals(other.getLocale()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getLocale() != null) { + _hashCode += getLocale().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(LocaleConfiguration.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/headers/1.0", "LocaleConfiguration")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("locale"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/headers/1.0", "locale")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + 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/types/NamedValue.java b/source/generated/org/alfresco/repo/webservice/types/NamedValue.java new file mode 100644 index 0000000000..cc096018de --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/NamedValue.java @@ -0,0 +1,154 @@ +/** + * NamedValue.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class NamedValue implements java.io.Serializable { + private java.lang.String name; + private java.lang.String value; + + public NamedValue() { + } + + public NamedValue( + java.lang.String name, + java.lang.String value) { + this.name = name; + this.value = value; + } + + + /** + * Gets the name value for this NamedValue. + * + * @return name + */ + public java.lang.String getName() { + return name; + } + + + /** + * Sets the name value for this NamedValue. + * + * @param name + */ + public void setName(java.lang.String name) { + this.name = name; + } + + + /** + * Gets the value value for this NamedValue. + * + * @return value + */ + public java.lang.String getValue() { + return value; + } + + + /** + * Sets the value value for this NamedValue. + * + * @param value + */ + public void setValue(java.lang.String value) { + this.value = value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof NamedValue)) return false; + NamedValue other = (NamedValue) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.name==null && other.getName()==null) || + (this.name!=null && + this.name.equals(other.getName()))) && + ((this.value==null && other.getValue()==null) || + (this.value!=null && + this.value.equals(other.getValue()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getName() != null) { + _hashCode += getName().hashCode(); + } + if (getValue() != null) { + _hashCode += getValue().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(NamedValue.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "NamedValue")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("name"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "name")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("value"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "value")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setNillable(true); + 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/types/NamespaceConfigurationMapping.java b/source/generated/org/alfresco/repo/webservice/types/NamespaceConfigurationMapping.java new file mode 100644 index 0000000000..417c992d5f --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/NamespaceConfigurationMapping.java @@ -0,0 +1,154 @@ +/** + * NamespaceConfigurationMapping.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class NamespaceConfigurationMapping implements java.io.Serializable { + private org.apache.axis.types.NCName prefix; + private java.lang.String uri; + + public NamespaceConfigurationMapping() { + } + + public NamespaceConfigurationMapping( + org.apache.axis.types.NCName prefix, + java.lang.String uri) { + this.prefix = prefix; + this.uri = uri; + } + + + /** + * Gets the prefix value for this NamespaceConfigurationMapping. + * + * @return prefix + */ + public org.apache.axis.types.NCName getPrefix() { + return prefix; + } + + + /** + * Sets the prefix value for this NamespaceConfigurationMapping. + * + * @param prefix + */ + public void setPrefix(org.apache.axis.types.NCName prefix) { + this.prefix = prefix; + } + + + /** + * Gets the uri value for this NamespaceConfigurationMapping. + * + * @return uri + */ + public java.lang.String getUri() { + return uri; + } + + + /** + * Sets the uri value for this NamespaceConfigurationMapping. + * + * @param uri + */ + public void setUri(java.lang.String uri) { + this.uri = uri; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof NamespaceConfigurationMapping)) return false; + NamespaceConfigurationMapping other = (NamespaceConfigurationMapping) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.prefix==null && other.getPrefix()==null) || + (this.prefix!=null && + this.prefix.equals(other.getPrefix()))) && + ((this.uri==null && other.getUri()==null) || + (this.uri!=null && + this.uri.equals(other.getUri()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getPrefix() != null) { + _hashCode += getPrefix().hashCode(); + } + if (getUri() != null) { + _hashCode += getUri().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(NamespaceConfigurationMapping.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/headers/1.0", ">NamespaceConfiguration>mapping")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("prefix"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/headers/1.0", "prefix")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "NCName")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("uri"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/headers/1.0", "uri")); + 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/types/Node.java b/source/generated/org/alfresco/repo/webservice/types/Node.java new file mode 100644 index 0000000000..061536839b --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/Node.java @@ -0,0 +1,260 @@ +/** + * Node.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class Node implements java.io.Serializable { + private org.alfresco.repo.webservice.types.Reference reference; + private java.lang.String type; + private java.lang.String[] aspects; + private org.alfresco.repo.webservice.types.NamedValue[] properties; + + public Node() { + } + + public Node( + org.alfresco.repo.webservice.types.Reference reference, + java.lang.String type, + java.lang.String[] aspects, + org.alfresco.repo.webservice.types.NamedValue[] properties) { + this.reference = reference; + this.type = type; + this.aspects = aspects; + this.properties = properties; + } + + + /** + * Gets the reference value for this Node. + * + * @return reference + */ + public org.alfresco.repo.webservice.types.Reference getReference() { + return reference; + } + + + /** + * Sets the reference value for this Node. + * + * @param reference + */ + public void setReference(org.alfresco.repo.webservice.types.Reference reference) { + this.reference = reference; + } + + + /** + * Gets the type value for this Node. + * + * @return type + */ + public java.lang.String getType() { + return type; + } + + + /** + * Sets the type value for this Node. + * + * @param type + */ + public void setType(java.lang.String type) { + this.type = type; + } + + + /** + * Gets the aspects value for this Node. + * + * @return aspects + */ + public java.lang.String[] getAspects() { + return aspects; + } + + + /** + * Sets the aspects value for this Node. + * + * @param aspects + */ + public void setAspects(java.lang.String[] aspects) { + this.aspects = aspects; + } + + public java.lang.String getAspects(int i) { + return this.aspects[i]; + } + + public void setAspects(int i, java.lang.String _value) { + this.aspects[i] = _value; + } + + + /** + * Gets the properties value for this Node. + * + * @return properties + */ + public org.alfresco.repo.webservice.types.NamedValue[] getProperties() { + return properties; + } + + + /** + * Sets the properties value for this Node. + * + * @param properties + */ + public void setProperties(org.alfresco.repo.webservice.types.NamedValue[] properties) { + this.properties = properties; + } + + public org.alfresco.repo.webservice.types.NamedValue getProperties(int i) { + return this.properties[i]; + } + + public void setProperties(int i, org.alfresco.repo.webservice.types.NamedValue _value) { + this.properties[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof Node)) return false; + Node other = (Node) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.reference==null && other.getReference()==null) || + (this.reference!=null && + this.reference.equals(other.getReference()))) && + ((this.type==null && other.getType()==null) || + (this.type!=null && + this.type.equals(other.getType()))) && + ((this.aspects==null && other.getAspects()==null) || + (this.aspects!=null && + java.util.Arrays.equals(this.aspects, other.getAspects()))) && + ((this.properties==null && other.getProperties()==null) || + (this.properties!=null && + java.util.Arrays.equals(this.properties, other.getProperties()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getReference() != null) { + _hashCode += getReference().hashCode(); + } + if (getType() != null) { + _hashCode += getType().hashCode(); + } + if (getAspects() != null) { + for (int i=0; + iResultSetRow>node")); + elemField.setMinOccurs(0); + 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/types/ResultSetRowNode.java b/source/generated/org/alfresco/repo/webservice/types/ResultSetRowNode.java new file mode 100644 index 0000000000..1992d56910 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/ResultSetRowNode.java @@ -0,0 +1,207 @@ +/** + * ResultSetRowNode.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class ResultSetRowNode implements java.io.Serializable { + private java.lang.String id; + private java.lang.String type; + private java.lang.String[] aspects; + + public ResultSetRowNode() { + } + + public ResultSetRowNode( + java.lang.String id, + java.lang.String type, + java.lang.String[] aspects) { + this.id = id; + this.type = type; + this.aspects = aspects; + } + + + /** + * Gets the id value for this ResultSetRowNode. + * + * @return id + */ + public java.lang.String getId() { + return id; + } + + + /** + * Sets the id value for this ResultSetRowNode. + * + * @param id + */ + public void setId(java.lang.String id) { + this.id = id; + } + + + /** + * Gets the type value for this ResultSetRowNode. + * + * @return type + */ + public java.lang.String getType() { + return type; + } + + + /** + * Sets the type value for this ResultSetRowNode. + * + * @param type + */ + public void setType(java.lang.String type) { + this.type = type; + } + + + /** + * Gets the aspects value for this ResultSetRowNode. + * + * @return aspects + */ + public java.lang.String[] getAspects() { + return aspects; + } + + + /** + * Sets the aspects value for this ResultSetRowNode. + * + * @param aspects + */ + public void setAspects(java.lang.String[] aspects) { + this.aspects = aspects; + } + + public java.lang.String getAspects(int i) { + return this.aspects[i]; + } + + public void setAspects(int i, java.lang.String _value) { + this.aspects[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof ResultSetRowNode)) return false; + ResultSetRowNode other = (ResultSetRowNode) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.id==null && other.getId()==null) || + (this.id!=null && + this.id.equals(other.getId()))) && + ((this.type==null && other.getType()==null) || + (this.type!=null && + this.type.equals(other.getType()))) && + ((this.aspects==null && other.getAspects()==null) || + (this.aspects!=null && + java.util.Arrays.equals(this.aspects, other.getAspects()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getId() != null) { + _hashCode += getId().hashCode(); + } + if (getType() != null) { + _hashCode += getType().hashCode(); + } + if (getAspects() != null) { + for (int i=0; + iResultSetRow>node")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("id"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "id")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "UUID")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("type"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "type")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("aspects"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "aspects")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + elemField.setMaxOccursUnbounded(true); + 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/types/RoleDefinition.java b/source/generated/org/alfresco/repo/webservice/types/RoleDefinition.java new file mode 100644 index 0000000000..b593263625 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/RoleDefinition.java @@ -0,0 +1,156 @@ +/** + * RoleDefinition.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class RoleDefinition implements java.io.Serializable { + private java.lang.String name; + private org.alfresco.repo.webservice.types.Cardinality cardinality; + + public RoleDefinition() { + } + + public RoleDefinition( + java.lang.String name, + org.alfresco.repo.webservice.types.Cardinality cardinality) { + this.name = name; + this.cardinality = cardinality; + } + + + /** + * Gets the name value for this RoleDefinition. + * + * @return name + */ + public java.lang.String getName() { + return name; + } + + + /** + * Sets the name value for this RoleDefinition. + * + * @param name + */ + public void setName(java.lang.String name) { + this.name = name; + } + + + /** + * Gets the cardinality value for this RoleDefinition. + * + * @return cardinality + */ + public org.alfresco.repo.webservice.types.Cardinality getCardinality() { + return cardinality; + } + + + /** + * Sets the cardinality value for this RoleDefinition. + * + * @param cardinality + */ + public void setCardinality(org.alfresco.repo.webservice.types.Cardinality cardinality) { + this.cardinality = cardinality; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof RoleDefinition)) return false; + RoleDefinition other = (RoleDefinition) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.name==null && other.getName()==null) || + (this.name!=null && + this.name.equals(other.getName()))) && + ((this.cardinality==null && other.getCardinality()==null) || + (this.cardinality!=null && + this.cardinality.equals(other.getCardinality()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getName() != null) { + _hashCode += getName().hashCode(); + } + if (getCardinality() != null) { + _hashCode += getCardinality().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(RoleDefinition.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "RoleDefinition")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("name"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "name")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("cardinality"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "cardinality")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Cardinality")); + elemField.setMinOccurs(0); + 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/types/Store.java b/source/generated/org/alfresco/repo/webservice/types/Store.java new file mode 100644 index 0000000000..ae4de7acb7 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/Store.java @@ -0,0 +1,154 @@ +/** + * Store.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class Store implements java.io.Serializable { + private org.alfresco.repo.webservice.types.StoreEnum scheme; + private java.lang.String address; + + public Store() { + } + + public Store( + org.alfresco.repo.webservice.types.StoreEnum scheme, + java.lang.String address) { + this.scheme = scheme; + this.address = address; + } + + + /** + * Gets the scheme value for this Store. + * + * @return scheme + */ + public org.alfresco.repo.webservice.types.StoreEnum getScheme() { + return scheme; + } + + + /** + * Sets the scheme value for this Store. + * + * @param scheme + */ + public void setScheme(org.alfresco.repo.webservice.types.StoreEnum scheme) { + this.scheme = scheme; + } + + + /** + * Gets the address value for this Store. + * + * @return address + */ + public java.lang.String getAddress() { + return address; + } + + + /** + * Sets the address value for this Store. + * + * @param address + */ + public void setAddress(java.lang.String address) { + this.address = address; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof Store)) return false; + Store other = (Store) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.scheme==null && other.getScheme()==null) || + (this.scheme!=null && + this.scheme.equals(other.getScheme()))) && + ((this.address==null && other.getAddress()==null) || + (this.address!=null && + this.address.equals(other.getAddress()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getScheme() != null) { + _hashCode += getScheme().hashCode(); + } + if (getAddress() != null) { + _hashCode += getAddress().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(Store.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Store")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("scheme"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "scheme")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "StoreEnum")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("address"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "address")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", ">Store>address")); + 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/types/StoreEnum.java b/source/generated/org/alfresco/repo/webservice/types/StoreEnum.java new file mode 100644 index 0000000000..0280d3bc74 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/StoreEnum.java @@ -0,0 +1,78 @@ +/** + * StoreEnum.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class StoreEnum implements java.io.Serializable { + private java.lang.String _value_; + private static java.util.HashMap _table_ = new java.util.HashMap(); + + // Constructor + protected StoreEnum(java.lang.String value) { + _value_ = value; + _table_.put(_value_,this); + } + + public static final java.lang.String _workspace = "workspace"; + public static final java.lang.String _versionStore = "versionStore"; + public static final java.lang.String _user = "user"; + public static final java.lang.String _search = "search"; + public static final java.lang.String _http = "http"; + public static final java.lang.String _system = "system"; + public static final StoreEnum workspace = new StoreEnum(_workspace); + public static final StoreEnum versionStore = new StoreEnum(_versionStore); + public static final StoreEnum user = new StoreEnum(_user); + public static final StoreEnum search = new StoreEnum(_search); + public static final StoreEnum http = new StoreEnum(_http); + public static final StoreEnum system = new StoreEnum(_system); + public java.lang.String getValue() { return _value_;} + public static StoreEnum fromValue(java.lang.String value) + throws java.lang.IllegalArgumentException { + StoreEnum enumeration = (StoreEnum) + _table_.get(value); + if (enumeration==null) throw new java.lang.IllegalArgumentException(); + return enumeration; + } + public static StoreEnum fromString(java.lang.String value) + throws java.lang.IllegalArgumentException { + return fromValue(value); + } + public boolean equals(java.lang.Object obj) {return (obj == this);} + public int hashCode() { return toString().hashCode();} + public java.lang.String toString() { return _value_;} + public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} + 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.EnumSerializer( + _javaType, _xmlType); + } + 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.EnumDeserializer( + _javaType, _xmlType); + } + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(StoreEnum.class); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "StoreEnum")); + } + /** + * Return type metadata object + */ + public static org.apache.axis.description.TypeDesc getTypeDesc() { + return typeDesc; + } + +} diff --git a/source/generated/org/alfresco/repo/webservice/types/ValueDefinition.java b/source/generated/org/alfresco/repo/webservice/types/ValueDefinition.java new file mode 100644 index 0000000000..66eb6a81b7 --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/ValueDefinition.java @@ -0,0 +1,226 @@ +/** + * ValueDefinition.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class ValueDefinition implements java.io.Serializable { + private java.lang.String name; + private java.lang.String title; + private java.lang.String description; + private java.lang.String dataType; + + public ValueDefinition() { + } + + public ValueDefinition( + java.lang.String name, + java.lang.String title, + java.lang.String description, + java.lang.String dataType) { + this.name = name; + this.title = title; + this.description = description; + this.dataType = dataType; + } + + + /** + * Gets the name value for this ValueDefinition. + * + * @return name + */ + public java.lang.String getName() { + return name; + } + + + /** + * Sets the name value for this ValueDefinition. + * + * @param name + */ + public void setName(java.lang.String name) { + this.name = name; + } + + + /** + * Gets the title value for this ValueDefinition. + * + * @return title + */ + public java.lang.String getTitle() { + return title; + } + + + /** + * Sets the title value for this ValueDefinition. + * + * @param title + */ + public void setTitle(java.lang.String title) { + this.title = title; + } + + + /** + * Gets the description value for this ValueDefinition. + * + * @return description + */ + public java.lang.String getDescription() { + return description; + } + + + /** + * Sets the description value for this ValueDefinition. + * + * @param description + */ + public void setDescription(java.lang.String description) { + this.description = description; + } + + + /** + * Gets the dataType value for this ValueDefinition. + * + * @return dataType + */ + public java.lang.String getDataType() { + return dataType; + } + + + /** + * Sets the dataType value for this ValueDefinition. + * + * @param dataType + */ + public void setDataType(java.lang.String dataType) { + this.dataType = dataType; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof ValueDefinition)) return false; + ValueDefinition other = (ValueDefinition) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.name==null && other.getName()==null) || + (this.name!=null && + this.name.equals(other.getName()))) && + ((this.title==null && other.getTitle()==null) || + (this.title!=null && + this.title.equals(other.getTitle()))) && + ((this.description==null && other.getDescription()==null) || + (this.description!=null && + this.description.equals(other.getDescription()))) && + ((this.dataType==null && other.getDataType()==null) || + (this.dataType!=null && + this.dataType.equals(other.getDataType()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getName() != null) { + _hashCode += getName().hashCode(); + } + if (getTitle() != null) { + _hashCode += getTitle().hashCode(); + } + if (getDescription() != null) { + _hashCode += getDescription().hashCode(); + } + if (getDataType() != null) { + _hashCode += getDataType().hashCode(); + } + __hashCodeCalc = false; + return _hashCode; + } + + // Type metadata + private static org.apache.axis.description.TypeDesc typeDesc = + new org.apache.axis.description.TypeDesc(ValueDefinition.class, true); + + static { + typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "ValueDefinition")); + org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("name"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "name")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("title"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "title")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("description"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "description")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); + elemField.setMinOccurs(0); + elemField.setNillable(false); + typeDesc.addFieldDesc(elemField); + elemField = new org.apache.axis.description.ElementDesc(); + elemField.setFieldName("dataType"); + elemField.setXmlName(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "dataType")); + elemField.setXmlType(new javax.xml.namespace.QName("http://www.alfresco.org/ws/model/content/1.0", "Name")); + 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/types/Version.java b/source/generated/org/alfresco/repo/webservice/types/Version.java new file mode 100644 index 0000000000..9023c25f8e --- /dev/null +++ b/source/generated/org/alfresco/repo/webservice/types/Version.java @@ -0,0 +1,311 @@ +/** + * Version.java + * + * This file was auto-generated from WSDL + * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. + */ + +package org.alfresco.repo.webservice.types; + +public class Version implements java.io.Serializable { + private org.alfresco.repo.webservice.types.Reference id; + private java.util.Calendar created; + private java.lang.String creator; + private java.lang.String label; + private boolean major; + private org.alfresco.repo.webservice.types.NamedValue[] commentaries; + + public Version() { + } + + public Version( + org.alfresco.repo.webservice.types.Reference id, + java.util.Calendar created, + java.lang.String creator, + java.lang.String label, + boolean major, + org.alfresco.repo.webservice.types.NamedValue[] commentaries) { + this.id = id; + this.created = created; + this.creator = creator; + this.label = label; + this.major = major; + this.commentaries = commentaries; + } + + + /** + * Gets the id value for this Version. + * + * @return id + */ + public org.alfresco.repo.webservice.types.Reference getId() { + return id; + } + + + /** + * Sets the id value for this Version. + * + * @param id + */ + public void setId(org.alfresco.repo.webservice.types.Reference id) { + this.id = id; + } + + + /** + * Gets the created value for this Version. + * + * @return created + */ + public java.util.Calendar getCreated() { + return created; + } + + + /** + * Sets the created value for this Version. + * + * @param created + */ + public void setCreated(java.util.Calendar created) { + this.created = created; + } + + + /** + * Gets the creator value for this Version. + * + * @return creator + */ + public java.lang.String getCreator() { + return creator; + } + + + /** + * Sets the creator value for this Version. + * + * @param creator + */ + public void setCreator(java.lang.String creator) { + this.creator = creator; + } + + + /** + * Gets the label value for this Version. + * + * @return label + */ + public java.lang.String getLabel() { + return label; + } + + + /** + * Sets the label value for this Version. + * + * @param label + */ + public void setLabel(java.lang.String label) { + this.label = label; + } + + + /** + * Gets the major value for this Version. + * + * @return major + */ + public boolean isMajor() { + return major; + } + + + /** + * Sets the major value for this Version. + * + * @param major + */ + public void setMajor(boolean major) { + this.major = major; + } + + + /** + * Gets the commentaries value for this Version. + * + * @return commentaries + */ + public org.alfresco.repo.webservice.types.NamedValue[] getCommentaries() { + return commentaries; + } + + + /** + * Sets the commentaries value for this Version. + * + * @param commentaries + */ + public void setCommentaries(org.alfresco.repo.webservice.types.NamedValue[] commentaries) { + this.commentaries = commentaries; + } + + public org.alfresco.repo.webservice.types.NamedValue getCommentaries(int i) { + return this.commentaries[i]; + } + + public void setCommentaries(int i, org.alfresco.repo.webservice.types.NamedValue _value) { + this.commentaries[i] = _value; + } + + private java.lang.Object __equalsCalc = null; + public synchronized boolean equals(java.lang.Object obj) { + if (!(obj instanceof Version)) return false; + Version other = (Version) obj; + if (obj == null) return false; + if (this == obj) return true; + if (__equalsCalc != null) { + return (__equalsCalc == obj); + } + __equalsCalc = obj; + boolean _equals; + _equals = true && + ((this.id==null && other.getId()==null) || + (this.id!=null && + this.id.equals(other.getId()))) && + ((this.created==null && other.getCreated()==null) || + (this.created!=null && + this.created.equals(other.getCreated()))) && + ((this.creator==null && other.getCreator()==null) || + (this.creator!=null && + this.creator.equals(other.getCreator()))) && + ((this.label==null && other.getLabel()==null) || + (this.label!=null && + this.label.equals(other.getLabel()))) && + this.major == other.isMajor() && + ((this.commentaries==null && other.getCommentaries()==null) || + (this.commentaries!=null && + java.util.Arrays.equals(this.commentaries, other.getCommentaries()))); + __equalsCalc = null; + return _equals; + } + + private boolean __hashCodeCalc = false; + public synchronized int hashCode() { + if (__hashCodeCalc) { + return 0; + } + __hashCodeCalc = true; + int _hashCode = 1; + if (getId() != null) { + _hashCode += getId().hashCode(); + } + if (getCreated() != null) { + _hashCode += getCreated().hashCode(); + } + if (getCreator() != null) { + _hashCode += getCreator().hashCode(); + } + if (getLabel() != null) { + _hashCode += getLabel().hashCode(); + } + _hashCode += (isMajor() ? Boolean.TRUE : Boolean.FALSE).hashCode(); + if (getCommentaries() != null) { + for (int i=0; + iTicketHolder.ticket so that all subclass implementations can + * use it to call other services. + * + * @see junit.framework.TestCase#setUp() + * @author gavinc + */ +public abstract class BaseWebServiceSystemTest extends BaseTest +{ + private static Log logger = LogFactory + .getLog(BaseWebServiceSystemTest.class); + + protected static final String USERNAME = "admin"; + protected static final String PASSWORD = "admin"; + + private Properties properties; + private Store store; + private Reference rootNodeReference; + private Reference contentReference; + + protected RepositoryServiceSoapBindingStub repositoryService; + protected ContentServiceSoapBindingStub contentService; + + public BaseWebServiceSystemTest() + { + try + { + EngineConfiguration config = new FileProvider(getResourcesDir(), "client-deploy.wsdd"); + this.contentService = (ContentServiceSoapBindingStub)new ContentServiceLocator(config).getContentService(); + assertNotNull(this.contentService); + this.contentService.setTimeout(60000); + + this.repositoryService = (RepositoryServiceSoapBindingStub)new RepositoryServiceLocator(config).getRepositoryService(); + assertNotNull(this.repositoryService); + this.repositoryService.setTimeout(60000); + } + catch (Exception e) + { + fail("Could not instantiate the content service" + e.toString()); + } + } + + /** + * Calls the AuthenticationService to retrieve a ticket for all tests to + * use. + */ + @Override + protected void setUp() throws Exception + { + super.setUp(); + AuthenticationServiceSoapBindingStub authSvc = null; + try + { + authSvc = (AuthenticationServiceSoapBindingStub) new AuthenticationServiceLocator() + .getAuthenticationService(); + } catch (ServiceException jre) + { + if (jre.getLinkedCause() != null) + { + jre.getLinkedCause().printStackTrace(); + } + + throw new AssertionFailedError("JAX-RPC ServiceException caught: " + + jre); + } + assertNotNull("authSvc is null", authSvc); + + // Time out after a minute + authSvc.setTimeout(60000); + + // call the authenticate method and retrieve the ticket + AuthenticationResult result = authSvc.startSession(USERNAME, PASSWORD); + assertNotNull("result is null", result); + + String ticket = result.getTicket(); + assertNotNull("ticket is null", ticket); + + TicketHolder.ticket = ticket; + if (logger.isDebugEnabled()) + { + logger.debug("Retrieved and stored ticket: " + TicketHolder.ticket); + } + } + + protected Store getStore() + { + if (this.store == null) + { + String strStoreRef = getProperties().getProperty( + WebServiceBootstrapSystemTest.PROP_STORE_REF); + StoreRef storeRef = new StoreRef(strStoreRef); + this.store = new Store(StoreEnum.fromValue(storeRef.getProtocol()), + storeRef.getIdentifier()); + } + return this.store; + } + + protected Reference getRootNodeReference() + { + if (this.rootNodeReference == null) + { + String strNodeRef = getProperties().getProperty( + WebServiceBootstrapSystemTest.PROP_ROOT_NODE_REF); + NodeRef rootNodeRef = new NodeRef(strNodeRef); + this.rootNodeReference = new Reference(getStore(), rootNodeRef + .getId(), null); + } + return this.rootNodeReference; + } + + protected Reference getContentReference() + { + if (this.contentReference == null) + { + String strNodeRef = getProperties().getProperty(WebServiceBootstrapSystemTest.PROP_CONTENT_NODE_REF); + NodeRef nodeRef = new NodeRef(strNodeRef); + this.contentReference = new Reference(getStore(), nodeRef.getId(), null); + } + return this.contentReference; + } + + protected ParentReference getFolderParentReference(QName assocName) + { + NodeRef folderNodeRef = getFolderNodeRef(); + ParentReference parentReference = new ParentReference(); + parentReference.setStore(getStore()); + parentReference.setUuid(folderNodeRef.getId()); + parentReference.setAssociationType(ContentModel.ASSOC_CONTAINS.toString()); + parentReference.setChildName(assocName.toString()); + return parentReference; + } + + protected Reference createContentAtRoot(String name, String contentValue) throws Exception + { + ParentReference parentRef = new ParentReference(); + parentRef.setStore(getStore()); + parentRef.setUuid(getRootNodeReference().getUuid()); + parentRef.setAssociationType(ContentModel.ASSOC_CHILDREN.toString()); + parentRef.setChildName(ContentModel.ASSOC_CHILDREN.toString()); + + NamedValue[] properties = new NamedValue[]{new NamedValue(ContentModel.PROP_NAME.toString(), name)}; + CMLCreate create = new CMLCreate("1", parentRef, ContentModel.TYPE_CONTENT.toString(), properties); + CML cml = new CML(); + cml.setCreate(new CMLCreate[]{create}); + UpdateResult[] result = this.repositoryService.update(cml); + + Reference newContentNode = result[0].getDestination(); + + Content content = this.contentService.write(newContentNode, ContentModel.PROP_CONTENT.toString(), contentValue.getBytes(), new ContentFormat("text/plain", "UTF-8")); + + assertNotNull(content); + assertNotNull(content.getFormat()); + assertEquals("text/plain", content.getFormat().getMimetype()); + + return content.getNode(); + } + + /** + * Get the content from the download servlet + * + * @param url + * @return + */ + protected String getContentAsString(String strUrl) throws Exception + { + // Add the ticket to the url + strUrl += "?ticket=" + TicketHolder.ticket; + + StringBuilder readContent = new StringBuilder(); + URL url = new URL(strUrl); + URLConnection conn = url.openConnection(); + InputStream is = conn.getInputStream(); + int read = is.read(); + while (read != -1) + { + readContent.append((char)read); + read = is.read(); + } + + return readContent.toString(); + } + + protected Predicate convertToPredicate(Reference reference) + { + Predicate predicate = new Predicate(); + predicate.setNodes(new Reference[] {reference}); + return predicate; + } + + private Properties getProperties() + { + if (this.properties == null) + { + this.properties = WebServiceBootstrapSystemTest + .getBootstrapProperties(); + } + return this.properties; + } + + private NodeRef getFolderNodeRef() + { + String strNodeRef = getProperties().getProperty(WebServiceBootstrapSystemTest.PROP_FOLDER_NODE_REF); + return new NodeRef(strNodeRef); + } +} diff --git a/source/java/org/alfresco/example/webservice/TicketHolder.java b/source/java/org/alfresco/example/webservice/TicketHolder.java new file mode 100644 index 0000000000..efd421a931 --- /dev/null +++ b/source/java/org/alfresco/example/webservice/TicketHolder.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.example.webservice; + +import java.io.IOException; + +import javax.security.auth.callback.Callback; +import javax.security.auth.callback.CallbackHandler; +import javax.security.auth.callback.UnsupportedCallbackException; + +import org.apache.ws.security.WSPasswordCallback; + +/** + * Implements CallbackHandler which returns the currently stored ticket in + * the static ticket field. + * + * @author gavinc + */ +public class TicketHolder implements CallbackHandler +{ + public static String ticket; + + /** + * @see javax.security.auth.callback.CallbackHandler#handle(javax.security.auth.callback.Callback[]) + */ + public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException + { + for (int i = 0; i < callbacks.length; i++) + { + if (callbacks[i] instanceof WSPasswordCallback) + { + WSPasswordCallback pc = (WSPasswordCallback)callbacks[i]; + pc.setPassword(ticket); + } + else + { + throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback"); + } + } + } +} diff --git a/source/java/org/alfresco/example/webservice/WebServiceBootstrapSystemTest.java b/source/java/org/alfresco/example/webservice/WebServiceBootstrapSystemTest.java new file mode 100644 index 0000000000..3f5e4c6ff3 --- /dev/null +++ b/source/java/org/alfresco/example/webservice/WebServiceBootstrapSystemTest.java @@ -0,0 +1,193 @@ +package org.alfresco.example.webservice; + +import java.io.BufferedReader; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +import javax.transaction.UserTransaction; + +import junit.framework.TestCase; + +import org.alfresco.error.AlfrescoRuntimeException; +import org.alfresco.model.ContentModel; +import org.alfresco.repo.content.MimetypeMap; +import org.alfresco.repo.security.authentication.AuthenticationComponent; +import org.alfresco.service.cmr.repository.ContentService; +import org.alfresco.service.cmr.repository.ContentWriter; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.cmr.repository.StoreRef; +import org.alfresco.service.cmr.view.ImporterService; +import org.alfresco.service.cmr.view.Location; +import org.alfresco.service.namespace.NamespaceService; +import org.alfresco.service.namespace.QName; +import org.alfresco.service.transaction.TransactionService; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +import com.sun.corba.se.impl.orb.ParserTable.TestContactInfoListFactory; + +public class WebServiceBootstrapSystemTest extends TestCase +{ + /** + * NOTE: You need to set the location of the indexes and content store to be a non-realtive + * location in the repository.properties file otherwise running this test here will not + * populate the correct index and content store and the test won't work when running against + * the repository + */ + + public static final String FOLDER_NAME = "test folder"; + public static final String CONTENT_NAME = "test content"; + + public static final String PROP_STORE_REF = "storeRef"; + public static final String PROP_ROOT_NODE_REF = "rootNodeRef"; + public static final String PROP_FOLDER_NODE_REF = "folderNodeRef"; + public static final String PROP_CONTENT_NODE_REF = "contentNodeRef"; + + private static final String TEMP_BOOTSTRAP_PROPERTIES = "./WebServiceTestBootstrap.properties"; + + private static final String TEST_CONTENT = "This is some test content. This is some test content."; + + + /** + * Runs the bootstrap and populates the property file with the infomration required for the tests + */ + public void testBootstrap() + { + ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:alfresco/application-context.xml"); + + // Get the services + TransactionService transactionService = (TransactionService)applicationContext.getBean("transactionComponent"); + AuthenticationComponent authenticationComponent = (AuthenticationComponent)applicationContext.getBean("authenticationComponent"); + NodeService nodeService = (NodeService)applicationContext.getBean("NodeService"); + ContentService contentService = (ContentService)applicationContext.getBean("contentService"); + ImporterService importerService = (ImporterService)applicationContext.getBean("importerComponent"); + + UserTransaction userTransaction = transactionService.getUserTransaction(); + authenticationComponent.setCurrentUser(authenticationComponent.getSystemUserName()); + try + { + + StoreRef storeRef = null; + NodeRef rootNodeRef = null; + NodeRef folderNodeRef = null; + NodeRef testContent = null; + + try + { + userTransaction.begin(); + + // Create the store + storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis()); + rootNodeRef = rootNodeRef = nodeService.getRootNode(storeRef); + + // Import the categories + InputStream viewStream = getClass().getClassLoader().getResourceAsStream("alfresco/bootstrap/categories.xml"); + BufferedReader reader = new BufferedReader(new InputStreamReader(viewStream)); + Location importLocation = new Location(storeRef); + importLocation.setPath("/"); + importerService.importView(reader, importLocation, null, null); + + // Folder properties + Map folderProps = new HashMap(1); + folderProps.put(ContentModel.PROP_NAME, FOLDER_NAME); + + // Create a folder + folderNodeRef = nodeService.createNode( + rootNodeRef, + ContentModel.ASSOC_CHILDREN, + ContentModel.ASSOC_CHILDREN, + ContentModel.TYPE_FOLDER, + folderProps).getChildRef(); + + Map contentProps = new HashMap(3); + contentProps.put(ContentModel.PROP_NAME, CONTENT_NAME); + + // Create some test content + testContent = nodeService.createNode( + rootNodeRef, + ContentModel.ASSOC_CHILDREN, + ContentModel.ASSOC_CHILDREN, + ContentModel.TYPE_CONTENT, + contentProps).getChildRef(); + ContentWriter writer = contentService.getWriter(testContent, ContentModel.PROP_CONTENT, true); + writer.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN); + writer.setEncoding("UTF-8"); + writer.putContent(TEST_CONTENT); + + // Add the translatable aspect to the test content + nodeService.addAspect(testContent, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "translatable"), null); + + // Create content to be the translation of the translatable content + NodeRef testContent2 = nodeService.createNode( + rootNodeRef, + ContentModel.ASSOC_CHILDREN, + ContentModel.ASSOC_CHILDREN, + ContentModel.TYPE_CONTENT, + contentProps).getChildRef(); + ContentWriter writer2 = contentService.getWriter(testContent2, ContentModel.PROP_CONTENT, true); + writer2.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN); + writer2.setEncoding("UTF-8"); + writer2.putContent(TEST_CONTENT); + + // Add the association from the master content to the translated content + nodeService.createAssociation(testContent, testContent2, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "translations")); + + userTransaction.commit(); + } + catch(Throwable e) + { + // rollback the transaction + try { if (userTransaction != null) {userTransaction.rollback();} } catch (Exception ex) {} + try {authenticationComponent.clearCurrentSecurityContext(); } catch (Exception ex) {} + throw new AlfrescoRuntimeException("Bootstrap failed", e); + } + + Properties properties = new Properties(); + properties.put(PROP_STORE_REF, storeRef.toString()); + properties.put(PROP_ROOT_NODE_REF, rootNodeRef.toString()); + properties.put(PROP_FOLDER_NODE_REF, folderNodeRef.toString()); + properties.put(PROP_CONTENT_NODE_REF, testContent.toString()); + + try + { + OutputStream outputStream = new FileOutputStream(TEMP_BOOTSTRAP_PROPERTIES); + properties.store(outputStream, "Web service node store details"); + outputStream.flush(); + } + catch (Exception e) + { + e.printStackTrace(); + fail("Unable to store bootstrap details."); + } + + //System.out.println(NodeStoreInspector.dumpNodeStore(nodeService, storeRef)); + } + finally + { + authenticationComponent.clearCurrentSecurityContext(); + } + } + + public static Properties getBootstrapProperties() + { + Properties properties = new Properties(); + try + { + InputStream inputStream = new FileInputStream(TEMP_BOOTSTRAP_PROPERTIES); + properties.load(inputStream); + } + catch (Exception e) + { + e.printStackTrace(); + fail("Unable to load test bootstrap details. Try running WebServiceBootstrapSystem test, then re-start container and try again."); + } + return properties; + } +} diff --git a/source/java/org/alfresco/example/webservice/WebServiceSuiteSystemTest.java b/source/java/org/alfresco/example/webservice/WebServiceSuiteSystemTest.java new file mode 100644 index 0000000000..6e30556bba --- /dev/null +++ b/source/java/org/alfresco/example/webservice/WebServiceSuiteSystemTest.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.example.webservice; + + +import junit.framework.Test; +import junit.framework.TestSuite; + +import org.alfresco.example.webservice.authentication.AuthenticationServiceSystemTest; +import org.alfresco.example.webservice.authoring.AuthoringServiceSystemTest; +import org.alfresco.example.webservice.classification.ClassificationServiceSystemTest; +import org.alfresco.example.webservice.content.ContentServiceSystemTest; +import org.alfresco.example.webservice.repository.RepositoryServiceSystemTest; +import org.alfresco.repo.webservice.CMLUtilTest; + +public class WebServiceSuiteSystemTest extends TestSuite +{ + public static Test suite() + { + TestSuite suite = new TestSuite(); + suite.addTestSuite(CMLUtilTest.class); + suite.addTestSuite(AuthenticationServiceSystemTest.class); + suite.addTestSuite(AuthoringServiceSystemTest.class); + suite.addTestSuite(ClassificationServiceSystemTest.class); + suite.addTestSuite(ContentServiceSystemTest.class); + suite.addTestSuite(RepositoryServiceSystemTest.class); + return suite; + } +} diff --git a/source/java/org/alfresco/example/webservice/authentication/AuthenticationServiceSystemTest.java b/source/java/org/alfresco/example/webservice/authentication/AuthenticationServiceSystemTest.java new file mode 100644 index 0000000000..e52af37dbb --- /dev/null +++ b/source/java/org/alfresco/example/webservice/authentication/AuthenticationServiceSystemTest.java @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.example.webservice.authentication; + +import javax.xml.rpc.ServiceException; + +import junit.framework.AssertionFailedError; + +import org.alfresco.util.BaseTest; + +/** + * Tests the AuthenticationService by trying to login as admin/admin and + * attempting to login with incorrect credentials. + * + * @author gavinc + */ +public class AuthenticationServiceSystemTest extends BaseTest +{ + private AuthenticationServiceSoapBindingStub binding; + + /** + * @see junit.framework.TestCase#setUp() + */ + @Override + protected void setUp() throws Exception + { + super.setUp(); + try + { + this.binding = (AuthenticationServiceSoapBindingStub)new AuthenticationServiceLocator().getAuthenticationService(); + } + catch (ServiceException jre) + { + if (jre.getLinkedCause() != null) + { + jre.getLinkedCause().printStackTrace(); + } + + throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre); + } + + assertNotNull("binding is null", this.binding); + + // Time out after a minute + binding.setTimeout(60000); + } + + /** + * Tests whether the authentication service is working correctly + * + * @throws Exception + */ + public void testSuccessfulLogin() throws Exception + { + try + { + AuthenticationResult value = this.binding.startSession("admin", "admin"); + assertNotNull("result must not be null", value); + System.out.println("ticket = " + value.getTicket()); + } + catch (AuthenticationFault error) + { + throw new AssertionFailedError("AuthenticationFault Exception caught: " + error); + } + } + + /** + * Tests that a failed authentication attempt fails as expected + * + * @throws Exception + */ + public void testFailedLogin() throws Exception + { + try + { + AuthenticationResult result = this.binding.startSession("wrong", "credentials"); + fail("The credentials are incorrect so an AuthenticationFault should have been thrown"); + } + catch (AuthenticationFault error) + { + // we expected this + } + } + + public void testEndSession() throws Exception + { + this.binding.startSession("admin", "admin"); + this.binding.endSession(); + } +} diff --git a/source/java/org/alfresco/example/webservice/authoring/AuthoringServiceSystemTest.java b/source/java/org/alfresco/example/webservice/authoring/AuthoringServiceSystemTest.java new file mode 100644 index 0000000000..acb6260440 --- /dev/null +++ b/source/java/org/alfresco/example/webservice/authoring/AuthoringServiceSystemTest.java @@ -0,0 +1,371 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.example.webservice.authoring; + + +import javax.xml.rpc.ServiceException; + +import junit.framework.AssertionFailedError; + +import org.alfresco.example.webservice.BaseWebServiceSystemTest; +import org.alfresco.example.webservice.content.Content; +import org.alfresco.example.webservice.types.ContentFormat; +import org.alfresco.example.webservice.types.NamedValue; +import org.alfresco.example.webservice.types.ParentReference; +import org.alfresco.example.webservice.types.Predicate; +import org.alfresco.example.webservice.types.Reference; +import org.alfresco.example.webservice.types.Version; +import org.alfresco.example.webservice.types.VersionHistory; +import org.alfresco.model.ContentModel; +import org.alfresco.repo.content.MimetypeMap; +import org.alfresco.service.namespace.QName; +import org.apache.axis.EngineConfiguration; +import org.apache.axis.configuration.FileProvider; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +public class AuthoringServiceSystemTest extends BaseWebServiceSystemTest +{ + @SuppressWarnings("unused") + private static Log logger = LogFactory.getLog(AuthoringServiceSystemTest.class); + + private static final String INITIAL_VERSION_CONTENT = "Content of the initial version"; + private static final String SECOND_VERSION_CONTENT = "The content for the second version is completely different"; + + private static final String VALUE_DESCRIPTION = "description"; + + private AuthoringServiceSoapBindingStub authoringService; + + @Override + protected void setUp() throws Exception + { + super.setUp(); + + try + { + EngineConfiguration config = new FileProvider(getResourcesDir(), + "client-deploy.wsdd"); + this.authoringService = (AuthoringServiceSoapBindingStub) new AuthoringServiceLocator( + config).getAuthoringService(); + } + catch (ServiceException jre) + { + if (jre.getLinkedCause() != null) + { + jre.getLinkedCause().printStackTrace(); + } + + throw new AssertionFailedError("JAX-RPC ServiceException caught: " + + jre); + } + + assertNotNull(this.authoringService); + + // Time out after a minute + this.authoringService.setTimeout(60000); + } + + /** + * Tests the checkout service method + * + * @throws Exception + */ + public void testCheckout() throws Exception + { + doCheckOut(); + + // TODO test multiple checkout + } + + /** + * Reusable method to do a standard checkout + * + * @return + * @throws Exception + */ + private Reference doCheckOut() throws Exception + { + // Use the helper to create the verionable node + Reference reference = createContentAtRoot("version_test.txt", INITIAL_VERSION_CONTENT); + Predicate predicate = convertToPredicate(reference); + + // Check the content out (to the same detination) + CheckoutResult result = this.authoringService.checkout(predicate, null); + assertNotNull(result); + assertEquals(1, result.getOriginals().length); + assertEquals(1, result.getWorkingCopies().length); + + // TODO need to check that the working copy and the origional are in the correct states ... + + return result.getWorkingCopies()[0]; + } + + /** + * Tests the checkout service method passing a destination for the working + * copy + * + * @throws Exception + */ + public void testCheckoutWithDestination() throws Exception + { + Reference reference = createContentAtRoot("version_test.txt", INITIAL_VERSION_CONTENT); + Predicate predicate = convertToPredicate(reference); + ParentReference parentReference = getFolderParentReference(QName.createQName("{test}workingCopy")); + + // Checkout the content to the folder + CheckoutResult result = this.authoringService.checkout(predicate, parentReference); + assertNotNull(result); + assertEquals(1, result.getOriginals().length); + assertEquals(1, result.getWorkingCopies().length); + + // TODO need to check that the working copy and the origional are in the correct states + } + + /** + * Tests the checkin service method + * + * @throws Exception + */ + public void testCheckin() throws Exception + { + // First we need to check a document out + Reference workingCopy = doCheckOut(); + + // Check in but keep checked out + Predicate predicate = convertToPredicate(workingCopy); + NamedValue[] comments = getVersionComments(); + CheckinResult checkinResult = this.authoringService.checkin(predicate, comments, true); + + // Check the result + assertNotNull(checkinResult); + assertEquals(1, checkinResult.getCheckedIn().length); + assertEquals(1, checkinResult.getWorkingCopies().length); + // TODO check that state of the orig and working copies + + // Checkin but don't keep checked out + Predicate predicate2 = convertToPredicate(checkinResult.getWorkingCopies()[0]); + CheckinResult checkinResult2 = this.authoringService.checkin(predicate2, comments, false); + + // Check the result + assertNotNull(checkinResult2); + assertEquals(1, checkinResult2.getCheckedIn().length); + assertNull(checkinResult2.getWorkingCopies()); + // TODO check the above behaviour ... + // TODO check that the state of the org and working copies + + // TODO check multiple checkin + } + + /** + * Helper method to get a list of version comments + * + * @return + */ + private NamedValue[] getVersionComments() + { + NamedValue[] comments = new NamedValue[1]; + comments[0] = new NamedValue(org.alfresco.service.cmr.version.Version.PROP_DESCRIPTION, VALUE_DESCRIPTION); + return comments; + } + + /** + * Tests the checkinExternal service method + * + * @throws Exception + */ + public void testCheckinExternal() throws Exception + { + // First we need to check a document out + Reference workingCopy = doCheckOut(); + + // Check in with external content + NamedValue[] comments = getVersionComments(); + ContentFormat contentFormat = new ContentFormat(MimetypeMap.MIMETYPE_TEXT_PLAIN, "UTF-8"); + Reference origionalNode = this.authoringService.checkinExternal(workingCopy, comments, false, contentFormat, SECOND_VERSION_CONTENT.getBytes()); + + // Check the origianl Node + assertNotNull(origionalNode); + Content[] contents = this.contentService.read(new Predicate(new Reference[]{origionalNode}, getStore(), null), ContentModel.PROP_CONTENT.toString()); + Content readResult = contents[0]; + assertNotNull(readResult); + String checkedInContent = getContentAsString(readResult.getUrl()); + assertNotNull(checkedInContent); + assertEquals(SECOND_VERSION_CONTENT, checkedInContent); + } + + /** + * Tests the cancelCheckout service method + * + * @throws Exception + */ + public void testCancelCheckout() throws Exception + { + // Check out a node + Reference workingCopy = doCheckOut(); + + // Cancel the check out + Predicate predicate = convertToPredicate(workingCopy); + CancelCheckoutResult result = this.authoringService.cancelCheckout(predicate); + + // Check the result + assertNotNull(result); + assertEquals(1, result.getOriginals().length); + // TODO check that state of the orig and that the working copy has been deleted + + // TODO I don't think that the working copies should be returned in the result since they have been deleted !! + } + + /** + * Tests the lock service methods, lock, unlock and getStaus + * + * @throws Exception + */ + public void testLockUnLockGetStatus() throws Exception + { + Reference reference = createContentAtRoot("lock_test1.txt", INITIAL_VERSION_CONTENT); + Predicate predicate = convertToPredicate(reference); + + // Get the status + checkLockStatus(predicate, null, null); + + // Lock with a write lock + Reference[] lockedRefs = this.authoringService.lock(predicate, false, LockTypeEnum.write); + assertNotNull(lockedRefs); + assertEquals(1, lockedRefs.length); + // TODO check in more detail + + // Get the status + checkLockStatus(predicate, USERNAME, LockTypeEnum.write); + + // Unlock (bad) +// try +// { +// this.authoringService.unlock(predicate, "bad", false); +// fail("This should have thrown an exception."); +// } +// catch (Throwable exception) +// { +// // Good .. we where expceting this +// } + + // Unlock (good) + Reference[] unlocked = this.authoringService.unlock(predicate, false); + assertNotNull(unlocked); + assertEquals(1, unlocked.length); + + // Get the status + checkLockStatus(predicate, null, null); + + // Read lock + Reference[] lockedRefs2 = this.authoringService.lock(predicate, false, LockTypeEnum.read); + + assertNotNull(lockedRefs2); + assertEquals(1, lockedRefs2.length); + // TODO check in more detail + + // Get the status + checkLockStatus(predicate, USERNAME, LockTypeEnum.read); + } + + private void checkLockStatus(Predicate predicate, String lockOwner, LockTypeEnum lockType) + throws Exception + { + LockStatus[] lockStatus1 = this.authoringService.getLockStatus(predicate); + assertNotNull(lockStatus1); + assertEquals(1, lockStatus1.length); + LockStatus ls1 = lockStatus1[0]; + assertNotNull(ls1); + assertEquals(lockOwner, ls1.getLockOwner()); + assertEquals(lockType, ls1.getLockType()); + } + + /** + * Tests the createVersion service method + * + * @throws Exception + */ + public void testVersionMethods() throws Exception + { + Reference reference = createContentAtRoot("create_version_test.txt", INITIAL_VERSION_CONTENT); + Predicate predicate = convertToPredicate(reference); + + // Get the version history (before its been versioned) + VersionHistory emptyVersionHistory = this.authoringService.getVersionHistory(reference); + assertNotNull(emptyVersionHistory); + assertNull(emptyVersionHistory.getVersions()); + + // Create the version + VersionResult result = this.authoringService.createVersion(predicate, getVersionComments(), false); + assertNotNull(result); + assertEquals(1, result.getNodes().length); + assertEquals(1, result.getVersions().length); + Version version = result.getVersions()[0]; + assertEquals("1.0", version.getLabel()); + // TODO check commentaries + // TODO check creator + + // Get the version history + VersionHistory versionHistory = this.authoringService.getVersionHistory(reference); + assertNotNull(versionHistory); + assertEquals(2, versionHistory.getVersions().length); + // TODO some more tests ... + + // Update the content + this.contentService.write(reference, ContentModel.PROP_CONTENT.toString(), SECOND_VERSION_CONTENT.getBytes(), null); + + // Create another version + VersionResult versionResult2 = this.authoringService.createVersion(predicate, getVersionComments(), false); + assertNotNull(versionResult2); + assertEquals(1, versionResult2.getNodes().length); + assertEquals(1, versionResult2.getVersions().length); + Version version2 = versionResult2.getVersions()[0]; + assertEquals("1.3", version2.getLabel()); + // TODO check commentaries + // TODO check creator + + // Check the version history + VersionHistory versionHistory2 = this.authoringService.getVersionHistory(reference); + assertNotNull(versionHistory2); + assertEquals(4, versionHistory2.getVersions().length); + // TODO some more tests ... + + // Confirm the current content of the node + Content[] contents = this.contentService.read(new Predicate(new Reference[]{reference}, getStore(), null), ContentModel.PROP_CONTENT.toString()); + Content readResult1 = contents[0]; + String content1 = getContentAsString(readResult1.getUrl()); + assertEquals(SECOND_VERSION_CONTENT, content1); + + // Revert the node to the first version + this.authoringService.revertVersion(reference, "1.0"); + + // Confirm that the state of the node has been reverted + Content[] contents2 = this.contentService.read(new Predicate(new Reference[]{reference}, getStore(), null), ContentModel.PROP_CONTENT.toString()); + Content readResult2 = contents2[0]; + String content2 = getContentAsString(readResult2.getUrl()); + assertEquals(INITIAL_VERSION_CONTENT, content2); + + // Now delete the version history + VersionHistory deletedVersionHistory = this.authoringService.deleteAllVersions(reference); + assertNotNull(deletedVersionHistory); + assertNull(deletedVersionHistory.getVersions()); + + // Check the version history + VersionHistory versionHistory3 = this.authoringService.getVersionHistory(reference); + assertNotNull(versionHistory3); + assertNull(versionHistory3.getVersions()); + } +} diff --git a/source/java/org/alfresco/example/webservice/classification/ClassificationServiceSystemTest.java b/source/java/org/alfresco/example/webservice/classification/ClassificationServiceSystemTest.java new file mode 100644 index 0000000000..c2a80c6275 --- /dev/null +++ b/source/java/org/alfresco/example/webservice/classification/ClassificationServiceSystemTest.java @@ -0,0 +1,199 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.example.webservice.classification; + +import javax.xml.rpc.ServiceException; + +import junit.framework.AssertionFailedError; + +import org.alfresco.example.webservice.BaseWebServiceSystemTest; +import org.alfresco.example.webservice.types.Category; +import org.alfresco.example.webservice.types.ClassDefinition; +import org.alfresco.example.webservice.types.Classification; +import org.alfresco.example.webservice.types.Predicate; +import org.alfresco.example.webservice.types.Reference; +import org.alfresco.util.GUID; +import org.apache.axis.EngineConfiguration; +import org.apache.axis.configuration.FileProvider; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +public class ClassificationServiceSystemTest extends BaseWebServiceSystemTest +{ + private static Log logger = LogFactory + .getLog(ClassificationServiceSystemTest.class); + + private ClassificationServiceSoapBindingStub classificationService; + + @Override + protected void setUp() throws Exception + { + super.setUp(); + + try + { + EngineConfiguration config = new FileProvider(getResourcesDir(), + "client-deploy.wsdd"); + this.classificationService = (ClassificationServiceSoapBindingStub) new ClassificationServiceLocator( + config).getClassificationService(); + } catch (ServiceException jre) + { + if (jre.getLinkedCause() != null) + { + jre.getLinkedCause().printStackTrace(); + } + + throw new AssertionFailedError("JAX-RPC ServiceException caught: " + + jre); + } + + assertNotNull("contentService is null", this.classificationService); + + // Time out after a minute + this.classificationService.setTimeout(60000); + } + + /** + * Tests the getClassifications service method + * + * @throws Exception + */ + public void testGetClassifications() throws Exception + { + Classification[] classifications = this.classificationService + .getClassifications(getStore()); + + assertNotNull(classifications); + assertTrue((classifications.length != 0)); + Classification classification = classifications[0]; + assertNotNull(classification.getTitle()); + assertNotNull(classification.getRootCategory()); + assertNotNull(classification.getRootCategory().getId()); + assertNotNull(classification.getRootCategory().getTitle()); + + if (logger.isDebugEnabled() == true) + { + for (Classification item : classifications) + { + logger.debug( + "Classification '" + + item.getTitle() + + "' with root category '" + + item.getRootCategory().getTitle() + + "'"); + } + } + } + + /** + * Tests the getChildCategories service method + * + * @throws Exception + */ + public void testGetChildCategories() throws Exception + { + Classification[] classifications = this.classificationService.getClassifications(getStore()); + Reference parentCategory = classifications[0].getRootCategory().getId(); + + Category[] categories = this.classificationService.getChildCategories(parentCategory); + assertNotNull(categories); + assertTrue((categories.length != 0)); + Category item = categories[0]; + assertNotNull(item.getId()); + assertNotNull(item.getTitle()); + + if (logger.isDebugEnabled() == true) + { + for (Category category : categories) + { + logger.debug( + "Sub-category '" + + category.getTitle() + + "'"); + } + } + } + + /** + * Tests the getCategories and setCategories service methods + * + * @throws Exception + */ + public void testGetAndSetCategories() throws Exception + { + Classification[] classifications = this.classificationService.getClassifications(getStore()); + String classification = classifications[0].getClassification(); + Reference category = classifications[0].getRootCategory().getId(); + + Reference reference = createContentAtRoot(GUID.generate(), "Any old content."); + Predicate predicate = convertToPredicate(reference); + + // First try and get the categories for a uncategoried node + CategoriesResult[] result1 = this.classificationService.getCategories(predicate); + assertNotNull(result1); + assertEquals(1, result1.length); + assertNull(result1[0].getCategories()); + + AppliedCategory appliedCategory = new AppliedCategory(); + appliedCategory.setCategories(new Reference[]{category}); + appliedCategory.setClassification(classification); + + AppliedCategory[] appliedCategories = new AppliedCategory[]{appliedCategory}; + + // Now classify the node + CategoriesResult[] result2 = this.classificationService.setCategories(predicate, appliedCategories); + assertNotNull(result2); + assertEquals(1, result2.length); + + // Now get the value back + CategoriesResult[] result3 = this.classificationService.getCategories(predicate); + assertNotNull(result3); + assertEquals(1, result3.length); + CategoriesResult categoryResult = result3[0]; + assertEquals(reference.getUuid(), categoryResult.getNode().getUuid()); + AppliedCategory[] appCats = categoryResult.getCategories(); + assertNotNull(appCats); + assertEquals(1, appCats.length); + AppliedCategory appCat = appCats[0]; + assertEquals(classification, appCat.getClassification()); + Reference[] refs = appCat.getCategories(); + assertNotNull(refs); + assertEquals(1, refs.length); + Reference ref = refs[0]; + assertEquals(category.getUuid(), ref.getUuid()); + + // TODO test multiple classifiations + // TODO test clearing the classifications + // TODO test updating the classifications + } + + + /** + * Tests the describeClassification service method + * + * @throws Exception + */ + public void testDescribeClassification() throws Exception + { + Classification[] classifications = this.classificationService.getClassifications(getStore()); + String classification = classifications[0].getClassification(); + + ClassDefinition classDefinition = this.classificationService.describeClassification(classification); + + assertNotNull(classDefinition); + } +} diff --git a/source/java/org/alfresco/example/webservice/content/ContentServiceSystemTest.java b/source/java/org/alfresco/example/webservice/content/ContentServiceSystemTest.java new file mode 100644 index 0000000000..f731438456 --- /dev/null +++ b/source/java/org/alfresco/example/webservice/content/ContentServiceSystemTest.java @@ -0,0 +1,153 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.example.webservice.content; + +import org.alfresco.example.webservice.BaseWebServiceSystemTest; +import org.alfresco.example.webservice.repository.UpdateResult; +import org.alfresco.example.webservice.types.CML; +import org.alfresco.example.webservice.types.CMLCreate; +import org.alfresco.example.webservice.types.ContentFormat; +import org.alfresco.example.webservice.types.NamedValue; +import org.alfresco.example.webservice.types.ParentReference; +import org.alfresco.example.webservice.types.Predicate; +import org.alfresco.example.webservice.types.Reference; +import org.alfresco.model.ContentModel; +import org.alfresco.repo.content.MimetypeMap; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +public class ContentServiceSystemTest extends BaseWebServiceSystemTest +{ + private static final String CONTENT = "This is a small piece of content to test the create service call"; + private static final String UPDATED_CONTENT = "This is some updated content to test the write service call"; + + private String fileName = "unit-test.txt"; + + public void testContentService() + throws Exception + { + ParentReference parentRef = new ParentReference(); + parentRef.setStore(getStore()); + parentRef.setUuid(getRootNodeReference().getUuid()); + parentRef.setAssociationType(ContentModel.ASSOC_CHILDREN.toString()); + parentRef.setChildName(ContentModel.ASSOC_CHILDREN.toString()); + + NamedValue[] properties = new NamedValue[]{new NamedValue(ContentModel.PROP_NAME.toString(), this.fileName)}; + CMLCreate create = new CMLCreate("1", parentRef, ContentModel.TYPE_CONTENT.toString(), properties); + CML cml = new CML(); + cml.setCreate(new CMLCreate[]{create}); + UpdateResult[] result = this.repositoryService.update(cml); + + Reference newContentNode = result[0].getDestination(); + String property = ContentModel.PROP_CONTENT.toString(); + Predicate predicate = new Predicate(new Reference[]{newContentNode}, getStore(), null); + + // First check a node that has no content set + Content[] contents1 = this.contentService.read(predicate, property); + assertNotNull(contents1); + assertEquals(1, contents1.length); + Content content1 = contents1[0]; + assertNotNull(content1); + assertEquals(0, content1.getLength()); + assertEquals(newContentNode.getUuid(), content1.getNode().getUuid()); + assertEquals(property, content1.getProperty()); + assertNull(content1.getUrl()); + assertNull(content1.getFormat()); + + // Write content + Content content2 = this.contentService.write(newContentNode, property, CONTENT.getBytes(), new ContentFormat(MimetypeMap.MIMETYPE_TEXT_PLAIN, "UTF-8")); + assertNotNull(content2); + assertTrue((content2.getLength() > 0)); + assertEquals(newContentNode.getUuid(), content2.getNode().getUuid()); + assertEquals(property, content2.getProperty()); + assertNotNull(content2.getUrl()); + assertNotNull(content2.getFormat()); + ContentFormat format2 = content2.getFormat(); + assertEquals(MimetypeMap.MIMETYPE_TEXT_PLAIN, format2.getMimetype()); + assertEquals("UTF-8", format2.getEncoding()); + assertEquals(CONTENT, getContentAsString(content2.getUrl())); + + // Read content + Content[] contents3 = this.contentService.read(predicate, property); + assertNotNull(contents3); + assertEquals(1, contents3.length); + Content content3 = contents3[0]; + assertNotNull(content3); + assertTrue((content3.getLength() > 0)); + assertEquals(newContentNode.getUuid(), content3.getNode().getUuid()); + assertEquals(property, content3.getProperty()); + assertNotNull(content3.getUrl()); + assertNotNull(content3.getFormat()); + ContentFormat format3 = content3.getFormat(); + assertEquals(MimetypeMap.MIMETYPE_TEXT_PLAIN, format3.getMimetype()); + assertEquals("UTF-8", format3.getEncoding()); + assertEquals(CONTENT, getContentAsString(content3.getUrl())); + + // Update content + Content content4 = this.contentService.write(newContentNode, property, UPDATED_CONTENT.getBytes(), new ContentFormat(MimetypeMap.MIMETYPE_TEXT_CSS, "UTF-8")); + assertNotNull(content4); + assertTrue((content4.getLength() > 0)); + assertEquals(newContentNode.getUuid(), content4.getNode().getUuid()); + assertEquals(property, content4.getProperty()); + assertNotNull(content4.getUrl()); + assertNotNull(content4.getFormat()); + ContentFormat format4 = content4.getFormat(); + assertEquals(MimetypeMap.MIMETYPE_TEXT_CSS, format4.getMimetype()); + assertEquals("UTF-8", format4.getEncoding()); + assertEquals(UPDATED_CONTENT, getContentAsString(content4.getUrl())); + + // Read updated content + Content[] contents5 = this.contentService.read(predicate, property); + assertNotNull(contents5); + assertEquals(1, contents5.length); + Content content5 = contents5[0]; + assertNotNull(content5); + assertTrue((content5.getLength() > 0)); + assertEquals(newContentNode.getUuid(), content5.getNode().getUuid()); + assertEquals(property, content5.getProperty()); + assertNotNull(content5.getUrl()); + assertNotNull(content5.getFormat()); + ContentFormat format5 = content5.getFormat(); + assertEquals(MimetypeMap.MIMETYPE_TEXT_CSS, format5.getMimetype()); + assertEquals("UTF-8", format5.getEncoding()); + assertEquals(UPDATED_CONTENT, getContentAsString(content5.getUrl())); + + // Clear content + Content[] contents6 = this.contentService.clear(predicate, property); + assertNotNull(contents6); + assertEquals(1, contents6.length); + Content content6 = contents6[0]; + assertNotNull(content6); + assertEquals(0, content6.getLength()); + assertEquals(newContentNode.getUuid(), content6.getNode().getUuid()); + assertEquals(property, content6.getProperty()); + assertNull(content6.getUrl()); + assertNull(content6.getFormat()); + + // Read cleared content + Content[] contents7 = this.contentService.read(predicate, property); + assertNotNull(contents7); + assertEquals(1, contents7.length); + Content content7 = contents7[0]; + assertNotNull(content7); + assertEquals(0, content7.getLength()); + assertEquals(newContentNode.getUuid(), content7.getNode().getUuid()); + assertEquals(property, content7.getProperty()); + assertNull(content7.getUrl()); + assertNull(content7.getFormat()); + } +} diff --git a/source/java/org/alfresco/example/webservice/repository/RepositoryServiceSystemTest.java b/source/java/org/alfresco/example/webservice/repository/RepositoryServiceSystemTest.java new file mode 100644 index 0000000000..0f87f86726 --- /dev/null +++ b/source/java/org/alfresco/example/webservice/repository/RepositoryServiceSystemTest.java @@ -0,0 +1,535 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.example.webservice.repository; + +import javax.xml.rpc.ServiceException; + +import junit.framework.AssertionFailedError; + +import org.alfresco.example.webservice.BaseWebServiceSystemTest; +import org.alfresco.example.webservice.WebServiceBootstrapSystemTest; +import org.alfresco.example.webservice.types.CML; +import org.alfresco.example.webservice.types.CMLAddAspect; +import org.alfresco.example.webservice.types.CMLCreate; +import org.alfresco.example.webservice.types.ClassDefinition; +import org.alfresco.example.webservice.types.NamedValue; +import org.alfresco.example.webservice.types.Node; +import org.alfresco.example.webservice.types.NodeDefinition; +import org.alfresco.example.webservice.types.ParentReference; +import org.alfresco.example.webservice.types.Predicate; +import org.alfresco.example.webservice.types.PropertyDefinition; +import org.alfresco.example.webservice.types.Query; +import org.alfresco.example.webservice.types.QueryConfiguration; +import org.alfresco.example.webservice.types.QueryLanguageEnum; +import org.alfresco.example.webservice.types.Reference; +import org.alfresco.example.webservice.types.ResultSet; +import org.alfresco.example.webservice.types.ResultSetRow; +import org.alfresco.example.webservice.types.ResultSetRowNode; +import org.alfresco.example.webservice.types.Store; +import org.alfresco.model.ContentModel; +import org.alfresco.repo.content.MimetypeMap; +import org.alfresco.service.cmr.repository.ContentData; +import org.alfresco.service.namespace.NamespaceService; +import org.alfresco.service.namespace.QName; +import org.apache.axis.EngineConfiguration; +import org.apache.axis.configuration.FileProvider; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +public class RepositoryServiceSystemTest extends BaseWebServiceSystemTest +{ + private static Log logger = LogFactory + .getLog(RepositoryServiceSystemTest.class); + + private RepositoryServiceSoapBindingStub repoService; + + @Override + protected void setUp() throws Exception + { + super.setUp(); + + try + { + EngineConfiguration config = new FileProvider(getResourcesDir(), + "client-deploy.wsdd"); + this.repoService = (RepositoryServiceSoapBindingStub) new RepositoryServiceLocator( + config).getRepositoryService(); + } catch (ServiceException jre) + { + if (jre.getLinkedCause() != null) + { + jre.getLinkedCause().printStackTrace(); + } + + throw new AssertionFailedError("JAX-RPC ServiceException caught: " + + jre); + } + + assertNotNull("repoService is null", this.repoService); + + // Time out after a minute + this.repoService.setTimeout(60000); + } + + /** + * Tests the getStores method + * + * @throws Exception + */ + public void testGetStores() throws Exception + { + Store[] stores = this.repoService.getStores(); + assertNotNull("Stores array should not be null", stores); + assertTrue("There should be at least 1 store", stores.length >= 1); + } + + /** + * Tests the query service call + * + * @throws Exception + */ + public void testQuery() throws Exception + { + // Query query = new Query(QueryLanguageEnum.lucene, "*"); + Query query = new Query(QueryLanguageEnum.lucene, + "( +@\\{http\\://www.alfresco.org/1.0\\}name:test*) OR TEXT:test*"); + + QueryResult queryResult = this.repoService.query(getStore(), query, + false); + assertNotNull("queryResult should not be null", queryResult); + + ResultSet resultSet = queryResult.getResultSet(); + assertNotNull("The result set should not be null", resultSet); + logger.debug("There are " + resultSet.getTotalRowCount() + " rows:"); + + if (resultSet.getTotalRowCount() > 0) + { + ResultSetRow[] rows = resultSet.getRows(); + for (int x = 0; x < rows.length; x++) + { + ResultSetRow row = rows[x]; + NamedValue[] columns = row.getColumns(); + for (int y = 0; y < columns.length; y++) + { + logger.debug("row " + x + ": " + + row.getColumns(y).getName() + " = " + + row.getColumns(y).getValue()); + } + } + } else + { + logger.debug("The query returned no results"); + fail("The query returned no results"); + } + } + + /** + * Tests the ability to retrieve the results of a query in batches + * + * @throws Exception + */ + public void testQuerySession() throws Exception + { + // define a query that will return a lot of hits i.e. EVERYTHING + Query query = new Query(QueryLanguageEnum.lucene, "*"); + + // add the query configuration header to the call + int batchSize = 5; + QueryConfiguration queryCfg = new QueryConfiguration(); + queryCfg.setFetchSize(batchSize); + this.repoService.setHeader(new RepositoryServiceLocator() + .getServiceName().getNamespaceURI(), "QueryHeader", queryCfg); + + // get the first set of results back + QueryResult queryResult = this.repoService.query(getStore(), query, + false); + assertNotNull("queryResult should not be null", queryResult); + String querySession = queryResult.getQuerySession(); + String origQuerySession = querySession; + assertNotNull("querySession should not be null", querySession); + + ResultSet resultSet = queryResult.getResultSet(); + assertNotNull("The result set should not be null", resultSet); + logger.debug("There are " + resultSet.getTotalRowCount() + + " rows in total"); + logger.debug("There are " + resultSet.getRows().length + + " rows in the first set"); + assertEquals("The result set size should be " + batchSize, batchSize, + resultSet.getRows().length); + + // get the next batch of results + queryResult = this.repoService.fetchMore(querySession); + assertNotNull("queryResult should not be null", queryResult); + querySession = queryResult.getQuerySession(); + assertNotNull("querySession should not be null", querySession); + + ResultSet resultSet2 = queryResult.getResultSet(); + assertNotNull("The second result set should not be null", resultSet2); + logger.debug("There are " + resultSet2.getRows().length + + " rows in the second set"); + assertEquals("The result set size should be " + batchSize, batchSize, + resultSet2.getRows().length); + + // get the rest of the results to make sure it finishes properly + while (querySession != null) + { + queryResult = this.repoService.fetchMore(querySession); + assertNotNull("queryResult returned in loop should not be null", + queryResult); + querySession = queryResult.getQuerySession(); + logger.debug("There were another " + + queryResult.getResultSet().getRows().length + + " rows returned"); + } + + // try and fetch some more results and we should get an error + try + { + queryResult = this.repoService.fetchMore(origQuerySession); + fail("We should have seen an error as all the results have been returned"); + } catch (Exception e) + { + // expected + } + } + + /** + * Tests the queryParents service method + * + * @throws Exception + */ + public void testQueryParents() throws Exception + { + // query for all the child nodes of the root + Reference node = getRootNodeReference(); + String rootId = node.getUuid(); + + QueryResult rootChildren = this.repoService.queryChildren(node); + + assertNotNull("rootChildren should not be null", rootChildren); + ResultSet rootChildrenResults = rootChildren.getResultSet(); + assertNotNull("rootChildrenResults should not be null", + rootChildrenResults); + assertTrue("There should be at least one child of the root node", + rootChildrenResults.getRows().length > 0); + + // get hold of the id of the first child + ResultSetRow firstRow = rootChildrenResults.getRows(0); + assertNotNull("getColumns() should not return null", firstRow + .getColumns()); + String id = firstRow.getNode().getId(); + logger.debug("Retrieving parents for first node found: " + id + "...."); + + node = new Reference(); + node.setStore(getStore()); + node.setUuid(id); + QueryResult parents = this.repoService.queryParents(node); + + assertNotNull("parents should not be null", parents); + ResultSet parentsResults = parents.getResultSet(); + assertNotNull("parentsResults should not be null", parentsResults); + assertTrue("There should be at least one parent", parentsResults + .getRows().length > 0); + + // show the results + boolean rootFound = false; + ResultSetRow[] rows = parentsResults.getRows(); + for (int x = 0; x < rows.length; x++) + { + ResultSetRow row = rows[x]; + assertNotNull("getColumns() should not return null", row + .getColumns()); + ResultSetRowNode rowNode = row.getNode(); + String nodeId = rowNode.getId(); + logger.debug("parent node = " + nodeId + ", type = " + + rowNode.getType()); + + if (nodeId.equals(rootId) == true) + { + rootFound = true; + } + } + + // make sure the root node was one of the parents + assertTrue("The root node was not found as one of the parents!!", + rootFound); + } + + /* + * Tests the queryAssociated service method + * + * @throws Exception + */ + public void testQueryAssociated() throws Exception + { + Reference contentRef = this.getContentReference(); + + Association association = new Association(QName.createQName(NamespaceService.CONTENT_MODEL_PREFIX, "translations").toString(), AssociationDirectionEnum.target); + QueryResult result = this.repoService.queryAssociated(contentRef, new Association[]{association}); + assertNotNull(result); + assertNotNull(result.getResultSet()); + assertNotNull(result.getResultSet().getRows()); + assertEquals(1, result.getResultSet().getRows().length); + } + + /** + * Tests the describe service method + * + * @throws Exception + */ + public void testDescribe() throws Exception + { + // get hold of a node we know some info about so we can test the + // returned values (the Alfresco Tutorial PDF) + Query query = new Query(QueryLanguageEnum.lucene, + "( +@\\{http\\://www.alfresco.org/1.0\\}name:test*) OR TEXT:test*"); + QueryResult queryResult = this.repoService.query(getStore(), query, + false); + assertNotNull("queryResult should not be null", queryResult); + ResultSet resultSet = queryResult.getResultSet(); + assertNotNull("The result set should not be null", resultSet); + assertTrue("There should be at least one result", resultSet + .getTotalRowCount() > 0); + String id = resultSet.getRows(0).getNode().getId(); + assertNotNull("Id of Alfresco Tutorial PDF should not be null", id); + + // create a predicate object to to send to describe method + Reference ref = new Reference(); + ref.setStore(getStore()); + ref.setUuid(id); + Predicate predicate = new Predicate(new Reference[] { ref }, null, null); + + // make the service call + NodeDefinition[] nodeDefs = this.repoService.describe(predicate); + assertNotNull("nodeDefs should not be null", nodeDefs); + assertTrue("There should only be one result", nodeDefs.length == 1); + + // get the result + NodeDefinition nodeDef = nodeDefs[0]; + assertNotNull("The nodeDef should not be null", nodeDef); + ClassDefinition typeDef = nodeDef.getType(); + assertNotNull("Type definition should not be null", typeDef); + + assertEquals("Type name is incorrect", + "{http://www.alfresco.org/model/content/1.0}content", typeDef + .getName()); + assertEquals("Superclass type name is incorrect", + "{http://www.alfresco.org/model/content/1.0}cmobject", typeDef + .getSuperClass()); + assertEquals("Type title is incorrect", "Content", typeDef.getTitle()); + assertEquals("Type description is incorrect", "Base Content Object", typeDef + .getDescription()); + assertFalse("Type is an aspect and it shouldn't be", typeDef + .isIsAspect()); + assertNull("There should not be any associations", typeDef + .getAssociations()); + assertNotNull("Properties should not be null", typeDef.getProperties()); + assertEquals("There should be 2 properties", 2, + typeDef.getProperties().length); + + // check the name and type of each of the properties + assertEquals("Property1 name is incorrect", + "{http://www.alfresco.org/model/content/1.0}content", typeDef + .getProperties(0).getName()); + assertEquals("Property1 type name is incorrect", + "{http://www.alfresco.org/model/dictionary/1.0}content", typeDef + .getProperties(0).getDataType()); + + assertEquals("Property5 name is incorrect", + "{http://www.alfresco.org/model/content/1.0}name", typeDef + .getProperties(1).getName()); + assertEquals("Property5 type name is incorrect", + "{http://www.alfresco.org/model/dictionary/1.0}text", typeDef + .getProperties(1).getDataType()); + + // check the aspects + ClassDefinition[] aspects = nodeDef.getAspects(); + assertNotNull("aspects should not be null", aspects); + assertEquals("There should be 2 aspects", 2, aspects.length); + + // check the first aspect + ClassDefinition aspect1 = aspects[0]; + assertEquals("Aspect1 name is incorrect", + "{http://www.alfresco.org/model/system/1.0}referenceable", + aspect1.getName()); + assertTrue("Aspect1 should be an aspect", aspect1.isIsAspect()); + assertNotNull("Aspect1 should have properties", aspect1.getProperties()); + assertEquals("Aspect1 has wrong number of properties", 3, aspect1 + .getProperties().length); + + // check the second aspect + ClassDefinition aspect2 = aspects[1]; + assertEquals("Aspect2 name is incorrect", + "{http://www.alfresco.org/model/content/1.0}auditable", aspect2 + .getName()); + assertTrue("Aspect2 should be an aspect", aspect2.isIsAspect()); + assertNotNull("Aspect2 should have properties", aspect2.getProperties()); + assertEquals("Aspect2 has wrong number of properties", 5, aspect2 + .getProperties().length); + } + + /** + * Tests passing a query in the predicate to return items to describe + * + * @throws Exception + */ + public void testPredicateQuery() throws Exception + { + // define a query to add to the predicate (get everything that mentions + // 'test') + Query query = new Query(QueryLanguageEnum.lucene, + "( +@\\{http\\://www.alfresco.org/1.0\\}name:test*) OR TEXT:test*"); + + Predicate predicate = new Predicate(); + predicate.setQuery(query); + predicate.setStore(getStore()); + + // call the service and make sure we get some details back + NodeDefinition[] nodeDefs = this.repoService.describe(predicate); + assertNotNull("nodeDefs should not be null", nodeDefs); + assertTrue("There should be at least one result", nodeDefs.length > 0); + + NodeDefinition nodeDef = nodeDefs[0]; + assertNotNull("The nodeDef should not be null", nodeDef); + ClassDefinition typeDef = nodeDef.getType(); + assertNotNull("Type definition should not be null", typeDef); + + logger.debug("type name = " + typeDef.getName()); + logger.debug("is aspect = " + typeDef.isIsAspect()); + PropertyDefinition[] propDefs = typeDef.getProperties(); + if (propDefs != null) + { + logger.debug("There are " + propDefs.length + " properties:"); + for (int x = 0; x < propDefs.length; x++) + { + PropertyDefinition propDef = propDefs[x]; + logger.debug("name = " + propDef.getName() + " type = " + + propDef.getDataType()); + } + } + } + + /** + * Tests the use of a path within a reference + * + * @throws Exception + */ + public void testPathReference() throws Exception + { + // setup a predicate to find the test folder using an xpath + Reference ref = new Reference(); + ref.setStore(getStore()); + ref.setPath("//*[@cm:name = '" + + WebServiceBootstrapSystemTest.FOLDER_NAME + "']"); + Predicate predicate = new Predicate(); + predicate.setNodes(new Reference[] { ref }); + + // call the service and make sure we get some details back + NodeDefinition[] nodeDefs = this.repoService.describe(predicate); + assertNotNull("nodeDefs should not be null", nodeDefs); + assertTrue("There should be at least one result", nodeDefs.length > 0); + + NodeDefinition nodeDef = nodeDefs[0]; + assertNotNull("The nodeDef should not be null", nodeDef); + ClassDefinition typeDef = nodeDef.getType(); + assertNotNull("Type definition should not be null", typeDef); + + logger.debug("type name = " + typeDef.getName()); + assertEquals("Type is incorrect", + "{http://www.alfresco.org/model/content/1.0}folder", typeDef + .getName()); + logger.debug("is aspect = " + typeDef.isIsAspect()); + assertFalse("Item should not be an aspect", typeDef.isIsAspect()); + PropertyDefinition[] propDefs = typeDef.getProperties(); + if (propDefs != null) + { + logger.debug("There are " + propDefs.length + " properties:"); + for (int x = 0; x < propDefs.length; x++) + { + PropertyDefinition propDef = propDefs[x]; + logger.debug("name = " + propDef.getName() + " type = " + + propDef.getDataType()); + } + } + } + + /** + * Tests the update service method + * + * @throws Exception + */ + public void testUpdate() throws Exception + { + CMLCreate create = new CMLCreate(); + create.setId("id1"); + create.setType(ContentModel.TYPE_CONTENT.toString()); + + ParentReference parentReference = new ParentReference(); + parentReference.setAssociationType(ContentModel.ASSOC_CHILDREN + .toString()); + parentReference.setChildName(ContentModel.ASSOC_CHILDREN.toString()); + parentReference.setStore(getStore()); + parentReference.setUuid(getRootNodeReference().getUuid()); + + create.setParent(parentReference); + create.setProperty(new NamedValue[] { + new NamedValue( + ContentModel.PROP_NAME.toString(), + "name"), + new NamedValue( + ContentModel.PROP_CONTENT.toString(), + new ContentData(null, MimetypeMap.MIMETYPE_TEXT_PLAIN, 0L, "UTF-8").toString()) + }); + + CMLAddAspect aspect = new CMLAddAspect(); + aspect.setAspect(ContentModel.ASPECT_VERSIONABLE.toString()); + aspect.setWhere_id("id1"); + + CML cml = new CML(); + cml.setCreate(new CMLCreate[]{create}); + cml.setAddAspect(new CMLAddAspect[]{aspect}); + + UpdateResult[] results = this.repoService.update(cml); + assertNotNull(results); + assertEquals(2, results.length); + } + + public void testGet() + throws Exception + { + Predicate predicate = new Predicate(null, getStore(), null); + Node[] nodes = this.repoService.get(predicate); + assertNotNull(nodes); + assertEquals(1, nodes.length); + + Node rootNode = nodes[0]; + assertEquals(getRootNodeReference().getUuid(), rootNode.getReference().getUuid()); + + logger.debug("Root node type = " + rootNode.getType()); + String aspects = ""; + for (String aspect : rootNode.getAspects()) + { + aspects += aspect + ", "; + } + logger.debug("Root node aspects = " + aspects); + for (NamedValue prop : rootNode.getProperties()) + { + logger.debug("Root node property " + prop.getName() + " = " + prop.getValue()); + } + + } +} diff --git a/source/java/org/alfresco/example/webservice/sample/WebServiceSample1.java b/source/java/org/alfresco/example/webservice/sample/WebServiceSample1.java new file mode 100644 index 0000000000..44d820b26a --- /dev/null +++ b/source/java/org/alfresco/example/webservice/sample/WebServiceSample1.java @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.example.webservice.sample; + +import java.io.ByteArrayInputStream; +import java.io.IOException; + +import javax.security.auth.callback.Callback; +import javax.security.auth.callback.CallbackHandler; +import javax.security.auth.callback.UnsupportedCallbackException; +import javax.xml.rpc.ServiceException; + +import org.alfresco.example.webservice.authentication.AuthenticationResult; +import org.alfresco.example.webservice.authentication.AuthenticationServiceLocator; +import org.alfresco.example.webservice.authentication.AuthenticationServiceSoapBindingStub; +import org.alfresco.example.webservice.repository.RepositoryServiceLocator; +import org.alfresco.example.webservice.repository.RepositoryServiceSoapBindingStub; +import org.alfresco.example.webservice.types.Store; +import org.apache.axis.EngineConfiguration; +import org.apache.axis.configuration.FileProvider; +import org.apache.ws.security.WSPasswordCallback; + +/** + * Web service sample 1. + *

+ * Connect to the reposity and get a list of all the stores available in the repository. + * + * @author Roy Wetherall + */ +public class WebServiceSample1 implements CallbackHandler +{ + /** Admin user name and password used to connect to the repository */ + public static final String USERNAME = "admin"; + public static final String PASSWORD = "admin"; + + /** The current ticket */ + public static String currentTicket; + + /** WS security information */ + public static final String WS_SECURITY_INFO = + "" + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + ""; + + /** + * Connect to the respository and print out the names of the available + * + * @param args + */ + public static void main(String[] args) + throws Exception + { + AuthenticationServiceSoapBindingStub authenticationService = (AuthenticationServiceSoapBindingStub)new AuthenticationServiceLocator().getAuthenticationService(); + + // Start the session + AuthenticationResult result = authenticationService.startSession(WebServiceSample1.USERNAME, WebServiceSample1.PASSWORD); + WebServiceSample1.currentTicket = result.getTicket(); + + // Get a reference to the respository web service + RepositoryServiceSoapBindingStub repositoryService = getRepositoryWebService(); + + // Get array of stores available in the repository + Store[] stores = repositoryService.getStores(); + if (stores == null) + { + // NOTE: empty array are returned as a null object, this is a issue with the generated web service code. + System.out.println("There are no stores avilable in the repository."); + } + else + { + // Output the names of all the stores available in the repository + System.out.println("The following stores are available in the repository:"); + for (Store store : stores) + { + System.out.println(store.getAddress()); + } + } + + // End the session + authenticationService.endSession(); + } + + /** + * Get the respository web service. + * + * @return the respository web service + * @throws ServiceException Service Exception + */ + public static RepositoryServiceSoapBindingStub getRepositoryWebService() throws ServiceException + { + // Create the respository service, adding the WS security header information + EngineConfiguration config = new FileProvider(new ByteArrayInputStream(WebServiceSample1.WS_SECURITY_INFO.getBytes())); + RepositoryServiceLocator repositoryServiceLocator = new RepositoryServiceLocator(config); + RepositoryServiceSoapBindingStub repositoryService = (RepositoryServiceSoapBindingStub)repositoryServiceLocator.getRepositoryService(); + return repositoryService; + } + + /** + * The implementation of the passwrod call back used by the WS Security + * + * @see javax.security.auth.callback.CallbackHandler#handle(javax.security.auth.callback.Callback[]) + */ + public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException + { + for (int i = 0; i < callbacks.length; i++) + { + if (callbacks[i] instanceof WSPasswordCallback) + { + WSPasswordCallback pc = (WSPasswordCallback)callbacks[i]; + pc.setPassword(currentTicket); + } + else + { + throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback"); + } + } + } +} diff --git a/source/java/org/alfresco/example/webservice/sample/WebServiceSample2.java b/source/java/org/alfresco/example/webservice/sample/WebServiceSample2.java new file mode 100644 index 0000000000..9f690a1cc0 --- /dev/null +++ b/source/java/org/alfresco/example/webservice/sample/WebServiceSample2.java @@ -0,0 +1,154 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.example.webservice.sample; + +import java.rmi.RemoteException; + +import javax.xml.rpc.ServiceException; + +import org.alfresco.example.webservice.authentication.AuthenticationResult; +import org.alfresco.example.webservice.authentication.AuthenticationServiceLocator; +import org.alfresco.example.webservice.authentication.AuthenticationServiceSoapBindingStub; +import org.alfresco.example.webservice.repository.QueryResult; +import org.alfresco.example.webservice.repository.RepositoryFault; +import org.alfresco.example.webservice.repository.RepositoryServiceSoapBindingStub; +import org.alfresco.example.webservice.types.NamedValue; +import org.alfresco.example.webservice.types.Query; +import org.alfresco.example.webservice.types.QueryLanguageEnum; +import org.alfresco.example.webservice.types.Reference; +import org.alfresco.example.webservice.types.ResultSet; +import org.alfresco.example.webservice.types.ResultSetRow; +import org.alfresco.example.webservice.types.Store; +import org.alfresco.example.webservice.types.StoreEnum; + +/** + * Web service sample 2 + *

+ * This sample shows how to execute a search using the repository web service and how to + * query for a nodes parents. + * + * @author Roy Wetherall + */ +public class WebServiceSample2 +{ + /** + * Main function + */ + public static void main(String[] args) + throws Exception + { + // Get the authentication service + AuthenticationServiceSoapBindingStub authenticationService = (AuthenticationServiceSoapBindingStub)new AuthenticationServiceLocator().getAuthenticationService(); + + // Start the session + AuthenticationResult result = authenticationService.startSession(WebServiceSample1.USERNAME, WebServiceSample1.PASSWORD); + WebServiceSample1.currentTicket = result.getTicket(); + + // Execute the search sample + executeSearch(); + + // End the session + authenticationService.endSession(); + } + + /** + * Executes a sample query and provides an example of using a parent query. + * + * @return returns a reference to a folder that is the parent of the search results + * ( used in further samples) + * @throws ServiceException Service exception + * @throws RemoteException Remove exception + * @throws RepositoryFault Repository fault + */ + public static Reference executeSearch() throws ServiceException, RemoteException, RepositoryFault + { + Reference parentReference = null; + + // Get a reference to the respository web service + RepositoryServiceSoapBindingStub repositoryService = WebServiceSample1.getRepositoryWebService(); + + // Create a store object referencing the main spaced store + Store store = new Store(StoreEnum.workspace, "SpacesStore"); + + // Create a query object, looking for all items with alfresco in the name of text + Query query = new Query(QueryLanguageEnum.lucene, "( +@\\{http\\://www.alfresco.org/1.0\\}name:alfresco*) OR TEXT:alfresco*"); + + // Execute the query + QueryResult queryResult = repositoryService.query(store, query, false); + + // Display the results + ResultSet resultSet = queryResult.getResultSet(); + ResultSetRow[] rows = resultSet.getRows(); + if (rows == null) + { + System.out.println("No query results found."); + } + else + { + System.out.println("Results from query:"); + outputResultSet(rows); + + // Get the id of the first result + String firstResultId = rows[0].getNode().getId(); + Reference reference = new Reference(store, firstResultId, null); + + // Get the parent(s) of the first result + QueryResult parentQueryResult = repositoryService.queryParents(reference); + + // Get the parent of the first result + ResultSet parentResultSet = parentQueryResult.getResultSet(); + ResultSetRow[] parentRows = parentResultSet.getRows(); + if (parentRows == null) + { + System.out.println("No query results found."); + } + else + { + System.out.println("Results from parent query:"); + outputResultSet(parentRows); + + // Return the first parent (we can use in other samples) + String firstParentId = parentRows[0].getNode().getId(); + parentReference = new Reference(store, firstParentId, null); + } + } + + return parentReference; + } + + /** + * Helper method to output the rows contained within a result set + * + * @param rows an array of rows + */ + public static void outputResultSet(ResultSetRow[] rows) + { + for (int x = 0; x < rows.length; x++) + { + ResultSetRow row = rows[x]; + + NamedValue[] columns = row.getColumns(); + for (int y = 0; y < columns.length; y++) + { + System.out.println("row " + x + ": " + + row.getColumns(y).getName() + " = " + + row.getColumns(y).getValue()); + } + } + } + +} diff --git a/source/java/org/alfresco/example/webservice/sample/WebServiceSample3.java b/source/java/org/alfresco/example/webservice/sample/WebServiceSample3.java new file mode 100644 index 0000000000..e99b3dfad8 --- /dev/null +++ b/source/java/org/alfresco/example/webservice/sample/WebServiceSample3.java @@ -0,0 +1,185 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.example.webservice.sample; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; + +import javax.xml.rpc.ServiceException; + +import org.alfresco.example.webservice.authentication.AuthenticationResult; +import org.alfresco.example.webservice.authentication.AuthenticationServiceLocator; +import org.alfresco.example.webservice.authentication.AuthenticationServiceSoapBindingStub; +import org.alfresco.example.webservice.content.Content; +import org.alfresco.example.webservice.content.ContentServiceLocator; +import org.alfresco.example.webservice.content.ContentServiceSoapBindingStub; +import org.alfresco.example.webservice.repository.UpdateResult; +import org.alfresco.example.webservice.types.CML; +import org.alfresco.example.webservice.types.CMLCreate; +import org.alfresco.example.webservice.types.ContentFormat; +import org.alfresco.example.webservice.types.NamedValue; +import org.alfresco.example.webservice.types.ParentReference; +import org.alfresco.example.webservice.types.Predicate; +import org.alfresco.example.webservice.types.Reference; +import org.alfresco.example.webservice.types.Store; +import org.alfresco.example.webservice.types.StoreEnum; +import org.alfresco.model.ContentModel; +import org.apache.axis.EngineConfiguration; +import org.apache.axis.configuration.FileProvider; + +/** + * Web service sample 3 + *

+ * This web service sample shows how new content can be added to the repository and how content + * can be read and updated via the web service API. + * + * @author Roy Wetherall + */ +public class WebServiceSample3 +{ + /** Content strings used in the sample */ + private static final String INITIAL_CONTENT = "This is some new content that I am adding to the repository"; + private static final String UPDATED_CONTENT = "This is the updated content"; + + /** The type of the association we are creating to the new content */ + private static final String ASSOC_CONTAINS = "{http://www.alfresco.org/model/content/1.0}contains"; + + /** + * Main function + */ + public static void main(String[] args) throws Exception + { + AuthenticationServiceSoapBindingStub authenticationService = (AuthenticationServiceSoapBindingStub)new AuthenticationServiceLocator().getAuthenticationService(); + + // Start the session + AuthenticationResult result = authenticationService.startSession(WebServiceSample1.USERNAME, WebServiceSample1.PASSWORD); + WebServiceSample1.currentTicket = result.getTicket(); + + // Get the content service + ContentServiceSoapBindingStub contentService = getContentWebService(); + + // Create new content in the respository + Reference newContentReference = createNewContent(contentService, "sampleThreeFileOne.txt", INITIAL_CONTENT); + + // Read the newly added content from the respository + Store store = new Store(StoreEnum.workspace, "SpacesStore"); + Content[] readResult = contentService.read( + new Predicate(new Reference[]{newContentReference}, store, null), + ContentModel.PROP_CONTENT.toString()); + Content content = readResult[0]; + + // Get the content from the download servlet using the URL and display it + System.out.println("The newly added content is:"); + System.out.println(getContentAsString(WebServiceSample1.currentTicket, content.getUrl())); + + // Update the content with something new + contentService.write(newContentReference, ContentModel.PROP_CONTENT.toString(), UPDATED_CONTENT.getBytes(), null); + + // Now output the updated content + Content[] readResult2 = contentService.read( + new Predicate(new Reference[]{newContentReference}, store, null), + ContentModel.PROP_CONTENT.toString()); + Content content2 = readResult2[0]; + System.out.println("The updated content is:"); + System.out.println(getContentAsString(WebServiceSample1.currentTicket, content2.getUrl())); + + // End the session + authenticationService.endSession(); + } + + /** + * Get the content web service + * + * @return content web service + * @throws ServiceException + */ + public static ContentServiceSoapBindingStub getContentWebService() throws ServiceException + { + // Create the content service, adding the WS security header information + EngineConfiguration config = new FileProvider(new ByteArrayInputStream(WebServiceSample1.WS_SECURITY_INFO.getBytes())); + ContentServiceLocator contentServiceLocator = new ContentServiceLocator(config); + ContentServiceSoapBindingStub contentService = (ContentServiceSoapBindingStub)contentServiceLocator.getContentService(); + return contentService; + } + + /** + * Helper method to create new content. + * + * @param contentService the content web service + * @param content the content itself + * @return a reference to the created content node + * @throws Exception + */ + public static Reference createNewContent(ContentServiceSoapBindingStub contentService, String name, String contentString) + throws Exception + { + // First we'll use the previous sample to get hold of a reference to a space that we can create the content within + Reference reference = WebServiceSample2.executeSearch(); + + // Create a parent reference, this contains information about the association we are createing to the new content and the + // parent of the new content (the space retrived from the search) + ParentReference parentReference = new ParentReference(ASSOC_CONTAINS, ASSOC_CONTAINS); + parentReference.setStore(reference.getStore()); + parentReference.setUuid(reference.getUuid()); + + // Define the content format for the content we are adding + ContentFormat contentFormat = new ContentFormat("text/plain", "UTF-8"); + + NamedValue[] properties = new NamedValue[]{new NamedValue(ContentModel.PROP_NAME.toString(), name)}; + CMLCreate create = new CMLCreate("1", parentReference, ContentModel.TYPE_CONTENT.toString(), properties); + CML cml = new CML(); + cml.setCreate(new CMLCreate[]{create}); + UpdateResult[] result = WebServiceSample1.getRepositoryWebService().update(cml); + + Reference newContentNode = result[0].getDestination(); + Content content = contentService.write(newContentNode, ContentModel.PROP_CONTENT.toString(), contentString.getBytes(), contentFormat); + + // Get a reference to the newly created content + return content.getNode(); + } + + /** + * This method gets the content from the download servlet for a given URL and returns it as a string. + * + * @param ticket the current ticket + * @param strUrl the content URL + * @return the content as a string + * @throws Exception + */ + public static String getContentAsString(String ticket, String strUrl) throws Exception + { + // Add the ticket to the url + strUrl += "?ticket=" + ticket; + + // Connect to donwload servlet + StringBuilder readContent = new StringBuilder(); + URL url = new URL(strUrl); + URLConnection conn = url.openConnection(); + InputStream is = conn.getInputStream(); + int read = is.read(); + while (read != -1) + { + readContent.append((char)read); + read = is.read(); + } + + // return content as a string + return readContent.toString(); + } +} diff --git a/source/java/org/alfresco/example/webservice/sample/WebServiceSample4.java b/source/java/org/alfresco/example/webservice/sample/WebServiceSample4.java new file mode 100644 index 0000000000..a2858071c5 --- /dev/null +++ b/source/java/org/alfresco/example/webservice/sample/WebServiceSample4.java @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.example.webservice.sample; + +import org.alfresco.example.webservice.authentication.AuthenticationResult; +import org.alfresco.example.webservice.authentication.AuthenticationServiceLocator; +import org.alfresco.example.webservice.authentication.AuthenticationServiceSoapBindingStub; +import org.alfresco.example.webservice.repository.RepositoryServiceSoapBindingStub; +import org.alfresco.example.webservice.repository.UpdateResult; +import org.alfresco.example.webservice.types.CML; +import org.alfresco.example.webservice.types.CMLAddAspect; +import org.alfresco.example.webservice.types.CMLCreate; +import org.alfresco.example.webservice.types.Node; +import org.alfresco.example.webservice.types.ParentReference; +import org.alfresco.example.webservice.types.Predicate; +import org.alfresco.example.webservice.types.Reference; +import org.alfresco.example.webservice.types.Store; +import org.alfresco.example.webservice.types.StoreEnum; +import org.alfresco.model.ContentModel; + +/** + * Web service sample 4 + *

+ * This sample shows how to construct and execute CML queries using the respository web service. + * + * @author Roy Wetherall + */ +public class WebServiceSample4 +{ + /** + * Main function + */ + public static void main(String[] args) + throws Exception + { + // Start the session + AuthenticationServiceSoapBindingStub authenticationService = (AuthenticationServiceSoapBindingStub)new AuthenticationServiceLocator().getAuthenticationService(); + AuthenticationResult result = authenticationService.startSession(WebServiceSample1.USERNAME, WebServiceSample1.PASSWORD); + WebServiceSample1.currentTicket = result.getTicket(); + + // Create a store object referencing the main spaced store + Store store = new Store(StoreEnum.workspace, "SpacesStore"); + + // Get the repository + RepositoryServiceSoapBindingStub repositoryService = WebServiceSample1.getRepositoryWebService(); + Reference folder = getTutorialFolder(store, repositoryService); + + // Create the CML structure + // When executed this cml update query will create a new content node beneth the tutorial folder and the add the + // versionable aspect to the newly created node + ParentReference parentReference = new ParentReference(ContentModel.ASSOC_CONTAINS.toString(), ContentModel.ASSOC_CONTAINS.toString()); + parentReference.setStore(store); + parentReference.setUuid(folder.getUuid()); + CMLCreate create = new CMLCreate("id1", parentReference, ContentModel.TYPE_CONTENT.toString(), null); + CMLAddAspect addAspect = new CMLAddAspect(ContentModel.ASPECT_VERSIONABLE.toString(), null, null, "id1"); + CML cml = new CML(); + cml.setCreate(new CMLCreate[]{create}); + cml.setAddAspect(new CMLAddAspect[]{addAspect}); + + // Execute the update + UpdateResult[] updateResults = repositoryService.update(cml); + + for (UpdateResult updateResult : updateResults) + { + String sourceId = "none"; + Reference source = updateResult.getSource(); + if (source != null) + { + sourceId = source.getUuid(); + } + + String destinationId = "none"; + Reference destination = updateResult.getDestination(); + if (destination != null) + { + destinationId = destination.getUuid(); + } + + System.out.println( + "Command = " + updateResult.getStatement() + + "; Source = " + sourceId + + "; Destination = " + destinationId); + } + + // End the session + authenticationService.endSession(); + } + + /** + * Get the space immediatly beneth company home call "Alfresco Tutorial" + * + * @param store + * @param repositoryService + * @return + * @throws Exception + */ + public static Reference getTutorialFolder(Store store, RepositoryServiceSoapBindingStub repositoryService) + throws Exception + { + Reference reference = new Reference(store, null, "/app:company_home/*[@cm:name=\"Alfresco Tutorial\"]"); + Predicate predicate = new Predicate(new Reference[]{reference}, null, null); + Node[] nodes = repositoryService.get(predicate); + return nodes[0].getReference(); + } + +} diff --git a/source/java/org/alfresco/example/webservice/sample/WebServiceSample5.java b/source/java/org/alfresco/example/webservice/sample/WebServiceSample5.java new file mode 100644 index 0000000000..a6851fb377 --- /dev/null +++ b/source/java/org/alfresco/example/webservice/sample/WebServiceSample5.java @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.example.webservice.sample; + +import java.io.ByteArrayInputStream; + +import javax.xml.rpc.ServiceException; + +import org.alfresco.example.webservice.authentication.AuthenticationResult; +import org.alfresco.example.webservice.authentication.AuthenticationServiceLocator; +import org.alfresco.example.webservice.authentication.AuthenticationServiceSoapBindingStub; +import org.alfresco.example.webservice.authoring.AuthoringServiceLocator; +import org.alfresco.example.webservice.authoring.AuthoringServiceSoapBindingStub; +import org.alfresco.example.webservice.authoring.CheckoutResult; +import org.alfresco.example.webservice.content.Content; +import org.alfresco.example.webservice.content.ContentServiceSoapBindingStub; +import org.alfresco.example.webservice.repository.RepositoryServiceSoapBindingStub; +import org.alfresco.example.webservice.types.CML; +import org.alfresco.example.webservice.types.CMLAddAspect; +import org.alfresco.example.webservice.types.ContentFormat; +import org.alfresco.example.webservice.types.NamedValue; +import org.alfresco.example.webservice.types.Predicate; +import org.alfresco.example.webservice.types.Reference; +import org.alfresco.example.webservice.types.Store; +import org.alfresco.example.webservice.types.StoreEnum; +import org.alfresco.example.webservice.types.Version; +import org.alfresco.example.webservice.types.VersionHistory; +import org.alfresco.model.ContentModel; +import org.alfresco.repo.content.MimetypeMap; +import org.apache.axis.EngineConfiguration; +import org.apache.axis.configuration.FileProvider; + +/** + * Web service sample 5 + *

+ * This sample shows how to check documents out, check them back in and then view the + * version history. + * + * @author Roy Wetherall + */ +public class WebServiceSample5 +{ + private final static String INITIAL_CONTENT = "This is the content pror to checkout"; + private final static String UPDATED_CONTENT = "This is the updated content"; + + private final static String VERSIONABLE_ASPECT = "{http://www.alfresco.org/model/content/1.0}versionable"; + + /** + * Main function + */ + public static void main(String[] args) + throws Exception + { + // Start the session + AuthenticationServiceSoapBindingStub authenticationService = (AuthenticationServiceSoapBindingStub)new AuthenticationServiceLocator().getAuthenticationService(); + AuthenticationResult result = authenticationService.startSession(WebServiceSample1.USERNAME, WebServiceSample1.PASSWORD); + WebServiceSample1.currentTicket = result.getTicket(); + + // Get the content and authoring service + RepositoryServiceSoapBindingStub repositoryService = WebServiceSample1.getRepositoryWebService(); + ContentServiceSoapBindingStub contentService = WebServiceSample3.getContentWebService(); + AuthoringServiceSoapBindingStub authoringService = WebServiceSample5.getAuthoringWebService(); + + // Get a reference to a newly created content + Reference contentReference = WebServiceSample3.createNewContent(contentService, "SampleFiveFileOne.txt", INITIAL_CONTENT); + + // Add the versionable aspect to the newly created content. This will allows the content to be versioned + makeVersionable(repositoryService, contentReference); + + // Checkout the newly created content, placing the working document in the same folder + Predicate itemsToCheckOut = new Predicate(new Reference[]{contentReference}, null, null); + CheckoutResult checkOutResult = authoringService.checkout(itemsToCheckOut, null); + + // Get a reference to the working copy + Reference workingCopyReference = checkOutResult.getWorkingCopies()[0]; + + // Update the content of the working copy + ContentFormat format = new ContentFormat(MimetypeMap.MIMETYPE_TEXT_PLAIN, "UTF-8"); + contentService.write(workingCopyReference, ContentModel.PROP_CONTENT.toString(), UPDATED_CONTENT.getBytes(), format); + + // Now check the working copy in with a description of the change made that will be recorded in the version history + Predicate predicate = new Predicate(new Reference[]{workingCopyReference}, null, null); + NamedValue[] comments = new NamedValue[]{new NamedValue("description", "The content has been updated")}; + authoringService.checkin(predicate, comments, false); + + // Output the updated content + Store store = new Store(StoreEnum.workspace, "SpacesStore"); + Content[] readResult = contentService.read( + new Predicate(new Reference[]{contentReference}, store, null), + ContentModel.PROP_CONTENT.toString()); + Content content = readResult[0]; + System.out.println("This is the checked-in content:"); + System.out.println(WebServiceSample3.getContentAsString(WebServiceSample1.currentTicket, content.getUrl())); + + // Get the version history + System.out.println("The version history:"); + VersionHistory versionHistory = authoringService.getVersionHistory(contentReference); + for (Version version : versionHistory.getVersions()) + { + // Output the version details + outputVersion(version); + } + + // End the session + authenticationService.endSession(); + } + + /** + * Get a reference to the authoring web service + * + * @return the authoring web service + * @throws ServiceException + */ + public static AuthoringServiceSoapBindingStub getAuthoringWebService() throws ServiceException + { + // Create the content service, adding the WS security header information + EngineConfiguration config = new FileProvider(new ByteArrayInputStream(WebServiceSample1.WS_SECURITY_INFO.getBytes())); + AuthoringServiceLocator authoringServiceLocator = new AuthoringServiceLocator(config); + AuthoringServiceSoapBindingStub authoringService = (AuthoringServiceSoapBindingStub)authoringServiceLocator.getAuthoringService(); + return authoringService; + } + + /** + * Helper method to make apply the versionable aspect to a given reference + *

+ * See sample 4 for more CML examples + * + * @param respositoryService the respository service + * @param reference the reference + * @throws Exception + */ + public static void makeVersionable(RepositoryServiceSoapBindingStub respositoryService, Reference reference) + throws Exception + { + // Create the add aspect query object + Predicate predicate = new Predicate(new Reference[]{reference}, null, null); + CMLAddAspect addAspect = new CMLAddAspect(VERSIONABLE_ASPECT, null, predicate, null); + + // Create the content management language query + CML cml = new CML(); + cml.setAddAspect(new CMLAddAspect[]{addAspect}); + + // Execute the query, which will add the versionable aspect to the node is question + respositoryService.update(cml); + } + + /** + * Helper to output the version details + * + * @param version the version + */ + private static void outputVersion(Version version) + { + System.out.println("Version label = " + version.getLabel() + "; Version description = " + version.getCommentaries()[0].getValue()); + } +} diff --git a/source/java/org/alfresco/example/webservice/sample/WebServiceSample6.java b/source/java/org/alfresco/example/webservice/sample/WebServiceSample6.java new file mode 100644 index 0000000000..8691cc339a --- /dev/null +++ b/source/java/org/alfresco/example/webservice/sample/WebServiceSample6.java @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.example.webservice.sample; + +import java.io.ByteArrayInputStream; + +import org.alfresco.example.webservice.authentication.AuthenticationResult; +import org.alfresco.example.webservice.authentication.AuthenticationServiceLocator; +import org.alfresco.example.webservice.authentication.AuthenticationServiceSoapBindingStub; +import org.alfresco.example.webservice.classification.ClassificationServiceLocator; +import org.alfresco.example.webservice.classification.ClassificationServiceSoapBindingStub; +import org.alfresco.example.webservice.repository.QueryResult; +import org.alfresco.example.webservice.repository.RepositoryServiceSoapBindingStub; +import org.alfresco.example.webservice.types.Category; +import org.alfresco.example.webservice.types.Classification; +import org.alfresco.example.webservice.types.Query; +import org.alfresco.example.webservice.types.QueryLanguageEnum; +import org.alfresco.example.webservice.types.Store; +import org.alfresco.example.webservice.types.StoreEnum; +import org.alfresco.repo.search.ISO9075; +import org.apache.axis.EngineConfiguration; +import org.apache.axis.configuration.FileProvider; + +/** + * Web service sample 6 + *

+ * Example showing how content can be queried for using categories + * + * @author Roy Wetherall + */ +public class WebServiceSample6 +{ + /** + * Main function + */ + public static void main(String[] args) + throws Exception + { + // Start the session + AuthenticationServiceSoapBindingStub authenticationService = (AuthenticationServiceSoapBindingStub)new AuthenticationServiceLocator().getAuthenticationService(); + AuthenticationResult result = authenticationService.startSession(WebServiceSample1.USERNAME, WebServiceSample1.PASSWORD); + WebServiceSample1.currentTicket = result.getTicket(); + + // Get the content and authoring service + RepositoryServiceSoapBindingStub repositoryService = WebServiceSample1.getRepositoryWebService(); + + // Get the classification service + EngineConfiguration config = new FileProvider(new ByteArrayInputStream(WebServiceSample1.WS_SECURITY_INFO.getBytes())); + ClassificationServiceSoapBindingStub classificationService = (ClassificationServiceSoapBindingStub) new ClassificationServiceLocator(config).getClassificationService(); + + // Create the store reference + Store store = new Store(StoreEnum.workspace, "SpacesStore"); + + // Get all the classifications + Classification[] classifications = classificationService.getClassifications(store); + + // Output some details + System.out.println("All classifications:"); + for (Classification classification : classifications) + { + System.out.println(classification.getClassification()); + System.out.println("Classification = " + classification.getTitle() + "; Root category = " + classification.getRootCategory().getTitle()); + } + + // Get the class definition for the classification we are interested in + Classification classification = classifications[0]; + + // Get the child categories + Category[] categories = null; + if (classifications.length > 0) + { + categories = classificationService.getChildCategories(classifications[0].getRootCategory().getId()); + if (categories != null) + { + // Output some details + System.out.println("The child categories of classification '" + classifications[0].getTitle() + "':"); + for (Category category : categories) + { + System.out.println("Title = " + category.getTitle()); + } + } + else + { + System.out.println("No child categories found."); + } + } + + // Now build a path query + StringBuilder pathQuery = new StringBuilder(128); + + //pathQuery.append("PATH:\"cm:generalclassifiable/cm:MyTestCategory/cm:One/member\""); + + // Encode the root category name + String encodedRoot = ISO9075.encode(classification.getRootCategory().getTitle()); + + // Build up the search path + if (categories != null && categories.length != 0) + { + for (int i=0; i" + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + ""; + + /** + * Main method + * + * @param args + */ + public static void main(String[] args) + { + WebServiceSampleGetRankedContent sample = new WebServiceSampleGetRankedContent(); + List results = sample.getRankedContent("Alfresco Tutorial", "alfresco*"); + + // Output the results for visual inspection + int iCount = 1; + for (ContentResult result : results) + { + System.out.println("Result " + iCount + ": " + result.toString()); + iCount ++; + } + } + + /** + * Get a list of ordered results of documents in the space specified matching the search + * text provided. + * + * @param spaceName the name of the space (immediatly beneth the company home space) to search + * @param searchValue the FTS search value + * @return list of results + */ + public List getRankedContent(String spaceName, String searchValue) + { + List results = new ArrayList(); + + try + { + // Get the authentication service + AuthenticationServiceSoapBindingStub authenticationService = (AuthenticationServiceSoapBindingStub)new AuthenticationServiceLocator().getAuthenticationService(); + + // Start the session + AuthenticationResult authenticationResult = authenticationService.startSession(WebServiceSample1.USERNAME, WebServiceSample1.PASSWORD); + WebServiceSampleGetRankedContent.currentTicket = authenticationResult.getTicket(); + + // Create the respository service, adding the WS security header information + EngineConfiguration config = new FileProvider(new ByteArrayInputStream(WebServiceSampleGetRankedContent.WS_SECURITY_INFO.getBytes())); + RepositoryServiceLocator repositoryServiceLocator = new RepositoryServiceLocator(config); + RepositoryServiceSoapBindingStub repositoryService = (RepositoryServiceSoapBindingStub)repositoryServiceLocator.getRepositoryService(); + + // Create a store object referencing the main spaced store + Store store = new Store(StoreEnum.workspace, "SpacesStore"); + + // Get a reference to the space we have named + Reference reference = new Reference(store, null, "/app:company_home/*[@cm:name=\"" + spaceName + "\"]"); + Predicate predicate = new Predicate(new Reference[]{reference}, null, null); + Node[] nodes = repositoryService.get(predicate); + + // Create a query object, looking for all items with alfresco in the name of text + Query query = new Query( + QueryLanguageEnum.lucene, + "+PARENT:\"workspace://SpacesStore/"+ nodes[0].getReference().getUuid() + "\" +TEXT:\"" + searchValue + "\""); + + // Execute the query + QueryResult queryResult = repositoryService.query(store, query, false); + + // Display the results + ResultSet resultSet = queryResult.getResultSet(); + ResultSetRow[] rows = resultSet.getRows(); + + if (rows != null) + { + // Get the infomation from the result set + for(ResultSetRow row : rows) + { + String nodeId = row.getNode().getId(); + ContentResult contentResult = new ContentResult(nodeId); + + for (NamedValue namedValue : row.getColumns()) + { + if (namedValue.getName().endsWith(ContentModel.PROP_CREATED.toString()) == true) + { + contentResult.setCreateDate(namedValue.getValue()); + } + else if (namedValue.getName().endsWith(ContentModel.PROP_NAME.toString()) == true) + { + contentResult.setName(namedValue.getValue()); + } + else if (namedValue.getName().endsWith(ContentModel.PROP_DESCRIPTION.toString()) == true) + { + contentResult.setDescription(namedValue.getValue()); + } + else if (namedValue.getName().endsWith(ContentModel.PROP_CONTENT.toString()) == true) + { + // We could go to the content service and ask for the content to get the URL but to save time we + // might as well dig the content URL out of the results. + String contentString = namedValue.getValue(); + String[] values = contentString.split("[|=]"); + contentResult.setUrl(values[1]); + } + } + + results.add(contentResult); + } + } + + // End the session + authenticationService.endSession(); + } + catch (Exception serviceException) + { + throw new AlfrescoRuntimeException("Unable to perform search.", serviceException); + } + + return results; + } + + /** + * Security callback handler + */ + public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException + { + for (int i = 0; i < callbacks.length; i++) + { + if (callbacks[i] instanceof WSPasswordCallback) + { + WSPasswordCallback pc = (WSPasswordCallback)callbacks[i]; + pc.setPassword(WebServiceSampleGetRankedContent.currentTicket); + } + else + { + throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback"); + } + } + } + + /** + * Class to contain the information about the result from the query + */ + public class ContentResult + { + private String id; + private String name; + private String description; + private String url; + private String createDate; + + public ContentResult(String id) + { + this.id = id; + } + + public String getCreateDate() + { + return createDate; + } + + public void setCreateDate(String createDate) + { + this.createDate = createDate; + } + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + + public String getId() + { + return id; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public String getUrl() + { + return url; + } + + public void setUrl(String url) + { + this.url = url; + } + + @Override + public String toString() + { + return "id=" + this.id + + "; name=" + this.name + + "; description=" + this.description + + "; created=" + this.createDate + + "; url=" + this.url; + } + } +} diff --git a/source/java/org/alfresco/repo/webdav/AbstractMoveOrCopyMethod.java b/source/java/org/alfresco/repo/webdav/AbstractMoveOrCopyMethod.java new file mode 100644 index 0000000000..08e1051a33 --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/AbstractMoveOrCopyMethod.java @@ -0,0 +1,146 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +import javax.servlet.http.HttpServletResponse; + +import org.alfresco.service.cmr.model.FileFolderService; +import org.alfresco.service.cmr.model.FileInfo; +import org.alfresco.service.cmr.model.FileNotFoundException; +import org.alfresco.service.cmr.repository.NodeRef; + +/** + * Implements the WebDAV COPY and MOVE methods + * + * @author Derek Hulley + */ +public abstract class AbstractMoveOrCopyMethod extends HierarchicalMethod +{ + /** + * Default constructor + */ + public AbstractMoveOrCopyMethod() + { + } + + /** + * Implement the move or copy, depending on the implementation + * + * @param fileFolderService the service to do the work + * @param sourceNodeRef the node to copy or move + * @param destParentNodeRef the destination parent + * @param name the name of the file or folder + * @throws Exception + */ + protected abstract void moveOrCopy( + FileFolderService fileFolderService, + NodeRef sourceNodeRef, + NodeRef destParentNodeRef, + String name) throws Exception; + + /** + * Exceute the request + * + * @exception WebDAVServerException + */ + protected final void executeImpl() throws WebDAVServerException, Exception + { + FileFolderService fileFolderService = getFileFolderService(); + + NodeRef rootNodeRef = getRootNodeRef(); + String servletPath = getServletPath(); + + // Debug + if (logger.isDebugEnabled()) + { + logger.debug("Copy from " + getPath() + " to " + getDestinationPath()); + } + + // the source must exist + String sourcePath = getPath(); + FileInfo sourceInfo = null; + try + { + sourceInfo = getDAVHelper().getNodeForPath(rootNodeRef, sourcePath, servletPath); + } + catch (FileNotFoundException e) + { + throw new WebDAVServerException(HttpServletResponse.SC_NOT_FOUND); + } + + // the destination parent must exist + String destPath = getDestinationPath(); + FileInfo destParentInfo = null; + try + { + destParentInfo = getDAVHelper().getParentNodeForPath(rootNodeRef, destPath, servletPath); + } + catch (FileNotFoundException e) + { + if (logger.isDebugEnabled()) + { + logger.debug("Destination parent folder doesn't exist: " + destPath); + } + throw new WebDAVServerException(HttpServletResponse.SC_NOT_FOUND); + } + + // check for the existence of the destination node + FileInfo destInfo = null; + try + { + destInfo = getDAVHelper().getNodeForPath(rootNodeRef, destPath, servletPath); + if (!hasOverWrite()) + { + if (logger.isDebugEnabled()) + { + logger.debug("Destination exists but overwrite is not allowed"); + } + // it exists and we may not overwrite + throw new WebDAVServerException(HttpServletResponse.SC_PRECONDITION_FAILED); + } + // delete the destination node if it is not the same as the source node + if (!destInfo.getNodeRef().equals(sourceInfo.getNodeRef())) + { + // attempting to move or copy onto another node + fileFolderService.delete(destInfo.getNodeRef()); + } + else + { + // it is a copy or move onto itself + } + } + catch (FileNotFoundException e) + { + // destination doesn't exist + } + + NodeRef sourceNodeRef = sourceInfo.getNodeRef(); + NodeRef destParentNodeRef = destParentInfo.getNodeRef(); + String name = getDAVHelper().splitPath(destPath)[1]; + moveOrCopy(fileFolderService, sourceNodeRef, destParentNodeRef, name); + + // Set the response status + if (destInfo == null) + { + m_response.setStatus(HttpServletResponse.SC_CREATED); + } + else + { + m_response.setStatus(HttpServletResponse.SC_NO_CONTENT); + } + } +} diff --git a/source/java/org/alfresco/repo/webdav/CopyMethod.java b/source/java/org/alfresco/repo/webdav/CopyMethod.java new file mode 100644 index 0000000000..673d13492e --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/CopyMethod.java @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +import org.alfresco.service.cmr.model.FileFolderService; +import org.alfresco.service.cmr.repository.NodeRef; + +/** + * Implements the WebDAV COPY method + * + * @author Derek Hulley + */ +public class CopyMethod extends AbstractMoveOrCopyMethod +{ + /** + * Default constructor + */ + public CopyMethod() + { + } + + @Override + protected void moveOrCopy( + FileFolderService fileFolderService, + NodeRef sourceNodeRef, + NodeRef destParentNodeRef, + String name) throws Exception + { + fileFolderService.copy(sourceNodeRef, destParentNodeRef, name); + } +} diff --git a/source/java/org/alfresco/repo/webdav/DeleteMethod.java b/source/java/org/alfresco/repo/webdav/DeleteMethod.java new file mode 100644 index 0000000000..7465a2031f --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/DeleteMethod.java @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +import java.util.List; + +import javax.servlet.http.HttpServletResponse; + +import org.alfresco.service.cmr.model.FileFolderService; +import org.alfresco.service.cmr.model.FileInfo; +import org.alfresco.service.cmr.model.FileNotFoundException; +import org.alfresco.service.cmr.repository.NodeRef; + +/** + * Implements the WebDAV DELETE method + * + * @author gavinc + */ +public class DeleteMethod extends WebDAVMethod +{ + /** + * Default constructor + */ + public DeleteMethod() + { + } + + /** + * Parse the request headers + * + * @exception WebDAVServerException + */ + protected void parseRequestHeaders() throws WebDAVServerException + { + // Nothing to do in this method + } + + /** + * Parse the request body + * + * @exception WebDAVServerException + */ + protected void parseRequestBody() throws WebDAVServerException + { + // Nothing to do in this method + } + + /** + * Execute the request + * + * @exception WebDAVServerException + */ + protected void executeImpl() throws WebDAVServerException, Exception + { + if (logger.isDebugEnabled()) + { + logger.debug("WebDAV DELETE: " + getPath()); + } + + FileFolderService fileFolderService = getFileFolderService(); + + NodeRef rootNodeRef = getRootNodeRef(); + + String path = getPath(); + List pathElements = getDAVHelper().splitAllPaths(path); + FileInfo fileInfo = null; + try + { + // get the node to delete + fileInfo = fileFolderService.resolveNamePath(rootNodeRef, pathElements); + } + catch (FileNotFoundException e) + { + if (logger.isDebugEnabled()) + { + logger.debug("Node not found: " + getPath()); + } + throw new WebDAVServerException(HttpServletResponse.SC_NOT_FOUND); + } + // delete it + fileFolderService.delete(fileInfo.getNodeRef()); + } +} diff --git a/source/java/org/alfresco/repo/webdav/GetMethod.java b/source/java/org/alfresco/repo/webdav/GetMethod.java new file mode 100644 index 0000000000..0a76debfd4 --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/GetMethod.java @@ -0,0 +1,478 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +import java.io.IOException; +import java.io.Writer; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.StringTokenizer; + +import javax.servlet.http.HttpServletResponse; + +import org.alfresco.service.cmr.model.FileFolderService; +import org.alfresco.service.cmr.model.FileInfo; +import org.alfresco.service.cmr.model.FileNotFoundException; +import org.alfresco.service.cmr.repository.ContentReader; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter; +import org.alfresco.service.cmr.repository.datatype.TypeConverter; + +/** + * Implements the WebDAV GET method + * + * @author gavinc + */ +public class GetMethod extends WebDAVMethod +{ + // Request parameters + + private ArrayList ifMatchTags = null; + private ArrayList ifNoneMatchTags = null; + private Date m_ifModifiedSince = null; + private Date m_ifUnModifiedSince = null; + + protected boolean m_returnContent = true; + + /** + * Default constructor + */ + public GetMethod() + { + } + + /** + * Parse the request headers + * + * @exception WebDAVServerException + */ + protected void parseRequestHeaders() throws WebDAVServerException + { + // If the range header is present output a warning, add support later + + String strRange = m_request.getHeader(WebDAV.HEADER_RANGE); + + if (strRange != null && strRange.length() > 0) + { + logger.warn("Range header (" + strRange + ") not supported"); + } + + // Capture all the If headers, process later + + String strIfMatch = m_request.getHeader(WebDAV.HEADER_IF_MATCH); + + if (strIfMatch != null && strIfMatch.length() > 0) + { + ifMatchTags = parseETags(strIfMatch); + } + + String strIfNoneMatch = m_request.getHeader(WebDAV.HEADER_IF_NONE_MATCH); + if (strIfNoneMatch != null && strIfNoneMatch.length() > 0) + { + ifNoneMatchTags = parseETags(strIfNoneMatch); + } + + // Parse the dates + + SimpleDateFormat dateFormat = new SimpleDateFormat(WebDAV.HEADER_IF_DATE_FORMAT); + String strIfModifiedSince = m_request.getHeader(WebDAV.HEADER_IF_MODIFIED_SINCE); + + if (strIfModifiedSince != null && strIfModifiedSince.length() > 0) + { + try + { + m_ifModifiedSince = dateFormat.parse(strIfModifiedSince); + } + catch (ParseException e) + { + logger.warn("Failed to parse If-Modified-Since date of " + strIfModifiedSince); + } + } + + String strIfUnModifiedSince = m_request.getHeader(WebDAV.HEADER_IF_UNMODIFIED_SINCE); + if (strIfUnModifiedSince != null && strIfUnModifiedSince.length() > 0) + { + try + { + m_ifUnModifiedSince = dateFormat.parse(strIfUnModifiedSince); + } + catch (ParseException e) + { + logger.warn("Failed to parse If-Unmodified-Since date of " + strIfUnModifiedSince); + } + } + } + + /** + * Parse the request body + * + * @exception WebDAVServerException + */ + protected void parseRequestBody() throws WebDAVServerException + { + // Nothing to do in this method + } + + /** + * Exceute the WebDAV request + * + * @exception WebDAVServerException + */ + protected void executeImpl() throws WebDAVServerException, Exception + { + FileFolderService fileFolderService = getFileFolderService(); + NodeRef rootNodeRef = getRootNodeRef(); + String path = getPath(); + String servletPath = getServletPath(); + + FileInfo nodeInfo = null; + try + { + nodeInfo = getDAVHelper().getNodeForPath(rootNodeRef, path, servletPath); + } + catch (FileNotFoundException e) + { + throw new WebDAVServerException(HttpServletResponse.SC_NOT_FOUND); + } + + // Check if the node is a folder + if (nodeInfo.isFolder()) + { + // is content required + if (!m_returnContent) + { + // it is a folder and no content is required + throw new WebDAVServerException(HttpServletResponse.SC_BAD_REQUEST); + } + // Generate a folder listing + generateDirectoryListing(nodeInfo); + } + else + { + NodeRef pathNodeRef = nodeInfo.getNodeRef(); + // Return the node details, and content if requested, check that the node passes the pre-conditions + + checkPreConditions(nodeInfo); + + // Build the response header + m_response.setHeader(WebDAV.HEADER_ETAG, getDAVHelper().makeQuotedETag(pathNodeRef)); + + Date modifiedDate = nodeInfo.getModifiedDate(); + if (modifiedDate != null) + { + long modDate = DefaultTypeConverter.INSTANCE.longValue(modifiedDate); + m_response.setHeader(WebDAV.HEADER_LAST_MODIFIED, WebDAV.formatHeaderDate(modDate)); + } + + ContentReader reader = fileFolderService.getReader(nodeInfo.getNodeRef()); + if (reader != null) + { + // there is content associated with the node + m_response.setHeader(WebDAV.HEADER_CONTENT_LENGTH, "" + reader.getSize()); + m_response.setHeader(WebDAV.HEADER_CONTENT_TYPE, reader.getMimetype()); + + if (m_returnContent) + { + // copy the content to the response output stream + reader.getContent(m_response.getOutputStream()); + } + } + } + } + + /** + * Checks the If header conditions + * + * @param nodeInfo the node to check + * @throws WebDAVServerException if a pre-condition is not met + */ + private void checkPreConditions(FileInfo nodeInfo) throws WebDAVServerException + { + // Make an etag for the node + + String strETag = getDAVHelper().makeQuotedETag(nodeInfo.getNodeRef()); + TypeConverter typeConv = DefaultTypeConverter.INSTANCE; + + // Check the If-Match header, don't send any content back if none of the tags in + // the list match the etag, and the wildcard is not present + + if (ifMatchTags != null) + { + if (ifMatchTags.contains(WebDAV.ASTERISK) == false && ifMatchTags.contains(strETag) == false) + { + throw new WebDAVServerException(HttpServletResponse.SC_PRECONDITION_FAILED); + } + } + + // Check the If-None-Match header, don't send any content back if any of the tags + // in the list match the etag, or the wildcard is present + + if (ifNoneMatchTags != null) + { + if (ifNoneMatchTags.contains(WebDAV.ASTERISK) || ifNoneMatchTags.contains(strETag)) + { + throw new WebDAVServerException(HttpServletResponse.SC_NOT_MODIFIED); + } + } + + // Check the modified since list, if the If-None-Match header was not specified + + if (m_ifModifiedSince != null && ifNoneMatchTags == null) + { + Date lastModifiedDate = nodeInfo.getModifiedDate(); + + long fileLastModified = lastModifiedDate != null ? typeConv.longValue(lastModifiedDate) : 0L; + long modifiedSince = m_ifModifiedSince.getTime(); + + if (fileLastModified != 0L && fileLastModified <= modifiedSince) + { + throw new WebDAVServerException(HttpServletResponse.SC_NOT_MODIFIED); + } + } + + // Check the un-modified since list + + if (m_ifUnModifiedSince != null) + { + Date lastModifiedDate = nodeInfo.getModifiedDate(); + + long fileLastModified = lastModifiedDate != null ? typeConv.longValue(lastModifiedDate) : 0L; + long unModifiedSince = m_ifUnModifiedSince.getTime(); + + if (fileLastModified >= unModifiedSince) + { + throw new WebDAVServerException(HttpServletResponse.SC_PRECONDITION_FAILED); + } + } + } + + /** + * Parses the given ETag header into a list of separate ETags + * + * @param strETagHeader The header to parse + * @return A list of ETags + */ + private ArrayList parseETags(String strETagHeader) + { + ArrayList list = new ArrayList(); + + StringTokenizer tokenizer = new StringTokenizer(strETagHeader, WebDAV.HEADER_VALUE_SEPARATOR); + while (tokenizer.hasMoreTokens()) + { + list.add(tokenizer.nextToken().trim()); + } + + return list; + } + + /** + * Generates a HTML representation of the contents of the path represented by the given node + * + * @param fileInfo the file to use + */ + private void generateDirectoryListing(FileInfo fileInfo) + { + FileFolderService fileFolderService = getFileFolderService(); + Writer writer = null; + + try + { + writer = m_response.getWriter(); + + // Get the list of child nodes for the parent node + List childNodeInfos = fileFolderService.list(fileInfo.getNodeRef()); + + // Send back the start of the HTML + writer.write("Alfresco Content Repository"); + writer.write("\n"); + writer.flush(); + + // Send back the table heading + writer.write("\n"); + writer.write("\n"); + writer.write("\n"); + writer.write("
Directory listing for "); + writer.write(getPath()); + writer.write("
"); + + writer.write("\n"); + writer.write(""); + writer.write(""); + writer.write(""); + writer.write(""); + + // Get the URL for the root path + String rootURL = WebDAV.getURLForPath(m_request, getPath(), true); + if (rootURL.endsWith(WebDAVHelper.PathSeperator) == false) + rootURL = rootURL + WebDAVHelper.PathSeperator; + + // Start with a link to the parent folder so we can navigate back up, unless we are at the root level + if (fileInfo.getNodeRef().equals(getRootNodeRef()) == false) + { + writer.write(""); + writer.write("\n"); + } + + // Send back what we have generated so far + writer.flush(); + int rowId = 0; + + for (FileInfo childNodeInfo : childNodeInfos) + { + // Output the details for the current node + writer.write(""); + + writer.write("\n"); + writer.flush(); + } + } + catch (Throwable e) + { + logger.error(e); + + if (writer != null) + { + try + { + writer.write("
NameSizeModified
"); + writer.write("[Up a level]"); + writer.write("
"); + writer.write(fname); + writer.write(""); + + writer.write(""); + if (fileInfo.isFolder()) + { + writer.write(formatSize("0")); + } + else + { + ContentReader reader = fileFolderService.getReader(childNodeInfo.getNodeRef()); + long fsize = 0L; + if ( reader != null) + { + fsize = reader.getSize(); + } + writer.write(formatSize("" + fsize)); + } + writer.write(""); + + Date modifiedDate = childNodeInfo.getModifiedDate(); + if (modifiedDate != null) + { + writer.write(WebDAV.formatHeaderDate(DefaultTypeConverter.INSTANCE.longValue(modifiedDate))); + } + else + { + writer.write(""); + } + writer.write("
"); + writer.write("An error occurred whilst generating the directory listing, "); + writer.write("please contact the system administrator.
"); + writer.flush(); + } + catch (IOException ioe) + { + } + } + } + } + + /** + * Formats the given size for display in a directory listing + * + * @param strSize The content size + * @return The formatted size + */ + private String formatSize(String strSize) + { + String strFormattedSize = strSize; + + int length = strSize.length(); + if (length < 4) + { + strFormattedSize = strSize + " bytes"; + } + else if (length >= 4 && length < 7) + { + String strLeft = strSize.substring(0, length - 3); + String strRight = strSize.substring(length - 3, length - 2); + + StringBuffer buffer = new StringBuffer(strLeft); + if (!strRight.equals("0")) + { + buffer.append("."); + buffer.append(strRight); + } + buffer.append(" Kb"); + + strFormattedSize = buffer.toString(); + } + else + { + String strLeft = strSize.substring(0, length - 6); + String strRight = strSize.substring(length - 6, length - 5); + + StringBuffer buffer = new StringBuffer(strLeft); + if (!strRight.equals("0")) + { + buffer.append("."); + buffer.append(strRight); + } + buffer.append(" Mb"); + + strFormattedSize = buffer.toString(); + } + + return strFormattedSize; + } +} diff --git a/source/java/org/alfresco/repo/webdav/HeadMethod.java b/source/java/org/alfresco/repo/webdav/HeadMethod.java new file mode 100644 index 0000000000..5ff32ea34f --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/HeadMethod.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +/** + * Implements the WebDAV HEAD method + * + * @author gavinc + */ +public class HeadMethod extends GetMethod +{ + /** + * Default constructor + */ + public HeadMethod() + { + // Do everything the GET request does apart from returning the content + + m_returnContent = false; + } +} diff --git a/source/java/org/alfresco/repo/webdav/HierarchicalMethod.java b/source/java/org/alfresco/repo/webdav/HierarchicalMethod.java new file mode 100644 index 0000000000..d0ac3e4abe --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/HierarchicalMethod.java @@ -0,0 +1,217 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +import java.net.MalformedURLException; +import java.net.URL; + +import javax.servlet.http.HttpServletResponse; + +/** + * Abstract base class for the hierarchical methods COPY and MOVE + * + * @author gavinc + */ +public abstract class HierarchicalMethod extends WebDAVMethod +{ + // Request parameters + + protected String m_strDestinationPath; + protected boolean m_overwrite = false; + + /** + * Default constructor + */ + public HierarchicalMethod() + { + } + + /** + * Return the destination path + * + * @return String + */ + public final String getDestinationPath() + { + return m_strDestinationPath; + } + + /** + * Return the overwrite setting + * + * @return boolean + */ + public final boolean hasOverWrite() + { + return m_overwrite; + } + + /** + * Parse the request headers + * + * @exception WebDAVServerException + */ + protected void parseRequestHeaders() throws WebDAVServerException + { + // Get the destination path for the copy + + String strDestination = m_request.getHeader(WebDAV.HEADER_DESTINATION); + + if (logger.isDebugEnabled()) + logger.debug("Parsing Destination header: " + strDestination); + + if (strDestination != null && strDestination.length() > 0) + { + int offset = -1; + + if (strDestination.startsWith("http://")) + { + // Check that the URL is on this server and refers to the WebDAV + // path, if not then return an error + + checkDestinationPath(strDestination); + + // Set the offset to the start of the + + offset = 7; + } + else if (strDestination.startsWith("https://")) + { + // Check that the URL is on this server and refers to the WebDAV + // path, if not then return an error + + checkDestinationPath(strDestination); + + // Set the offset to the start of the + + offset = 8; + } + + // Strip the start of the path if not a relative path + + if (offset != -1) + { + offset = strDestination.indexOf(WebDAV.PathSeperator, offset); + if (offset != -1) + { + String strPath = strDestination.substring(offset); + String servletPath = m_request.getServletPath(); + + offset = strPath.indexOf(servletPath); + if (offset != -1) + strPath = strPath.substring(offset + servletPath.length()); + + m_strDestinationPath = WebDAV.decodeURL(strPath); + } + } + } + + // Failed to fix the destination path, return an error + + if (m_strDestinationPath == null) + { + logger.warn("Failed to parse the Destination header: " + strDestination); + throw new WebDAVServerException(HttpServletResponse.SC_BAD_REQUEST); + } + + // Check if the copy should overwrite an existing file + + String strOverwrite = m_request.getHeader(WebDAV.HEADER_OVERWRITE); + if (strOverwrite != null && strOverwrite.equals(WebDAV.T)) + { + m_overwrite = true; + } + } + + /** + * Parse the request body + * + * @exception WebDAVServerException + */ + protected void parseRequestBody() throws WebDAVServerException + { + // NOTE: Hierarchical methods do have a body to define what should + // happen + // to the properties when they are moved or copied, however, this + // feature is not implemented by many servers, including ours!! + } + + /** + * Check that the destination path is on this server and is a valid WebDAV + * path for this server + * + * @param path String + * @exception WebDAVServerException + */ + protected final void checkDestinationPath(String path) throws WebDAVServerException + { + try + { + // Parse the URL + + URL url = new URL(path); + + // Check if the path is on this WebDAV server + + boolean localPath = true; + + if (url.getPort() != -1 && url.getPort() != m_request.getLocalPort()) + { + // Debug + + if (logger.isDebugEnabled()) + logger.debug("Destination path, different server port"); + + localPath = false; + } + else if (url.getHost().equals(m_request.getLocalName()) == false + && url.getHost().equals(m_request.getLocalAddr()) == false) + { + // Debug + + if (logger.isDebugEnabled()) + logger.debug("Destination path, different server name/address"); + + localPath = false; + } + else if (url.getPath().indexOf(m_request.getServletPath()) == -1) + { + // Debug + + if (logger.isDebugEnabled()) + logger.debug("Destination path, different serlet path"); + + localPath = false; + } + + // If the URL does not refer to this WebDAV server throw an + // exception + + if (localPath != true) + throw new WebDAVServerException(HttpServletResponse.SC_BAD_GATEWAY); + } + catch (MalformedURLException ex) + { + // Debug + + if (logger.isDebugEnabled()) + logger.debug("Bad destination path, " + path); + + throw new WebDAVServerException(HttpServletResponse.SC_BAD_GATEWAY); + } + } +} diff --git a/source/java/org/alfresco/repo/webdav/LockMethod.java b/source/java/org/alfresco/repo/webdav/LockMethod.java new file mode 100644 index 0000000000..e9a5f8d9c5 --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/LockMethod.java @@ -0,0 +1,297 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +import java.util.List; + +import javax.servlet.http.HttpServletResponse; + +import org.alfresco.model.ContentModel; +import org.alfresco.service.cmr.lock.LockService; +import org.alfresco.service.cmr.lock.LockStatus; +import org.alfresco.service.cmr.lock.LockType; +import org.alfresco.service.cmr.model.FileFolderService; +import org.alfresco.service.cmr.model.FileInfo; +import org.alfresco.service.cmr.model.FileNotFoundException; +import org.alfresco.service.cmr.repository.NodeRef; +import org.dom4j.io.XMLWriter; + +/** + * Implements the WebDAV LOCK method + * + * @author gavinc + */ +public class LockMethod extends WebDAVMethod +{ + private String m_strLockToken = null; + private int m_timeoutDuration = WebDAV.DEPTH_INFINITY; + + /** + * Default constructor + */ + public LockMethod() + { + } + + /** + * Check if the lock token is valid + * + * @return boolean + */ + protected final boolean hasLockToken() + { + return m_strLockToken != null ? true : false; + } + + /** + * Return the lock token of an existing lock + * + * @return String + */ + protected final String getLockToken() + { + return m_strLockToken; + } + + /** + * Return the lock timeout, in minutes + * + * @return int + */ + protected final int getLockTimeout() + { + return m_timeoutDuration; + } + + /** + * Parse the request headers + * + * @exception WebDAVServerException + */ + protected void parseRequestHeaders() throws WebDAVServerException + { + // Get the lock token, if any + + m_strLockToken = parseIfHeader(); + + // Get the lock timeout value + + String strTimeout = m_request.getHeader(WebDAV.HEADER_TIMEOUT); + + // If the timeout header starts with anything other than Second + // leave the timeout as the default + + if (strTimeout != null && strTimeout.startsWith(WebDAV.SECOND)) + { + try + { + // Some clients send header as Second-180 Seconds so we need to + // look for the space + + int idx = strTimeout.indexOf(" "); + + if (idx != -1) + { + // Get the bit after Second- and before the space + + strTimeout = strTimeout.substring(WebDAV.SECOND.length(), idx); + } + else + { + // The string must be in the correct format + + strTimeout = strTimeout.substring(WebDAV.SECOND.length()); + } + m_timeoutDuration = Integer.parseInt(strTimeout); + } + catch (Exception e) + { + // Warn about the parse failure and leave the timeout as the + // default + + logger.warn("Failed to parse Timeout header: " + strTimeout); + } + } + + // DEBUG + + if (logger.isDebugEnabled()) + logger.debug("Lock lockToken=" + getLockToken() + ", timeout=" + getLockTimeout()); + } + + /** + * Parse the request body + * + * @exception WebDAVServerException + */ + protected void parseRequestBody() throws WebDAVServerException + { + // NOTE: There is a body for lock requests which contain the + // type of lock to apply and the lock owner but we will + // ignore these settings so don't bother reading the body + } + + /** + * Exceute the request + * + * @exception WebDAVServerException + */ + protected void executeImpl() throws WebDAVServerException, Exception + { + FileFolderService fileFolderService = getFileFolderService(); + String path = getPath(); + NodeRef rootNodeRef = getRootNodeRef(); + // Get the active user + String userName = getDAVHelper().getAuthenticationService().getCurrentUserName(); + + if (logger.isDebugEnabled()) + { + logger.debug("Locking node: \n" + + " user: " + userName + "\n" + + " path: " + path); + } + + FileInfo lockNodeInfo = null; + try + { + // Check if the path exists + lockNodeInfo = getDAVHelper().getNodeForPath(getRootNodeRef(), getPath(), m_request.getServletPath()); + } + catch (FileNotFoundException e) + { + // need to create it + String[] splitPath = getDAVHelper().splitPath(path); + // check + if (splitPath[1].length() == 0) + { + throw new WebDAVServerException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + } + + List dirPathElements = getDAVHelper().splitAllPaths(splitPath[0]); + FileInfo dirInfo = fileFolderService.makeFolders(rootNodeRef, dirPathElements, ContentModel.TYPE_FOLDER); + if (dirInfo == null) + { + throw new WebDAVServerException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + } + // create the file + lockNodeInfo = fileFolderService.create(dirInfo.getNodeRef(), splitPath[1], ContentModel.TYPE_CONTENT); + + if (logger.isDebugEnabled()) + { + logger.debug("Created new node for lock: \n" + + " path: " + path + "\n" + + " node: " + lockNodeInfo); + } + } + + + // Check if this is a new lock or a refresh + if (hasLockToken()) + { + // Refresh an existing lock + refreshLock(lockNodeInfo.getNodeRef(), userName); + } + else + { + // Create a new lock + createLock(lockNodeInfo.getNodeRef(), userName); + } + + // We either created a new lock or refreshed an existing lock, send back the lock details + generateResponse(lockNodeInfo.getNodeRef(), userName); + } + + /** + * Create a new lock + * + * @param lockNode NodeRef + * @param userName String + * @exception WebDAVServerException + */ + private final void createLock(NodeRef lockNode, String userName) throws WebDAVServerException + { + LockService lockService = getLockService(); + + // Check the lock status of the node + LockStatus lockSts = lockService.getLockStatus(lockNode); + + // DEBUG + if (logger.isDebugEnabled()) + logger.debug("Create lock status=" + lockSts); + + if (lockSts == LockStatus.LOCKED || lockSts == LockStatus.LOCK_OWNER) + { + // Indicate that the resource is already locked + throw new WebDAVServerException(WebDAV.WEBDAV_SC_LOCKED); + } + + // Lock the node + lockService.lock(lockNode, LockType.WRITE_LOCK, getLockTimeout()); + } + + /** + * Refresh an existing lock + * + * @param lockNode NodeRef + * @param userName String + * @exception WebDAVServerException + */ + private final void refreshLock(NodeRef lockNode, String userName) throws WebDAVServerException + { + LockService lockService = getLockService(); + + // Check the lock status of the node + LockStatus lockSts = lockService.getLockStatus(lockNode); + + // DEBUG + if (logger.isDebugEnabled()) + logger.debug("Refresh lock status=" + lockSts); + + if (lockSts != LockStatus.LOCK_OWNER) + { + // Indicate that the resource is already locked + throw new WebDAVServerException(WebDAV.WEBDAV_SC_LOCKED); + } + + // Update the expiry for the lock + lockService.lock(lockNode, LockType.WRITE_LOCK, getLockTimeout()); + } + + /** + * Generates the XML lock discovery response body + */ + private void generateResponse(NodeRef lockNode, String userName) throws Exception + { + XMLWriter xml = createXMLWriter(); + + xml.startDocument(); + + String nsdec = generateNamespaceDeclarations(null); + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_MULTI_STATUS + nsdec, WebDAV.XML_NS_MULTI_STATUS + nsdec, + getDAVHelper().getNullAttributes()); + + // Output the lock details + generateLockDiscoveryXML(xml, lockNode); + + // Close off the XML + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_MULTI_STATUS, WebDAV.XML_NS_MULTI_STATUS); + + // Send the XML back to the client + m_response.setStatus(HttpServletResponse.SC_OK); + xml.flush(); + } +} diff --git a/source/java/org/alfresco/repo/webdav/MkcolMethod.java b/source/java/org/alfresco/repo/webdav/MkcolMethod.java new file mode 100644 index 0000000000..38f8434a83 --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/MkcolMethod.java @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +import javax.servlet.http.HttpServletResponse; + +import org.alfresco.model.ContentModel; +import org.alfresco.service.cmr.model.FileFolderService; +import org.alfresco.service.cmr.model.FileInfo; +import org.alfresco.service.cmr.model.FileNotFoundException; +import org.alfresco.service.cmr.repository.NodeRef; +import org.w3c.dom.Document; + +/** + * Implements the WebDAV MKCOL method + * + * @author gavinc + */ +public class MkcolMethod extends WebDAVMethod +{ + /** + * Default constructor + */ + public MkcolMethod() + { + } + + /** + * Parse the request headers + * + * @Exception WebDAVServerException + */ + protected void parseRequestHeaders() throws WebDAVServerException + { + // Nothing to do in this method + } + + /** + * Parse the request body + * + * @exception WebDAVServerException + */ + protected void parseRequestBody() throws WebDAVServerException + { + // There should not be a body with the MKCOL request + + Document body = getRequestBodyAsDocument(); + + if (body != null) + { + throw new WebDAVServerException(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE); + } + } + + /** + * Exceute the request + * + * @exception WebDAVServerException + */ + protected void executeImpl() throws WebDAVServerException, Exception + { + FileFolderService fileFolderService = getFileFolderService(); + + // see if it exists + try + { + getDAVHelper().getNodeForPath(getRootNodeRef(), getPath(), getServletPath()); + // already exists + throw new WebDAVServerException(HttpServletResponse.SC_METHOD_NOT_ALLOWED); + } + catch (FileNotFoundException e) + { + // it doesn't exist + } + + // Trim the last path component and check if the parent path exists + String parentPath = getPath(); + int lastPos = parentPath.lastIndexOf(WebDAVHelper.PathSeperator); + + NodeRef parentNodeRef = null; + + if ( lastPos == 0) + { + // Create new folder at root + + parentPath = WebDAVHelper.PathSeperator; + parentNodeRef = getRootNodeRef(); + } + else if (lastPos != -1) + { + // Trim the last path component + parentPath = parentPath.substring(0, lastPos + 1); + try + { + FileInfo parentFileInfo = getDAVHelper().getNodeForPath(getRootNodeRef(), parentPath, m_request.getServletPath()); + parentNodeRef = parentFileInfo.getNodeRef(); + } + catch (FileNotFoundException e) + { + // parent path is missing + throw new WebDAVServerException(HttpServletResponse.SC_NOT_FOUND); + } + } + else + { + // Looks like a bad path + throw new WebDAVServerException(HttpServletResponse.SC_METHOD_NOT_ALLOWED); + } + + // Get the new folder name + String folderName = getPath().substring(lastPos + 1); + + // Create the new folder node + fileFolderService.create(parentNodeRef, folderName, ContentModel.TYPE_FOLDER); + + // Return a success status + m_response.setStatus(HttpServletResponse.SC_CREATED); + } +} diff --git a/source/java/org/alfresco/repo/webdav/MoveMethod.java b/source/java/org/alfresco/repo/webdav/MoveMethod.java new file mode 100644 index 0000000000..a7ec731562 --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/MoveMethod.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +import org.alfresco.service.cmr.model.FileFolderService; +import org.alfresco.service.cmr.repository.NodeRef; + +/** + * Implements the WebDAV MOVE method + * + * @author Derek Hulley + */ +public class MoveMethod extends AbstractMoveOrCopyMethod +{ + /** + * Default constructor + */ + public MoveMethod() + { + } + + protected void moveOrCopy( + FileFolderService fileFolderService, + NodeRef sourceNodeRef, + NodeRef destParentNodeRef, + String name) throws Exception + { + fileFolderService.move(sourceNodeRef, destParentNodeRef, name); + } +} diff --git a/source/java/org/alfresco/repo/webdav/OptionsMethod.java b/source/java/org/alfresco/repo/webdav/OptionsMethod.java new file mode 100644 index 0000000000..b83547c20a --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/OptionsMethod.java @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +import org.alfresco.service.cmr.model.FileInfo; +import org.alfresco.service.cmr.model.FileNotFoundException; + +/** + * Implements the WebDAV OPTIONS method + * + * @author Gavin Cornwell + */ +public class OptionsMethod extends WebDAVMethod +{ + private static final String DAV_HEADER = "DAV"; + private static final String DAV_HEADER_CONTENT = "1,2"; + private static final String ALLOW_HEADER = "Allow"; + private static final String MS_HEADER = "MS-Author-Via"; + + private static final String FILE_METHODS = "OPTIONS, GET, HEAD, POST, DELETE, PROPFIND, COPY, MOVE, LOCK, UNLOCK"; + private static final String COLLECTION_METHODS = FILE_METHODS + ", PUT"; + + /** + * Default constructor + */ + public OptionsMethod() + { + } + + /** + * Parse the request header fields + * + * @exception WebDAVServerException + */ + protected void parseRequestHeaders() throws WebDAVServerException + { + // Nothing to do in this method + } + + /** + * Parse the request main body + * + * @exception WebDAVServerException + */ + protected void parseRequestBody() throws WebDAVServerException + { + // Nothing to do in this method + } + + /** + * Perform the main request processing + * + * @exception WebDAVServerException + */ + protected void executeImpl() throws WebDAVServerException + { + boolean isFolder; + try + { + FileInfo fileInfo = getDAVHelper().getNodeForPath(getRootNodeRef(), getPath(), getServletPath()); + isFolder = fileInfo.isFolder(); + } + catch (FileNotFoundException e) + { + // Do nothing; just default to a folder + isFolder = true; + } + // Add the header to advertise the level of support the server has + m_response.addHeader(DAV_HEADER, DAV_HEADER_CONTENT); + + // Add the proprietary Microsoft header to make Microsoft clients behave + m_response.addHeader(MS_HEADER, DAV_HEADER); + + // Add the header to show what methods are allowed + m_response.addHeader(ALLOW_HEADER, isFolder ? COLLECTION_METHODS : FILE_METHODS); + } +} diff --git a/source/java/org/alfresco/repo/webdav/PostMethod.java b/source/java/org/alfresco/repo/webdav/PostMethod.java new file mode 100644 index 0000000000..569a311a75 --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/PostMethod.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +/** + * Implements the WebDAV POST method + * + * @author Gavin Cornwell + */ +public class PostMethod extends PutMethod +{ + /** + * Default constructor + */ + public PostMethod() + { + } +} diff --git a/source/java/org/alfresco/repo/webdav/PropFindMethod.java b/source/java/org/alfresco/repo/webdav/PropFindMethod.java new file mode 100644 index 0000000000..a2ddc74b9a --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/PropFindMethod.java @@ -0,0 +1,905 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletResponse; + +import org.alfresco.error.AlfrescoRuntimeException; +import org.alfresco.model.ContentModel; +import org.alfresco.service.cmr.lock.LockService; +import org.alfresco.service.cmr.lock.LockStatus; +import org.alfresco.service.cmr.model.FileFolderService; +import org.alfresco.service.cmr.model.FileInfo; +import org.alfresco.service.cmr.model.FileNotFoundException; +import org.alfresco.service.cmr.repository.ContentData; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter; +import org.alfresco.service.cmr.repository.datatype.TypeConverter; +import org.alfresco.service.namespace.QName; +import org.dom4j.DocumentHelper; +import org.dom4j.io.XMLWriter; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.Attributes; +import org.xml.sax.helpers.AttributesImpl; + +/** + * Implements the WebDAV PROPFIND method + * + * @author Gavin Cornwell + */ +public class PropFindMethod extends WebDAVMethod +{ + // Request types + private static final int GET_ALL_PROPS = 0; + private static final int GET_NAMED_PROPS = 1; + private static final int FIND_PROPS = 2; + + // Find depth and request type + private int m_depth = WebDAV.DEPTH_INFINITY; + private int m_mode = GET_ALL_PROPS; + + // Requested properties + private ArrayList m_properties = null; + + // Available namespaces list + private HashMap m_namespaces = null; + + /** + * Default constructor + */ + public PropFindMethod() + { + m_namespaces = new HashMap(); + } + + /** + * Return the property find depth + * + * @return int + */ + public final int getDepth() + { + return m_depth; + } + + /** + * Return the find mode + * + * @return int + */ + public final int getMode() + { + return m_mode; + } + + /** + * Parse the request headers + * + * @exception WebDAVServerException + */ + protected void parseRequestHeaders() throws WebDAVServerException + { + // Store the Depth header as this is used by several WebDAV methods + + String strDepth = m_request.getHeader(WebDAV.HEADER_DEPTH); + if (strDepth != null && strDepth.length() > 0) + { + if (strDepth.equals(WebDAV.ZERO)) + { + m_depth = WebDAV.DEPTH_0; + } + else if (strDepth.equals(WebDAV.ONE)) + { + m_depth = WebDAV.DEPTH_1; + } + else + { + m_depth = WebDAV.DEPTH_INFINITY; + } + } + } + + /** + * Parse the request body + * + * @exception WebDAVServerException + */ + protected void parseRequestBody() throws WebDAVServerException + { + Document body = getRequestBodyAsDocument(); + if (body != null) + { + Element rootElement = body.getDocumentElement(); + NodeList childList = rootElement.getChildNodes(); + Node node = null; + + for (int i = 0; i < childList.getLength(); i++) + { + Node currentNode = childList.item(i); + switch (currentNode.getNodeType()) + { + case Node.TEXT_NODE: + break; + case Node.ELEMENT_NODE: + if (currentNode.getNodeName().endsWith(WebDAV.XML_ALLPROP)) + { + m_mode = GET_ALL_PROPS; + } + else if (currentNode.getNodeName().endsWith(WebDAV.XML_PROP)) + { + m_mode = GET_NAMED_PROPS; + node = currentNode; + } + else if (currentNode.getNodeName().endsWith(WebDAV.XML_PROPNAME)) + { + m_mode = FIND_PROPS; + } + + break; + } + } + + if (m_mode == GET_NAMED_PROPS) + { + m_properties = new ArrayList(); + childList = node.getChildNodes(); + + for (int i = 0; i < childList.getLength(); i++) + { + Node currentNode = childList.item(i); + switch (currentNode.getNodeType()) + { + case Node.TEXT_NODE: + break; + case Node.ELEMENT_NODE: + m_properties.add(createProperty(currentNode)); + break; + } + } + } + } + } + + /** + * Exceute the main WebDAV request processing + * + * @exception WebDAVServerException + */ + protected void executeImpl() throws WebDAVServerException, Exception + { + m_response.setStatus(WebDAV.WEBDAV_SC_MULTI_STATUS); + + FileFolderService fileFolderService = getFileFolderService(); + + FileInfo pathNodeInfo = null; + try + { + // Check that the path exists + pathNodeInfo = getDAVHelper().getNodeForPath(getRootNodeRef(), m_strPath, m_request.getServletPath()); + } + catch (FileNotFoundException e) + { + // The path is not valid - send a 404 error back to the client + throw new WebDAVServerException(HttpServletResponse.SC_NOT_FOUND); + } + + // Set the response content type + + m_response.setContentType(WebDAV.XML_CONTENT_TYPE); + + // Create multistatus response + + XMLWriter xml = createXMLWriter(); + + xml.startDocument(); + + String nsdec = generateNamespaceDeclarations(m_namespaces); + xml.startElement( + WebDAV.DAV_NS, + WebDAV.XML_MULTI_STATUS + nsdec, + WebDAV.XML_NS_MULTI_STATUS + nsdec, + getDAVHelper().getNullAttributes()); + + // Create the path for the current location in the tree + StringBuilder baseBuild = new StringBuilder(256); + baseBuild.append(getPath()); + if (baseBuild.length() == 0 || baseBuild.charAt(baseBuild.length() - 1) != WebDAVHelper.PathSeperatorChar) + { + baseBuild.append(WebDAVHelper.PathSeperatorChar); + } + String basePath = baseBuild.toString(); + + // Output the response for the root node, depth zero + generateResponseForNode(xml, pathNodeInfo, basePath); + + // If additional levels are required and the root node is a folder then recurse to the required + // level and output node details a level at a time + if (getDepth() != WebDAV.DEPTH_0 && pathNodeInfo.isFolder()) + { + // Create the initial list of nodes to report + List nodeInfos = new ArrayList(10); + nodeInfos.add(pathNodeInfo); + + int curDepth = WebDAV.DEPTH_1; + + // Save the base path length + int baseLen = baseBuild.length(); + + // List of next level of nodes to report + List nextNodeInfos = null; + if (getDepth() > WebDAV.DEPTH_1) + { + nextNodeInfos = new ArrayList(10); + } + + // Loop reporting each level of nodes to the requested depth + while (curDepth <= getDepth() && nodeInfos != null) + { + // Clear out the next level of nodes, if required + if (nextNodeInfos != null) + { + nextNodeInfos.clear(); + } + + // Output the current level of node(s), the node list should + // only contain folder nodes + + for (FileInfo curNodeInfo : nodeInfos) + { + // Get the list of child nodes for the current node + List childNodeInfos = fileFolderService.list(curNodeInfo.getNodeRef()); + + // can skip the current node if it doesn't have children + if (childNodeInfos.size() == 0) + { + continue; + } + + // Output the child node details + // Generate the base path for the current parent node + + baseBuild.setLength(baseLen); + try + { + String pathSnippet = getDAVHelper().getPathFromNode(pathNodeInfo.getNodeRef(), curNodeInfo.getNodeRef()); + baseBuild.append(pathSnippet); + } + catch (FileNotFoundException e) + { + // move to the next node + continue; + } + + int curBaseLen = baseBuild.length(); + + // Output the child node details + for (FileInfo curChildInfo : childNodeInfos) + { + // Build the path for the current child node + baseBuild.setLength(curBaseLen); + + baseBuild.append(curChildInfo.getName()); + + // Output the current child node details + generateResponseForNode(xml, curChildInfo, baseBuild.toString()); + + // If the child is a folder add it to the list of next level nodes + if (nextNodeInfos != null && curChildInfo.isFolder()) + { + nextNodeInfos.add(curChildInfo); + } + } + } + + // Update the current tree depth + curDepth++; + + // Move the next level of nodes to the current node list + nodeInfos = nextNodeInfos; + } + } + + // Close the outer XML element + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_MULTI_STATUS, WebDAV.XML_NS_MULTI_STATUS); + + // Send remaining data + xml.flush(); + } + + /** + * Creates a WebDAVProperty from the given XML node + */ + private WebDAVProperty createProperty(Node node) + { + WebDAVProperty property = null; + + String strName = node.getLocalName(); + String strNamespaceUri = node.getNamespaceURI(); + + if (strNamespaceUri.equals(WebDAV.DEFAULT_NAMESPACE_URI)) + { + property = new WebDAVProperty(strName); + } + else + { + property = new WebDAVProperty(strName, strNamespaceUri, getNamespaceName(strNamespaceUri)); + } + + return property; + } + + /** + * Retrieves the namespace name for the given namespace URI, one is + * generated if it doesn't exist + */ + private String getNamespaceName(String strNamespaceUri) + { + String strNamespaceName = m_namespaces.get(strNamespaceUri); + if (strNamespaceName == null) + { + strNamespaceName = "ns" + m_namespaces.size(); + m_namespaces.put(strNamespaceUri, strNamespaceName); + } + + return strNamespaceName; + } + + /** + * Generates the required response XML for the current node + * + * @param xml XMLWriter + * @param node NodeRef + * @param path String + */ + private void generateResponseForNode(XMLWriter xml, FileInfo nodeInfo, String path) throws Exception + { + NodeRef nodeRef = nodeInfo.getNodeRef(); + boolean isFolder = nodeInfo.isFolder(); + + // Output the response block for the current node + xml.startElement( + WebDAV.DAV_NS, + WebDAV.XML_RESPONSE, + WebDAV.XML_NS_RESPONSE, + getDAVHelper().getNullAttributes()); + + // Build the href string for the current node + String strHRef = WebDAV.getURLForPath(m_request, path, isFolder); + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_HREF, WebDAV.XML_NS_HREF, getDAVHelper().getNullAttributes()); + xml.write(strHRef); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_HREF, WebDAV.XML_NS_HREF); + + switch (m_mode) + { + case GET_NAMED_PROPS: + generateNamedPropertiesResponse(xml, nodeInfo); + break; + case GET_ALL_PROPS: + generateAllPropertiesResponse(xml, nodeRef, isFolder); + break; + case FIND_PROPS: + generateFindPropertiesResponse(xml, nodeRef, isFolder); + break; + } + + // Close off the response element + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_RESPONSE, WebDAV.XML_NS_RESPONSE); + } + + /** + * Generates the XML response for a PROPFIND request that asks for a + * specific set of properties + * + * @param xml XMLWriter + * @param node NodeRef + * @param isDir boolean + */ + private void generateNamedPropertiesResponse(XMLWriter xml, FileInfo nodeInfo) throws Exception + { + NodeRef nodeRef = nodeInfo.getNodeRef(); + boolean isFolder = nodeInfo.isFolder(); + + // Get the properties for the node + Map props = getNodeService().getProperties(nodeRef); + + // Output the start of the properties element + Attributes nullAttr = getDAVHelper().getNullAttributes(); + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_PROPSTAT, WebDAV.XML_NS_PROPSTAT, nullAttr); + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_PROP, WebDAV.XML_NS_PROP, nullAttr); + + ArrayList propertiesNotFound = new ArrayList(); + + TypeConverter typeConv = DefaultTypeConverter.INSTANCE; + + // Loop through the requested property list + for (WebDAVProperty property : m_properties) + { + // Get the requested property details + + String propName = property.getName(); + String propNamespaceUri = property.getNamespaceUri(); +// String propNamespaceName = property.getNamespaceName(); + + // Check if the property is a standard WebDAV property + + Object davValue = null; + + if (propNamespaceUri.equals(WebDAV.DEFAULT_NAMESPACE_URI)) + { + // Check if the client is requesting lock information + if (propName.equals(WebDAV.XML_LOCK_DISCOVERY)) // && metaData.isLocked()) + { + generateLockDiscoveryResponse(xml, nodeRef, isFolder); + } + else if (propName.equals(WebDAV.XML_SUPPORTED_LOCK)) + { + // Output the supported lock types + writeLockTypes(xml); + } + + // Check if the client is requesting the resource type + + else if (propName.equals(WebDAV.XML_RESOURCE_TYPE)) + { + // If the node is a folder then return as a collection type + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_RESOURCE_TYPE, WebDAV.XML_NS_RESOURCE_TYPE, nullAttr); + if (isFolder) + { + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_COLLECTION)); + } + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_RESOURCE_TYPE, WebDAV.XML_NS_RESOURCE_TYPE); + } + else if (propName.equals(WebDAV.XML_DISPLAYNAME)) + { + // Get the node name + if (getRootNodeRef().equals(nodeRef)) + { + // Output an empty name for the root node + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_SOURCE)); + } + else + { + // Get the node name + davValue = WebDAV.getDAVPropertyValue(props, WebDAV.XML_DISPLAYNAME); + + // Output the node name + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_DISPLAYNAME, WebDAV.XML_NS_DISPLAYNAME, nullAttr); + if (davValue != null) + { + String name = typeConv.convert(String.class, davValue); + if (name == null || name.length() == 0) + { + logger.error("WebDAV name is null, value=" + davValue.getClass().getName() + ", node=" + nodeRef); + } + xml.write(name); + } + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_DISPLAYNAME, WebDAV.XML_NS_DISPLAYNAME); + } + } + else if (propName.equals(WebDAV.XML_SOURCE)) + { + // NOTE: source is always a no content element in our + // implementation + + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_SOURCE)); + } + else if (propName.equals(WebDAV.XML_GET_LAST_MODIFIED)) + { + // Get the modifed date/time + + davValue = WebDAV.getDAVPropertyValue(props, WebDAV.XML_GET_LAST_MODIFIED); + + // Output the last modified date of the node + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_GET_LAST_MODIFIED, WebDAV.XML_NS_GET_LAST_MODIFIED, + nullAttr); + if (davValue != null) + xml.write(WebDAV.formatModifiedDate(typeConv.convert(Date.class, davValue))); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_GET_LAST_MODIFIED, WebDAV.XML_NS_GET_LAST_MODIFIED); + } + else if (propName.equals(WebDAV.XML_GET_CONTENT_LANGUAGE) && !isFolder) + { + // Get the content language + // TODO: + // Output the content language + xml.startElement( + WebDAV.DAV_NS, WebDAV.XML_GET_CONTENT_LANGUAGE, + WebDAV.XML_NS_GET_CONTENT_LANGUAGE, nullAttr); + // TODO: + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_GET_CONTENT_LANGUAGE, WebDAV.XML_NS_GET_CONTENT_LANGUAGE); + } + else if (propName.equals(WebDAV.XML_GET_CONTENT_TYPE) && !isFolder) + { + // Get the content type + davValue = WebDAV.getDAVPropertyValue(props, WebDAV.XML_GET_CONTENT_TYPE); + + // Output the content type + xml.startElement( + WebDAV.DAV_NS, WebDAV.XML_GET_CONTENT_TYPE, + WebDAV.XML_NS_GET_CONTENT_TYPE, nullAttr); + if (davValue != null) + xml.write(typeConv.convert(String.class, davValue)); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_GET_CONTENT_TYPE, WebDAV.XML_NS_GET_CONTENT_TYPE); + } + else if (propName.equals(WebDAV.XML_GET_ETAG) && !isFolder) + { + // Output the etag + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_GET_ETAG, WebDAV.XML_NS_GET_ETAG, nullAttr); + xml.write(getDAVHelper().makeETag(nodeRef)); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_GET_ETAG, WebDAV.XML_NS_GET_ETAG); + } + else if (propName.equals(WebDAV.XML_GET_CONTENT_LENGTH)) + { + // Get the content length, if it's not a folder + long len = 0; + + if (!isFolder) + { + ContentData contentData = (ContentData) props.get(ContentModel.PROP_CONTENT); + if (contentData != null) + len = contentData.getSize(); + } + + // Output the content length + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_GET_CONTENT_LENGTH, WebDAV.XML_NS_GET_CONTENT_LENGTH, + nullAttr); + xml.write("" + len); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_GET_CONTENT_LENGTH, WebDAV.XML_NS_GET_CONTENT_LENGTH); + } + else if (propName.equals(WebDAV.XML_CREATION_DATE)) + { + // Get the creation date + davValue = WebDAV.getDAVPropertyValue(props, WebDAV.XML_CREATION_DATE); + + // Output the creation date + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_CREATION_DATE, WebDAV.XML_NS_CREATION_DATE, nullAttr); + if (davValue != null) + xml.write(WebDAV.formatCreationDate(typeConv.convert(Date.class, davValue))); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_CREATION_DATE, WebDAV.XML_NS_CREATION_DATE); + } + else + { + // Could not map the requested property to an Alfresco property + if (property.getName().equals(WebDAV.XML_HREF) == false) + propertiesNotFound.add(property); + } + } + else + { + // Look in the custom properties + + // TODO: Custom properties lookup +// String qualifiedName = propNamespaceUri + WebDAV.NAMESPACE_SEPARATOR + propName; + propertiesNotFound.add(property); + } + } + + // Close off the successful part of the response + + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_PROP, WebDAV.XML_NS_PROP); + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_STATUS, WebDAV.XML_NS_STATUS, nullAttr); + xml.write(WebDAV.HTTP1_1 + " " + HttpServletResponse.SC_OK + " " + WebDAV.SC_OK_DESC); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_STATUS, WebDAV.XML_NS_STATUS); + + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_PROPSTAT, WebDAV.XML_NS_PROPSTAT); + + // If some of the requested properties were not found return another + // status section + + if (propertiesNotFound.size() > 0) + { + // Start the second status section + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_PROPSTAT, WebDAV.XML_NS_PROPSTAT, nullAttr); + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_PROP, WebDAV.XML_NS_PROP, nullAttr); + + // Loop through the list of properties that were not found + + for (WebDAVProperty property : propertiesNotFound) + { + // Output the property not found status block + + String propName = property.getName(); + String propNamespaceName = property.getNamespaceName(); + String propQName = propName; + if (propNamespaceName != null && propNamespaceName.length() > 0) + propQName = propNamespaceName + ":" + propName; + + xml.write(DocumentHelper.createElement(propQName)); + } + + // Close the unsuccessful part of the response + + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_PROP, WebDAV.XML_NS_PROP); + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_STATUS, WebDAV.XML_NS_STATUS, nullAttr); + xml.write(WebDAV.HTTP1_1 + " " + HttpServletResponse.SC_NOT_FOUND + " " + WebDAV.SC_NOT_FOUND_DESC); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_STATUS, WebDAV.XML_NS_STATUS); + + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_PROPSTAT, WebDAV.XML_NS_PROPSTAT); + } + } + + /** + * Generates the XML response for a PROPFIND request that asks for all known + * properties + * + * @param xml XMLWriter + * @param node NodeRef + * @param isDir boolean + */ + private void generateAllPropertiesResponse(XMLWriter xml, NodeRef node, boolean isDir) throws Exception + { + // Get the properties for the node + + Map props = getNodeService().getProperties(node); + + // Output the start of the properties element + + Attributes nullAttr = getDAVHelper().getNullAttributes(); + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_PROPSTAT, WebDAV.XML_NS_PROPSTAT, nullAttr); + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_PROP, WebDAV.XML_NS_PROP, nullAttr); + + // Generate a lock status report, if locked + + generateLockDiscoveryResponse(xml, node, isDir); + + // Output the supported lock types + + writeLockTypes(xml); + + // If the node is a folder then return as a collection type + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_RESOURCE_TYPE, WebDAV.XML_NS_RESOURCE_TYPE, nullAttr); + if (isDir) + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_COLLECTION)); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_RESOURCE_TYPE, WebDAV.XML_NS_RESOURCE_TYPE); + + // Get the node name + + Object davValue = WebDAV.getDAVPropertyValue(props, WebDAV.XML_DISPLAYNAME); + + TypeConverter typeConv = DefaultTypeConverter.INSTANCE; + + // Output the node name + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_DISPLAYNAME, WebDAV.XML_NS_DISPLAYNAME, nullAttr); + if (davValue != null) + { + String name = typeConv.convert(String.class, davValue); + if (name == null || name.length() == 0) + { + logger.error("WebDAV name is null, value=" + davValue.getClass().getName() + ", node=" + node); + } + xml.write(name); + } + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_DISPLAYNAME, WebDAV.XML_NS_DISPLAYNAME); + + // Output the source + // + // NOTE: source is always a no content element in our implementation + + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_SOURCE)); + + // Get the creation date + + davValue = WebDAV.getDAVPropertyValue(props, WebDAV.XML_CREATION_DATE); + + // Output the creation date + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_CREATION_DATE, WebDAV.XML_NS_CREATION_DATE, nullAttr); + if (davValue != null) + xml.write(WebDAV.formatCreationDate(typeConv.convert(Date.class, davValue))); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_CREATION_DATE, WebDAV.XML_NS_CREATION_DATE); + + // Get the modifed date/time + + davValue = WebDAV.getDAVPropertyValue(props, WebDAV.XML_GET_LAST_MODIFIED); + + // Output the last modified date of the node + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_GET_LAST_MODIFIED, WebDAV.XML_NS_GET_LAST_MODIFIED, nullAttr); + if (davValue != null) + xml.write(WebDAV.formatModifiedDate(typeConv.convert(Date.class, davValue))); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_GET_LAST_MODIFIED, WebDAV.XML_NS_GET_LAST_MODIFIED); + + // For a file node output the content language and content type + + if (isDir == false) + { + // Get the content language + + // TODO: + // Output the content language + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_GET_CONTENT_LANGUAGE, WebDAV.XML_NS_GET_CONTENT_LANGUAGE, + nullAttr); + // TODO: + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_GET_CONTENT_LANGUAGE, WebDAV.XML_NS_GET_CONTENT_LANGUAGE); + + // Get the content type + davValue = WebDAV.getDAVPropertyValue(props, WebDAV.XML_GET_CONTENT_TYPE); + + // Output the content type + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_GET_CONTENT_TYPE, WebDAV.XML_NS_GET_CONTENT_TYPE, nullAttr); + if (davValue != null) + xml.write(typeConv.convert(String.class, davValue)); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_GET_CONTENT_TYPE, WebDAV.XML_NS_GET_CONTENT_TYPE); + + // Output the etag + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_GET_ETAG, WebDAV.XML_NS_GET_ETAG, nullAttr); + xml.write(getDAVHelper().makeETag(node)); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_GET_ETAG, WebDAV.XML_NS_GET_ETAG); + } + + // Get the content length, if it's not a folder + + long len = 0; + + if (isDir == false) + { + ContentData contentData = (ContentData) props.get(ContentModel.PROP_CONTENT); + if (contentData != null) + len = contentData.getSize(); + } + + // Output the content length + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_GET_CONTENT_LENGTH, WebDAV.XML_NS_GET_CONTENT_LENGTH, nullAttr); + xml.write("" + len); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_GET_CONTENT_LENGTH, WebDAV.XML_NS_GET_CONTENT_LENGTH); + + // Print out all the custom properties + + // TODO: Output custom properties + + // Close off the response + + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_PROP, WebDAV.XML_NS_PROP); + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_STATUS, WebDAV.XML_NS_STATUS, nullAttr); + xml.write(WebDAV.HTTP1_1 + " " + HttpServletResponse.SC_OK + " " + WebDAV.SC_OK_DESC); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_STATUS, WebDAV.XML_NS_STATUS); + + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_PROPSTAT, WebDAV.XML_NS_PROPSTAT); + } + + /** + * Generates the XML response for a PROPFIND request that asks for a list of + * all known properties + * + * @param xml XMLWriter + * @param node NodeRef + * @param isDir boolean + */ + private void generateFindPropertiesResponse(XMLWriter xml, NodeRef node, boolean isDir) + { + try + { + // Output the start of the properties element + + Attributes nullAttr = getDAVHelper().getNullAttributes(); + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_PROPSTAT, WebDAV.XML_NS_PROPSTAT, nullAttr); + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_PROP, WebDAV.XML_NS_PROP, nullAttr); + + // Output the well-known properties + + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_LOCK_DISCOVERY)); + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_SUPPORTED_LOCK)); + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_RESOURCE_TYPE)); + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_DISPLAYNAME)); + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_GET_LAST_MODIFIED)); + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_GET_CONTENT_LENGTH)); + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_CREATION_DATE)); + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_GET_ETAG)); + + if (isDir) + { + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_GET_CONTENT_LANGUAGE)); + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_GET_CONTENT_TYPE)); + } + + // Output the custom properties + + // TODO: Custom properties + + // Close off the response + + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_PROP, WebDAV.XML_NS_PROP); + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_STATUS, WebDAV.XML_NS_STATUS, nullAttr); + xml.write(WebDAV.HTTP1_1 + " " + HttpServletResponse.SC_OK + " " + WebDAV.SC_OK_DESC); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_STATUS, WebDAV.XML_NS_STATUS); + + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_PROPSTAT, WebDAV.XML_NS_PROPSTAT); + } + catch (Exception ex) + { + // Convert to a runtime exception + + throw new AlfrescoRuntimeException("XML processing error", ex); + } + } + + /** + * Generates the XML response snippet showing the lock information for the + * given path + * + * @param xml XMLWriter + * @param node NodeRef + * @param isDir boolean + */ + private void generateLockDiscoveryResponse(XMLWriter xml, NodeRef node, boolean isDir) throws Exception + { + // Get the lock status for the node + + LockService lockService = getLockService(); + LockStatus lockSts = lockService.getLockStatus(node); + + // Output the lock status reponse + + if (lockSts != LockStatus.NO_LOCK) + generateLockDiscoveryXML(xml, node); + } + + /** + * Output the supported lock types XML element + * + * @param xml XMLWriter + */ + private void writeLockTypes(XMLWriter xml) + { + try + { + AttributesImpl nullAttr = getDAVHelper().getNullAttributes(); + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_SUPPORTED_LOCK, WebDAV.XML_NS_SUPPORTED_LOCK, nullAttr); + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_LOCK_SCOPE, WebDAV.XML_NS_LOCK_SCOPE, nullAttr); + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_EXCLUSIVE)); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_LOCK_SCOPE, WebDAV.XML_NS_LOCK_SCOPE); + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_LOCK_TYPE, WebDAV.XML_NS_LOCK_TYPE, nullAttr); + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_WRITE)); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_LOCK_TYPE, WebDAV.XML_NS_LOCK_TYPE); + + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_SUPPORTED_LOCK, WebDAV.XML_NS_SUPPORTED_LOCK); + } + catch (Exception ex) + { + throw new AlfrescoRuntimeException("XML write error", ex); + } + } +} diff --git a/source/java/org/alfresco/repo/webdav/PutMethod.java b/source/java/org/alfresco/repo/webdav/PutMethod.java new file mode 100644 index 0000000000..b99330f3dc --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/PutMethod.java @@ -0,0 +1,158 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +import java.io.InputStream; +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +import javax.servlet.http.HttpServletResponse; + +import org.alfresco.model.ContentModel; +import org.alfresco.service.cmr.model.FileExistsException; +import org.alfresco.service.cmr.model.FileFolderService; +import org.alfresco.service.cmr.model.FileInfo; +import org.alfresco.service.cmr.model.FileNotFoundException; +import org.alfresco.service.cmr.repository.ContentWriter; +import org.alfresco.service.namespace.QName; + +/** + * Implements the WebDAV PUT method + * + * @author Gavin Cornwell + */ +public class PutMethod extends WebDAVMethod +{ + // Request parameters + private String m_strLockToken = null; + private String m_strContentType = null; + private boolean m_expectHeaderPresent = false; + + /** + * Default constructor + */ + public PutMethod() + { + } + + /** + * Parse the request headers + * + * @exception WebDAVServerException + */ + protected void parseRequestHeaders() throws WebDAVServerException + { + m_strContentType = m_request.getHeader(WebDAV.HEADER_CONTENT_TYPE); + String strExpect = m_request.getHeader(WebDAV.HEADER_EXPECT); + + if (strExpect != null && strExpect.equals(WebDAV.HEADER_EXPECT_CONTENT)) + { + m_expectHeaderPresent = true; + } + + // Get the lock token, if any + + m_strLockToken = parseIfHeader(); + } + + /** + * Parse the request body + * + * @exception WebDAVServerException + */ + protected void parseRequestBody() throws WebDAVServerException + { + // Nothing to do in this method, the body contains + // the content it will be dealt with later + } + + /** + * Exceute the WebDAV request + * + * @exception WebDAVServerException + */ + protected void executeImpl() throws WebDAVServerException, Exception + { + FileFolderService fileFolderService = getFileFolderService(); + + // Get the status for the request path + FileInfo contentNodeInfo = null; + boolean created = false; + try + { + contentNodeInfo = getDAVHelper().getNodeForPath(getRootNodeRef(), getPath(), getServletPath()); + // make sure that we are not trying to use a folder + if (contentNodeInfo.isFolder()) + { + throw new WebDAVServerException(HttpServletResponse.SC_BAD_REQUEST); + } + } + catch (FileNotFoundException e) + { + // the file doesn't exist - create it + String[] paths = getDAVHelper().splitPath(getPath()); + try + { + FileInfo parentNodeInfo = getDAVHelper().getNodeForPath(getRootNodeRef(), paths[0], getServletPath()); + // create file + contentNodeInfo = fileFolderService.create(parentNodeInfo.getNodeRef(), paths[1], ContentModel.TYPE_CONTENT); + created = true; + + // apply the titled aspect - title and description + Map titledProps = new HashMap(3, 1.0f); + titledProps.put(ContentModel.PROP_TITLE, paths[1]); + titledProps.put(ContentModel.PROP_DESCRIPTION, ""); + getNodeService().addAspect(contentNodeInfo.getNodeRef(), ContentModel.ASPECT_TITLED, titledProps); + } + catch (FileNotFoundException ee) + { + // bad path + throw new WebDAVServerException(HttpServletResponse.SC_BAD_REQUEST); + } + catch (FileExistsException ee) + { + // bad path + throw new WebDAVServerException(HttpServletResponse.SC_BAD_REQUEST); + } + } + + // Access the content + ContentWriter writer = fileFolderService.getWriter(contentNodeInfo.getNodeRef()); + // set content properties + if (m_strContentType != null) + { + writer.setMimetype(m_strContentType); + } + else + { + String guessedMimetype = getServiceRegistry().getMimetypeService().guessMimetype(contentNodeInfo.getName()); + writer.setMimetype(guessedMimetype); + } + // use default encoding + writer.setEncoding("UTF-8"); + + // Get the input stream from the request data + InputStream input = m_request.getInputStream(); + + // Write the new data to the content node + writer.putContent(input); + + // Set the response status, depending if the node existed or not + m_response.setStatus(created ? HttpServletResponse.SC_CREATED : HttpServletResponse.SC_NO_CONTENT); + } +} diff --git a/source/java/org/alfresco/repo/webdav/UnlockMethod.java b/source/java/org/alfresco/repo/webdav/UnlockMethod.java new file mode 100644 index 0000000000..2b37c54e8c --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/UnlockMethod.java @@ -0,0 +1,176 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +import javax.servlet.http.HttpServletResponse; + +import org.alfresco.service.cmr.lock.LockService; +import org.alfresco.service.cmr.lock.LockStatus; +import org.alfresco.service.cmr.model.FileInfo; +import org.alfresco.service.cmr.model.FileNotFoundException; + +/** + * Implements the WebDAV UNLOCK method + * + * @author gavinc + */ +public class UnlockMethod extends WebDAVMethod +{ + private String m_strLockToken = null; + + /** + * Default constructor + */ + public UnlockMethod() + { + } + + /** + * Return the lock token of an existing lock + * + * @return String + */ + protected final String getLockToken() + { + return m_strLockToken; + } + + /** + * Parse the request headers + * + * @exception WebDAVServerException + */ + protected void parseRequestHeaders() throws WebDAVServerException + { + // Get the lock token, if any + String strLockTokenHeader = m_request.getHeader(WebDAV.HEADER_LOCK_TOKEN); + + // DEBUG + if (logger.isDebugEnabled()) + logger.debug("Parsing Lock-Token header: " + strLockTokenHeader); + + // Validate the lock token + if (strLockTokenHeader != null && strLockTokenHeader.startsWith("<") && strLockTokenHeader.endsWith(">")) + { + try + { + m_strLockToken = strLockTokenHeader.substring( + WebDAV.OPAQUE_LOCK_TOKEN.length() + 1, + strLockTokenHeader.length() - 1); + } + catch (IndexOutOfBoundsException e) + { + logger.warn("Failed to parse If header: " + strLockTokenHeader); + } + } + + // If there is no token this is a bad request so send an error back + if (m_strLockToken == null) + { + throw new WebDAVServerException(HttpServletResponse.SC_BAD_REQUEST); + } + } + + /** + * Parse the request body + * + * @exception WebDAVServerException + */ + protected void parseRequestBody() throws WebDAVServerException + { + // Nothing to do in this method + } + + /** + * Exceute the request + * + * @exception WebDAVServerException + */ + protected void executeImpl() throws WebDAVServerException + { + if (logger.isDebugEnabled()) + { + logger.debug("Lock node; path=" + getPath() + ", token=" + getLockToken()); + } + + FileInfo lockNodeInfo = null; + try + { + lockNodeInfo = getDAVHelper().getNodeForPath(getRootNodeRef(), getPath(), getServletPath()); + } + catch (FileNotFoundException e) + { + throw new WebDAVServerException(HttpServletResponse.SC_NOT_FOUND); + } + + // Parse the lock token + String[] lockInfo = WebDAV.parseLockToken(getLockToken()); + if (lockInfo == null) + { + // Bad lock token + throw new WebDAVServerException(HttpServletResponse.SC_PRECONDITION_FAILED); + } + + // Get the lock status for the node + LockService lockService = getDAVHelper().getLockService(); + // String nodeId = lockInfo[0]; + // String userName = lockInfo[1]; + + LockStatus lockSts = lockService.getLockStatus(lockNodeInfo.getNodeRef()); + if (lockSts == LockStatus.LOCK_OWNER) + { + // Unlock the node + lockService.unlock(lockNodeInfo.getNodeRef()); + + // Indicate that the unlock was successful + m_response.setStatus(HttpServletResponse.SC_NO_CONTENT); + + // DEBUG + if (logger.isDebugEnabled()) + { + logger.debug("Unlock token=" + getLockToken() + " Successful"); + } + } + else if (lockSts == LockStatus.NO_LOCK) + { + // DEBUG + if (logger.isDebugEnabled()) + logger.debug("Unlock token=" + getLockToken() + " Not locked"); + + // Node is not locked + throw new WebDAVServerException(HttpServletResponse.SC_PRECONDITION_FAILED); + } + else if (lockSts == LockStatus.LOCKED) + { + // DEBUG + if (logger.isDebugEnabled()) + logger.debug("Unlock token=" + getLockToken() + " Not lock owner"); + + // Node is locked but not by this user + throw new WebDAVServerException(HttpServletResponse.SC_PRECONDITION_FAILED); + } + else if (lockSts == LockStatus.LOCK_EXPIRED) + { + // DEBUG + if (logger.isDebugEnabled()) + logger.debug("Unlock token=" + getLockToken() + " Lock expired"); + + // Return a success status + m_response.setStatus(HttpServletResponse.SC_NO_CONTENT); + } + } +} diff --git a/source/java/org/alfresco/repo/webdav/WebDAV.java b/source/java/org/alfresco/repo/webdav/WebDAV.java new file mode 100644 index 0000000000..fbb3b448a2 --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/WebDAV.java @@ -0,0 +1,552 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +import java.io.Serializable; +import java.net.URLDecoder; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; + +import org.alfresco.error.AlfrescoRuntimeException; +import org.alfresco.model.ContentModel; +import org.alfresco.service.cmr.repository.ContentData; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.namespace.QName; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Helper class used by the WebDAV protocol handling classes + * + * @author gavinc + */ +public class WebDAV +{ + // Logging + + private static Log logger = LogFactory.getLog("org.alfresco.protocol.webdav"); + + // WebDAV XML namespace + + public static final String DAV_NS = "D"; + public static final String DAV_NS_PREFIX = DAV_NS + ":"; + + // PROPFIND depth + + public static final int DEPTH_0 = 0; + public static final int DEPTH_1 = 1; + public static final int DEPTH_INFINITY = -1; + public static final short TIMEOUT_INFINITY = -1; + + // WebDAV HTTP response codes + + public static final int WEBDAV_SC_MULTI_STATUS = 207; + public static final int WEBDAV_SC_LOCKED = 423; + + // HTTP response code descriptions + + public static final String SC_OK_DESC = "OK"; + public static final String SC_NOT_FOUND_DESC = "Not Found"; + + // HTTP methods + + public static final String METHOD_PUT = "PUT"; + public static final String METHOD_POST = "POST"; + public static final String METHOD_GET = "GET"; + public static final String METHOD_DELETE = "DELETE"; + public static final String METHOD_HEAD = "HEAD"; + public static final String METHOD_OPTIONS = "OPTIONS"; + public static final String METHOD_PROPFIND = "PROPFIND"; + public static final String METHOD_PROPPATCH = "PROPPATCH"; + public static final String METHOD_MKCOL = "MKCOL"; + public static final String METHOD_MOVE = "MOVE"; + public static final String METHOD_COPY = "COPY"; + public static final String METHOD_LOCK = "LOCK"; + public static final String METHOD_UNLOCK = "UNLOCK"; + + // HTTP headers + + public static final String HEADER_CONTENT_LENGTH = "Content-Length"; + public static final String HEADER_CONTENT_TYPE = "Content-Type"; + public static final String HEADER_DEPTH = "Depth"; + public static final String HEADER_DESTINATION = "Destination"; + public static final String HEADER_ETAG = "ETag"; + public static final String HEADER_EXPECT = "Expect"; + public static final String HEADER_EXPECT_CONTENT = "100-continue"; + public static final String HEADER_IF = "If"; + public static final String HEADER_IF_MATCH = "If-Match"; + public static final String HEADER_IF_MODIFIED_SINCE = "If-Modified-Since"; + public static final String HEADER_IF_NONE_MATCH = "If-None-Match"; + public static final String HEADER_IF_RANGE = "If-Range"; + public static final String HEADER_IF_UNMODIFIED_SINCE = "If-Unmodified-Since"; + public static final String HEADER_LAST_MODIFIED = "Last-Modified"; + public static final String HEADER_LOCK_TOKEN = "Lock-Token"; + public static final String HEADER_OVERWRITE = "Overwrite"; + public static final String HEADER_RANGE = "Range"; + public static final String HEADER_TIMEOUT = "Timeout"; + + // If-Modified/If-Unmodified date format + + public static final String HEADER_IF_DATE_FORMAT = "EEE, dd MMM yyyy HH:mm:ss zzz"; + + // General string constants + + public static final String ASTERISK = "*"; + public static final String DEFAULT_NAMESPACE_URI = "DAV:"; + public static final String DIR_SEPARATOR = "/"; + public static final String FAKE_TOKEN = "faketoken"; + public static final String HTTP1_1 = "HTTP/1.1"; + public static final String INFINITE = "Infinite"; + public static final String INFINITY = "infinity"; + public static final String OPAQUE_LOCK_TOKEN = "opaquelocktoken:"; + public static final String NAMESPACE_SEPARATOR = ":"; + public static final String SECOND = "Second-"; + public static final String HEADER_VALUE_SEPARATOR = ","; + public static final String ZERO = "0"; + public static final String ONE = "1"; + public static final String T = "T"; + + // Strings used in WebDAV XML payload + + public static final String XML_NS = "xmlns"; + + public static final String XML_ACTIVE_LOCK = "activelock"; + public static final String XML_ALLPROP = "allprop"; + public static final String XML_COLLECTION = "collection"; + public static final String XML_CREATION_DATE = "creationdate"; + public static final String XML_DEPTH = "depth"; + public static final String XML_DISPLAYNAME = "displayname"; + public static final String XML_EXCLUSIVE = "exclusive"; + public static final String XML_GET_CONTENT_LANGUAGE = "getcontentlanguage"; + public static final String XML_GET_CONTENT_LENGTH = "getcontentlength"; + public static final String XML_GET_CONTENT_TYPE = "getcontenttype"; + public static final String XML_GET_ETAG = "getetag"; + public static final String XML_GET_LAST_MODIFIED = "getlastmodified"; + public static final String XML_HREF = "href"; + public static final String XML_LOCK_DISCOVERY = "lockdiscovery"; + public static final String XML_LOCK_SCOPE = "lockscope"; + public static final String XML_LOCK_TOKEN = "locktoken"; + public static final String XML_LOCK_TYPE = "locktype"; + public static final String XML_MULTI_STATUS = "multistatus"; + public static final String XML_OWNER = "owner"; + public static final String XML_PROP = "prop"; + public static final String XML_PROPNAME = "propname"; + public static final String XML_PROPSTAT = "propstat"; + public static final String XML_RESOURCE_TYPE = "resourcetype"; + public static final String XML_RESPONSE = "response"; + public static final String XML_SHARED = "shared"; + public static final String XML_SOURCE = "source"; + public static final String XML_STATUS = "status"; + public static final String XML_SUPPORTED_LOCK = "supportedlock"; + public static final String XML_TIMEOUT = "timeout"; + public static final String XML_WRITE = "write"; + + // Namespaced versions of payload elements + + public static final String XML_NS_ACTIVE_LOCK = DAV_NS_PREFIX + "activelock"; + public static final String XML_NS_ALLPROP = DAV_NS_PREFIX + "allprop"; + public static final String XML_NS_COLLECTION = DAV_NS_PREFIX + "collection"; + public static final String XML_NS_CREATION_DATE = DAV_NS_PREFIX + "creationdate"; + public static final String XML_NS_DEPTH = DAV_NS_PREFIX + "depth"; + public static final String XML_NS_DISPLAYNAME = DAV_NS_PREFIX + "displayname"; + public static final String XML_NS_EXCLUSIVE = DAV_NS_PREFIX + "exclusive"; + public static final String XML_NS_GET_CONTENT_LANGUAGE = DAV_NS_PREFIX + "getcontentlanguage"; + public static final String XML_NS_GET_CONTENT_LENGTH = DAV_NS_PREFIX + "getcontentlength"; + public static final String XML_NS_GET_CONTENT_TYPE = DAV_NS_PREFIX + "getcontenttype"; + public static final String XML_NS_GET_ETAG = DAV_NS_PREFIX + "getetag"; + public static final String XML_NS_GET_LAST_MODIFIED = DAV_NS_PREFIX + "getlastmodified"; + public static final String XML_NS_HREF = DAV_NS_PREFIX + "href"; + public static final String XML_NS_LOCK_DISCOVERY = DAV_NS_PREFIX + "lockdiscovery"; + public static final String XML_NS_LOCK_SCOPE = DAV_NS_PREFIX + "lockscope"; + public static final String XML_NS_LOCK_TOKEN = DAV_NS_PREFIX + "locktoken"; + public static final String XML_NS_LOCK_TYPE = DAV_NS_PREFIX + "locktype"; + public static final String XML_NS_MULTI_STATUS = DAV_NS_PREFIX + "multistatus"; + public static final String XML_NS_OWNER = DAV_NS_PREFIX + "owner"; + public static final String XML_NS_PROP = DAV_NS_PREFIX + "prop"; + public static final String XML_NS_PROPNAME = DAV_NS_PREFIX + "propname"; + public static final String XML_NS_PROPSTAT = DAV_NS_PREFIX + "propstat"; + public static final String XML_NS_RESOURCE_TYPE = DAV_NS_PREFIX + "resourcetype"; + public static final String XML_NS_RESPONSE = DAV_NS_PREFIX + "response"; + public static final String XML_NS_SHARED = DAV_NS_PREFIX + "shared"; + public static final String XML_NS_SOURCE = DAV_NS_PREFIX + "source"; + public static final String XML_NS_STATUS = DAV_NS_PREFIX + "status"; + public static final String XML_NS_SUPPORTED_LOCK = DAV_NS_PREFIX + "supportedlock"; + public static final String XML_NS_TIMEOUT = DAV_NS_PREFIX + "timeout"; + public static final String XML_NS_WRITE = DAV_NS_PREFIX + "write"; + + public static final String XML_CONTENT_TYPE = "text/xml; charset=UTF-8"; + + private static HashMap s_codeDescriptions = null; + + // Path seperator + + private static final String DIR_SEPERATOR = "\\"; + + // Path seperator + + public static final String PathSeperator = "/"; + public static final char PathSeperatorChar = '/'; + + // Lock token seperator + + public static final String LOCK_TOKEN_SEPERATOR = ":"; + + // Root path + + private static final String RootPath = PathSeperator; + + // Map WebDAV property names to Alfresco property names + + private static Hashtable _propertyNameMap; + + // WebDAV creation date/time formatter + + private static SimpleDateFormat _creationDateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); + + // HTTP header date/time formatter + + private static SimpleDateFormat _httpDateFormatter = new SimpleDateFormat(HEADER_IF_DATE_FORMAT); + + /** + * Formats the given date so that it conforms with the Last-Modified HTTP header + * + * @param date The date to format + * @return The formatted date string + */ + public static String formatModifiedDate(Date date) + { + return _httpDateFormatter.format(date); + } + + /** + * Formats the given date so that it conforms with the Last-Modified HTTP header + * + * @param date long + * @return The formatted date string + */ + public static String formatModifiedDate(long ldate) + { + return _httpDateFormatter.format(new Date(ldate)); + } + + /** + * Formats the given date so that it conforms with the WebDAV creation date/time format + * + * @param date The date to format + * @return The formatted date string + */ + public static String formatCreationDate(Date date) + { + return _creationDateFormatter.format(date); + } + + /** + * Formats the given date so that it conforms with the WebDAV creation date/time format + * + * @param date long + * @return The formatted date string + */ + public static String formatCreationDate(long ldate) + { + return _creationDateFormatter.format(new Date(ldate)); + } + + /** + * Formats the given date for use in the HTTP header + * + * @param date Date + * @return String + */ + public static String formatHeaderDate(Date date) + { + return _httpDateFormatter.format( date); + } + + /** + * Formats the given date for use in the HTTP header + * + * @param date long + * @return String + */ + public static String formatHeaderDate(long date) + { + return _httpDateFormatter.format( new Date(date)); + } + + /** + * Return the Alfresco property value for the specified WebDAV property + * + * @param props Map + * @param davPropName String + * @return Object + */ + public static Object getDAVPropertyValue( Map props, String davPropName) + { + // Convert the WebDAV property name to the corresponding Alfresco property + + QName propName = _propertyNameMap.get( davPropName); + if ( propName == null) + throw new AlfrescoRuntimeException("No mapping for WebDAV property " + davPropName); + + // Return the property value + Object value = props.get(propName); + if (value instanceof ContentData) + { + ContentData contentData = (ContentData) value; + if (davPropName.equals(WebDAV.XML_GET_CONTENT_TYPE)) + { + value = contentData.getMimetype(); + } + else if (davPropName.equals(WebDAV.XML_GET_CONTENT_LENGTH)) + { + value = new Long(contentData.getSize()); + } + } + return value; + } + + + /** + * Maps the current HTTP request to a path that can be used to access a content repository + * + * @param request HTTP request + * @return A content repository path + */ + public static String getRepositoryPath(HttpServletRequest request) + { + // Try and get the path + + String strPath = request.getPathInfo(); + + // If we failed to get the path from the request try and get the path from the servlet path + + if (strPath == null) + { + strPath = request.getServletPath(); + } + + // If we still have not got a path then default to the root directory + + if (strPath == null || strPath.length() == 0) + { + strPath = RootPath; + } + + // Make sure there are no trailing slashes + + else if (strPath.endsWith(DIR_SEPARATOR)) + { + strPath = strPath.substring(0, strPath.length() - 1); + } + + // Check if the path starts with the base servlet path + + if ( strPath.startsWith(request.getServletPath())) + { + int len = request.getServletPath().length(); + + if ( strPath.length() > len) + strPath = strPath.substring(len); + else + strPath = RootPath; + } + + // Return the path + + return decodeURL(strPath); + } + + /** + * Returns a URL that could be used to access the given path. + * + * @param request HttpServletRequest + * @param path String + * @param isCollection boolean + * @return String + */ + public static String getURLForPath(HttpServletRequest request, String path, boolean isCollection) + { + StringBuilder urlStr = new StringBuilder(request.getRequestURI()); + String servletPath = request.getServletPath(); + + int rootPos = urlStr.indexOf(servletPath); + if ( rootPos != -1) + urlStr.setLength(rootPos + servletPath.length()); + + if ( urlStr.charAt(urlStr.length() - 1) != PathSeperatorChar) + urlStr.append(PathSeperator); + + if ( path.equals(RootPath) == false) + { + if ( path.startsWith(PathSeperator)) + urlStr.append(path.substring(1)); + else + urlStr.append(path); + } + + return urlStr.toString(); + } + + /** + * Returns a context-relative path, beginning with a "/", that represents the canonical version + * of the specified path after ".." and "." elements are resolved out. If the specified path + * attempts to go outside the boundaries of the current context (i.e. too many ".." path + * elements are present), return null instead. + * + * @param strPath The path to be decoded + */ + public static String decodeURL(String strPath) + { + if (strPath == null) + return null; + + // Resolve encoded characters in the normalized path, which also handles encoded + // spaces so we can skip that later. Placed at the beginning of the chain so that + // encoded bad stuff(tm) can be caught by the later checks + + String strNormalized = null; + + try + { + strNormalized = URLDecoder.decode(strPath, "UTF-8"); + } + catch (Exception ex) + { + logger.error("Error in decodeURL, URL = " + strPath, ex); + } + + if (strNormalized == null) + return (null); + + // Normalize the slashes and add leading slash if necessary + + if (strNormalized.indexOf('\\') >= 0) + strNormalized = strNormalized.replace('\\', '/'); + + if (!strNormalized.startsWith("/")) + strNormalized = "/" + strNormalized; + + // Resolve occurrences of "//" in the normalized path + + while (true) + { + int index = strNormalized.indexOf("//"); + if (index < 0) + break; + strNormalized = strNormalized.substring(0, index) + strNormalized.substring(index + 1); + } + + // Resolve occurrences of "/./" in the normalized path + + while (true) + { + int index = strNormalized.indexOf("/./"); + if (index < 0) + break; + strNormalized = strNormalized.substring(0, index) + strNormalized.substring(index + 2); + } + + // Resolve occurrences of "/../" in the normalized path + + while (true) + { + int index = strNormalized.indexOf("/../"); + if (index < 0) + break; + if (index == 0) + return (null); // Trying to go outside our context + + int index2 = strNormalized.lastIndexOf('/', index - 1); + strNormalized = strNormalized.substring(0, index2) + strNormalized.substring(index + 3); + } + + // Return the normalized path that we have completed + + return strNormalized; + } + + /** + * Make a unique lock token + * + * @param lockNode NodeRef + * @param owner String + * @return String + */ + public static final String makeLockToken(NodeRef lockNode, String owner) + { + StringBuilder str = new StringBuilder(); + + str.append(WebDAV.OPAQUE_LOCK_TOKEN); + str.append(lockNode.getId()); + str.append(LOCK_TOKEN_SEPERATOR); + str.append(owner); + + return str.toString(); + } + + /** + * Parse a lock token returning the node if and username + * + * @param lockToken String + * @return String[] + */ + public static final String[] parseLockToken(String lockToken) + { + // Check if the lock token is valid + + if ( lockToken == null) + return null; + + // Check if the token contains the lock token header + + if ( lockToken.startsWith(WebDAV.OPAQUE_LOCK_TOKEN)) + lockToken = lockToken.substring(WebDAV.OPAQUE_LOCK_TOKEN.length()); + + // Split the node id and username tokens + + int pos = lockToken.indexOf(LOCK_TOKEN_SEPERATOR); + if ( pos == -1) + return null; + + String[] tokens = new String[2]; + + tokens[0] = lockToken.substring(0,pos); + tokens[1] = lockToken.substring(pos + 1); + + return tokens; + } + + /** + * Static initializer + */ + static + { + // Create the WebDAV to Alfresco property mapping table + + _propertyNameMap = new Hashtable(); + + _propertyNameMap.put(XML_DISPLAYNAME, ContentModel.PROP_NAME); + _propertyNameMap.put(XML_CREATION_DATE, ContentModel.PROP_CREATED); + _propertyNameMap.put(XML_GET_LAST_MODIFIED, ContentModel.PROP_MODIFIED); + _propertyNameMap.put(XML_GET_CONTENT_TYPE, ContentModel.PROP_CONTENT); + } +} diff --git a/source/java/org/alfresco/repo/webdav/WebDAVHelper.java b/source/java/org/alfresco/repo/webdav/WebDAVHelper.java new file mode 100644 index 0000000000..4d69018675 --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/WebDAVHelper.java @@ -0,0 +1,418 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.StringTokenizer; + +import org.alfresco.model.ContentModel; +import org.alfresco.service.ServiceRegistry; +import org.alfresco.service.cmr.dictionary.DictionaryService; +import org.alfresco.service.cmr.lock.LockService; +import org.alfresco.service.cmr.model.FileFolderService; +import org.alfresco.service.cmr.model.FileInfo; +import org.alfresco.service.cmr.model.FileNotFoundException; +import org.alfresco.service.cmr.repository.CopyService; +import org.alfresco.service.cmr.repository.MimetypeService; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter; +import org.alfresco.service.cmr.search.SearchService; +import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.namespace.NamespaceService; +import org.alfresco.util.EqualsHelper; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.xml.sax.helpers.AttributesImpl; + +/** + * WebDAV Protocol Helper Class + * + *

Provides helper methods for repository access using the WebDAV protocol. + * + * @author GKSpencer + */ +public class WebDAVHelper +{ + // Constants + + // Path seperator + public static final String PathSeperator = "/"; + public static final char PathSeperatorChar = '/'; + + // Logging + private static Log logger = LogFactory.getLog("org.alfresco.protocol.webdav"); + + // Service registry + private ServiceRegistry m_serviceRegistry; + + // Services + private NodeService m_nodeService; + private FileFolderService m_fileFolderService; + private SearchService m_searchService; + private NamespaceService m_namespaceService; + private DictionaryService m_dictionaryService; + private MimetypeService m_mimetypeService; + private LockService m_lockService; + private AuthenticationService m_authService; + + // Empty XML attribute list + + private AttributesImpl m_nullAttribs = new AttributesImpl(); + + /** + * Class constructor + * + * @param serviceRegistry ServiceRegistry + * @param authService AuthenticationService + */ + protected WebDAVHelper(ServiceRegistry serviceRegistry, AuthenticationService authService) + { + m_serviceRegistry = serviceRegistry; + + m_nodeService = m_serviceRegistry.getNodeService(); + m_fileFolderService = m_serviceRegistry.getFileFolderService(); + m_searchService = m_serviceRegistry.getSearchService(); + m_namespaceService = m_serviceRegistry.getNamespaceService(); + m_dictionaryService = m_serviceRegistry.getDictionaryService(); + m_mimetypeService = m_serviceRegistry.getMimetypeService(); + m_lockService = m_serviceRegistry.getLockService(); + + m_authService = authService; + } + + /** + * Return the authentication service + * + * @return AuthenticationService + */ + public final AuthenticationService getAuthenticationService() + { + return m_authService; + } + + /** + * Return the service registry + * + * @return ServiceRegistry + */ + public final ServiceRegistry getServiceRegistry() + { + return m_serviceRegistry; + } + + /** + * Return the node service + * + * @return NodeService + */ + public final NodeService getNodeService() + { + return m_nodeService; + } + + public FileFolderService getFileFolderService() + { + return m_fileFolderService; + } + + /** + * Return the search service + * + * @return SearchService + */ + public final SearchService getSearchService() + { + return m_searchService; + } + + /** + * Return the namespace service + * + * @return NamespaceService + */ + public final NamespaceService getNamespaceService() + { + return m_namespaceService; + } + + /** + * Return the dictionary service + * + * @return DictionaryService + */ + public final DictionaryService getDictionaryService() + { + return m_dictionaryService; + } + + /** + * Return the mimetype service + * + * @return MimetypeService + */ + public final MimetypeService getMimetypeService() + { + return m_mimetypeService; + } + + /** + * Return the lock service + * + * @return LockService + */ + public final LockService getLockService() + { + return m_lockService; + } + + /** + * Return the copy service + * + * @return CopyService + */ + public final CopyService getCopyService() + { + return getServiceRegistry().getCopyService(); + } + + /** + * Split the path into seperate directory path and file name strings. + * If the path is not empty, then there will always be an entry for the filename + * + * @param path Full path string. + * @return Returns a String[2] with the folder path and file path. + */ + public final String[] splitPath(String path) + { + if (path == null) + throw new IllegalArgumentException("path may not be null"); + + // Create an array of strings to hold the path and file name strings + String[] pathStr = new String[] {"", ""}; + + // Check if the path has a trailing seperator, if so then there is no file name. + + int pos = path.lastIndexOf(PathSeperatorChar); + if (pos == -1 || pos == (path.length() - 1)) + { + // Set the path string in the returned string array + pathStr[1] = path; + } + else + { + pathStr[0] = path.substring(0, pos); + pathStr[1] = path.substring(pos + 1); + } + // Return the path strings + return pathStr; + } + + /** + * Split the path into all the component directories and filename + * + * @param path String + * @return String[] + */ + public final List splitAllPaths(String path) + { + if (path == null || path.length() == 0) + { + return Collections.emptyList(); + } + + // split the path + StringTokenizer token = new StringTokenizer(path, PathSeperator); + List results = new ArrayList(10); + while (token.hasMoreTokens()) + { + results.add(token.nextToken()); + } + return results; + } + + /** + * Get the file info for the given paths + * + * @param rootNodeRef the acting webdav root + * @param path the path to search for + * @param servletPath the base servlet path, which may be null or empty + * @return Return the file info for the path + * @throws FileNotFoundException if the path doesn't refer to a valid node + */ + public final FileInfo getNodeForPath(NodeRef rootNodeRef, String path, String servletPath) throws FileNotFoundException + { + if (rootNodeRef == null) + { + throw new IllegalArgumentException("Root node may not be null"); + } + else if (path == null) + { + throw new IllegalArgumentException("Path may not be null"); + } + + FileFolderService fileFolderService = getFileFolderService(); + // Check for the root path + if ( path.length() == 0 || path.equals(PathSeperator) || EqualsHelper.nullSafeEquals(path, servletPath)) + { + return fileFolderService.getFileInfo(rootNodeRef); + } + + // remove the servlet path from the path + if (servletPath != null && servletPath.length() > 0 && path.startsWith(servletPath)) + { + // Strip the servlet path from the relative path + path = path.substring(servletPath.length()); + } + + // split the paths up + List splitPath = splitAllPaths(path); + + // find it + FileInfo fileInfo = m_fileFolderService.resolveNamePath(rootNodeRef, splitPath); + + // done + if (logger.isDebugEnabled()) + { + logger.debug("Fetched node for path: \n" + + " root: " + rootNodeRef + "\n" + + " path: " + path + "\n" + + " servlet path: " + servletPath + "\n" + + " result: " + fileInfo); + } + return fileInfo; + } + + public final FileInfo getParentNodeForPath(NodeRef rootNodeRef, String path, String servletPath) throws FileNotFoundException + { + if (rootNodeRef == null) + { + throw new IllegalArgumentException("Root node may not be null"); + } + else if (path == null) + { + throw new IllegalArgumentException("Path may not be null"); + } + // shorten the path + String[] paths = splitPath(path); + return getNodeForPath(rootNodeRef, paths[0], servletPath); + } + + /** + * Return the relative path for the node walking back to the specified root node + * + * @param rootNodeRef the root below which the path will be valid + * @param nodeRef the node's path to get + * @return Returns string of form /A/B/C where C represents the from node and + */ + public final String getPathFromNode(NodeRef rootNodeRef, NodeRef nodeRef) throws FileNotFoundException + { + // Check if the nodes are valid, or equal + if (rootNodeRef == null || nodeRef == null) + throw new IllegalArgumentException("Invalid node(s) in getPathFromNode call"); + + // short cut if the path node is the root node + if (rootNodeRef.equals(nodeRef)) + return ""; + + FileFolderService fileFolderService = getFileFolderService(); + + // get the path elements + List pathInfos = fileFolderService.getNamePath(rootNodeRef, nodeRef); + + // build the path string + StringBuilder sb = new StringBuilder(pathInfos.size() * 20); + for (FileInfo fileInfo : pathInfos) + { + sb.append(WebDAVHelper.PathSeperatorChar); + sb.append(fileInfo.getName()); + } + // done + if (logger.isDebugEnabled()) + { + logger.debug("Build name path for node: \n" + + " root: " + rootNodeRef + "\n" + + " target: " + nodeRef + "\n" + + " path: " + sb); + } + return sb.toString(); + } + + /** + * Make an ETag value for a node using the GUID and modify date/time + * + * @param node NodeRef + * @return String + */ + public final String makeETag(NodeRef node) + { + // Get the modify date/time property for the node + + StringBuilder etag = new StringBuilder(); + makeETagString(node, etag); + return etag.toString(); + } + + /** + * Make an ETag value for a node using the GUID and modify date/time + * + * @param node NodeRef + * @return String + */ + public final String makeQuotedETag(NodeRef node) + { + StringBuilder etag = new StringBuilder(); + + etag.append("\""); + makeETagString(node, etag); + etag.append("\""); + return etag.toString(); + } + + /** + * Make an ETag value for a node using the GUID and modify date/time + * + * @param node NodeRef + * @param str StringBuilder + */ + protected final void makeETagString(NodeRef node, StringBuilder etag) + { + // Get the modify date/time property for the node + + Object modVal = getNodeService().getProperty(node, ContentModel.PROP_MODIFIED); + + etag.append(node.getId()); + + if ( modVal != null) + { + etag.append("_"); + etag.append(DefaultTypeConverter.INSTANCE.longValue(modVal)); + } + } + + /** + * Return the null XML attribute list + * + * @return AttributesImpl + */ + public final AttributesImpl getNullAttributes() + { + return m_nullAttribs; + } +} diff --git a/source/java/org/alfresco/repo/webdav/WebDAVMethod.java b/source/java/org/alfresco/repo/webdav/WebDAVMethod.java new file mode 100644 index 0000000000..6e6d91effe --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/WebDAVMethod.java @@ -0,0 +1,520 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +import java.io.IOException; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.alfresco.model.ContentModel; +import org.alfresco.repo.security.permissions.AccessDeniedException; +import org.alfresco.repo.transaction.TransactionUtil; +import org.alfresco.repo.transaction.TransactionUtil.TransactionWork; +import org.alfresco.service.ServiceRegistry; +import org.alfresco.service.cmr.lock.LockService; +import org.alfresco.service.cmr.model.FileFolderService; +import org.alfresco.service.cmr.repository.ContentService; +import org.alfresco.service.cmr.repository.MimetypeService; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.transaction.TransactionService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.dom4j.DocumentHelper; +import org.dom4j.io.OutputFormat; +import org.dom4j.io.XMLWriter; +import org.w3c.dom.Document; +import org.xml.sax.Attributes; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * Abstract base class for all the WebDAV method handling classes + * + * @author gavinc + */ +public abstract class WebDAVMethod +{ + // Log output + + protected static Log logger = LogFactory.getLog("org.alfresco.webdav.protocol"); + + // Output formatted XML in the response + + private static final boolean XMLPrettyPrint = true; + + // Servlet request/response + + protected HttpServletRequest m_request; + protected HttpServletResponse m_response; + + // WebDAV helper + + protected WebDAVHelper m_davHelper; + + // Root node + + protected NodeRef m_rootNodeRef; + + // Repository path + + protected String m_strPath = null; + + /** + * Default constructor + */ + public WebDAVMethod() + { + } + + /** + * Set the request/response details + * + * @param req HttpServletRequest + * @param resp HttpServletResponse + * @param registry ServiceRegistry + * @param rootNode NodeRef + */ + public void setDetails(HttpServletRequest req, HttpServletResponse resp, WebDAVHelper davHelper, NodeRef rootNode) + { + m_request = req; + m_response = resp; + m_davHelper = davHelper; + m_rootNodeRef = rootNode; + + m_strPath = WebDAV.getRepositoryPath(req); + } + + /** + * Executes the method + */ + public void execute() throws WebDAVServerException + { + // Parse the HTTP headers + parseRequestHeaders(); + + // Parse the HTTP body + parseRequestBody(); + + TransactionWork executeWork = new TransactionWork() + { + public WebDAVServerException doWork() throws Exception + { + executeImpl(); + return null; + } + }; + try + { + // Execute the method + TransactionService transactionService = getTransactionService(); + TransactionUtil.executeInUserTransaction(transactionService, executeWork); + } + catch (AccessDeniedException e) + { + // Return a forbidden status + throw new WebDAVServerException(HttpServletResponse.SC_UNAUTHORIZED, e); + } + catch (Throwable e) + { + Throwable cause = e.getCause(); + if (cause instanceof WebDAVServerException) + { + throw (WebDAVServerException) cause; + } + else + { + // Convert error to a server error + throw new WebDAVServerException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e); + } + } + } + + /** + * Access the content repository to satisfy the request and generates the appropriate WebDAV + * response. + * + * @throws WebDAVServerException a general server exception + * @throws Exception any unhandled exception + */ + protected abstract void executeImpl() throws WebDAVServerException, Exception; + + /** + * Parses the given request body represented as an XML document and sets any necessary context + * ready for execution. + */ + protected abstract void parseRequestBody() throws WebDAVServerException; + + /** + * Parses the HTTP headers of the request and sets any necessary context ready for execution. + */ + protected abstract void parseRequestHeaders() throws WebDAVServerException; + + /** + * Retrieves the request body as an XML document + * + * @return The body of the request as an XML document or null if there isn't a body + */ + protected Document getRequestBodyAsDocument() throws WebDAVServerException + { + Document body = null; + + if (m_request.getContentLength() > 0) + { + // TODO: Do we need to do anything for chunking support? + + try + { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + + DocumentBuilder builder = factory.newDocumentBuilder(); + body = builder.parse(new InputSource(m_request.getReader())); + } + catch (ParserConfigurationException e) + { + throw new WebDAVServerException(HttpServletResponse.SC_BAD_REQUEST, e); + } + catch (SAXException e) + { + throw new WebDAVServerException(HttpServletResponse.SC_BAD_REQUEST, e); + } + catch (IOException e) + { + throw new WebDAVServerException(HttpServletResponse.SC_BAD_REQUEST, e); + } + } + + return body; + } + + /** + * Returns the lock token present in the If header + * + * @return The lock token present in the If header + */ + protected String parseIfHeader() throws WebDAVServerException + { + String strLockToken = null; + + String strIf = m_request.getHeader(WebDAV.HEADER_IF); + + if (logger.isDebugEnabled()) + logger.debug("Parsing If header: " + strIf); + + if (strIf != null && strIf.length() > 0) + { + if (strIf.startsWith("(<")) + { + // Parse the tokens (only get the first one though) + + int idx = strIf.indexOf(">"); + if (idx != -1) + { + try + { + strLockToken = strIf.substring(WebDAV.OPAQUE_LOCK_TOKEN.length() + 2, idx); + } + catch (IndexOutOfBoundsException e) + { + logger.warn("Failed to parse If header: " + strIf); + } + } + else + { + throw new WebDAVServerException(HttpServletResponse.SC_BAD_REQUEST); + } + + // Print a warning if there are other tokens detected + + if (strIf.length() > idx + 2) + { + logger.warn("The If header contained more than one lock token, only one is supported"); + } + } + else if (strIf.startsWith("<")) + { + logger.warn("Tagged lists in the If header are not supported"); + } + else if (strIf.startsWith("([")) + { + logger.warn("ETags in the If header are not supported"); + } + } + + return strLockToken; + } + + /** + * Return the WebDAV protocol helper + * + * @return WebDAVHelper + */ + protected final WebDAVHelper getDAVHelper() + { + return m_davHelper; + } + + /** + * Return the service registry + * + * @return ServiceRegistry + */ + protected final ServiceRegistry getServiceRegistry() + { + return m_davHelper.getServiceRegistry(); + } + + /** + * Convenience method to return the transaction service + * + * @return TransactionService + */ + protected final TransactionService getTransactionService() + { + return m_davHelper.getServiceRegistry().getTransactionService(); + } + + /** + * Convenience method to return the node service + * + * @return NodeService + */ + protected final NodeService getNodeService() + { + return m_davHelper.getNodeService(); + } + + /** + * @return Returns the general file/folder manipulation service + */ + protected final FileFolderService getFileFolderService() + { + return m_davHelper.getFileFolderService(); + } + + /** + * Convenience method to return the content service + * + * @return ContentService + */ + protected final ContentService getContentService() + { + return m_davHelper.getServiceRegistry().getContentService(); + } + + /** + * Convenience method to return the mimetype service + * + * @return MimetypeService + */ + protected final MimetypeService getMimetypeService() + { + return m_davHelper.getMimetypeService(); + } + + /** + * Convenience method to return the lock service + * + * @return LockService + */ + protected final LockService getLockService() + { + return m_davHelper.getLockService(); + } + + /** + * Convenience method to return the authentication service + * + * @return AuthenticationService + */ + protected final AuthenticationService getAuthenticationService() + { + return m_davHelper.getAuthenticationService(); + } + + /** + * @return Returns the path of the servlet + */ + protected final String getServletPath() + { + return m_request.getServletPath(); + } + + /** + * Return the root node + * + * @return NodeRef + */ + protected final NodeRef getRootNodeRef() + { + return m_rootNodeRef; + } + + /** + * Return the relative path + * + * @return String + */ + protected final String getPath() + { + return m_strPath; + } + + /** + * Create an XML writer for the response + * + * @return XMLWriter + * @exception IOException + */ + protected final XMLWriter createXMLWriter() throws IOException + { + // Check if debug output or XML pretty printing is enabled + + XMLWriter writer = null; + + if (XMLPrettyPrint == true || logger.isDebugEnabled()) + { + writer = new XMLWriter(m_response.getWriter(), OutputFormat.createPrettyPrint()); + } + else + { + writer = new XMLWriter(m_response.getWriter(), OutputFormat.createCompactFormat()); + } + + // Return the writer + + return writer; + } + + /** + * Generates the lock discovery XML response + * + * @param xml XMLWriter + * @param lockNode NodeRef + */ + protected void generateLockDiscoveryXML(XMLWriter xml, NodeRef lockNode) throws Exception + { + Attributes nullAttr= getDAVHelper().getNullAttributes(); + + if (lockNode != null) + { + + // Get the lock details + + NodeService nodeService = getNodeService(); + + String owner = (String) nodeService.getProperty(lockNode, ContentModel.PROP_LOCK_OWNER); + Date expiryDate = (Date) nodeService.getProperty(lockNode, ContentModel.PROP_EXPIRY_DATE); + + // Output the XML response + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_LOCK_DISCOVERY, WebDAV.XML_NS_LOCK_DISCOVERY, nullAttr); + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_ACTIVE_LOCK, WebDAV.XML_NS_ACTIVE_LOCK, nullAttr); + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_LOCK_TYPE, WebDAV.XML_NS_LOCK_TYPE, nullAttr); + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_WRITE)); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_LOCK_TYPE, WebDAV.XML_NS_LOCK_TYPE); + + // NOTE: We only do exclusive lock tokens at the moment + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_LOCK_SCOPE, WebDAV.XML_NS_LOCK_SCOPE, nullAttr); + xml.write(DocumentHelper.createElement(WebDAV.XML_NS_EXCLUSIVE)); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_LOCK_SCOPE, WebDAV.XML_NS_LOCK_SCOPE); + + // NOTE: We only support one level of lock at the moment + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_DEPTH, WebDAV.XML_NS_DEPTH, nullAttr); + xml.write(WebDAV.ZERO); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_DEPTH, WebDAV.XML_NS_DEPTH); + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_OWNER, WebDAV.XML_NS_OWNER, nullAttr); + xml.write(owner); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_OWNER, WebDAV.XML_NS_OWNER); + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_TIMEOUT, WebDAV.XML_NS_TIMEOUT, nullAttr); + + // Output the expiry time + + String strTimeout = WebDAV.INFINITE; + if (expiryDate != null) + { + long timeoutRemaining = (expiryDate.getTime() - System.currentTimeMillis())/1000L; + + strTimeout = WebDAV.SECOND + timeoutRemaining; + } + xml.write(strTimeout); + + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_TIMEOUT, WebDAV.XML_NS_TIMEOUT); + + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_LOCK_TOKEN, WebDAV.XML_NS_LOCK_TOKEN, nullAttr); + xml.startElement(WebDAV.DAV_NS, WebDAV.XML_HREF, WebDAV.XML_NS_HREF, nullAttr); + + xml.write(WebDAV.makeLockToken(lockNode, owner)); + + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_HREF, WebDAV.XML_NS_HREF); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_LOCK_TOKEN, WebDAV.XML_NS_LOCK_TOKEN); + + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_ACTIVE_LOCK, WebDAV.XML_NS_ACTIVE_LOCK); + xml.endElement(WebDAV.DAV_NS, WebDAV.XML_LOCK_DISCOVERY, WebDAV.XML_NS_LOCK_DISCOVERY); + } + } + + /** + * Generates a list of namespace declarations for the response + */ + protected String generateNamespaceDeclarations(HashMap nameSpaces) + { + StringBuilder ns = new StringBuilder(); + + ns.append(" "); + ns.append(WebDAV.XML_NS); + ns.append(":"); + ns.append(WebDAV.DAV_NS); + ns.append("=\""); + ns.append(WebDAV.DEFAULT_NAMESPACE_URI); + ns.append("\""); + + // Add additional namespaces + + if ( nameSpaces != null) + { + Iterator namespaceList = nameSpaces.keySet().iterator(); + + while (namespaceList.hasNext()) + { + String strNamespaceUri = namespaceList.next(); + String strNamespaceName = nameSpaces.get(strNamespaceUri); + + ns.append(" ").append(WebDAV.XML_NS).append(":").append(strNamespaceName).append("=\""); + ns.append(strNamespaceUri).append("\" "); + } + } + + return ns.toString(); + } + + +} diff --git a/source/java/org/alfresco/repo/webdav/WebDAVProperty.java b/source/java/org/alfresco/repo/webdav/WebDAVProperty.java new file mode 100644 index 0000000000..e69e193deb --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/WebDAVProperty.java @@ -0,0 +1,156 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +/** + * Class to represent a WebDAV property + * + * @author gavinc + */ +public class WebDAVProperty +{ + private String m_strName = null; + private String m_strNamespaceUri = WebDAV.DEFAULT_NAMESPACE_URI; + private String m_strNamespaceName = null; + private String m_strValue = null; + + /** + * Constructs a WebDAVProperty + * + * @param strName + * @param strNamespaceUri + * @param strNamespaceName + * @param strValue + */ + public WebDAVProperty(String strName, String strNamespaceUri, String strNamespaceName, String strValue) + { + this(strName, strNamespaceUri, strNamespaceName); + m_strValue = strValue; + } + + /** + * Constructs a WebDAVProperty + * + * @param strName + * @param strNamespaceUri + * @param strNamespaceName + * @param strValue + */ + public WebDAVProperty(String strName, String strNamespaceUri, String strNamespaceName) + { + this(strName); + + m_strNamespaceUri = strNamespaceUri; + m_strNamespaceName = strNamespaceName; + } + + /** + * Constructs a WebDAVProperty with the default namespace details + * + * @param strName + */ + public WebDAVProperty(String strName) + { + m_strName = strName; + } + + /** + * Returns the name of the property + * + * @return The name of the property + */ + public String getName() + { + return m_strName; + } + + /** + * Returns the namespace URI for this property + * + * @return The namespace URI for this property + */ + public String getNamespaceUri() + { + return m_strNamespaceUri; + } + + /** + * Determine if the property has a namespace + * + * @return boolean + */ + public final boolean hasNamespaceName() + { + return m_strNamespaceName != null ? true : false; + } + + /** + * Returns the namespace name for this property + * + * @return The namespace name for this property + */ + public String getNamespaceName() + { + return m_strNamespaceName; + } + + /** + * Returns the value of this property + * + * @return The value of this property + */ + public String getValue() + { + return m_strValue; + } + + /** + * Sets the property's value + * + * @param strValue The new value + */ + public void setValue(String strValue) + { + m_strValue = strValue; + } + + /** + * Return the property as a string + * + * @return String + */ + public String toString() + { + StringBuilder str = new StringBuilder(); + + str.append("["); + + str.append(getName()); + str.append("="); + str.append(getValue()); + str.append(",URI="); + str.append(getNamespaceUri()); + + if ( hasNamespaceName()) + { + str.append(","); + str.append(getNamespaceName()); + } + + return str.toString(); + } +} diff --git a/source/java/org/alfresco/repo/webdav/WebDAVServerException.java b/source/java/org/alfresco/repo/webdav/WebDAVServerException.java new file mode 100644 index 0000000000..da718a335e --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/WebDAVServerException.java @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +import javax.servlet.http.HttpServletResponse; + +/** + * Exception class that represents an error in the WebDAV protocol layer + * + * @author gavinc + */ +public class WebDAVServerException extends Exception +{ + private static final long serialVersionUID = -2949418282738082368L; + + private int m_httpStatusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR; + private Throwable m_cause = null; + + /** + * Constructs a WebDAVException + * + * @param httpStatusCode The HTTP status code + */ + public WebDAVServerException(int httpStatusCode) + { + this(httpStatusCode, null); + } + + /** + * Constructs a WebDAVException + * + * @param httpStatusCode The HTTP status code + * @param cause The cause of this exception + */ + public WebDAVServerException(int httpStatusCode, Throwable cause) + { + super(Integer.toString(httpStatusCode)); + + m_httpStatusCode = httpStatusCode; + m_cause = cause; + } + + /** + * Returns the HTTP status code + * + * @return The HTTP status code + */ + public int getHttpStatusCode() + { + return m_httpStatusCode; + } + + /** + * Returns the cause of this exception + * + * @return The cause of this exception + */ + public Throwable getCause() + { + return m_cause; + } + + /** + * @see java.lang.Object#toString() + */ + public String toString() + { + String strErrorMsg = "HTTP Status Code: " + m_httpStatusCode; + + if (m_cause != null) + { + strErrorMsg = strErrorMsg + " caused by: " + m_cause.toString(); + } + + return strErrorMsg; + } +} diff --git a/source/java/org/alfresco/repo/webdav/WebDAVServlet.java b/source/java/org/alfresco/repo/webdav/WebDAVServlet.java new file mode 100644 index 0000000000..daf66fc2c9 --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/WebDAVServlet.java @@ -0,0 +1,313 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain an + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webdav; + +import java.io.IOException; +import java.util.Enumeration; +import java.util.Hashtable; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.transaction.UserTransaction; + +import org.alfresco.filesys.server.config.ServerConfiguration; +import org.alfresco.filesys.server.core.InvalidDeviceInterfaceException; +import org.alfresco.filesys.server.core.ShareType; +import org.alfresco.filesys.server.core.SharedDevice; +import org.alfresco.filesys.server.core.SharedDeviceList; +import org.alfresco.filesys.server.filesys.DiskInterface; +import org.alfresco.filesys.server.filesys.DiskSharedDevice; +import org.alfresco.filesys.smb.server.repo.ContentContext; +import org.alfresco.filesys.smb.server.repo.ContentDiskInterface; +import org.alfresco.repo.webdav.auth.AuthenticationFilter; +import org.alfresco.repo.webdav.auth.WebDAVUser; +import org.alfresco.service.ServiceRegistry; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.transaction.TransactionService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +/** + * Servlet that accepts WebDAV requests for the hub. The request is served by the hub's content + * repository framework and the response sent back using the WebDAV protocol. + * + * @author gavinc + */ +public class WebDAVServlet extends HttpServlet +{ + public static final String WEBDAV_PREFIX = "webdav"; + + private static final long serialVersionUID = 6900069445027527165L; + + // Logging + + private static Log logger = LogFactory.getLog("org.alfresco.webdav.protocol"); + + // Error message(s) + + private static final String INTERNAL_SERVER_ERROR = "Internal Server Error: "; + + // Service registry, used by methods to find services to process requests + + private ServiceRegistry m_serviceRegistry; + + // Transaction service, each request is wrapped in a transaction + + private TransactionService m_transactionService; + + // WebDAV method handlers + + private Hashtable m_davMethods; + + // Root node + + private NodeRef m_rootNodeRef; + + // WebDAV helper class + + private WebDAVHelper m_davHelper; + + /** + * @see javax.servlet.http.HttpServlet#service(javax.servlet.http.HttpServletRequest, + * javax.servlet.http.HttpServletResponse) + */ + protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, + IOException + { + long startTime = 0; + if (logger.isDebugEnabled()) + { + startTime = System.currentTimeMillis(); + } + + // Wrap the request in a transaction + + UserTransaction tx = m_transactionService.getUserTransaction(); + + try + { + // Create the appropriate WebDAV method for the request and execute it + + WebDAVMethod method = createMethod(request, response); + + if (method == null) + { + // Debug + + if ( logger.isErrorEnabled()) + logger.error("WebDAV method not implemented - " + request.getMethod()); + + // Return an error status + + response.sendError(HttpServletResponse.SC_NOT_IMPLEMENTED); + return; + } + else if ( method.getRootNodeRef() == null) + { + // Debug + + if ( logger.isErrorEnabled()) + logger.error("No root node for request"); + + // Return an error status + + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + return; + } + + // Execute the WebDAV request, wrapped in a transaction + + tx.begin(); + method.execute(); + tx.commit(); + } + catch (Exception e) + { + // Whatever happened we need to rollback the transaction + + try + { + tx.rollback(); + } + catch (Exception ex) + { + logger.warn("Failed to rollback transaction", ex); + } + + // Work out how to handle the error + + if (e instanceof WebDAVServerException) + { + WebDAVServerException error = (WebDAVServerException) e; + if (error.getCause() != null) + { + logger.error(INTERNAL_SERVER_ERROR, error.getCause()); + } + + if (logger.isDebugEnabled()) + { + // Show what status code the method sent back + + logger.debug(request.getMethod() + " is returning status code: " + error.getHttpStatusCode()); + } + + if (response.isCommitted()) + { + logger.warn("Could not return the status code to the client as the response has already been committed!"); + } + else + { + response.sendError(error.getHttpStatusCode()); + } + } + else + { + logger.error(INTERNAL_SERVER_ERROR, e); + + if (response.isCommitted()) + { + logger.warn("Could not return the internal server error code to the client as the response has already been committed!"); + } + else + { + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + } + } + } + finally + { + if (logger.isDebugEnabled()) + { + long endTime = System.currentTimeMillis(); + long duration = endTime - startTime; + logger.debug(request.getMethod() + " took " + duration + "ms to execute"); + } + } + } + + /** + * Create a WebDAV method handler + * + * @param request HttpServletRequest + * @param response HttpServletResponse + * @return WebDAVMethod + */ + private WebDAVMethod createMethod(HttpServletRequest request, HttpServletResponse response) + { + // Get the type of the current request + + String strHttpMethod = request.getMethod(); + + if (logger.isDebugEnabled()) + logger.debug("WebDAV request " + strHttpMethod + " on path " + + request.getRequestURI()); + + Class methodClass = m_davMethods.get(strHttpMethod); + WebDAVMethod method = null; + + if ( methodClass != null) + { + try + { + // Create the handler method + + method = (WebDAVMethod) methodClass.newInstance(); + method.setDetails(request, response, m_davHelper, m_rootNodeRef); + } + catch (Exception ex) + { + // Debug + + if ( logger.isDebugEnabled()) + logger.debug(ex); + } + } + + // Return the WebDAV method handler, or null if not supported + + return method; + } + + /** + * Initialize the servlet + * + * @param config ServletConfig + * @exception ServletException + */ + public void init(ServletConfig config) throws ServletException + { + super.init(config); + + // Get service registry + + WebApplicationContext context = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext()); + m_serviceRegistry = (ServiceRegistry)context.getBean(ServiceRegistry.SERVICE_REGISTRY); + + m_transactionService = m_serviceRegistry.getTransactionService(); + + AuthenticationService authService = (AuthenticationService) context.getBean("authenticationService"); + + // Create the WebDAV helper + + m_davHelper = new WebDAVHelper(m_serviceRegistry, authService); + + // Initialize the root node + // + // For now we get the details from the first available shared filesystem that is configured + + ServerConfiguration fileSrvConfig = (ServerConfiguration) context.getBean(ServerConfiguration.SERVER_CONFIGURATION); + if ( fileSrvConfig == null) + throw new ServletException("File server configuration not available"); + + DiskSharedDevice filesys = fileSrvConfig.getPrimaryFilesystem(); + + if ( filesys != null) + { + // Get the root node from the filesystem + + ContentContext contentCtx = (ContentContext) filesys.getContext(); + m_rootNodeRef = contentCtx.getRootNode(); + } + else + { + logger.warn("No default root node for WebDAV, using home node only"); + } + + // Create the WebDAV methods table + + m_davMethods = new Hashtable(); + + m_davMethods.put(WebDAV.METHOD_PROPFIND, PropFindMethod.class); + m_davMethods.put(WebDAV.METHOD_COPY, CopyMethod.class); + m_davMethods.put(WebDAV.METHOD_DELETE, DeleteMethod.class); + m_davMethods.put(WebDAV.METHOD_GET, GetMethod.class); + m_davMethods.put(WebDAV.METHOD_HEAD, HeadMethod.class); + m_davMethods.put(WebDAV.METHOD_LOCK, LockMethod.class); + m_davMethods.put(WebDAV.METHOD_MKCOL, MkcolMethod.class); + m_davMethods.put(WebDAV.METHOD_MOVE, MoveMethod.class); + m_davMethods.put(WebDAV.METHOD_OPTIONS, OptionsMethod.class); + m_davMethods.put(WebDAV.METHOD_POST, PostMethod.class); + m_davMethods.put(WebDAV.METHOD_PUT, PutMethod.class); + m_davMethods.put(WebDAV.METHOD_UNLOCK, UnlockMethod.class); + } +} diff --git a/source/java/org/alfresco/repo/webdav/auth/AuthenticationFilter.java b/source/java/org/alfresco/repo/webdav/auth/AuthenticationFilter.java new file mode 100644 index 0000000000..c6e15e6a4b --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/auth/AuthenticationFilter.java @@ -0,0 +1,199 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ + +package org.alfresco.repo.webdav.auth; + +import java.io.IOException; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.alfresco.model.ContentModel; +import org.alfresco.repo.security.authentication.AuthenticationComponent; +import org.alfresco.repo.security.authentication.AuthenticationException; +import org.alfresco.service.ServiceRegistry; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.cmr.security.AuthenticationService; +import org.alfresco.service.cmr.security.PersonService; +import org.alfresco.service.transaction.TransactionService; +import org.apache.commons.codec.binary.Base64; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +/** + * WebDAV Authentication Filter Class + * + * @author GKSpencer + */ +public class AuthenticationFilter implements Filter +{ + // Authenticated user session object name + + public final static String AUTHENTICATION_USER = "_alfDAVAuthTicket"; + + // Servlet context + + private ServletContext m_context; + + // Various services required by NTLM authenticator + + private AuthenticationService m_authService; + private AuthenticationComponent m_authComponent; + private PersonService m_personService; + private NodeService m_nodeService; + + /** + * Initialize the filter + * + * @param config FitlerConfig + * @exception ServletException + */ + public void init(FilterConfig config) throws ServletException + { + // Save the context + + m_context = config.getServletContext(); + + // Setup the authentication context + + WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(m_context); + + ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY); + m_nodeService = serviceRegistry.getNodeService(); + + m_authService = (AuthenticationService) ctx.getBean("authenticationService"); + m_authComponent = (AuthenticationComponent) ctx.getBean("authenticationComponent"); + m_personService = (PersonService) ctx.getBean("personService"); + } + + /** + * Run the authentication filter + * + * @param req ServletRequest + * @param resp ServletResponse + * @param chain FilterChain + * @exception ServletException + * @exception IOException + */ + public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, + ServletException + { + // Assume it's an HTTP request + + HttpServletRequest httpReq = (HttpServletRequest) req; + HttpServletResponse httpResp = (HttpServletResponse) resp; + + // Get the user details object from the session + + WebDAVUser user = (WebDAVUser) httpReq.getSession().getAttribute(AUTHENTICATION_USER); + + if (user == null) + { + // Get the authorization header + + String authHdr = httpReq.getHeader("Authorization"); + + if ( authHdr != null && authHdr.length() > 5 && authHdr.substring(0,5).equalsIgnoreCase("BASIC")) + { + // Basic authentication details present + + String basicAuth = new String(Base64.decodeBase64(authHdr.substring(5).getBytes())); + + // Split the username and password + + String username = null; + String password = null; + + int pos = basicAuth.indexOf(":"); + if ( pos != -1) + { + username = basicAuth.substring(0, pos); + password = basicAuth.substring(pos + 1); + } + else + { + username = basicAuth; + password = ""; + } + + try + { + // Authenticate the user + + m_authService.authenticate(username, password.toCharArray()); + + // Get the users home folder + + NodeRef homeSpaceRef = (NodeRef) m_nodeService.getProperty(m_personService.getPerson(username), ContentModel.PROP_HOMEFOLDER); + + // Setup User object and Home space ID etc. + + user = new WebDAVUser(username, m_authService.getCurrentTicket(), homeSpaceRef); + + httpReq.getSession().setAttribute(AUTHENTICATION_USER, user); + } + catch ( AuthenticationException ex) + { + // Do nothing, user object will be null + } + } + + // Check if the user is authenticated, if not then prompt again + + if ( user == null) + { + // No user/ticket, force the client to prompt for logon details + + httpResp.setHeader("WWW-Authenticate", "BASIC"); + httpResp.setStatus(HttpServletResponse.SC_UNAUTHORIZED); + + httpResp.flushBuffer(); + return; + } + } + else + { + // Setup the authentication context + + m_authService.validate(user.getTicket()); + + // Set the current locale + + // I18NUtil.setLocale(Application.getLanguage(httpRequest.getSession())); + } + + // Chain other filters + + chain.doFilter(req, resp); + } + + /** + * Cleanup filter resources + */ + public void destroy() + { + // Nothing to do + } +} diff --git a/source/java/org/alfresco/repo/webdav/auth/WebDAVUser.java b/source/java/org/alfresco/repo/webdav/auth/WebDAVUser.java new file mode 100644 index 0000000000..374e7f9a1d --- /dev/null +++ b/source/java/org/alfresco/repo/webdav/auth/WebDAVUser.java @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ + +package org.alfresco.repo.webdav.auth; + +import org.alfresco.service.cmr.repository.NodeRef; + +/** + * WebDAV User Class + * + *

Contains the details of an authenticated WebDAV user + * + * @author GKSpencer + */ +public class WebDAVUser +{ + // User name + + private String m_userName; + + // Authentication ticket + + private String m_ticket; + + // User home node + + private NodeRef m_homeNode; + + /** + * Class constructor + * + * @param user String + * @param ticket String + * @param homeNode NodeRef + */ + public WebDAVUser(String user, String ticket, NodeRef homeNode) + { + m_userName = user; + m_ticket = ticket; + m_homeNode = homeNode; + } + + /** + * Return the user name + * + * @return String + */ + public final String getUserName() + { + return m_userName; + } + + /** + * Return the ticket + * + * @return String + */ + public final String getTicket() + { + return m_ticket; + } + + /** + * Check if the user has a home node + * + * @return boolean + */ + public final boolean hasHomeNode() + { + return m_homeNode != null ? true : false; + } + + /** + * Return the user home node + * + * @return NodeRef + */ + public final NodeRef getHomeNode() + { + return m_homeNode; + } + + /** + * Set the home folder node for this user + * + * @param homeNode NodeRef + */ + protected final void setHomeNode(NodeRef homeNode) + { + m_homeNode = homeNode; + } + + /** + * Return the user details as a string + * + * @return String + */ + public String toString() + { + StringBuilder str = new StringBuilder(); + + str.append("["); + str.append(getUserName()); + str.append(":"); + str.append(getTicket()); + + if ( hasHomeNode()) + { + str.append(",Home="); + str.append(getHomeNode()); + } + str.append("]"); + + return str.toString(); + } +} diff --git a/source/java/org/alfresco/repo/webservice/AbstractWebService.java b/source/java/org/alfresco/repo/webservice/AbstractWebService.java new file mode 100644 index 0000000000..b18d5101fa --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/AbstractWebService.java @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the GNU Lesser General Public License as + * published by the Free Software Foundation; either version + * 2.1 of the License, or (at your option) any later version. + * You may obtain a copy of the License at + * + * http://www.gnu.org/licenses/lgpl.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice; + +import org.alfresco.service.cmr.repository.ContentService; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.cmr.search.SearchService; +import org.alfresco.service.namespace.NamespaceService; + +/** + * Abstract base class for all web service implementations, provides support for common + * service injection + * + * @author gavinc + */ +public abstract class AbstractWebService +{ + protected NodeService nodeService; + protected ContentService contentService; + protected SearchService searchService; + protected NamespaceService namespaceService; + + /** + * Sets the instance of the NodeService to be used + * + * @param nodeService The NodeService + */ + public void setNodeService(NodeService nodeService) + { + this.nodeService = nodeService; + } + + /** + * Sets the ContentService instance to use + * + * @param contentSvc The ContentService + */ + public void setContentService(ContentService contentSvc) + { + this.contentService = contentSvc; + } + + /** + * Sets the instance of the SearchService to be used + * + * @param searchService The SearchService + */ + public void setSearchService(SearchService searchService) + { + this.searchService = searchService; + } + + /** + * Sets the instance of the NamespaceService to be used + * + * @param namespaceService The NamespaceService + */ + public void setNamespaceService(NamespaceService namespaceService) + { + this.namespaceService = namespaceService; + } +} diff --git a/source/java/org/alfresco/repo/webservice/CMLUtil.java b/source/java/org/alfresco/repo/webservice/CMLUtil.java new file mode 100644 index 0000000000..9ce0becd9f --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/CMLUtil.java @@ -0,0 +1,569 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.alfresco.repo.webservice.repository.UpdateResult; +import org.alfresco.repo.webservice.types.CML; +import org.alfresco.repo.webservice.types.CMLAddAspect; +import org.alfresco.repo.webservice.types.CMLAddChild; +import org.alfresco.repo.webservice.types.CMLCopy; +import org.alfresco.repo.webservice.types.CMLCreate; +import org.alfresco.repo.webservice.types.CMLCreateAssociation; +import org.alfresco.repo.webservice.types.CMLDelete; +import org.alfresco.repo.webservice.types.CMLMove; +import org.alfresco.repo.webservice.types.CMLRemoveAspect; +import org.alfresco.repo.webservice.types.CMLRemoveAssociation; +import org.alfresco.repo.webservice.types.CMLRemoveChild; +import org.alfresco.repo.webservice.types.CMLUpdate; +import org.alfresco.repo.webservice.types.NamedValue; +import org.alfresco.repo.webservice.types.ParentReference; +import org.alfresco.repo.webservice.types.Predicate; +import org.alfresco.repo.webservice.types.Reference; +import org.alfresco.service.cmr.repository.CopyService; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.cmr.search.SearchService; +import org.alfresco.service.namespace.NamespaceService; +import org.alfresco.service.namespace.QName; +import org.alfresco.util.PropertyMap; + +/** + * @author Roy Wetherall + */ +public class CMLUtil +{ + private static final String CREATE = "create"; + private static final String ADD_ASPECT = "addAspect"; + private static final String REMOVE_ASPECT = "removeAspect"; + private static final String UPDATE = "update"; + private static final String DELETE = "delete"; + private static final String MOVE = "move"; + private static final String COPY = "copy"; + private static final String ADD_CHILD = "addChild"; + private static final String REMOVE_CHILD = "removeChild"; + private static final String CREATE_ASSOCIATION = "createAssociation"; + private static final String REMOVE_ASSOCIATION = "removeAssociation"; + + private NodeService nodeService; + private SearchService searchService; + private NamespaceService namespaceService; + private CopyService copyService; + + public void setNodeService(NodeService nodeService) + { + this.nodeService = nodeService; + } + + public void setSearchService(SearchService searchService) + { + this.searchService = searchService; + } + + public void setNamespaceService(NamespaceService namespaceService) + { + this.namespaceService = namespaceService; + } + + public void setCopyService(CopyService copyService) + { + this.copyService = copyService; + } + + /** + * Execute a cml update query. + * + * @param cml the cml objects + * @return the update result + */ + public UpdateResult[] executeCML(CML cml) + { + ExecutionContext context = new ExecutionContext(); + List results = new ArrayList(); + + // Execute creates + CMLCreate[] creates = cml.getCreate(); + if (creates != null) + { + for (CMLCreate create : creates) + { + executeCMLCreate(create, context, results); + } + } + + // Exceute add aspect + CMLAddAspect[] addAspects = cml.getAddAspect(); + if (addAspects != null) + { + for (CMLAddAspect addAspect : addAspects) + { + executeCMLAddAspect(addAspect, context, results); + } + } + + // Execeute remove aspect + CMLRemoveAspect[] removeAspects = cml.getRemoveAspect(); + if (removeAspects != null) + { + for (CMLRemoveAspect removeAspect : removeAspects) + { + executeCMLRemoveAspect(removeAspect, context, results); + } + } + + // Execute update + CMLUpdate[] updates = cml.getUpdate(); + if (updates != null) + { + for (CMLUpdate update : updates) + { + executeCMLUpdate(update, context, results); + } + } + + // Execute delete + CMLDelete[] deletes = cml.getDelete(); + if (deletes != null) + { + for (CMLDelete delete : deletes) + { + executeCMLDelete(delete, context, results); + } + } + + // Execute move + CMLMove[] moves = cml.getMove(); + if (moves != null) + { + for (CMLMove move : moves) + { + executeCMLMove(move, context, results); + } + } + + // Execute copy + CMLCopy[] copies = cml.getCopy(); + if (copies != null) + { + for (CMLCopy copy : copies) + { + executeCMLCopy(copy, context, results); + } + } + + // Execute addChild + CMLAddChild[] addChildren = cml.getAddChild(); + if (addChildren != null) + { + for (CMLAddChild addChild : addChildren) + { + executeCMLAddChild(addChild, context, results); + } + } + + // Execute removeChild + CMLRemoveChild[] removeChildren = cml.getRemoveChild(); + if (removeChildren != null) + { + for (CMLRemoveChild removeChild : removeChildren) + { + executeCMLRemoveChild(removeChild, context, results); + } + } + + // Execute createAssociation + CMLCreateAssociation[] createAssocs = cml.getCreateAssociation(); + if (createAssocs != null) + { + for (CMLCreateAssociation createAssoc : createAssocs) + { + executeCMLCreateAssociation(createAssoc, context, results); + } + } + + // Execute removeAssociation + CMLRemoveAssociation[] removeAssocs = cml.getRemoveAssociation(); + if (removeAssocs != null) + { + for (CMLRemoveAssociation removeAssoc : removeAssocs) + { + executeCMLRemoveAssociation(removeAssoc, context, results); + } + } + + return results.toArray(new UpdateResult[results.size()]); + } + + /** + * + * @param create + * @param result + */ + private void executeCMLCreate(CMLCreate create, ExecutionContext context, List results) + { + // Get the detail of the parent + ParentReference parentReference = create.getParent(); + NodeRef parentNodeRef = Utils.convertToNodeRef( + parentReference, + this.nodeService, + this.searchService, + this.namespaceService); + QName assocTypeQName = QName.createQName(parentReference.getAssociationType()); + QName assocQName = QName.createQName(parentReference.getChildName()); + + // Get the type of the node to create + QName nodeTypeQName = QName.createQName(create.getType()); + + // Get the properties + PropertyMap properties = getPropertyMap(create.getProperty()); + + // Create the new node + NodeRef nodeRef = this.nodeService.createNode(parentNodeRef, assocTypeQName, assocQName, nodeTypeQName, properties).getChildRef(); + + // Store the node ref in the execution context (if appropraite) + String id = create.getId(); + if (id != null && id.length() != 0) + { + context.addId(id, nodeRef); + } + + results.add(createResult(CREATE, null, nodeRef)); + } + + private PropertyMap getPropertyMap(NamedValue[] namedValues) + { + PropertyMap properties = new PropertyMap(); + if (namedValues != null) + { + for (NamedValue value : namedValues) + { + QName qname = QName.createQName(value.getName()); + properties.put(qname, value.getValue()); + } + } + return properties; + } + + private UpdateResult createResult(String cmd, NodeRef sourceNodeRef, NodeRef destinationNodeRef) + { + UpdateResult result = new UpdateResult(); + result.setStatement(cmd); + if (sourceNodeRef != null) + { + result.setSource(Utils.convertToReference(sourceNodeRef)); + } + if (destinationNodeRef != null) + { + result.setDestination(Utils.convertToReference(destinationNodeRef)); + } + // Sort out the count ??? + return result; + } + + /** + * + * @param addAspect + * @param result + */ + private void executeCMLAddAspect(CMLAddAspect addAspect, ExecutionContext context, List results) + { + // Get the node refs + List nodeRefs = getNodeRefList(addAspect.getWhere_id(), addAspect.getWhere(), context); + + // Get the aspect name and the properties + QName aspectQName = QName.createQName(addAspect.getAspect()); + PropertyMap properties = getPropertyMap(addAspect.getProperty()); + + for (NodeRef nodeRef : nodeRefs) + { + // Add the aspect + this.nodeService.addAspect(nodeRef, aspectQName, properties); + + // Create the result + results.add(createResult(ADD_ASPECT, nodeRef, nodeRef)); + } + } + + private void executeCMLRemoveAspect(CMLRemoveAspect removeAspect, ExecutionContext context, List results) + { + // Get the node refs + List nodeRefs = getNodeRefList(removeAspect.getWhere_id(), removeAspect.getWhere(), context); + + // Get the aspect name + QName aspectQName = QName.createQName(removeAspect.getAspect()); + + for (NodeRef nodeRef : nodeRefs) + { + // Add the aspect + this.nodeService.removeAspect(nodeRef, aspectQName); + + // Create the result + results.add(createResult(REMOVE_ASPECT, nodeRef, nodeRef)); + } + } + + private List getNodeRefList(String id, Predicate predicate, ExecutionContext context) + { + List nodeRefs = new ArrayList(); + if (id != null && id.length() != 0) + { + NodeRef localNodeRef = context.getNodeRef(id); + if (localNodeRef != null) + { + nodeRefs.add(localNodeRef); + } + } + else + { + nodeRefs = Utils.resolvePredicate(predicate, this.nodeService, this.searchService, this.namespaceService); + } + return nodeRefs; + } + + private void executeCMLUpdate(CMLUpdate update, ExecutionContext context, List results) + { + // Get the nodes and properties + List nodeRefs = getNodeRefList(update.getWhere_id(), update.getWhere(), context); + PropertyMap props = getPropertyMap(update.getProperty()); + + for (NodeRef nodeRef : nodeRefs) + { + // Update the property values + Map currentProps = this.nodeService.getProperties(nodeRef); + currentProps.putAll(props); + this.nodeService.setProperties(nodeRef, currentProps); + + // Get the result + results.add(createResult(UPDATE, nodeRef, nodeRef)); + } + } + + private void executeCMLDelete(CMLDelete delete, ExecutionContext context, List results) + { + List nodeRefs = Utils.resolvePredicate(delete.getWhere(), this.nodeService, this.searchService, this.namespaceService); + for (NodeRef nodeRef : nodeRefs) + { + // Delete the node + this.nodeService.deleteNode(nodeRef); + + // Create the result + results.add(createResult(DELETE, nodeRef, null)); + } + } + + private void executeCMLMove(CMLMove move, ExecutionContext context, List results) + { + NodeRef destinationNodeRef = getNodeRef(move.getTo_id(), move.getTo(), context); + if (destinationNodeRef != null) + { + QName assocType = null; + QName assocName = null; + if (move.getTo_id() != null) + { + assocType = QName.createQName(move.getAssociationType()); + assocName = QName.createQName(move.getChildName()); + } + else + { + assocType = QName.createQName(move.getTo().getAssociationType()); + assocName = QName.createQName(move.getTo().getChildName()); + } + + List nodesToMove = getNodeRefList(move.getWhere_id(), move.getWhere(), context); + for (NodeRef nodeToMove : nodesToMove) + { + NodeRef newNodeRef = this.nodeService.moveNode(nodeToMove, destinationNodeRef, assocType, assocName).getChildRef(); + + // Create the result + results.add(createResult(MOVE, nodeToMove, newNodeRef)); + } + } + } + + private NodeRef getNodeRef(String id, ParentReference parentReference, ExecutionContext context) + { + NodeRef nodeRef = null; + if (id != null && id.length() != 0) + { + nodeRef = context.getNodeRef(id); + } + else + { + nodeRef = Utils.convertToNodeRef(parentReference, this.nodeService, this.searchService, this.namespaceService); + } + + return nodeRef; + } + + private NodeRef getNodeRef(String id, Reference reference, ExecutionContext context) + { + NodeRef nodeRef = null; + if (id != null && id.length() != 0) + { + nodeRef = context.getNodeRef(id); + } + else + { + nodeRef = Utils.convertToNodeRef(reference, this.nodeService, this.searchService, this.namespaceService); + } + + return nodeRef; + } + + private void executeCMLCopy(CMLCopy copy, ExecutionContext context, List results) + { + NodeRef destinationNodeRef = getNodeRef(copy.getTo_id(), copy.getTo(), context); + if (destinationNodeRef != null) + { + QName assocType = null; + QName assocName = null; + if (copy.getTo_id() != null) + { + assocType = QName.createQName(copy.getAssociationType()); + assocName = QName.createQName(copy.getChildName()); + } + else + { + assocType = QName.createQName(copy.getTo().getAssociationType()); + assocName = QName.createQName(copy.getTo().getChildName()); + } + + boolean copyChildren = false; + Boolean value = copy.getChildren(); + if (value != null) + { + copyChildren = value.booleanValue(); + } + + List nodesToCopy = getNodeRefList(copy.getWhere_id(), copy.getWhere(), context); + for (NodeRef nodeToCopy : nodesToCopy) + { + NodeRef newNodeRef = this.copyService.copy(nodeToCopy, destinationNodeRef, assocType, assocName, copyChildren); + + // Create the result + results.add(createResult(COPY, nodeToCopy, newNodeRef)); + } + } + + } + + private void executeCMLAddChild(CMLAddChild addChild, ExecutionContext context, List results) + { + NodeRef nodeRef = getNodeRef(addChild.getTo_id(), addChild.getTo(), context); + if (nodeRef != null) + { + QName assocType = null; + QName assocName = null; + if (addChild.getTo_id() != null) + { + assocType = QName.createQName(addChild.getAssociationType()); + assocName = QName.createQName(addChild.getChildName()); + } + else + { + assocType = QName.createQName(addChild.getTo().getAssociationType()); + assocName = QName.createQName(addChild.getTo().getChildName()); + } + + List whereNodeRefs = getNodeRefList(addChild.getWhere_id(), addChild.getWhere(), context); + for (NodeRef whereNodeRef : whereNodeRefs) + { + this.nodeService.addChild(nodeRef, whereNodeRef, assocType, assocName); + + // Create the result + results.add(createResult(ADD_CHILD, nodeRef, whereNodeRef)); + } + } + } + + private void executeCMLRemoveChild(CMLRemoveChild removeChild, ExecutionContext context, List results) + { + NodeRef parentNodeRef = getNodeRef(removeChild.getFrom_id(), removeChild.getFrom(), context); + if (parentNodeRef != null) + { + List childNodeRefs = getNodeRefList(removeChild.getWhere_id(), removeChild.getWhere(), context); + for (NodeRef childNodeRef : childNodeRefs) + { + this.nodeService.removeChild(parentNodeRef, childNodeRef); + + // Create the result + results.add(createResult(REMOVE_CHILD, parentNodeRef, null)); + } + } + + } + + private void executeCMLCreateAssociation(CMLCreateAssociation createAssoc, ExecutionContext context, List results) + { + QName assocType = QName.createQName(createAssoc.getAssociation()); + if (assocType != null) + { + List fromNodeRefs = getNodeRefList(createAssoc.getFrom_id(), createAssoc.getFrom(), context); + List toNodeRefs = getNodeRefList(createAssoc.getTo_id(), createAssoc.getTo(), context); + for (NodeRef fromNodeRef : fromNodeRefs) + { + for (NodeRef toNodeRef : toNodeRefs) + { + this.nodeService.createAssociation(fromNodeRef, toNodeRef, assocType); + + // Create the result + results.add(createResult(CREATE_ASSOCIATION, fromNodeRef, toNodeRef)); + } + } + } + } + + private void executeCMLRemoveAssociation(CMLRemoveAssociation removeAssoc, ExecutionContext context, List results) + { + QName assocType = QName.createQName(removeAssoc.getAssociation()); + if (assocType != null) + { + List fromNodeRefs = getNodeRefList(removeAssoc.getFrom_id(), removeAssoc.getFrom(), context); + List toNodeRefs = getNodeRefList(removeAssoc.getTo_id(), removeAssoc.getTo(), context); + for (NodeRef fromNodeRef : fromNodeRefs) + { + for (NodeRef toNodeRef : toNodeRefs) + { + this.nodeService.removeAssociation(fromNodeRef, toNodeRef, assocType); + + // Create the result + results.add(createResult(REMOVE_ASSOCIATION, fromNodeRef, toNodeRef)); + } + } + } + } + + private class ExecutionContext + { + private Map idMap = new HashMap(); + + public void addId(String id, NodeRef nodeRef) + { + this.idMap.put(id, nodeRef); + } + + public NodeRef getNodeRef(String id) + { + return this.idMap.get(id); + } + } +} diff --git a/source/java/org/alfresco/repo/webservice/CMLUtilTest.java b/source/java/org/alfresco/repo/webservice/CMLUtilTest.java new file mode 100644 index 0000000000..70916dac5c --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/CMLUtilTest.java @@ -0,0 +1,448 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice; + +import java.util.List; + +import org.alfresco.model.ContentModel; +import org.alfresco.repo.content.MimetypeMap; +import org.alfresco.repo.security.authentication.AuthenticationComponent; +import org.alfresco.repo.webservice.repository.UpdateResult; +import org.alfresco.repo.webservice.types.CML; +import org.alfresco.repo.webservice.types.CMLAddAspect; +import org.alfresco.repo.webservice.types.CMLAddChild; +import org.alfresco.repo.webservice.types.CMLCopy; +import org.alfresco.repo.webservice.types.CMLCreate; +import org.alfresco.repo.webservice.types.CMLCreateAssociation; +import org.alfresco.repo.webservice.types.CMLDelete; +import org.alfresco.repo.webservice.types.CMLMove; +import org.alfresco.repo.webservice.types.CMLRemoveAspect; +import org.alfresco.repo.webservice.types.CMLRemoveAssociation; +import org.alfresco.repo.webservice.types.CMLRemoveChild; +import org.alfresco.repo.webservice.types.CMLUpdate; +import org.alfresco.repo.webservice.types.NamedValue; +import org.alfresco.repo.webservice.types.ParentReference; +import org.alfresco.repo.webservice.types.Predicate; +import org.alfresco.repo.webservice.types.Reference; +import org.alfresco.service.cmr.repository.AssociationRef; +import org.alfresco.service.cmr.repository.ChildAssociationRef; +import org.alfresco.service.cmr.repository.ContentData; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.cmr.repository.StoreRef; +import org.alfresco.service.cmr.search.SearchService; +import org.alfresco.service.namespace.NamespaceService; +import org.alfresco.service.namespace.QName; +import org.alfresco.util.BaseSpringTest; +import org.alfresco.util.PropertyMap; + +/** + * @author Roy Wetherall + */ +public class CMLUtilTest extends BaseSpringTest +{ + private static final ContentData CONTENT_DATA_TEXT_UTF8 = new ContentData(null, MimetypeMap.MIMETYPE_TEXT_PLAIN, 0L, "UTF-8"); + private static final ContentData CONTENT_DATA_HTML_UTF16 = new ContentData(null, MimetypeMap.MIMETYPE_HTML, 0L, "UTF-16"); + + private CMLUtil cmlUtil; + private NodeService nodeService; + private StoreRef testStoreRef; + private NodeRef rootNodeRef; + private NodeRef nodeRef; + private NamespaceService namespaceService; + private SearchService searchService; + private NodeRef folderNodeRef; + private AuthenticationComponent authenticationComponent; + + @Override + protected String[] getConfigLocations() + { + return new String[]{"classpath:org/alfresco/repo/webservice/cml-test.xml"}; + } + + @Override + protected void onSetUpInTransaction() throws Exception + { + this.cmlUtil = (CMLUtil)this.applicationContext.getBean("CMLUtil"); + this.nodeService = (NodeService)this.applicationContext.getBean("nodeService"); + this.searchService = (SearchService)this.applicationContext.getBean("searchService"); + this.namespaceService = (NamespaceService)this.applicationContext.getBean("namespaceService"); + this.authenticationComponent = (AuthenticationComponent) this.applicationContext.getBean("authenticationComponent"); + + this.authenticationComponent.setSystemUserAsCurrentUser(); + + // Create the store and get the root node + this.testStoreRef = this.nodeService.createStore( + StoreRef.PROTOCOL_WORKSPACE, "Test_" + + System.currentTimeMillis()); + this.rootNodeRef = this.nodeService.getRootNode(this.testStoreRef); + + // Create the node used for tests + PropertyMap contentProps = new PropertyMap(); + contentProps.put(ContentModel.PROP_CONTENT, CONTENT_DATA_TEXT_UTF8); + this.nodeRef = this.nodeService.createNode( + this.rootNodeRef, + ContentModel.ASSOC_CHILDREN, + ContentModel.ASSOC_CHILDREN, + ContentModel.TYPE_CONTENT, + contentProps).getChildRef(); + + this.folderNodeRef = this.nodeService.createNode( + this.rootNodeRef, + ContentModel.ASSOC_CHILDREN, + ContentModel.ASSOC_CHILDREN, + ContentModel.TYPE_FOLDER).getChildRef(); + } + + @Override + protected void onTearDownInTransaction() + { + authenticationComponent.clearCurrentSecurityContext(); + super.onTearDownInTransaction(); + } + + public void testMoreThanOneStatement() + { + + } + + public void testCreate() + { + CMLCreate[] creates = new CMLCreate[]{createCMLCreate(ContentModel.TYPE_CONTENT, "id1")}; + + CML cml = new CML(); + cml.setCreate(creates); + + UpdateResult[] result = this.cmlUtil.executeCML(cml); + assertNotNull(result); + assertEquals(1, result.length); + + UpdateResult updateResult = result[0]; + assertEquals("create", updateResult.getStatement()); + assertNull(updateResult.getSource()); + assertNotNull(updateResult.getDestination()); + NodeRef createdNodeRef = Utils.convertToNodeRef(updateResult.getDestination(), this.nodeService, this.searchService, this.namespaceService); + assertNotNull(createdNodeRef); + + assertEquals(ContentModel.TYPE_CONTENT, this.nodeService.getType(createdNodeRef)); + assertEquals("name", this.nodeService.getProperty(createdNodeRef, ContentModel.PROP_NAME)); + + //System.out.println(NodeStoreInspector.dumpNodeStore(this.nodeService, this.testStoreRef)); + } + + public void testAddRemoveAspect() + { + CMLAddAspect addAspect = new CMLAddAspect(); + addAspect.setAspect(ContentModel.ASPECT_VERSIONABLE.toString()); + addAspect.setWhere(createPredicate(this.nodeRef)); + + CML cml = new CML(); + cml.setAddAspect(new CMLAddAspect[]{addAspect}); + + UpdateResult[] result = this.cmlUtil.executeCML(cml); + assertNotNull(result); + assertEquals(1, result.length); + + UpdateResult updateResult = result[0]; + assertEquals("addAspect", updateResult.getStatement()); + assertNotNull(updateResult.getSource()); + assertNotNull(updateResult.getDestination()); + + assertTrue(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE)); + + // TODO should test with properties set as well + + CMLRemoveAspect removeAspect = new CMLRemoveAspect(); + removeAspect.setAspect(ContentModel.ASPECT_VERSIONABLE.toString()); + removeAspect.setWhere(createPredicate(this.nodeRef)); + + CML cml2 = new CML(); + cml2.setRemoveAspect(new CMLRemoveAspect[]{removeAspect}); + + UpdateResult[] results2 = this.cmlUtil.executeCML(cml2); + assertNotNull(results2); + assertEquals(1, results2.length); + + UpdateResult result2 = results2[0]; + assertEquals("removeAspect", result2.getStatement()); + assertNotNull(result2.getDestination()); + assertNotNull(result2.getSource()); + + assertFalse(this.nodeService.hasAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE)); + + } + + public void testUpdate() + { + CMLUpdate update = new CMLUpdate(); + update.setWhere(createPredicate(this.nodeRef)); + update.setProperty(new NamedValue[] + { + new NamedValue(ContentModel.PROP_NAME.toString(), "updatedName"), + new NamedValue(ContentModel.PROP_CONTENT.toString(), CONTENT_DATA_HTML_UTF16.toString()) + }); + + CML cml = new CML(); + cml.setUpdate(new CMLUpdate[]{update}); + + UpdateResult[] result = this.cmlUtil.executeCML(cml); + assertNotNull(result); + assertEquals(1, result.length); + + UpdateResult updateResult = result[0]; + assertEquals("update", updateResult.getStatement()); + assertNotNull(updateResult.getSource()); + assertNotNull(updateResult.getDestination()); + + assertEquals("updatedName", this.nodeService.getProperty(this.nodeRef, ContentModel.PROP_NAME)); + assertEquals(CONTENT_DATA_HTML_UTF16, this.nodeService.getProperty(this.nodeRef, ContentModel.PROP_CONTENT)); + } + + public void testDelete() + { + CMLDelete delete = new CMLDelete(); + delete.setWhere(createPredicate(this.nodeRef)); + + CML cml = new CML(); + cml.setDelete(new CMLDelete[]{delete}); + + UpdateResult[] result = this.cmlUtil.executeCML(cml); + assertNotNull(result); + assertEquals(1, result.length); + + UpdateResult updateResult = result[0]; + assertEquals("delete", updateResult.getStatement()); + assertNotNull(updateResult.getSource()); + assertNull(updateResult.getDestination()); + + // Check that the node no longer exists + assertFalse(this.nodeService.exists(this.nodeRef)); + } + + public void testMove() + { + CMLMove move = new CMLMove(); + move.setTo(createParentReference(this.folderNodeRef, ContentModel.ASSOC_CONTAINS, ContentModel.ASSOC_CONTAINS)); + move.setWhere(createPredicate(this.nodeRef)); + + CML cml = new CML(); + cml.setMove(new CMLMove[]{move}); + + UpdateResult[] result = this.cmlUtil.executeCML(cml); + assertNotNull(result); + assertEquals(1, result.length); + + UpdateResult updateResult = result[0]; + assertEquals("move", updateResult.getStatement()); + assertNotNull(updateResult.getSource()); + assertNotNull(updateResult.getDestination()); + + List assocs = this.nodeService.getChildAssocs(this.folderNodeRef); + assertNotNull(assocs); + assertEquals(1, assocs.size()); + ChildAssociationRef assoc = assocs.get(0); + assertEquals(assoc.getChildRef(), Utils.convertToNodeRef( + updateResult.getDestination(), + this.nodeService, + this.searchService, + this.namespaceService)); + } + + public void testCopy() + { + CMLCopy copy = new CMLCopy(); + copy.setTo(createParentReference(this.folderNodeRef, ContentModel.ASSOC_CONTAINS, ContentModel.ASSOC_CONTAINS)); + copy.setWhere(createPredicate(this.nodeRef)); + + CML cml = new CML(); + cml.setCopy(new CMLCopy[]{copy}); + + UpdateResult[] result = this.cmlUtil.executeCML(cml); + assertNotNull(result); + assertEquals(1, result.length); + + UpdateResult updateResult = result[0]; + assertEquals("copy", updateResult.getStatement()); + assertNotNull(updateResult.getSource()); + assertNotNull(updateResult.getDestination()); + + List assocs = this.nodeService.getChildAssocs(this.folderNodeRef); + assertNotNull(assocs); + assertEquals(1, assocs.size()); + ChildAssociationRef assoc = assocs.get(0); + assertEquals(assoc.getChildRef(), Utils.convertToNodeRef( + updateResult.getDestination(), + this.nodeService, + this.searchService, + this.namespaceService)); + } + + public void testAddChild() + { + CMLAddChild addChild = new CMLAddChild(); + addChild.setTo(createParentReference(this.folderNodeRef, ContentModel.ASSOC_CONTAINS, ContentModel.ASSOC_CONTAINS)); + addChild.setWhere(createPredicate(this.nodeRef)); + + CML cml = new CML(); + cml.setAddChild(new CMLAddChild[]{addChild}); + + UpdateResult[] result = this.cmlUtil.executeCML(cml); + assertNotNull(result); + assertEquals(1, result.length); + + UpdateResult updateResult = result[0]; + assertEquals("addChild", updateResult.getStatement()); + assertNotNull(updateResult.getSource()); + assertNotNull(updateResult.getDestination()); + + List assocs = this.nodeService.getChildAssocs(this.folderNodeRef); + assertNotNull(assocs); + assertEquals(1, assocs.size()); + ChildAssociationRef assoc = assocs.get(0); + assertEquals(assoc.getChildRef(), Utils.convertToNodeRef( + updateResult.getDestination(), + this.nodeService, + this.searchService, + this.namespaceService)); + } + + public void testRemoveChild() + { + // Add the node as a child of the folder + this.nodeService.addChild(this.folderNodeRef, this.nodeRef, ContentModel.ASSOC_CONTAINS, ContentModel.ASSOC_CONTAINS); + + CMLRemoveChild removeChild = new CMLRemoveChild(); + removeChild.setFrom(Utils.convertToReference(this.folderNodeRef)); + removeChild.setWhere(createPredicate(this.nodeRef)); + + CML cml = new CML(); + cml.setRemoveChild(new CMLRemoveChild[]{removeChild}); + + UpdateResult[] result = this.cmlUtil.executeCML(cml); + assertNotNull(result); + assertEquals(1, result.length); + + UpdateResult updateResult = result[0]; + assertEquals("removeChild", updateResult.getStatement()); + assertNotNull(updateResult.getSource()); + assertNull(updateResult.getDestination()); + + List assocs = this.nodeService.getChildAssocs(this.folderNodeRef); + assertEquals(0, assocs.size()); + } + + public void testCreateAssociation() + { + CMLCreateAssociation createAssoc = new CMLCreateAssociation(); + createAssoc.setAssociation(ContentModel.ASSOC_CONTAINS.toString()); + createAssoc.setFrom(createPredicate(this.folderNodeRef)); + createAssoc.setTo(createPredicate(this.nodeRef)); + + CML cml = new CML(); + cml.setCreateAssociation(new CMLCreateAssociation[]{createAssoc}); + + UpdateResult[] result = this.cmlUtil.executeCML(cml); + assertNotNull(result); + assertEquals(1, result.length); + + UpdateResult updateResult = result[0]; + assertEquals("createAssociation", updateResult.getStatement()); + assertNotNull(updateResult.getSource()); + assertNotNull(updateResult.getDestination()); + + List assocs = this.nodeService.getTargetAssocs(this.folderNodeRef, ContentModel.ASSOC_CONTAINS); + assertNotNull(assocs); + assertEquals(1, assocs.size()); + AssociationRef assoc = assocs.get(0); + assertEquals(assoc.getTargetRef(), Utils.convertToNodeRef( + updateResult.getDestination(), + this.nodeService, + this.searchService, + this.namespaceService)); + } + + public void testRemoveAssociation() + { + this.nodeService.createAssociation(this.folderNodeRef, this.nodeRef, ContentModel.ASSOC_CONTAINS); + + CMLRemoveAssociation removeAssociation = new CMLRemoveAssociation(); + removeAssociation.setAssociation(ContentModel.ASSOC_CONTAINS.toString()); + removeAssociation.setFrom(createPredicate(this.folderNodeRef)); + removeAssociation.setTo(createPredicate(this.nodeRef)); + + CML cml = new CML(); + cml.setRemoveAssociation(new CMLRemoveAssociation[]{removeAssociation}); + + UpdateResult[] result = this.cmlUtil.executeCML(cml); + assertNotNull(result); + assertEquals(1, result.length); + + UpdateResult updateResult = result[0]; + assertEquals("removeAssociation", updateResult.getStatement()); + assertNotNull(updateResult.getSource()); + assertNotNull(updateResult.getDestination()); + + List assocs = this.nodeService.getTargetAssocs(this.folderNodeRef, ContentModel.ASSOC_CONTAINS); + assertNotNull(assocs); + assertEquals(0, assocs.size()); + } + + private ParentReference createParentReference(NodeRef nodeRef, QName assocType, QName assocName) + { + ParentReference parentReference = new ParentReference(); + parentReference.setAssociationType(assocType.toString()); + parentReference.setChildName(assocName.toString()); + parentReference.setStore(Utils.convertToStore(nodeRef.getStoreRef())); + parentReference.setUuid(nodeRef.getId()); + return parentReference; + } + + private Predicate createPredicate(NodeRef nodeRef) + { + Predicate predicate = new Predicate(); + predicate.setStore(Utils.convertToStore(nodeRef.getStoreRef())); + predicate.setNodes(new Reference[]{Utils.convertToReference(nodeRef)}); + return predicate; + } + + private CMLCreate createCMLCreate(QName type, String id) + { + CMLCreate create = new CMLCreate(); + create.setId("id1"); + create.setType(ContentModel.TYPE_CONTENT.toString()); + + ParentReference parentReference = new ParentReference(); + parentReference.setAssociationType(ContentModel.ASSOC_CHILDREN.toString()); + parentReference.setChildName(ContentModel.ASSOC_CHILDREN.toString()); + parentReference.setStore(Utils.convertToStore(this.testStoreRef)); + parentReference.setUuid(this.rootNodeRef.getId()); + + create.setParent(parentReference); + create.setProperty(getContentNamedValues()); + + return create; + } + + private NamedValue[] getContentNamedValues() + { + return new NamedValue[] + { + new NamedValue(ContentModel.PROP_NAME.toString(), "name"), + new NamedValue(ContentModel.PROP_CONTENT.toString(), CONTENT_DATA_TEXT_UTF8.toString()) + }; + } +} diff --git a/source/java/org/alfresco/repo/webservice/Utils.java b/source/java/org/alfresco/repo/webservice/Utils.java new file mode 100644 index 0000000000..5feeea5144 --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/Utils.java @@ -0,0 +1,600 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import javax.transaction.UserTransaction; + +import org.alfresco.repo.webservice.axis.QueryConfigHandler; +import org.alfresco.repo.webservice.types.AssociationDefinition; +import org.alfresco.repo.webservice.types.Cardinality; +import org.alfresco.repo.webservice.types.ClassDefinition; +import org.alfresco.repo.webservice.types.NamedValue; +import org.alfresco.repo.webservice.types.ParentReference; +import org.alfresco.repo.webservice.types.Predicate; +import org.alfresco.repo.webservice.types.PropertyDefinition; +import org.alfresco.repo.webservice.types.Query; +import org.alfresco.repo.webservice.types.QueryLanguageEnum; +import org.alfresco.repo.webservice.types.Reference; +import org.alfresco.repo.webservice.types.RoleDefinition; +import org.alfresco.repo.webservice.types.Store; +import org.alfresco.repo.webservice.types.StoreEnum; +import org.alfresco.repo.webservice.types.Version; +import org.alfresco.service.ServiceRegistry; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.cmr.repository.StoreRef; +import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter; +import org.alfresco.service.cmr.search.ResultSet; +import org.alfresco.service.cmr.search.SearchService; +import org.alfresco.service.cmr.version.VersionType; +import org.alfresco.service.namespace.NamespaceService; +import org.alfresco.service.namespace.QName; +import org.alfresco.service.transaction.TransactionService; +import org.apache.axis.MessageContext; +import org.apache.axis.transport.http.HTTPConstants; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +/** + * Helper class used by the web services + * + * @author gavinc + */ +public class Utils +{ + public static final String REPOSITORY_SERVICE_NAMESPACE = "http://www.alfresco.org/ws/service/repository/1.0"; + + private Utils() + { + // don't allow construction + } + + /** + * Converts the web service Store type to a StoreRef used by the repository + * + * @param store + * The Store to convert + * @return The converted StoreRef + */ + public static StoreRef convertToStoreRef(Store store) + { + return new StoreRef(store.getScheme().getValue(), store.getAddress()); + } + + /** + * Converts a store reference ot a Store type + * + * @param ref + * the store reference + * @return the store + */ + public static Store convertToStore(StoreRef ref) + { + return new Store(StoreEnum.fromValue(ref.getProtocol()), ref + .getIdentifier()); + } + + /** + * Converts the given Reference web service type into a repository NodeRef + * + * @param ref + * The Reference to convert + * @return The NodeRef representation of the Reference + */ + public static NodeRef convertToNodeRef(Reference ref, + NodeService nodeService, SearchService searchService, + NamespaceService namespaceService) + { + return resolveToNodeRef(ref.getStore(), ref.getUuid(), ref.getPath(), + nodeService, searchService, namespaceService); + } + + /** + * Converts the given ParentReference web service type into a repository + * NodeRef + * + * @param parentRef + * The ParentReference to convert + * @return The NodeRef representation of the ParentReference + */ + public static NodeRef convertToNodeRef(ParentReference parentRef, + NodeService nodeService, SearchService searchService, + NamespaceService namespaceService) + { + // TODO: Also take into account any association information passed in + // the ParentReference + + return resolveToNodeRef(parentRef.getStore(), parentRef.getUuid(), + parentRef.getPath(), nodeService, searchService, + namespaceService); + } + + /** + * Converts the given repository NodeRef object into a web service Reference + * type + * + * @param node + * The node to create a Reference for + * @return The Reference + */ + public static Reference convertToReference(NodeRef node) + { + Reference ref = new Reference(); + Store store = new Store(StoreEnum.fromValue(node.getStoreRef() + .getProtocol()), node.getStoreRef().getIdentifier()); + ref.setStore(store); + ref.setUuid(node.getId()); + return ref; + } + + /** + * Resolves the given parameters to a repository NodeRef + * + * @param store + * The Store to search within + * @param uuid + * The id of the node, or the id of the starting node if a path + * is also present + * @param path + * The path to the required node, if a uuid is given the search + * starts from that node otherwise the search will start from the + * root node + * @param nodeService + * NodeService to use + * @param searchService + * SearchService to use + * @param namespaceService + * NamespaceService to use + * @return A repository NodeRef + */ + public static NodeRef resolveToNodeRef(Store store, String uuid, + String path, NodeService nodeService, SearchService searchService, + NamespaceService namespaceService) + { + if (store == null) + { + throw new IllegalArgumentException( + "A Store must be supplied to resolve to a NodeRef"); + } + + NodeRef nodeRef = null; + + // find out where we are starting from, either the root or the node + // represented by the uuid + NodeRef rootNodeRef = null; + if (uuid == null) + { + 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) + { + List nodes = searchService.selectNodes(rootNodeRef, path, + null, namespaceService, false); + + // make sure we only have one result + if (nodes.size() != 1) + { + StringBuilder builder = new StringBuilder( + "Failed to resolve to a single NodeRef with parameters (store="); + builder.append(store.getScheme().getValue()).append(":") + .append(store.getAddress()); + builder.append(" uuid=").append(uuid); + builder.append(" path=").append(path).append("), found "); + builder.append(nodes.size()).append(" nodes."); + throw new IllegalStateException(builder.toString()); + } + + nodeRef = nodes.get(0); + } else + { + // if there is no path just use whatever the rootNodeRef currently + // is + nodeRef = rootNodeRef; + } + + return nodeRef; + } + + /** + * Resolves the given predicate into a list of NodeRefs that can be acted + * upon + * + * @param predicate + * The predicate passed from the client + * @param nodeService + * NodeService to use + * @param searchService + * SearchService to use + * @param namespaceService + * NamespaceService to use + * @return A List of NodeRef objects + */ + public static List resolvePredicate(Predicate predicate, + NodeService nodeService, SearchService searchService, + NamespaceService namespaceService) + { + List nodeRefs = null; + + if (predicate.getNodes() != null) + { + Reference[] nodes = predicate.getNodes(); + nodeRefs = new ArrayList(nodes.length); + + for (int x = 0; x < nodes.length; x++) + { + nodeRefs.add(convertToNodeRef(nodes[x], nodeService, + searchService, namespaceService)); + } + } + else if (predicate.getQuery() != null) + { + // make sure a query is present + Query query = predicate.getQuery(); + + if (query == null) + { + throw new IllegalStateException( + "Either a set of nodes or a query must be supplied in a Predicate."); + } + + // make sure a Store has been supplied too + if (predicate.getStore() == null) + { + throw new IllegalStateException( + "A Store has to be supplied to in order to execute a query."); + } + + QueryLanguageEnum langEnum = query.getLanguage(); + + if (langEnum.equals(QueryLanguageEnum.cql) + || langEnum.equals(QueryLanguageEnum.xpath)) + { + throw new IllegalArgumentException("Only '" + + QueryLanguageEnum.lucene.getValue() + + "' queries are currently supported!"); + } + + // execute the query + ResultSet searchResults = null; + try + { + searchResults = searchService.query(Utils + .convertToStoreRef(predicate.getStore()), langEnum + .getValue(), query.getStatement()); + // get hold of all the NodeRef's from the results + nodeRefs = searchResults.getNodeRefs(); + } + finally + { + if (searchResults != null) + { + searchResults.close(); + } + } + } + else if (predicate.getStore() != null) + { + // Since only the store was supplied interpret this to mean the predicate should be resolved to the + // stores root node + Store store = predicate.getStore(); + NodeRef rootNode = nodeService.getRootNode(Utils.convertToStoreRef(store)); + + nodeRefs = new ArrayList(); + nodeRefs.add(rootNode); + } + + return nodeRefs; + } + + /** + * Returns the current Spring WebApplicationContext object + * + * @param msgContext + * SOAP message context + * @return The Spring WebApplicationContext + */ + public static WebApplicationContext getSpringContext( + MessageContext msgContext) + { + // get hold of the web application context via the message context + HttpServletRequest req = (HttpServletRequest) msgContext + .getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST); + ServletContext servletCtx = req.getSession().getServletContext(); + return WebApplicationContextUtils + .getRequiredWebApplicationContext(servletCtx); + } + + /** + * Returns a UserTransaction that can be used within a service call + * + * @param msgContext + * SOAP message context + * @return a UserTransaction + */ + public static UserTransaction getUserTransaction(MessageContext msgContext) + { + // get the service regsistry + ServiceRegistry svcReg = (ServiceRegistry) getSpringContext(msgContext) + .getBean(ServiceRegistry.SERVICE_REGISTRY); + + TransactionService transactionService = svcReg.getTransactionService(); + return transactionService.getUserTransaction(); + } + + /** + * Returns the value of the fetchSize from the + * QueryConfiguration SOAP header (if present) + * + * @param msgContext + * The SOAP MessageContext + * @return The current batch size or -1 if the header is not present + */ + public static int getBatchSize(MessageContext msgContext) + { + int batchSize = -1; + + Integer batchConfigSize = (Integer) MessageContext.getCurrentContext() + .getProperty(QueryConfigHandler.ALF_FETCH_SIZE); + if (batchConfigSize != null) + { + batchSize = batchConfigSize.intValue(); + } + + return batchSize; + } + + /** + * Converts a repository version object into a web service version object. + * + * @param version + * the repository version object + * @return the web service version object + */ + public static Version convertToVersion( + org.alfresco.service.cmr.version.Version version) + { + Version webServiceVersion = new Version(); + + // Set the basic properties + webServiceVersion.setId(Utils.convertToReference(version + .getFrozenStateNodeRef())); + webServiceVersion.setCreator(version.getCreator()); + webServiceVersion.setLabel(version.getVersionLabel()); + + // Set the created date + Date createdDate = version.getCreatedDate(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(createdDate); + webServiceVersion.setCreated(calendar); + + // Set the falg to indicate whether the version was mojor or minor + boolean isMajor = false; + VersionType versionType = version.getVersionType(); + if (versionType != null + && versionType.equals(VersionType.MAJOR) == true) + { + isMajor = true; + } + webServiceVersion.setMajor(isMajor); + + // Set the commetary values + Map versionProps = version.getVersionProperties(); + NamedValue[] namedValues = new NamedValue[versionProps.size()]; + int iIndex = 0; + for (Map.Entry entry : versionProps.entrySet()) + { + String value = null; + try + { + value = DefaultTypeConverter.INSTANCE.convert(String.class, entry.getValue()); + } + catch (Throwable exception) + { + value = entry.getValue().toString(); + } + namedValues[iIndex] = new NamedValue(entry.getKey(), value); + iIndex++; + } + webServiceVersion.setCommentaries(namedValues); + + return webServiceVersion; + } + + /** + * Creates a ClassDefinition web service type object for the given + * repository ClassDefinition + * + * @param ddClassDef The repository ClassDefinition to generate + * @return The web service ClassDefinition representation + */ + public static ClassDefinition setupClassDefObject(org.alfresco.service.cmr.dictionary.ClassDefinition ddClassDef) + { + ClassDefinition classDef = new ClassDefinition(); + classDef.setName(ddClassDef.getName().toString()); + classDef.setIsAspect(ddClassDef.isAspect()); + + if (ddClassDef.getTitle() != null) + { + classDef.setTitle(ddClassDef.getTitle()); + } + if (ddClassDef.getDescription() != null) + { + classDef.setDescription(ddClassDef.getDescription()); + } + if (ddClassDef.getParentName() != null) + { + classDef.setSuperClass(ddClassDef.getParentName().toString()); + } + + // represent the properties + Map props = ddClassDef.getProperties(); + if (props != null) + { + PropertyDefinition[] propDefs = new PropertyDefinition[props.size()]; + int pos = 0; + for (org.alfresco.service.cmr.dictionary.PropertyDefinition ddPropDef : props.values()) + { + PropertyDefinition propDef = new PropertyDefinition(); + propDef.setName(ddPropDef.getName().toString()); + propDef.setDataType(ddPropDef.getDataType().getName().toString()); + propDef.setMandatory(ddPropDef.isMandatory()); + propDef.setReadOnly(ddPropDef.isProtected()); + if (ddPropDef.getDefaultValue() != null) + { + propDef.setDefaultValue(ddPropDef.getDefaultValue()); + } + if (ddPropDef.getTitle() != null) + { + propDef.setTitle(ddPropDef.getTitle()); + } + if (ddPropDef.getDescription() != null) + { + propDef.setDescription(ddPropDef.getDescription()); + } + + // add it to the array + propDefs[pos] = propDef; + pos++; + } + + // add properties to the overall ClassDefinition + classDef.setProperties(propDefs); + } + + // TODO need to get the child associations as well !! + + // represent the associations + Map assocs = ddClassDef.getAssociations(); + if (assocs != null) + { + AssociationDefinition[] assocDefs = new AssociationDefinition[assocs.size()]; + int pos = 0; + for (org.alfresco.service.cmr.dictionary.AssociationDefinition ddAssocDef : assocs.values()) + { + AssociationDefinition assocDef = new AssociationDefinition(); + assocDef.setName(ddAssocDef.getName().toString()); + assocDef.setIsChild(ddAssocDef.isChild()); + if (ddAssocDef.getTitle() != null) + { + assocDef.setTitle(ddAssocDef.getTitle()); + } + if (ddAssocDef.getDescription() != null) + { + assocDef.setDescription(ddAssocDef.getDescription()); + } + + RoleDefinition sourceRole = new RoleDefinition(); + if (ddAssocDef.getSourceRoleName() != null) + { + sourceRole.setName(ddAssocDef.getSourceRoleName().toString()); + } + sourceRole.setCardinality(setupSourceCardinalityObject(ddAssocDef)); + assocDef.setSourceRole(sourceRole); + + RoleDefinition targetRole = new RoleDefinition(); + if (ddAssocDef.getTargetRoleName() != null) + { + targetRole.setName(ddAssocDef.getTargetRoleName().toString()); + } + targetRole.setCardinality(setupTargetCardinalityObject(ddAssocDef));; + assocDef.setTargetRole(targetRole); + assocDef.setTargetClass(ddAssocDef.getTargetClass().getName().toString()); + + assocDefs[pos] = assocDef; + pos++; + } + + classDef.setAssociations(assocDefs); + } + + return classDef; + } + + /** + * Creates a web service Cardinality type for the source from the given repository AssociationDefinition + * + * @param ddAssocDef The AssociationDefinition to get the cardinality from + * @return The Cardinality + */ + private static Cardinality setupSourceCardinalityObject(org.alfresco.service.cmr.dictionary.AssociationDefinition ddAssocDef) + { + if (ddAssocDef.isSourceMandatory() == false && ddAssocDef.isSourceMany() == false) + { + // 0..1 + return Cardinality.value1; + } + else if (ddAssocDef.isSourceMandatory() && ddAssocDef.isSourceMany() == false) + { + // 1 + return Cardinality.value2; + } + else if (ddAssocDef.isSourceMandatory() && ddAssocDef.isSourceMany()) + { + // 1..* + return Cardinality.value4; + } + else + { + // * + return Cardinality.value3; + } + } + + /** + * Creates a web service Cardinality type for the target from the given repository AssociationDefinition + * + * @param ddAssocDef The AssociationDefinition to get the cardinality from + * @return The Cardinality + */ + private static Cardinality setupTargetCardinalityObject(org.alfresco.service.cmr.dictionary.AssociationDefinition ddAssocDef) + { + if (ddAssocDef.isTargetMandatory() == false && ddAssocDef.isTargetMany() == false) + { + // 0..1 + return Cardinality.value1; + } + else if (ddAssocDef.isTargetMandatory() && ddAssocDef.isTargetMany() == false) + { + // 1 + return Cardinality.value2; + } + else if (ddAssocDef.isTargetMandatory() && ddAssocDef.isTargetMany()) + { + // 1..* + return Cardinality.value4; + } + else + { + // * + return Cardinality.value3; + } + } +} diff --git a/source/java/org/alfresco/repo/webservice/authentication/AuthenticationWebService.java b/source/java/org/alfresco/repo/webservice/authentication/AuthenticationWebService.java new file mode 100644 index 0000000000..63cadba5dc --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/authentication/AuthenticationWebService.java @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice.authentication; + +import java.rmi.RemoteException; + +import org.alfresco.example.webservice.TicketHolder; +import org.alfresco.repo.security.authentication.AuthenticationException; +import org.alfresco.service.cmr.security.AuthenticationService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Web service implementation of the AuthenticationService. The WSDL for this + * service can be accessed from + * http://localhost:8080/alfresco/wsdl/authentication-service.wsdl + * + * @author gavinc + */ +public class AuthenticationWebService implements AuthenticationServiceSoapPort +{ + private static Log logger = LogFactory.getLog(AuthenticationWebService.class); + + private AuthenticationService authenticationService; + + /** + * Sets the AuthenticationService instance to use + * + * @param authenticationSvc + * The AuthenticationService + */ + public void setAuthenticationService(AuthenticationService authenticationSvc) + { + this.authenticationService = authenticationSvc; + } + + /** + * @see org.alfresco.repo.webservice.authentication.AuthenticationServiceSoapPort#startSession(java.lang.String, + * java.lang.String) + */ + public AuthenticationResult startSession(String username, String password) + throws RemoteException, AuthenticationFault + { + try + { + this.authenticationService.authenticate(username, password.toCharArray()); + String ticket = this.authenticationService.getCurrentTicket(); + + if (logger.isDebugEnabled()) + { + logger.debug("Issued ticket '" + ticket + "' for '" + username + "'"); + } + + return new AuthenticationResult(username, ticket); + } + catch (AuthenticationException ae) + { + throw new AuthenticationFault(100, ae.getMessage()); + } + catch (Throwable e) + { + throw new AuthenticationFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.authentication.AuthenticationServiceSoapPort#endSession() + */ + public void endSession() throws RemoteException, AuthenticationFault + { + try + { + String ticket = TicketHolder.ticket; + if (ticket != null) + { + this.authenticationService.invalidateTicket(ticket); + this.authenticationService.clearCurrentSecurityContext(); + + if (logger.isDebugEnabled()) + { + logger.debug("Session ended for ticket '" + ticket + "'"); + } + } + } + catch (Throwable e) + { + throw new AuthenticationFault(0, e.getMessage()); + } + } +} diff --git a/source/java/org/alfresco/repo/webservice/authoring/AuthoringWebService.java b/source/java/org/alfresco/repo/webservice/authoring/AuthoringWebService.java new file mode 100644 index 0000000000..62d8ca2f82 --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/authoring/AuthoringWebService.java @@ -0,0 +1,804 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice.authoring; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.Serializable; +import java.rmi.RemoteException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.alfresco.model.ContentModel; +import org.alfresco.repo.transaction.TransactionUtil; +import org.alfresco.repo.webservice.AbstractWebService; +import org.alfresco.repo.webservice.Utils; +import org.alfresco.repo.webservice.types.ContentFormat; +import org.alfresco.repo.webservice.types.NamedValue; +import org.alfresco.repo.webservice.types.ParentReference; +import org.alfresco.repo.webservice.types.Predicate; +import org.alfresco.repo.webservice.types.Reference; +import org.alfresco.repo.webservice.types.VersionHistory; +import org.alfresco.service.cmr.coci.CheckOutCheckInService; +import org.alfresco.service.cmr.lock.LockService; +import org.alfresco.service.cmr.lock.LockType; +import org.alfresco.service.cmr.repository.ContentWriter; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.version.Version; +import org.alfresco.service.cmr.version.VersionService; +import org.alfresco.service.namespace.QName; +import org.alfresco.service.transaction.TransactionService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Web service implementation of the AuthoringService. The WSDL for this service + * can be accessed from + * http://localhost:8080/alfresco/wsdl/authoring-service.wsdl + * + * @author gavinc + */ +public class AuthoringWebService extends AbstractWebService implements + AuthoringServiceSoapPort +{ + /** + * Logger + */ + private static Log logger = LogFactory.getLog(AuthoringWebService.class); + + /** + * The check in check out service + */ + private CheckOutCheckInService cociService; + + /** + * The lock service + */ + private LockService lockService; + + /** + * The version service + */ + private VersionService versionService; + + /** + * The transaction service + */ + private TransactionService transactionService; + + /** + * Sets the CheckInCheckOutService to use + * + * @param cociService + * The CheckInCheckOutService + */ + public void setCheckOutCheckinService(CheckOutCheckInService cociService) + { + this.cociService = cociService; + } + + /** + * Sets the LockService to use + * + * @param lockService the lock service + */ + public void setLockService(LockService lockService) + { + this.lockService = lockService; + } + + /** + * Set the version service + * + * @param versionService the version service + */ + public void setVersionService(VersionService versionService) + { + this.versionService = versionService; + } + + /** + * Set the transaction service + * + * @param transactionService + * the transaction service + */ + public void setTransactionService(TransactionService transactionService) + { + this.transactionService = transactionService; + } + + /** + * @see org.alfresco.repo.webservice.authoring.AuthoringServiceSoapPort#checkout(org.alfresco.repo.webservice.types.Predicate, + * org.alfresco.repo.webservice.types.ParentReference) + */ + public CheckoutResult checkout(final Predicate items, final ParentReference destination) throws RemoteException, + AuthoringFault + { + try + { + return TransactionUtil.executeInUserTransaction( + this.transactionService, + new TransactionUtil.TransactionWork() + { + public CheckoutResult doWork() + { + List nodes = Utils.resolvePredicate(items, + AuthoringWebService.this.nodeService, + AuthoringWebService.this.searchService, + AuthoringWebService.this.namespaceService); + CheckoutResult checkoutResult = new CheckoutResult(); + Reference[] originals = new Reference[nodes.size()]; + Reference[] workingCopies = new Reference[nodes.size()]; + + // get a repository NodeRef for the destination (if + // there is one) + NodeRef destinationRef = null; + if (destination != null) + { + destinationRef = Utils.convertToNodeRef( + destination, + AuthoringWebService.this.nodeService, + AuthoringWebService.this.searchService, + AuthoringWebService.this.namespaceService); + } + + for (int x = 0; x < nodes.size(); x++) + { + // get the current node + NodeRef original = nodes.get(x); + + // call the appropriate service method depending on + // whether a destination has been provided + NodeRef workingCopy = null; + if (destinationRef != null) + { + workingCopy = AuthoringWebService.this.cociService + .checkout( + original, + destinationRef, + QName.createQName(destination.getAssociationType()), + QName.createQName(destination.getChildName())); + } else + { + workingCopy = AuthoringWebService.this.cociService + .checkout(original); + } + + // store the results + originals[x] = Utils.convertToReference(original); + workingCopies[x] = Utils.convertToReference(workingCopy); + } + + // setup the result object + checkoutResult.setOriginals(originals); + checkoutResult.setWorkingCopies(workingCopies); + + return checkoutResult; + } + }); + } + catch (Throwable e) + { + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new AuthoringFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.authoring.AuthoringServiceSoapPort#checkin(org.alfresco.repo.webservice.types.Predicate, + * org.alfresco.repo.webservice.types.NamedValue[], boolean) + */ + public CheckinResult checkin(final Predicate items, + final NamedValue[] comments, final boolean keepCheckedOut) + throws RemoteException, AuthoringFault + { + try + { + return TransactionUtil.executeInUserTransaction( + this.transactionService, + new TransactionUtil.TransactionWork() + { + public CheckinResult doWork() + { + // Get the passed nodes + List nodes = Utils.resolvePredicate( + items, + AuthoringWebService.this.nodeService, + AuthoringWebService.this.searchService, + AuthoringWebService.this.namespaceService); + + // Map the comments into the expected map + Map mapComments = new HashMap(comments.length); + for (NamedValue value : comments) + { + mapComments.put(value.getName(), value.getValue()); + } + + Reference[] checkedIn = new Reference[nodes.size()]; + List listWorkingCopies = new ArrayList(nodes.size()); + int iIndex = 0; + + // Execute checkin for each node + // TODO should be able to do this as a batch so that all the nodes are versioned together + for (NodeRef node : nodes) + { + // Checkin the node + NodeRef checkedInNode = AuthoringWebService.this.cociService.checkin(node, mapComments, null, keepCheckedOut); + + // Add the results to the array + checkedIn[iIndex] = Utils.convertToReference(checkedInNode); + + // Only return the working copies if the node is keep checked out otherwise the working copies have been deleted + if (keepCheckedOut == true) + { + listWorkingCopies.add(Utils.convertToReference(node)); + } + iIndex++; + } + + // Sort out the working copy list + Reference[] workingCopies = listWorkingCopies.toArray(new Reference[listWorkingCopies.size()]); + if (workingCopies == null) + { + workingCopies = new Reference[0]; + } + + // Create the result object + CheckinResult result = new CheckinResult(); + result.setCheckedIn(checkedIn); + result.setWorkingCopies(workingCopies); + + return result; + } + }); + } + catch (Throwable e) + { + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new AuthoringFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.authoring.AuthoringServiceSoapPort#checkinExternal(org.alfresco.repo.webservice.types.Reference, org.alfresco.repo.webservice.types.NamedValue[], boolean, org.alfresco.repo.webservice.types.ContentFormat, byte[]) + */ + public Reference checkinExternal(final Reference node, final NamedValue[] comments, final boolean keepCheckedOut, final ContentFormat format, final byte[] content) + throws RemoteException, AuthoringFault + { + try + { + return TransactionUtil.executeInUserTransaction( + this.transactionService, + new TransactionUtil.TransactionWork() + { + public Reference doWork() + { + // Get the passed nodes + NodeRef nodeRef = Utils.convertToNodeRef( + node, + AuthoringWebService.this.nodeService, + AuthoringWebService.this.searchService, + AuthoringWebService.this.namespaceService); + + // Write the content to the server + // TODO: Need to get the property QName into this method + ContentWriter contentWriter = AuthoringWebService.this.contentService.getWriter(nodeRef, ContentModel.PROP_CONTENT, false); + if (contentWriter == null) + { + throw new RuntimeException("Unable to write external content before checkin."); + } + InputStream is = new ByteArrayInputStream(content); + contentWriter.setEncoding(format.getEncoding()); + contentWriter.setMimetype(format.getMimetype()); + contentWriter.putContent(is); + String contentUrl = contentWriter.getContentUrl(); + + // Get the version properties map + Map versionProperties = new HashMap(comments.length); + for (NamedValue namedValue : comments) + { + versionProperties.put(namedValue.getName(), namedValue.getValue()); + } + + // CheckIn the content + NodeRef origNodeRef = AuthoringWebService.this.cociService.checkin( + nodeRef, + versionProperties, + contentUrl, + keepCheckedOut); + // Return the orig node ref + return Utils.convertToReference(origNodeRef); + } + }); + } + catch (Throwable e) + { + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new AuthoringFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.authoring.AuthoringServiceSoapPort#cancelCheckout(org.alfresco.repo.webservice.types.Predicate) + */ + public CancelCheckoutResult cancelCheckout(final Predicate items) + throws RemoteException, AuthoringFault + { + try + { + return TransactionUtil.executeInUserTransaction( + this.transactionService, + new TransactionUtil.TransactionWork() + { + public CancelCheckoutResult doWork() + { + // Get the passed nodes + List nodes = Utils.resolvePredicate( + items, + AuthoringWebService.this.nodeService, + AuthoringWebService.this.searchService, + AuthoringWebService.this.namespaceService); + + // Create the arrays to hold results + Reference[] origNodes = new Reference[nodes.size()]; + Reference[] workingCopies = new Reference[nodes.size()]; + int iIndex = 0; + + for (NodeRef node : nodes) + { + // Cancel the checkout + NodeRef origNode = AuthoringWebService.this.cociService.cancelCheckout(node); + + // Set the value in the arrays + origNodes[iIndex] = Utils.convertToReference(origNode); + workingCopies[iIndex] = Utils.convertToReference(node); + iIndex ++; + } + + CancelCheckoutResult result = new CancelCheckoutResult(); + result.setOriginals(origNodes); + result.setWorkingCopies(workingCopies); + + return result; + } + }); + } + catch (Throwable e) + { + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new AuthoringFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.authoring.AuthoringServiceSoapPort#lock(org.alfresco.repo.webservice.types.Predicate, + * boolean, org.alfresco.repo.webservice.authoring.LockTypeEnum) + */ + public Reference[] lock(final Predicate items, final boolean lockChildren, final LockTypeEnum lockType) + throws RemoteException, AuthoringFault + { + try + { + return TransactionUtil.executeInUserTransaction( + this.transactionService, + new TransactionUtil.TransactionWork() + { + public Reference[] doWork() + { + // Get the passed nodes + List nodes = Utils.resolvePredicate( + items, + AuthoringWebService.this.nodeService, + AuthoringWebService.this.searchService, + AuthoringWebService.this.namespaceService); + + // Gather together the results + Reference[] result = new Reference[nodes.size()]; + int iIndex = 0; + for (NodeRef node : nodes) + { + LockType convertedLockType = convertToLockType(lockType); + AuthoringWebService.this.lockService.lock(node, convertedLockType, 0, lockChildren); + result[iIndex] = Utils.convertToReference(node); + iIndex++; + } + + return result; + } + }); + } + catch (Throwable e) + { + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new AuthoringFault(0, e.getMessage()); + } + } + + /** + * Convert from the web service lock type to the Lock type enum value used by the service interface + * + * @param lockTypeEnum web service lock type value + * @return lock type enum value used by the service interface + */ + private LockType convertToLockType(LockTypeEnum lockTypeEnum) + { + LockType lockType = null; + if (lockTypeEnum.equals(LockTypeEnum.write) == true) + { + lockType = LockType.WRITE_LOCK; + } + else + { + lockType = LockType.READ_ONLY_LOCK; + } + return lockType; + } + + /** + * @see org.alfresco.repo.webservice.authoring.AuthoringServiceSoapPort#unlock(org.alfresco.repo.webservice.types.Predicate, + * boolean) + */ + public Reference[] unlock(final Predicate items, final boolean unlockChildren) + throws RemoteException, AuthoringFault + { + try + { + return TransactionUtil.executeInUserTransaction( + this.transactionService, + new TransactionUtil.TransactionWork() + { + public Reference[] doWork() + { + // Get the passed nodes + List nodes = Utils.resolvePredicate( + items, + AuthoringWebService.this.nodeService, + AuthoringWebService.this.searchService, + AuthoringWebService.this.namespaceService); + + // Gather together the results + Reference[] result = new Reference[nodes.size()]; + int iIndex = 0; + for (NodeRef node : nodes) + { + AuthoringWebService.this.lockService.unlock(node, unlockChildren); + + result[iIndex] = Utils.convertToReference(node); + iIndex++; + } + + return result; + } + }); + } + catch (Throwable e) + { + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new AuthoringFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.authoring.AuthoringServiceSoapPort#getLockStatus(org.alfresco.repo.webservice.types.Predicate) + */ + public LockStatus[] getLockStatus(final Predicate items) + throws RemoteException, AuthoringFault + { + try + { + return TransactionUtil.executeInUserTransaction( + this.transactionService, + new TransactionUtil.TransactionWork() + { + public LockStatus[] doWork() + { + // Get the passed nodes + List nodes = Utils.resolvePredicate( + items, + AuthoringWebService.this.nodeService, + AuthoringWebService.this.searchService, + AuthoringWebService.this.namespaceService); + + // Gather together the results + LockStatus[] result = new LockStatus[nodes.size()]; + int iIndex = 0; + for (NodeRef node : nodes) + { + // Get the lock owner + String lockOwner = (String)AuthoringWebService.this.nodeService.getProperty(node, ContentModel.PROP_LOCK_OWNER); + + // Get the lock type + LockTypeEnum lockTypeEnum = convertFromLockType(AuthoringWebService.this.lockService.getLockType(node)); + + LockStatus lockStatus = new LockStatus(); + lockStatus.setLockOwner(lockOwner); + lockStatus.setLockType(lockTypeEnum); + lockStatus.setNode(Utils.convertToReference(node)); + + result[iIndex] = lockStatus; + iIndex++; + } + + return result; + } + }); + } + catch (Throwable e) + { + + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + e.printStackTrace(); + throw new AuthoringFault(0, e.getMessage()); + } + } + + private LockTypeEnum convertFromLockType(LockType lockType) + { + LockTypeEnum result = null; + if (lockType != null) + { + switch (lockType) + { + case WRITE_LOCK: + result = LockTypeEnum.write; + break; + case READ_ONLY_LOCK: + result = LockTypeEnum.read; + break; + } + } + return result; + } + + /** + * @see org.alfresco.repo.webservice.authoring.AuthoringServiceSoapPort#createVersion(org.alfresco.repo.webservice.types.Predicate, + * org.alfresco.repo.webservice.types.NamedValue[], boolean) + */ + public VersionResult createVersion(final Predicate items, final NamedValue[] comments, final boolean versionChildren) + throws RemoteException, AuthoringFault + { + try + { + return TransactionUtil.executeInUserTransaction( + this.transactionService, + new TransactionUtil.TransactionWork() + { + public VersionResult doWork() + { + // Get the passed nodes + List nodes = Utils.resolvePredicate( + items, + AuthoringWebService.this.nodeService, + AuthoringWebService.this.searchService, + AuthoringWebService.this.namespaceService); + + // Map the comments into the expected map + Map mapComments = new HashMap(comments.length); + for (NamedValue value : comments) + { + mapComments.put(value.getName(), value.getValue()); + } + + List versionedReferences = new ArrayList(nodes.size()); + List webServiceVersions = new ArrayList(nodes.size()); + + // Version each node + for (NodeRef node : nodes) + { + Collection versions = AuthoringWebService.this.versionService.createVersion(node, mapComments, versionChildren); + for (Version version : versions) + { + versionedReferences.add(Utils.convertToReference(version.getVersionedNodeRef())); + webServiceVersions.add(Utils.convertToVersion(version)); + } + } + + VersionResult result = new VersionResult(); + result.setNodes(versionedReferences.toArray(new Reference[versionedReferences.size()])); + result.setVersions(webServiceVersions.toArray(new org.alfresco.repo.webservice.types.Version[webServiceVersions.size()])); + return result; + } + }); + } + catch (Throwable e) + { + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + e.printStackTrace(); + + throw new AuthoringFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.authoring.AuthoringServiceSoapPort#getVersionHistory(org.alfresco.repo.webservice.types.Reference) + */ + public VersionHistory getVersionHistory(final Reference node) + throws RemoteException, AuthoringFault + { + try + { + return TransactionUtil.executeInUserTransaction( + this.transactionService, + new TransactionUtil.TransactionWork() + { + public VersionHistory doWork() + { + org.alfresco.service.cmr.version.VersionHistory versionHistory = + AuthoringWebService.this.versionService.getVersionHistory( + Utils.convertToNodeRef( + node, + AuthoringWebService.this.nodeService, + AuthoringWebService.this.searchService, + AuthoringWebService.this.namespaceService)); + + VersionHistory webServiceVersionHistory = new VersionHistory(); + if (versionHistory != null) + { + Collection versions = versionHistory.getAllVersions(); + org.alfresco.repo.webservice.types.Version[] webServiceVersions = new org.alfresco.repo.webservice.types.Version[versions.size()]; + int iIndex = 0; + for (Version version : versions) + { + webServiceVersions[iIndex] = Utils.convertToVersion(version); + iIndex ++; + } + webServiceVersionHistory.setVersions(webServiceVersions); + } + + return webServiceVersionHistory; + } + }); + } + catch (Throwable e) + { + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new AuthoringFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.authoring.AuthoringServiceSoapPort#revertVersion(org.alfresco.repo.webservice.types.Reference, + * java.lang.String) + */ + @SuppressWarnings("unchecked") + public void revertVersion(final Reference node, final String versionLabel) + throws RemoteException, AuthoringFault + { + try + { + TransactionUtil.executeInUserTransaction( + this.transactionService, + new TransactionUtil.TransactionWork() + { + public Object doWork() + { + NodeRef nodeRef = Utils.convertToNodeRef( + node, + AuthoringWebService.this.nodeService, + AuthoringWebService.this.searchService, + AuthoringWebService.this.namespaceService); + + org.alfresco.service.cmr.version.VersionHistory versionHistory = AuthoringWebService.this.versionService.getVersionHistory(nodeRef); + if (versionHistory != null) + { + Version version = versionHistory.getVersion(versionLabel); + if (version != null) + { + AuthoringWebService.this.versionService.revert(nodeRef, version); + } + else + { + throw new RuntimeException("The node could not be reverted because the version label is invalid."); + } + } + else + { + throw new RuntimeException("A unversioned node cannot be reverted."); + } + + return null; + } + }); + } + catch (Throwable e) + { + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new AuthoringFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.authoring.AuthoringServiceSoapPort#deleteAllVersions(org.alfresco.repo.webservice.types.Reference) + */ + public VersionHistory deleteAllVersions(final Reference node) + throws RemoteException, AuthoringFault + { + try + { + return TransactionUtil.executeInUserTransaction( + this.transactionService, + new TransactionUtil.TransactionWork() + { + public VersionHistory doWork() + { + NodeRef nodeRef = Utils.convertToNodeRef( + node, + AuthoringWebService.this.nodeService, + AuthoringWebService.this.searchService, + AuthoringWebService.this.namespaceService); + + AuthoringWebService.this.versionService.deleteVersionHistory(nodeRef); + + return new VersionHistory(); + } + }); + } + catch (Throwable e) + { + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new AuthoringFault(0, e.getMessage()); + } + } +} diff --git a/source/java/org/alfresco/repo/webservice/axis/QueryConfigHandler.java b/source/java/org/alfresco/repo/webservice/axis/QueryConfigHandler.java new file mode 100644 index 0000000000..e2212ba48d --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/axis/QueryConfigHandler.java @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice.axis; + +import org.alfresco.repo.webservice.Utils; +import org.alfresco.repo.webservice.types.QueryConfiguration; +import org.apache.axis.AxisFault; +import org.apache.axis.MessageContext; +import org.apache.axis.description.OperationDesc; +import org.apache.axis.handlers.BasicHandler; +import org.apache.axis.message.SOAPEnvelope; +import org.apache.axis.message.SOAPHeaderElement; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Axis handler to extract the fetchSize parameter from the QueryConfiguration SOAP header. + * The value of fetchSize is then placed in the MessageContext with a property name of + * ALF_FETCH_SIZE + * + * @author gavinc + */ +public class QueryConfigHandler extends BasicHandler +{ + public static final String ALF_FETCH_SIZE = "ALF_FETCH_SIZE"; + + private static final long serialVersionUID = 6467938074555362971L; + private static Log logger = LogFactory.getLog(QueryConfigHandler.class); + + /** + * @see org.apache.axis.Handler#invoke(org.apache.axis.MessageContext) + */ + public void invoke(MessageContext msgContext) throws AxisFault + { + try + { + // determine the method we are calling + String opName = "Unknown method"; + OperationDesc op = msgContext.getOperation(); + if (op != null) + { + opName = op.getName(); + } + + // try and find the appropriate header and extract info from it + SOAPEnvelope env = msgContext.getRequestMessage().getSOAPEnvelope(); + SOAPHeaderElement header = env.getHeaderByName(Utils.REPOSITORY_SERVICE_NAMESPACE, "QueryHeader"); + if (header != null) + { + if (logger.isDebugEnabled()) + logger.debug("Found QueryHeader for call to " + opName); + + QueryConfiguration queryCfg = (QueryConfiguration)header.getObjectValue(QueryConfiguration.class); + if (queryCfg != null) + { + int fetchSize = queryCfg.getFetchSize(); + + if (logger.isDebugEnabled()) + logger.debug("Fetch size for query = " + fetchSize); + + msgContext.setProperty(ALF_FETCH_SIZE, new Integer(fetchSize)); + } + else + { + if (logger.isDebugEnabled()) + logger.debug("Failed to find QueryConfiguration within QueryHeader"); + } + } + else + { + if (logger.isDebugEnabled()) + { + logger.debug("QueryHeader was not found for call to " + opName); + } + } + } + catch (Throwable e) + { + if (logger.isDebugEnabled()) + logger.debug("Failed to determine fetch size", e); + } + } +} diff --git a/source/java/org/alfresco/repo/webservice/axis/SpringBeanRPCProvider.java b/source/java/org/alfresco/repo/webservice/axis/SpringBeanRPCProvider.java new file mode 100644 index 0000000000..35ec3c4d73 --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/axis/SpringBeanRPCProvider.java @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice.axis; + +import org.alfresco.repo.webservice.Utils; +import org.apache.axis.AxisFault; +import org.apache.axis.MessageContext; +import org.apache.axis.handlers.soap.SOAPService; +import org.apache.axis.providers.java.RPCProvider; +import org.springframework.web.context.WebApplicationContext; + +/** + * A custom Axis RPC Provider that retrieves services via Spring + * + * @author gavinc + */ +public class SpringBeanRPCProvider extends RPCProvider +{ + private static final long serialVersionUID = 2173234269124176995L; + private static final String OPTION_NAME = "springBean"; + private WebApplicationContext webAppCtx; + + /** + * Retrieves the class of the bean represented by the given name + * + * @see org.apache.axis.providers.java.JavaProvider#getServiceClass(java.lang.String, org.apache.axis.handlers.soap.SOAPService, org.apache.axis.MessageContext) + */ + @Override + protected Class getServiceClass(String beanName, SOAPService service, MessageContext msgCtx) throws AxisFault + { + Class clazz = null; + + Object bean = getBean(msgCtx, beanName); + if (bean != null) + { + clazz = bean.getClass(); + } + + return clazz; + } + + /** + * @see org.apache.axis.providers.java.JavaProvider#getServiceClassNameOptionName() + */ + @Override + protected String getServiceClassNameOptionName() + { + return OPTION_NAME; + } + + /** + * Retrieves the bean with the given name from the current spring context + * + * @see org.apache.axis.providers.java.JavaProvider#makeNewServiceObject(org.apache.axis.MessageContext, java.lang.String) + */ + @Override + protected Object makeNewServiceObject(MessageContext msgCtx, String beanName) throws Exception + { + return getBean(msgCtx, beanName); + } + + /** + * Retrieves the bean with the given name from the current spring context + * + * @param msgCtx Axis MessageContext + * @param beanName Name of the bean to lookup + * @return The instance of the bean + */ + private Object getBean(MessageContext msgCtx, String beanName) throws AxisFault + { + return getWebAppContext(msgCtx).getBean(beanName); + } + + /** + * Retrieves the Spring context from the web application + * + * @param msgCtx Axis MessageContext + * @return The Spring web app context + */ + private WebApplicationContext getWebAppContext(MessageContext msgCtx) throws AxisFault + { + if (this.webAppCtx == null && msgCtx != null) + { + this.webAppCtx = Utils.getSpringContext(msgCtx); + } + + if (this.webAppCtx == null) + { + throw new AxisFault("Failed to retrieve the Spring web application context"); + } + + return this.webAppCtx; + } +} diff --git a/source/java/org/alfresco/repo/webservice/axis/TicketCallbackHandler.java b/source/java/org/alfresco/repo/webservice/axis/TicketCallbackHandler.java new file mode 100644 index 0000000000..2e20afdcc2 --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/axis/TicketCallbackHandler.java @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice.axis; + +import java.io.IOException; + +import javax.security.auth.callback.Callback; +import javax.security.auth.callback.CallbackHandler; +import javax.security.auth.callback.UnsupportedCallbackException; + +import org.alfresco.repo.security.authentication.AuthenticationException; +import org.alfresco.repo.webservice.authentication.AuthenticationFault; +import org.alfresco.service.cmr.security.AuthenticationService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.ws.security.WSPasswordCallback; + +/** + * CallbackHandler that verifies the given ticket in the password element of the UsernameToken + * header is still a valid ticket + * + * @author gavinc + */ +public class TicketCallbackHandler implements CallbackHandler +{ + private static final Log logger = LogFactory.getLog(TicketCallbackHandler.class); + + private AuthenticationService authenticationService; + + /** + * Sets the AuthenticationService instance to use + * + * @param authenticationService The AuthenticationService + */ + public void setAuthenticationService(AuthenticationService authenticationService) + { + this.authenticationService = authenticationService; + } + + /** + * @see javax.security.auth.callback.CallbackHandler#handle(javax.security.auth.callback.Callback[]) + */ + public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException + { + for (int i = 0; i < callbacks.length; i++) + { + if (callbacks[i] instanceof WSPasswordCallback) + { + WSPasswordCallback pc = (WSPasswordCallback)callbacks[i]; + String ticket = pc.getPassword(); + + if (logger.isDebugEnabled()) + { + logger.debug("Verifying ticket for: " + pc.getIdentifer()); + logger.debug("Ticket: " + ticket); + } + + // ensure the ticket is valid + try + { + this.authenticationService.validate(ticket); + } + catch (AuthenticationException ae) + { + if (logger.isDebugEnabled()) + logger.debug("Ticket validation failed: " + ae.getMessage()); + + // NOTE: Throwing AuthenticationFault just gets consumed and the ws-security handler + // reports a missing password; we would need to modify the WSS4J code to let + // the exception bubble up so for now just let the default message get thrown + throw new AuthenticationFault(701, "Authentication failed due to an invalid ticket"); + } + + if (logger.isDebugEnabled()) + logger.debug("Ticket validated successfully"); + + // if all is well set the password to return as the given ticket + pc.setPassword(pc.getPassword()); + } + else + { + throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback"); + } + } + } +} diff --git a/source/java/org/alfresco/repo/webservice/axis/TicketCallbackSpringHandler.java b/source/java/org/alfresco/repo/webservice/axis/TicketCallbackSpringHandler.java new file mode 100644 index 0000000000..08ebc7ab13 --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/axis/TicketCallbackSpringHandler.java @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice.axis; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; + +import org.apache.axis.AxisFault; +import org.apache.axis.MessageContext; +import org.apache.axis.handlers.BasicHandler; +import org.apache.axis.transport.http.HTTPConstants; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.ws.security.handler.WSHandlerConstants; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +/** + * Axis handler that retrieves the TicketCallbackHandler instance from + * a Spring context. The authentication service is injected by Spring + * so that when it gets called by the WSS4J handler it can verify the + * ticket passed to the service. + * The callback handler is then added to the MessageContext under the standard + * WsHandlerConstants.PW_CALLBACK_REF property. + * + * @author gavinc + */ +public class TicketCallbackSpringHandler extends BasicHandler +{ + private static final Log logger = LogFactory.getLog(TicketCallbackSpringHandler.class); + private static final String BEAN_NAME = "ticketCallbackHandler"; + private static final long serialVersionUID = -135125831180499667L; + + /** + * @see org.apache.axis.Handler#invoke(org.apache.axis.MessageContext) + */ + public void invoke(MessageContext msgContext) throws AxisFault + { + // get hold of the Spring context and retrieve the AuthenticationService + HttpServletRequest req = (HttpServletRequest)msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST); + ServletContext servletCtx = req.getSession().getServletContext(); + WebApplicationContext webAppCtx = WebApplicationContextUtils.getRequiredWebApplicationContext(servletCtx); + TicketCallbackHandler callback = (TicketCallbackHandler)webAppCtx.getBean(BEAN_NAME); + + // store the callback in the context where the WS-Security handler can pick it up from + msgContext.setProperty(WSHandlerConstants.PW_CALLBACK_REF, callback); + } +} diff --git a/source/java/org/alfresco/repo/webservice/axis/WSDDSpringBeanRPCProvider.java b/source/java/org/alfresco/repo/webservice/axis/WSDDSpringBeanRPCProvider.java new file mode 100644 index 0000000000..ed122c7217 --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/axis/WSDDSpringBeanRPCProvider.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice.axis; + +import org.apache.axis.EngineConfiguration; +import org.apache.axis.Handler; +import org.apache.axis.deployment.wsdd.WSDDProvider; +import org.apache.axis.deployment.wsdd.WSDDService; + +/** + * Provider class loaded by Axis, used to identify and + * create an instance of our SpringRPC provider which in + * turn loads service endpoints from Spring configured beans + * + * @see org.alfresco.repo.webservice.axis.SpringBeanRPCProvider + * @author gavinc + */ +public class WSDDSpringBeanRPCProvider extends WSDDProvider +{ + private static final String PROVIDER_NAME = "SpringRPC"; + + /** + * @see org.apache.axis.deployment.wsdd.WSDDProvider#newProviderInstance(org.apache.axis.deployment.wsdd.WSDDService, org.apache.axis.EngineConfiguration) + */ + @Override + public Handler newProviderInstance(WSDDService service, EngineConfiguration registry) + throws Exception + { + return new SpringBeanRPCProvider(); + } + + /** + * @see org.apache.axis.deployment.wsdd.WSDDProvider#getName() + */ + @Override + public String getName() + { + return PROVIDER_NAME; + } + +} diff --git a/source/java/org/alfresco/repo/webservice/classification/ClassificationWebService.java b/source/java/org/alfresco/repo/webservice/classification/ClassificationWebService.java new file mode 100644 index 0000000000..d3f3a2abaf --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/classification/ClassificationWebService.java @@ -0,0 +1,454 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice.classification; + +import java.io.Serializable; +import java.rmi.RemoteException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import org.alfresco.model.ContentModel; +import org.alfresco.repo.transaction.TransactionUtil; +import org.alfresco.repo.webservice.AbstractWebService; +import org.alfresco.repo.webservice.Utils; +import org.alfresco.repo.webservice.types.Category; +import org.alfresco.repo.webservice.types.ClassDefinition; +import org.alfresco.repo.webservice.types.Classification; +import org.alfresco.repo.webservice.types.Predicate; +import org.alfresco.repo.webservice.types.Reference; +import org.alfresco.repo.webservice.types.Store; +import org.alfresco.service.cmr.dictionary.DataTypeDefinition; +import org.alfresco.service.cmr.dictionary.DictionaryService; +import org.alfresco.service.cmr.dictionary.PropertyDefinition; +import org.alfresco.service.cmr.repository.ChildAssociationRef; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter; +import org.alfresco.service.cmr.search.CategoryService; +import org.alfresco.service.namespace.QName; +import org.alfresco.service.transaction.TransactionService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Web service implementation of the ClassificationService. The WSDL for this + * service can be accessed from + * http://localhost:8080/alfresco/wsdl/classification-service.wsdl + * + * @author gavinc + */ +public class ClassificationWebService extends AbstractWebService implements + ClassificationServiceSoapPort +{ + private static Log logger = LogFactory.getLog(ClassificationWebService.class); + + /** + * The category service + */ + private CategoryService categoryService; + + /** + * The dictionary service + */ + private DictionaryService dictionaryService; + + /** + * The transaction service + */ + private TransactionService transactionService; + + /** + * Set the category service + * + * @param categoryService the category service + */ + public void setCategoryService(CategoryService categoryService) + { + this.categoryService = categoryService; + } + + /** + * Set the transaction service + * + * @param transactionService the transaction service + */ + public void setTransactionService(TransactionService transactionService) + { + this.transactionService = transactionService; + } + + /** + * Set the dictionary service + * + * @param dictionaryService the dictionary service + */ + public void setDictionaryService(DictionaryService dictionaryService) + { + this.dictionaryService = dictionaryService; + } + + /** + * @see org.alfresco.repo.webservice.classification.ClassificationServiceSoapPort#getClassifications() + */ + public Classification[] getClassifications(final Store store) throws RemoteException, + ClassificationFault + { + try + { + return TransactionUtil.executeInUserTransaction( + this.transactionService, + new TransactionUtil.TransactionWork() + { + public Classification[] doWork() + { + List classifications = new ArrayList(); + + Collection categoryAspects = ClassificationWebService.this.categoryService.getClassificationAspects(); + for (QName aspect : categoryAspects) + { + // Get the title of the cateogry + String title = null; + org.alfresco.service.cmr.dictionary.ClassDefinition aspectDefinition = ClassificationWebService.this.dictionaryService.getClass(aspect); + if (aspectDefinition != null) + { + title = aspectDefinition.getTitle(); + } + + if (logger.isDebugEnabled()) + { + logger.debug("Category aspect found: " + title + " (" + aspect.toString() + ")"); + } + + Collection assocs = ClassificationWebService.this.categoryService.getCategories( + Utils.convertToStoreRef(store), + aspect, + CategoryService.Depth.IMMEDIATE); + for (ChildAssociationRef assoc : assocs) + { + NodeRef categoryNodeRef = assoc.getChildRef(); + + Classification classification = new Classification(); + classification.setClassification(aspect.toString()); + classification.setTitle(title); + // TODO set the description + classification.setRootCategory(convertToCategory(categoryNodeRef)); + + classifications.add(classification); + } + } + + return classifications.toArray(new Classification[classifications.size()]); + } + }); + } + catch (Throwable e) + { + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new ClassificationFault(0, e.getMessage()); + } + } + + private Category convertToCategory(NodeRef nodeRef) + { + String title = (String)this.nodeService.getProperty(nodeRef, ContentModel.PROP_NAME); + + if (logger.isDebugEnabled()) + { + logger.debug("Category: " + title + "(" + nodeRef.toString() + ")"); + } + + Category category = new Category(); + category.setId(Utils.convertToReference(nodeRef)); + category.setTitle(title); + // TODO need to set the description + return category; + } + + /** + * @see org.alfresco.repo.webservice.classification.ClassificationServiceSoapPort#getChildCategories(org.alfresco.repo.webservice.types.Reference) + */ + public Category[] getChildCategories(final Reference parentCategory) + throws RemoteException, ClassificationFault + { + try + { + return TransactionUtil.executeInUserTransaction( + this.transactionService, + new TransactionUtil.TransactionWork() + { + public Category[] doWork() + { + NodeRef parentNodeRef = Utils.convertToNodeRef( + parentCategory, + ClassificationWebService.this.nodeService, + ClassificationWebService.this.searchService, + ClassificationWebService.this.namespaceService); + + Collection assocs = ClassificationWebService.this.categoryService.getChildren( + parentNodeRef, + CategoryService.Mode.SUB_CATEGORIES, + CategoryService.Depth.IMMEDIATE); + + List categories = new ArrayList(assocs.size()); + + for (ChildAssociationRef assoc : assocs) + { + NodeRef categoryNodeRef = assoc.getChildRef(); + categories.add(convertToCategory(categoryNodeRef)); + } + + return categories.toArray(new Category[categories.size()]); + } + }); + } + catch (Throwable e) + { + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new ClassificationFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.classification.ClassificationServiceSoapPort#getCategories(org.alfresco.repo.webservice.types.Predicate) + */ + public CategoriesResult[] getCategories(final Predicate items) + throws RemoteException, ClassificationFault + { + try + { + return TransactionUtil.executeInUserTransaction( + this.transactionService, + new TransactionUtil.TransactionWork() + { + public CategoriesResult[] doWork() + { + List result = new ArrayList(); + + List nodeRefs = Utils.resolvePredicate( + items, + ClassificationWebService.this.nodeService, + ClassificationWebService.this.searchService, + ClassificationWebService.this.namespaceService); + + for (NodeRef nodeRef : nodeRefs) + { + List appliedCategories = new ArrayList(); + + Set apsects = ClassificationWebService.this.nodeService.getAspects(nodeRef); + for (QName aspect : apsects) + { + if (ClassificationWebService.this.dictionaryService.isSubClass(aspect, ContentModel.ASPECT_CLASSIFIABLE) == true) + { + QName categoryPropertyName = getPropertyName(aspect); + + if (categoryPropertyName != null) + { + // Get the category value + Collection categoryNodeRefs = DefaultTypeConverter.INSTANCE.getCollection( + NodeRef.class, + ClassificationWebService.this.nodeService.getProperty(nodeRef, categoryPropertyName)); + + Reference[] categoryReferences = new Reference[categoryNodeRefs.size()]; + int iIndex = 0; + for (NodeRef categoryNodeRef : categoryNodeRefs) + { + categoryReferences[iIndex] = Utils.convertToReference(categoryNodeRef); + iIndex ++; + } + + + // Create the applied category object + AppliedCategory appliedCategory = new AppliedCategory(); + appliedCategory.setClassification(aspect.toString()); + appliedCategory.setCategories(categoryReferences); + + appliedCategories.add(appliedCategory); + } + } + } + + // Create the category result object + CategoriesResult categoryResult = new CategoriesResult(); + categoryResult.setNode(Utils.convertToReference(nodeRef)); + categoryResult.setCategories(appliedCategories.toArray(new AppliedCategory[appliedCategories.size()])); + + result.add(categoryResult); + } + + return result.toArray(new CategoriesResult[result.size()]); + } + }); + } + catch (Throwable e) + { + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new ClassificationFault(0, e.getMessage()); + } + } + + /** + * Get the category property qname for a classifiable apsect + * + * @param aspect the aspect qname + * @return the property qname, null if none found + */ + private QName getPropertyName(QName aspect) + { + QName categoryPropertyName = null; + + // Need to get category property + org.alfresco.service.cmr.dictionary.ClassDefinition classDefinition = ClassificationWebService.this.dictionaryService.getClass(aspect); + for (PropertyDefinition propertyDefintion : classDefinition.getProperties().values()) + { + if (DataTypeDefinition.CATEGORY.equals(propertyDefintion.getDataType().getName()) == true) + { + // We have found the category property (assume there is only one) + categoryPropertyName = propertyDefintion.getName(); + break; + } + } + + return categoryPropertyName; + } + + /** + * @see org.alfresco.repo.webservice.classification.ClassificationServiceSoapPort#setCategories(org.alfresco.repo.webservice.types.Predicate, + * org.alfresco.repo.webservice.classification.AppliedCategory[]) + */ + public CategoriesResult[] setCategories(final Predicate items, final AppliedCategory[] categories) + throws RemoteException, ClassificationFault + { + try + { + return TransactionUtil.executeInUserTransaction( + this.transactionService, + new TransactionUtil.TransactionWork() + { + public CategoriesResult[] doWork() + { + List result = new ArrayList(); + + List nodeRefs = Utils.resolvePredicate( + items, + ClassificationWebService.this.nodeService, + ClassificationWebService.this.searchService, + ClassificationWebService.this.namespaceService); + + for (NodeRef nodeRef : nodeRefs) + { + List appliedCategories = new ArrayList(); + + for (AppliedCategory category : categories) + { + QName aspect = QName.createQName(category.getClassification()); + QName propertyName = getPropertyName(aspect); + if (propertyName != null) + { + // First check that the aspect has been applied to the node + if (ClassificationWebService.this.nodeService.hasAspect(nodeRef, aspect) == false) + { + ClassificationWebService.this.nodeService.addAspect(nodeRef, aspect, null); + } + + ArrayList categoryNodeRefs = new ArrayList(category.getCategories().length); + for (Reference categoryReference : category.getCategories()) + { + categoryNodeRefs.add(Utils.convertToNodeRef( + categoryReference, + ClassificationWebService.this.nodeService, + ClassificationWebService.this.searchService, + ClassificationWebService.this.namespaceService)); + } + + ClassificationWebService.this.nodeService.setProperty(nodeRef, propertyName, categoryNodeRefs); + + // Create the applied category object + AppliedCategory appliedCategory = new AppliedCategory(); + appliedCategory.setClassification(category.getClassification()); + appliedCategory.setCategories(category.getCategories()); + + appliedCategories.add(appliedCategory); + } + } + + + // Create the category result object + CategoriesResult categoryResult = new CategoriesResult(); + categoryResult.setNode(Utils.convertToReference(nodeRef)); + categoryResult.setCategories(appliedCategories.toArray(new AppliedCategory[appliedCategories.size()])); + + result.add(categoryResult); + } + + return result.toArray(new CategoriesResult[result.size()]); + } + }); + } + catch (Throwable e) + { + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new ClassificationFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.classification.ClassificationServiceSoapPort#describeClassification(org.alfresco.repo.webservice.types.Reference) + */ + public ClassDefinition describeClassification(final String classification) + throws RemoteException, ClassificationFault + { + try + { + return TransactionUtil.executeInUserTransaction( + this.transactionService, + new TransactionUtil.TransactionWork() + { + public ClassDefinition doWork() + { + org.alfresco.service.cmr.dictionary.ClassDefinition classDefinition = ClassificationWebService.this.dictionaryService.getClass(QName.createQName(classification)); + return Utils.setupClassDefObject(classDefinition); + } + }); + } + catch (Throwable e) + { + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new ClassificationFault(0, e.getMessage()); + } + } +} diff --git a/source/java/org/alfresco/repo/webservice/cml-test.xml b/source/java/org/alfresco/repo/webservice/cml-test.xml new file mode 100644 index 0000000000..fcd50a4461 --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/cml-test.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/source/java/org/alfresco/repo/webservice/content/ContentWebService.java b/source/java/org/alfresco/repo/webservice/content/ContentWebService.java new file mode 100644 index 0000000000..8a15991b72 --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/content/ContentWebService.java @@ -0,0 +1,300 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice.content; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.rmi.RemoteException; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.transaction.UserTransaction; + +import org.alfresco.model.ContentModel; +import org.alfresco.repo.webservice.AbstractWebService; +import org.alfresco.repo.webservice.Utils; +import org.alfresco.repo.webservice.types.ContentFormat; +import org.alfresco.repo.webservice.types.Predicate; +import org.alfresco.repo.webservice.types.Reference; +import org.alfresco.service.cmr.repository.ContentReader; +import org.alfresco.service.cmr.repository.ContentWriter; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.namespace.QName; +import org.apache.axis.MessageContext; +import org.apache.axis.transport.http.HTTPConstants; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Web service implementation of the ContentService. The WSDL for this service + * can be accessed from http://localhost:8080/alfresco/wsdl/content-service.wsdl + * + * @author gavinc + */ +public class ContentWebService extends AbstractWebService implements + ContentServiceSoapPort +{ + private static Log logger = LogFactory.getLog(ContentWebService.class); + + private static final String BROWSER_URL = "{0}://{1}{2}/download/direct/{3}/{4}/{5}/{6}"; + + /** + * @see org.alfresco.repo.webservice.content.ContentServiceSoapPort#read(org.alfresco.repo.webservice.types.Reference) + */ + public Content[] read(Predicate items, String property) + throws RemoteException, ContentFault + { + UserTransaction tx = null; + + try + { + tx = Utils.getUserTransaction(MessageContext.getCurrentContext()); + tx.begin(); + + // resolve the predicates + List nodes = Utils.resolvePredicate(items, this.nodeService, this.searchService, this.namespaceService); + List results = new ArrayList(nodes.size()); + for (NodeRef nodeRef : nodes) + { + // Add content to the result + results.add(createContent(nodeRef, property)); + } + + // commit the transaction + tx.commit(); + + return results.toArray(new Content[results.size()]); + } + catch (Throwable e) + { + // rollback the transaction + try + { + if (tx != null) + { + tx.rollback(); + } + } + catch (Exception ex) + { + } + + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new ContentFault(0, e.getMessage()); + } + } + + /** + * Create the content object + * + * @param nodeRef the node reference + * @param property the content property + * @return the content object + * @throws UnsupportedEncodingException + */ + private Content createContent(NodeRef nodeRef, String property) + throws UnsupportedEncodingException + { + Content content = null; + + // Lets have a look and see if this node has any content on this node + ContentReader contentReader = this.contentService.getReader(nodeRef, QName.createQName(property)); + + if (contentReader != null) + { + // Work out what the server, port and context path are + HttpServletRequest req = (HttpServletRequest)MessageContext.getCurrentContext().getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST); + + String address = req.getLocalName(); + if (req.getLocalPort() != 80) + { + address = address + ":" + req.getLocalPort(); + } + + // Get the file name + String filename = (String)this.nodeService.getProperty(nodeRef, ContentModel.PROP_NAME); + + // format the URL that can be used to download the content + String downloadUrl = MessageFormat.format(BROWSER_URL, + new Object[] { req.getScheme(), address, + req.getContextPath(), + nodeRef.getStoreRef().getProtocol(), + nodeRef.getStoreRef().getIdentifier(), + nodeRef.getId(), + URLEncoder.encode(filename, "UTF-8") }); + + // Create the content object + ContentFormat format = new ContentFormat(contentReader.getMimetype(), contentReader.getEncoding()); + content = new Content(Utils.convertToReference(nodeRef), property, contentReader.getSize(), format, downloadUrl); + + // Debug + if (logger.isDebugEnabled()) + { + logger.debug("Content: " + nodeRef.getId() + " name=" + + filename + " encoding=" + + content.getFormat().getEncoding() + " mimetype=" + + content.getFormat().getMimetype() + " size=" + + content.getLength() + " downloadURL=" + + content.getUrl()); + } + } + else + { + // Create an empty content object + content = new Content(Utils.convertToReference(nodeRef), property, 0, null, null); + + // Debug + if (logger.isDebugEnabled()) + { + logger.debug("No content found: " + nodeRef.getId()); + } + } + + return content; + } + + /** + * @see org.alfresco.repo.webservice.content.ContentServiceSoapPort#write(org.alfresco.repo.webservice.types.Reference, + * byte[]) + */ + public Content write(Reference node, String property, byte[] content, ContentFormat format) + throws RemoteException, ContentFault + { + UserTransaction tx = null; + + try + { + tx = Utils.getUserTransaction(MessageContext.getCurrentContext()); + tx.begin(); + + // create a NodeRef from the parent reference + NodeRef nodeRef = Utils.convertToNodeRef(node, this.nodeService, + this.searchService, this.namespaceService); + + // Get the content writer + ContentWriter writer = this.contentService.getWriter(nodeRef, QName.createQName(property), true); + + // Set the content format details (if they have been specified) + if (format != null) + { + writer.setEncoding(format.getEncoding()); + writer.setMimetype(format.getMimetype()); + } + + // Write the content + writer.putContent(new String(content)); + + // Debug + if (logger.isDebugEnabled()) + { + logger.debug("Updated content for node with id: " + nodeRef.getId()); + } + + // Commit the transaction + tx.commit(); + + // Return the content object + return createContent(nodeRef, property); + } + catch (Throwable e) + { + // Rollback the transaction + try + { + if (tx != null) + { + tx.rollback(); + } + } catch (Exception ex) + { + } + + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new ContentFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.content.ContentServiceSoapPort#clear(org.alfresco.repo.webservice.types.Predicate, + * java.lang.String) + */ + public Content[] clear(Predicate items, String property) + throws RemoteException, ContentFault + { + UserTransaction tx = null; + + try + { + tx = Utils.getUserTransaction(MessageContext.getCurrentContext()); + tx.begin(); + + List nodes = Utils.resolvePredicate(items, this.nodeService,this.searchService, this.namespaceService); + Content[] contents = new Content[nodes.size()]; + + // delete each node in the predicate + for (int x = 0; x < nodes.size(); x++) + { + NodeRef nodeRef = nodes.get(x); + + // Clear the content + this.nodeService.setProperty(nodeRef, QName.createQName(property), null); + + if (logger.isDebugEnabled()) + { + logger.debug("Cleared content node with id: " + nodeRef.getId()); + } + + contents[x] = createContent(nodeRef, property); + } + + // commit the transaction + tx.commit(); + + return contents; + } + catch (Throwable e) + { + // rollback the transaction + try + { + if (tx != null) + { + tx.rollback(); + } + } catch (Exception ex) + { + } + + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new ContentFault(0, e.getMessage()); + } + } +} diff --git a/source/java/org/alfresco/repo/webservice/repository/AbstractQuerySession.java b/source/java/org/alfresco/repo/webservice/repository/AbstractQuerySession.java new file mode 100644 index 0000000000..12fb384bee --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/repository/AbstractQuerySession.java @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice.repository; + +import org.alfresco.util.GUID; + +/** + * Abstract implementation of a QuerySession providing support + * for automatic id generation and provides support for + * paging through query results. + * + * @author gavinc + */ +public abstract class AbstractQuerySession implements QuerySession +{ + protected int batchSize; + protected int position = 0; + + private String id; + + /** + * Common constructor that initialises the session's id and batch size + * + * @param batchSize The batch size this session will use + */ + public AbstractQuerySession(int batchSize) + { + this.id = GUID.generate(); + this.batchSize = batchSize; + } + + /** + * @see org.alfresco.repo.webservice.repository.QuerySession#getId() + */ + public String getId() + { + return this.id; + } + + /** + * Calculates the index of the last row to retrieve. + * + * @param totalRowCount The total number of rows in the results + * @return The index of the last row to return + */ + protected int calculateLastRowIndex(int totalRowCount) + { + int lastRowIndex = totalRowCount; + + // set the last row index if there are more results available + // than the batch size + if ((this.batchSize != -1) && ((this.position + this.batchSize) < totalRowCount)) + { + lastRowIndex = this.position + this.batchSize; + } + + return lastRowIndex; + } + + /** + * Calculates the value of the next position. + * If the end of the result set is reached the position is set to -1 + * + * @param totalRowCount The total number of rows in the results + * @param queryResult The QueryResult object being returned to the client, + * if there are no more results the id is removed from the QueryResult instance + */ + protected void updatePosition(int totalRowCount, QueryResult queryResult) + { + this.position += this.batchSize; + if (this.position >= totalRowCount) + { + // signify that there are no more results + this.position = -1; + queryResult.setQuerySession(null); + } + } +} diff --git a/source/java/org/alfresco/repo/webservice/repository/AssociatedQuerySession.java b/source/java/org/alfresco/repo/webservice/repository/AssociatedQuerySession.java new file mode 100644 index 0000000000..780241c207 --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/repository/AssociatedQuerySession.java @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice.repository; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +import org.alfresco.repo.webservice.Utils; +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.repository.AssociationRef; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.cmr.search.SearchService; +import org.alfresco.service.namespace.NamespaceService; +import org.alfresco.service.namespace.QName; +import org.alfresco.service.namespace.RegexQNamePattern; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Implementation of a QuerySession that stores the results from a query for + * associations + * + * @author Roy Wetherall + */ +public class AssociatedQuerySession extends AbstractQuerySession +{ + private static final long serialVersionUID = 6488008047324436124L; + + private transient static Log logger = LogFactory + .getLog(AssociatedQuerySession.class); + + private Reference node; + + /** + * Constructs a AssociatedQuerySession + * + * @param batchSize + * The batch size to use for this session + * @param node + * The node to retrieve the associations + */ + public AssociatedQuerySession(int batchSize, Reference node) + { + super(batchSize); + + this.node = node; + } + + /** + * @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) + { + QueryResult queryResult = null; + + if (this.position != -1) + { + if (logger.isDebugEnabled()) + logger.debug("Before getNextResultsBatch: " + toString()); + + // create the node ref and get the children from the repository + NodeRef nodeRef = Utils.convertToNodeRef(this.node, nodeService, + searchService, namespaceService); + List assocs = nodeService.getTargetAssocs(nodeRef, + RegexQNamePattern.MATCH_ALL); + + int totalRows = assocs.size(); + int lastRow = calculateLastRowIndex(totalRows); + int currentBatchSize = lastRow - this.position; + + if (logger.isDebugEnabled()) + 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.ResultSetRow[] rows = new org.alfresco.repo.webservice.types.ResultSetRow[currentBatchSize]; + + int arrPos = 0; + for (int x = this.position; x < lastRow; x++) + { + AssociationRef assoc = assocs.get(x); + NodeRef childNodeRef = assoc.getTargetRef(); + ResultSetRowNode rowNode = new ResultSetRowNode(childNodeRef + .getId(), nodeService.getType(childNodeRef).toString(), + null); + + // create columns for all the properties of the node + // get the data for the row and build up the columns structure + Map props = nodeService + .getProperties(childNodeRef); + NamedValue[] columns = new NamedValue[props.size()]; + 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); + col++; + } + + ResultSetRow row = new ResultSetRow(); + row.setRowIndex(x); + row.setNode(rowNode); + row.setColumns(columns); + + // add the row to the overall results + rows[arrPos] = row; + arrPos++; + } + + // add the rows to the result set and set the total row count + batchResults.setRows(rows); + batchResults.setTotalRowCount(totalRows); + + queryResult = new QueryResult(getId(), batchResults); + + // move the position on + updatePosition(totalRows, queryResult); + + if (logger.isDebugEnabled()) + logger.debug("After getNextResultsBatch: " + toString()); + } + + return queryResult; + } + + /** + * @see java.lang.Object#toString() + */ + @Override + public String toString() + { + StringBuilder builder = new StringBuilder(super.toString()); + builder.append(" (id=").append(getId()); + builder.append(" batchSize=").append(this.batchSize); + builder.append(" position=").append(this.position); + builder.append(" node-id=").append(this.node.getUuid()).append(")"); + return builder.toString(); + } +} diff --git a/source/java/org/alfresco/repo/webservice/repository/ChildrenQuerySession.java b/source/java/org/alfresco/repo/webservice/repository/ChildrenQuerySession.java new file mode 100644 index 0000000000..0c8d1f9484 --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/repository/ChildrenQuerySession.java @@ -0,0 +1,152 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice.repository; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +import org.alfresco.repo.webservice.Utils; +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.repository.ChildAssociationRef; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +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; + +/** + * Implementation of a QuerySession that stores the results from a query for children + * + * @author gavinc + */ +public class ChildrenQuerySession extends AbstractQuerySession +{ + private static final long serialVersionUID = -5347036309571057074L; + + private transient static Log logger = LogFactory.getLog(ChildrenQuerySession.class); + + private Reference node; + + /** + * Constructs a ChildrenQuerySession + * + * @param batchSize The batch size to use for this session + * @param node The node to retrieve the parents + */ + public ChildrenQuerySession(int batchSize, Reference node) + { + super(batchSize); + + this.node = node; + } + + /** + * @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) + { + QueryResult queryResult = null; + + if (this.position != -1) + { + if (logger.isDebugEnabled()) + logger.debug("Before getNextResultsBatch: " + toString()); + + // create the node ref and get the children from the repository + NodeRef nodeRef = Utils.convertToNodeRef(this.node, nodeService, searchService, namespaceService); + List kids = nodeService.getChildAssocs(nodeRef); + + int totalRows = kids.size(); + int lastRow = calculateLastRowIndex(totalRows); + int currentBatchSize = lastRow - this.position; + + if (logger.isDebugEnabled()) + 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.ResultSetRow[] rows = new org.alfresco.repo.webservice.types.ResultSetRow[currentBatchSize]; + + int arrPos = 0; + for (int x = this.position; x < lastRow; x++) + { + ChildAssociationRef assoc = kids.get(x); + NodeRef childNodeRef = assoc.getChildRef(); + ResultSetRowNode rowNode = new ResultSetRowNode(childNodeRef.getId(), nodeService.getType(childNodeRef).toString(), null); + + // create columns for all the properties of the node + // get the data for the row and build up the columns structure + Map props = nodeService.getProperties(childNodeRef); + NamedValue[] columns = new NamedValue[props.size()]; + 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); + col++; + } + + ResultSetRow row = new ResultSetRow(); + row.setRowIndex(x); + row.setNode(rowNode); + row.setColumns(columns); + + // add the row to the overall results + rows[arrPos] = row; + arrPos++; + } + + // add the rows to the result set and set the total row count + batchResults.setRows(rows); + batchResults.setTotalRowCount(totalRows); + + queryResult = new QueryResult(getId(), batchResults); + + // move the position on + updatePosition(totalRows, queryResult); + + if (logger.isDebugEnabled()) + logger.debug("After getNextResultsBatch: " + toString()); + } + + return queryResult; + } + + /** + * @see java.lang.Object#toString() + */ + @Override + public String toString() + { + StringBuilder builder = new StringBuilder(super.toString()); + builder.append(" (id=").append(getId()); + builder.append(" batchSize=").append(this.batchSize); + builder.append(" position=").append(this.position); + builder.append(" node-id=").append(this.node.getUuid()).append(")"); + return builder.toString(); + } +} diff --git a/source/java/org/alfresco/repo/webservice/repository/ParentsQuerySession.java b/source/java/org/alfresco/repo/webservice/repository/ParentsQuerySession.java new file mode 100644 index 0000000000..4200198c97 --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/repository/ParentsQuerySession.java @@ -0,0 +1,152 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice.repository; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +import org.alfresco.repo.webservice.Utils; +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.repository.ChildAssociationRef; +import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +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; + +/** + * Implementation of a QuerySession that stores the results from a query for parents + * + * @author gavinc + */ +public class ParentsQuerySession extends AbstractQuerySession +{ + private static final long serialVersionUID = 2539375863409175463L; + + private transient static Log logger = LogFactory.getLog(ParentsQuerySession.class); + + private Reference node; + + /** + * Constructs a ParentsQuerySession + * + * @param batchSize The batch size to use for this session + * @param node The node to retrieve the parents + */ + public ParentsQuerySession(int batchSize, Reference node) + { + super(batchSize); + + this.node = node; + } + + /** + * @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) + { + QueryResult queryResult = null; + + if (this.position != -1) + { + if (logger.isDebugEnabled()) + logger.debug("Before getNextResultsBatch: " + toString()); + + // create the node ref and get the children from the repository + NodeRef nodeRef = Utils.convertToNodeRef(this.node, nodeService, searchService, namespaceService); + List parents = nodeService.getParentAssocs(nodeRef); + + int totalRows = parents.size(); + int lastRow = calculateLastRowIndex(totalRows); + int currentBatchSize = lastRow - this.position; + + if (logger.isDebugEnabled()) + 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.ResultSetRow[] rows = new org.alfresco.repo.webservice.types.ResultSetRow[currentBatchSize]; + + int arrPos = 0; + for (int x = this.position; x < lastRow; x++) + { + ChildAssociationRef assoc = parents.get(x); + NodeRef parentNodeRef = assoc.getParentRef(); + ResultSetRowNode rowNode = new ResultSetRowNode(parentNodeRef.getId(), nodeService.getType(parentNodeRef).toString(), null); + + // create columns for all the properties of the node + // get the data for the row and build up the columns structure + Map props = nodeService.getProperties(parentNodeRef); + NamedValue[] columns = new NamedValue[props.size()]; + 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); + col++; + } + + ResultSetRow row = new ResultSetRow(); + row.setRowIndex(x); + row.setNode(rowNode); + row.setColumns(columns); + + // add the row to the overall results + rows[arrPos] = row; + arrPos++; + } + + // add the rows to the result set and set the total row count + batchResults.setRows(rows); + batchResults.setTotalRowCount(totalRows); + + queryResult = new QueryResult(getId(), batchResults); + + // move the position on + updatePosition(totalRows, queryResult); + + if (logger.isDebugEnabled()) + logger.debug("After getNextResultsBatch: " + toString()); + } + + return queryResult; + } + + /** + * @see java.lang.Object#toString() + */ + @Override + public String toString() + { + StringBuilder builder = new StringBuilder(super.toString()); + builder.append(" (id=").append(getId()); + builder.append(" batchSize=").append(this.batchSize); + builder.append(" position=").append(this.position); + builder.append(" node-id=").append(this.node.getUuid()).append(")"); + return builder.toString(); + } +} diff --git a/source/java/org/alfresco/repo/webservice/repository/QuerySession.java b/source/java/org/alfresco/repo/webservice/repository/QuerySession.java new file mode 100644 index 0000000000..18f437ac20 --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/repository/QuerySession.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice.repository; + +import java.io.Serializable; + +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.cmr.search.SearchService; +import org.alfresco.service.namespace.NamespaceService; + +/** + * Interface definition for a QuerySession. + * + * @author gavinc + */ +public interface QuerySession extends Serializable +{ + /** + * Retrieves the id this query session can be identified as + * + * @return Id of this query session + */ + public String getId(); + + /** + * Returns a QueryResult object representing the next batch of results. + * QueryResult will contain a maximum of items as determined by the + * fetchSize element of the QueryConfiguration SOAP header. + * + * When the last batch of results is being returned the querySession of + * QueryResult will be null. + * + * @see org.alfresco.repo.webservice.repository.QuerySession#getId() + * @param searchService The SearchService to use for gathering the results + * @param nodeService The NodeService to use for gathering the results + * @param namespaceService The NamespaceService to use + * @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); +} diff --git a/source/java/org/alfresco/repo/webservice/repository/RepositoryWebService.java b/source/java/org/alfresco/repo/webservice/repository/RepositoryWebService.java new file mode 100644 index 0000000000..7a96b7bd66 --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/repository/RepositoryWebService.java @@ -0,0 +1,681 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice.repository; + +import java.io.Serializable; +import java.rmi.RemoteException; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.transaction.UserTransaction; + +import org.alfresco.repo.cache.SimpleCache; +import org.alfresco.repo.webservice.AbstractWebService; +import org.alfresco.repo.webservice.CMLUtil; +import org.alfresco.repo.webservice.Utils; +import org.alfresco.repo.webservice.types.CML; +import org.alfresco.repo.webservice.types.ClassDefinition; +import org.alfresco.repo.webservice.types.NamedValue; +import org.alfresco.repo.webservice.types.Node; +import org.alfresco.repo.webservice.types.NodeDefinition; +import org.alfresco.repo.webservice.types.Predicate; +import org.alfresco.repo.webservice.types.Query; +import org.alfresco.repo.webservice.types.QueryLanguageEnum; +import org.alfresco.repo.webservice.types.Reference; +import org.alfresco.repo.webservice.types.Store; +import org.alfresco.repo.webservice.types.StoreEnum; +import org.alfresco.service.cmr.dictionary.AspectDefinition; +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; +import org.apache.commons.logging.LogFactory; + +/** + * Web service implementation of the RepositoryService. The WSDL for this + * service can be accessed from + * http://localhost:8080/alfresco/wsdl/repository-service.wsdl + * + * @author gavinc + */ +public class RepositoryWebService extends AbstractWebService implements + RepositoryServiceSoapPort +{ + private static Log logger = LogFactory.getLog(RepositoryWebService.class); + + private DictionaryService dictionaryService; + + private CMLUtil cmlUtil; + + private SimpleCache querySessionCache; + + /** + * Sets the instance of the DictionaryService to be used + * + * @param dictionaryService + * The DictionaryService + */ + public void setDictionaryService(DictionaryService dictionaryService) + { + this.dictionaryService = dictionaryService; + } + + /** + * Sets the CML Util + * + * @param cmlUtil CML util object + */ + public void setCmlUtil(CMLUtil cmlUtil) + { + this.cmlUtil = cmlUtil; + } + + /** + * Sets the instance of the SimpleCache to be used + * + * @param querySessionCache + * The SimpleCache + */ + public void setQuerySessionCache( + SimpleCache querySessionCache) + { + this.querySessionCache = querySessionCache; + } + + /** + * @see org.alfresco.repo.webservice.repository.RepositoryServiceSoapPort#getStores() + */ + public Store[] getStores() throws RemoteException, RepositoryFault + { + UserTransaction tx = null; + + try + { + tx = Utils.getUserTransaction(MessageContext.getCurrentContext()); + tx.begin(); + + List stores = this.nodeService.getStores(); + Store[] returnStores = new Store[stores.size()]; + for (int x = 0; x < stores.size(); x++) + { + StoreRef storeRef = stores.get(x); + + if (logger.isDebugEnabled() == true) + { + logger.debug("Store protocol :" + storeRef.getProtocol()); + } + + StoreEnum storeEnum = StoreEnum.fromString(storeRef + .getProtocol()); + Store store = new Store(storeEnum, storeRef.getIdentifier()); + returnStores[x] = store; + } + + // commit the transaction + tx.commit(); + + return returnStores; + } catch (Throwable e) + { + // rollback the transaction + try + { + if (tx != null) + { + tx.rollback(); + } + } catch (Exception ex) + { + } + + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new RepositoryFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.repository.RepositoryServiceSoapPort#query(org.alfresco.repo.webservice.types.Store, + * org.alfresco.repo.webservice.types.Query, boolean) + */ + public QueryResult query(Store store, Query query, boolean includeMetaData) + throws RemoteException, RepositoryFault + { + QueryLanguageEnum langEnum = query.getLanguage(); + + if (langEnum.equals(QueryLanguageEnum.cql) + || langEnum.equals(QueryLanguageEnum.xpath)) + { + throw new RepositoryFault(110, "Only '" + + QueryLanguageEnum.lucene.getValue() + + "' queries are currently supported!"); + } + + UserTransaction tx = null; + MessageContext msgContext = MessageContext.getCurrentContext(); + + try + { + tx = Utils.getUserTransaction(msgContext); + tx.begin(); + + // setup a query session and get the first batch of results + QuerySession querySession = new ResultSetQuerySession(Utils + .getBatchSize(msgContext), store, query, includeMetaData); + QueryResult queryResult = querySession + .getNextResultsBatch(this.searchService, this.nodeService, + this.namespaceService); + + // add the session to the cache if there are more results to come + if (queryResult.getQuerySession() != null) + { + // this.querySessionCache.putQuerySession(querySession); + this.querySessionCache.put(queryResult.getQuerySession(), + querySession); + } + + // commit the transaction + tx.commit(); + + return queryResult; + } catch (Throwable e) + { + // rollback the transaction + try + { + if (tx != null) + { + tx.rollback(); + } + } catch (Exception ex) + { + } + + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + e.printStackTrace(); + + throw new RepositoryFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.repository.RepositoryServiceSoapPort#queryChildren(org.alfresco.repo.webservice.types.Reference) + */ + public QueryResult queryChildren(Reference node) throws RemoteException, + RepositoryFault + { + UserTransaction tx = null; + + try + { + tx = Utils.getUserTransaction(MessageContext.getCurrentContext()); + tx.begin(); + + // setup a query session and get the first batch of results + QuerySession querySession = new ChildrenQuerySession(Utils + .getBatchSize(MessageContext.getCurrentContext()), node); + QueryResult queryResult = querySession + .getNextResultsBatch(this.searchService, this.nodeService, + this.namespaceService); + + // add the session to the cache if there are more results to come + if (queryResult.getQuerySession() != null) + { + // this.querySessionCache.putQuerySession(querySession); + this.querySessionCache.put(queryResult.getQuerySession(), + querySession); + } + + // commit the transaction + tx.commit(); + + return queryResult; + } catch (Throwable e) + { + // rollback the transaction + try + { + if (tx != null) + { + tx.rollback(); + } + } catch (Exception ex) + { + } + + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new RepositoryFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.repository.RepositoryServiceSoapPort#queryParents(org.alfresco.repo.webservice.types.Reference) + */ + public QueryResult queryParents(Reference node) throws RemoteException, + RepositoryFault + { + UserTransaction tx = null; + + try + { + tx = Utils.getUserTransaction(MessageContext.getCurrentContext()); + tx.begin(); + + // setup a query session and get the first batch of results + QuerySession querySession = new ParentsQuerySession(Utils + .getBatchSize(MessageContext.getCurrentContext()), node); + QueryResult queryResult = querySession + .getNextResultsBatch(this.searchService, this.nodeService, + this.namespaceService); + + // add the session to the cache if there are more results to come + if (queryResult.getQuerySession() != null) + { + // this.querySessionCache.putQuerySession(querySession); + this.querySessionCache.put(queryResult.getQuerySession(), + querySession); + } + + // commit the transaction + tx.commit(); + + return queryResult; + } catch (Throwable e) + { + // rollback the transaction + try + { + if (tx != null) + { + tx.rollback(); + } + } catch (Exception ex) + { + } + + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new RepositoryFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.repository.RepositoryServiceSoapPort#queryAssociated(org.alfresco.repo.webservice.types.Reference, + * org.alfresco.repo.webservice.repository.Association[]) + */ + public QueryResult queryAssociated(Reference node, Association[] association) + throws RemoteException, RepositoryFault + { + UserTransaction tx = null; + + try + { + tx = Utils.getUserTransaction(MessageContext.getCurrentContext()); + tx.begin(); + + // setup a query session and get the first batch of results + QuerySession querySession = new AssociatedQuerySession(Utils.getBatchSize(MessageContext.getCurrentContext()), node); + QueryResult queryResult = querySession + .getNextResultsBatch(this.searchService, this.nodeService, + this.namespaceService); + + // add the session to the cache if there are more results to come + if (queryResult.getQuerySession() != null) + { + // this.querySessionCache.putQuerySession(querySession); + this.querySessionCache.put(queryResult.getQuerySession(), + querySession); + } + + // commit the transaction + tx.commit(); + + return queryResult; + } + catch (Throwable e) + { + // rollback the transaction + try + { + if (tx != null) + { + tx.rollback(); + } + } catch (Exception ex) + { + } + + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new RepositoryFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.repository.RepositoryServiceSoapPort#fetchMore(java.lang.String) + */ + public QueryResult fetchMore(String querySession) throws RemoteException, + RepositoryFault + { + QueryResult queryResult = null; + + UserTransaction tx = null; + + try + { + tx = Utils.getUserTransaction(MessageContext.getCurrentContext()); + tx.begin(); + + // try and get the QuerySession with the given id from the cache + QuerySession session = this.querySessionCache.get(querySession); + + if (session == null) + { + if (logger.isDebugEnabled()) + logger.debug("Invalid querySession id requested: " + + querySession); + + throw new RepositoryFault(4, "querySession with id '" + + querySession + "' is invalid"); + } + + // get the next batch of results + queryResult = session.getNextResultsBatch(this.searchService, + this.nodeService, this.namespaceService); + + // remove the QuerySession from the cache if there are no more + // results to come + if (queryResult.getQuerySession() == null) + { + this.querySessionCache.remove(querySession); + } + + // commit the transaction + tx.commit(); + + return queryResult; + } catch (Throwable e) + { + // rollback the transaction + try + { + if (tx != null) + { + tx.rollback(); + } + } catch (Exception ex) + { + } + + if (e instanceof RepositoryFault) + { + throw (RepositoryFault) e; + } else + { + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new RepositoryFault(0, e.getMessage()); + } + } + } + + /** + * @see org.alfresco.repo.webservice.repository.RepositoryServiceSoapPort#update(org.alfresco.repo.webservice.types.CML) + */ + public UpdateResult[] update(CML statements) throws RemoteException, + RepositoryFault + { + UpdateResult[] result = null; + UserTransaction tx = null; + + try + { + tx = Utils.getUserTransaction(MessageContext.getCurrentContext()); + tx.begin(); + + result = this.cmlUtil.executeCML(statements); + + // commit the transaction + tx.commit(); + + return result; + } + catch (Throwable e) + { + // rollback the transaction + try + { + if (tx != null) + { + tx.rollback(); + } + } catch (Exception ex) + { + } + + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new RepositoryFault(0, e.getMessage()); + } + } + + /** + * @see org.alfresco.repo.webservice.repository.RepositoryServiceSoapPort#describe(org.alfresco.repo.webservice.types.Predicate) + */ + public NodeDefinition[] describe(Predicate items) throws RemoteException, + RepositoryFault + { + NodeDefinition[] nodeDefs = null; + UserTransaction tx = null; + + try + { + tx = Utils.getUserTransaction(MessageContext.getCurrentContext()); + tx.begin(); + + List nodes = Utils + .resolvePredicate(items, this.nodeService, + this.searchService, this.namespaceService); + nodeDefs = new NodeDefinition[nodes.size()]; + + for (int x = 0; x < nodes.size(); x++) + { + nodeDefs[x] = setupNodeDefObject(nodes.get(x)); + } + + // commit the transaction + tx.commit(); + + return nodeDefs; + } catch (Throwable e) + { + // rollback the transaction + try + { + if (tx != null) + { + tx.rollback(); + } + } catch (Exception ex) + { + } + + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new RepositoryFault(0, e.getMessage()); + } + } + + /** + * Creates a NodeDefinition web service type object for the given + * repository NodeRef instance + * + * @param nodeRef The NodeRef to generate the NodeDefinition for + * @return The NodeDefinition representation of nodeRef + */ + private NodeDefinition setupNodeDefObject(NodeRef nodeRef) + { + if (logger.isDebugEnabled()) + logger.debug("Building NodeDefinition for node: " + nodeRef); + + TypeDefinition ddTypeDef = this.dictionaryService + .getType(this.nodeService.getType(nodeRef)); + + // create the web service ClassDefinition type from the data dictionary TypeDefinition + ClassDefinition typeDef = Utils.setupClassDefObject(ddTypeDef); + + // create the web service ClassDefinition types to represent the aspects + ClassDefinition[] aspectDefs = null; + List aspects = ddTypeDef.getDefaultAspects(); + if (aspects != null) + { + aspectDefs = new ClassDefinition[aspects.size()]; + int pos = 0; + for (AspectDefinition ddAspectDef : aspects) + { + aspectDefs[pos] = Utils.setupClassDefObject(ddAspectDef); + pos++; + } + } + + return new NodeDefinition(typeDef, aspectDefs); + } + + /** + * Gets the nodes associatiated with the predicate provided. Usefull when the store and ids of the required + * nodes are known. + * + * @see org.alfresco.repo.webservice.repository.RepositoryServiceSoapPort#get(org.alfresco.repo.webservice.types.Predicate) + */ + public Node[] get(Predicate where) throws RemoteException, RepositoryFault + { + Node[] nodes = null; + UserTransaction tx = null; + + try + { + tx = Utils.getUserTransaction(MessageContext.getCurrentContext()); + tx.begin(); + + // Resolve the predicate to a list of node references + List nodeRefs = Utils.resolvePredicate(where, this.nodeService, this.searchService, this.namespaceService); + nodes = new Node[nodeRefs.size()]; + int index = 0; + for (NodeRef nodeRef : nodeRefs) + { + // Get the nodes reference + Reference reference = Utils.convertToReference(nodeRef); + + // Get the nodes type + String type = this.nodeService.getType(nodeRef).toString(); + + // Get the nodes aspects + Set aspectQNames = this.nodeService.getAspects(nodeRef); + String[] aspects = new String[aspectQNames.size()]; + int aspectIndex = 0; + for (QName aspectQName : aspectQNames) + { + aspects[aspectIndex] = aspectQName.toString(); + aspectIndex++; + } + + // Get the nodes properties + Map propertyMap = this.nodeService.getProperties(nodeRef); + NamedValue[] properties = new NamedValue[propertyMap.size()]; + int propertyIndex = 0; + for (Map.Entry 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); + propertyIndex++; + } + + // Create the node and add to the array + Node node = new Node(reference, type, aspects, properties); + nodes[index] = node; + + index++; + } + + // commit the transaction + tx.commit(); + } + catch (Throwable e) + { + // rollback the transaction + try + { + if (tx != null) + { + tx.rollback(); + } + } + catch (Exception ex) + { + // Ignore + } + + if (logger.isDebugEnabled()) + { + logger.error("Unexpected error occurred", e); + } + + throw new RepositoryFault(0, e.getMessage()); + } + + return nodes; + } +} diff --git a/source/java/org/alfresco/repo/webservice/repository/ResultSetQuerySession.java b/source/java/org/alfresco/repo/webservice/repository/ResultSetQuerySession.java new file mode 100644 index 0000000000..e85ab40637 --- /dev/null +++ b/source/java/org/alfresco/repo/webservice/repository/ResultSetQuerySession.java @@ -0,0 +1,188 @@ +/* + * Copyright (C) 2005 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ +package org.alfresco.repo.webservice.repository; + +import java.io.Serializable; +import java.util.Map; + +import org.alfresco.repo.webservice.Utils; +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.repository.NodeRef; +import org.alfresco.service.cmr.repository.NodeService; +import org.alfresco.service.cmr.repository.Path; +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.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * Implementation of a QuerySession that retrieves results from a repository ResultSet + * + * @author gavinc + */ +public class ResultSetQuerySession extends AbstractQuerySession +{ + private static final long serialVersionUID = -9154514445963635138L; + + private transient static Log logger = LogFactory.getLog(ResultSetQuerySession.class); + + private Store store; + private Query query; + private boolean includeMetaData; + + /** + * Constructs a ResultSetQuerySession + * + * @param batchSize The batch size to use for this session + * @param store The repository store to query against + * @param query The query to execute + * @param includeMetaData Whether to include metadata in the query results + */ + public ResultSetQuerySession(int batchSize, Store store, Query query, boolean includeMetaData) + { + super(batchSize); + + this.store = store; + this.query = query; + this.includeMetaData = includeMetaData; + } + + /** + * @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) + { + QueryResult queryResult = null; + + if (this.position != -1) + { + if (logger.isDebugEnabled()) + logger.debug("Before getNextResultsBatch: " + toString()); + + // handle the special search string of * meaning, get everything + String statement = query.getStatement(); + if (statement.equals("*")) + { + statement = "ISNODE:*"; + } + ResultSet searchResults = null; + try + { + searchResults = searchService.query(Utils.convertToStoreRef(this.store), + this.query.getLanguage().getValue(), statement); + + int totalRows = searchResults.length(); + int lastRow = calculateLastRowIndex(totalRows); + int currentBatchSize = lastRow - this.position; + + if (logger.isDebugEnabled()) + 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.ResultSetRow[] rows = new org.alfresco.repo.webservice.types.ResultSetRow[currentBatchSize]; + + int arrPos = 0; + for (int x = this.position; x < lastRow; x++) + { + ResultSetRow origRow = searchResults.getRow(x); + NodeRef nodeRef = origRow.getNodeRef(); + ResultSetRowNode rowNode = new ResultSetRowNode(nodeRef.getId(), nodeService.getType(nodeRef).toString(), null); + + // get the data for the row and build up the columns structure + Map values = origRow.getValues(); + NamedValue[] columns = new NamedValue[values.size()]; + int col = 0; + for (Path path : values.keySet()) + { + String value = null; + Serializable valueObj = values.get(path); + if (valueObj != null) + { + value = valueObj.toString(); + } + + // Get the attribute QName from the result path + String attributeName = path.last().toString(); + if (attributeName.startsWith("@") == true) + { + attributeName = attributeName.substring(1); + } + + columns[col] = new NamedValue(attributeName, value); + col++; + } + + + org.alfresco.repo.webservice.types.ResultSetRow row = new org.alfresco.repo.webservice.types.ResultSetRow(); + row.setColumns(columns); + row.setScore(origRow.getScore()); + row.setRowIndex(x); + row.setNode(rowNode); + + // add the row to the overall results + rows[arrPos] = row; + arrPos++; + } + + // 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 + batchResults.setRows(rows); + batchResults.setTotalRowCount(totalRows); + + queryResult = new QueryResult(getId(), batchResults); + + // move the position on + updatePosition(totalRows, queryResult); + + if (logger.isDebugEnabled()) + logger.debug("After getNextResultsBatch: " + toString()); + } + finally + { + if (searchResults != null) + { + searchResults.close(); + } + } + } + + return queryResult; + } + + /** + * @see java.lang.Object#toString() + */ + @Override + public String toString() + { + StringBuilder builder = new StringBuilder(super.toString()); + builder.append(" (id=").append(getId()); + builder.append(" batchSize=").append(this.batchSize); + builder.append(" position=").append(this.position); + builder.append(" store=").append(this.store.getScheme().getValue()).append(":").append(this.store.getAddress()); + builder.append(" language=").append(this.query.getLanguage().getValue()); + builder.append(" statement=").append(this.query.getStatement()); + builder.append(")"); + return builder.toString(); + } +} diff --git a/source/java/web-services-application-context.xml b/source/java/web-services-application-context.xml new file mode 100644 index 0000000000..d991c8e636 --- /dev/null +++ b/source/java/web-services-application-context.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + webservice.QuerySessionCache + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/meta-inf/services/org.apache.axis.deployment.wsdd.Provider b/source/meta-inf/services/org.apache.axis.deployment.wsdd.Provider new file mode 100644 index 0000000000..9078ba3858 --- /dev/null +++ b/source/meta-inf/services/org.apache.axis.deployment.wsdd.Provider @@ -0,0 +1 @@ +org.alfresco.repo.webservice.axis.WSDDSpringBeanRPCProvider \ No newline at end of file diff --git a/source/test-resources/client-deploy.wsdd b/source/test-resources/client-deploy.wsdd new file mode 100644 index 0000000000..a571b046d2 --- /dev/null +++ b/source/test-resources/client-deploy.wsdd @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/web/WEB-INF/server-config.wsdd b/source/web/WEB-INF/server-config.wsdd new file mode 100644 index 0000000000..736c3773d4 --- /dev/null +++ b/source/web/WEB-INF/server-config.wsdd @@ -0,0 +1,1666 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Authenticates the caller with the repository + /wsdl/authentication-service.wsdl + + + + + + + + + + + + + + + + + + + + + + + + + Provides repository query and model services + /wsdl/repository-service.wsdl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Provides read and write access to content streams. + /wsdl/content-service.wsdl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Provides support for collaborative editing of content. + /wsdl/authoring-service.wsdl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Provides support for classifying content resources. + /wsdl/classification-service.wsdl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/wsdl/authentication-service.wsdl b/source/wsdl/authentication-service.wsdl new file mode 100644 index 0000000000..f1f29b3711 --- /dev/null +++ b/source/wsdl/authentication-service.wsdl @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Provides simple authentication capability. + + + + + + diff --git a/source/wsdl/authoring-service.wsdl b/source/wsdl/authoring-service.wsdl new file mode 100644 index 0000000000..210476f415 --- /dev/null +++ b/source/wsdl/authoring-service.wsdl @@ -0,0 +1,585 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Checkout a content resource for editing. + + + + + + Checkin a content resource. + + + + + + Checkin an external content resource thus replacing the existing working content. + + + + + + Cancels the checkout. + + + + + + Locks a content resource. + + + + + + Unlocks a content resource. + + + + + + Gets the lock status of the specified nodes. + + + + + + Create a snapshot of the specified node(s) in the version store. + + + + + + Gets the version history for the specfied node. + + + + + + Revert a node to the snapshot of the specified version. + + + + + + Delete all snapshot versions of the specified node. + + + + + + + + + Checkout a content resource for editing. + + + + + + + + + + + + + Checkin a content resource. + + + + + + + + + + + + + Checkin an external content resource thus replacing the existing working content. + + + + + + + + + + + + + Cancels the checkout. + + + + + + + + + + + + + Locks a content resource. + + + + + + + + + + + + + Unlocks a content resource. + + + + + + + + + + + + + Gets the lock status of the specified nodes. + + + + + + + + + + + + + Create a snapshot of the specified node(s) in the version store. + + + + + + + + + + + + + Gets the version history for the specfied node. + + + + + + + + + + + + + Revert a node to the snapshot of the specified version. + + + + + + + + + + + + + Delete all snapshot versions of the specified node. + + + + + + + + + + + + + + + Provides support for collaborative editing of content. + + + + + + diff --git a/source/wsdl/classification-service.wsdl b/source/wsdl/classification-service.wsdl new file mode 100644 index 0000000000..2615633e28 --- /dev/null +++ b/source/wsdl/classification-service.wsdl @@ -0,0 +1,277 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets available classifications. + + + + + + Gets child categories for the specified parent category. + + + + + + Gets the categories applied to the specified content resource. + + + + + + Modifies the categories applied to the specified content resource. + + + + + + Describe a classification in terms of how it is represented in the meta model i.e. is it an aspect, which property holds the applied category. + + + + + + + + + + Gets available classifications. + + + + + + + + + + + + + Gets child categories for the specified parent category. + + + + + + + + + + + + + Gets the categories applied to the specified content resource. + + + + + + + + + + + + + Modifies the categories applied to the specified content resource. + + + + + + + + + + + + + Describe a classification in terms of how it is represented in the meta model i.e. is it an aspect, which property holds the applied category. + + + + + + + + + + + + + + + Provides support for classifying content resources. + + + + + + diff --git a/source/wsdl/cml.xsd b/source/wsdl/cml.xsd new file mode 100644 index 0000000000..cc465ae607 --- /dev/null +++ b/source/wsdl/cml.xsd @@ -0,0 +1,191 @@ + + + + + + Alfresco Web Services for Content Management. CML - Content Manipulation Language - Draft. + + + + + + + + + The CML statements. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/wsdl/content-service.wsdl b/source/wsdl/content-service.wsdl new file mode 100644 index 0000000000..bfdc067802 --- /dev/null +++ b/source/wsdl/content-service.wsdl @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Retrieves content from the repository. + + + + + + Writes content to the repository. + + + + + + Clears content from the repository. + + + + + + + + + Retrieves content from the repository. + + + + + + + + + + + + + Writes content to the repository. + + + + + + + + + + + + + Clears content from the repository. + + + + + + + + + + + + + + + Provides read and write access to content streams. + + + + + + diff --git a/source/wsdl/headers.xsd b/source/wsdl/headers.xsd new file mode 100644 index 0000000000..9a56ad6f78 --- /dev/null +++ b/source/wsdl/headers.xsd @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/wsdl/repository-service.wsdl b/source/wsdl/repository-service.wsdl new file mode 100644 index 0000000000..578489f70d --- /dev/null +++ b/source/wsdl/repository-service.wsdl @@ -0,0 +1,481 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Defines the SOAP headers used by this service. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Retrieves a list of stores where content resources are held. + + + + + + Executes a query against a store. + + + + + + Executes a query to retrieve the children of the specified resource. + + + + + + Executes a query to retrieve the parents of the specified resource. + + + + + + Executes a query to retrieve associated resources of the specified resource. + + + + + + Fetches the next batch of query results. + + + + + + Executes a CML script to manipulate the contents of a Repository store. + + + + + + Describes a content resource. + + + + + + Gets a resource from the repository. + + + + + + + + + + Retrieves a list of stores where content resources are held. + + + + + + + + + + + + + Executes a query against a store + + + + + + + + + + + + + + Executes a query to retrieve the children of the specified resource. + + + + + + + + + + + + + + Executes a query to retrieve the parents of the specified resource. + + + + + + + + + + + + + + Executes a query to retrieve associated resources of the specified resource. + + + + + + + + + + + + + + Fetches the next batch of query results. + + + + + + + + + + + + + Executes a CML script to manipulate the contents of a Repository store. + + + + + + + + + + + + + Describes a content resource. + + + + + + + + + + + + + Gets a resource from the respository. + + + + + + + + + + + + + + + Provides read and write operations against a repository. + + + + + + diff --git a/source/wsdl/types.xsd b/source/wsdl/types.xsd new file mode 100644 index 0000000000..0c0969f969 --- /dev/null +++ b/source/wsdl/types.xsd @@ -0,0 +1,326 @@ + + + + Alfresco Web Services for Content Management. Type Definitions - Draft. + + + + + + + + + TODO: Define constraints + + + + + + + + + + + + + + + TODO: Define constraints + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TODO: MinOccurs = 0? + TODO: Define Constraints + + + + + + + + + + + + TODO: MinOccurs = 0? + TODO: Define Constraints + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +