As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
public String DISCOVERY_SERVICE_WSDL_LOCATION = "/alfresco/cmisws/DiscoveryService?wsdl"; public final static QName DISCOVERY_SERVICE_NAME = new QName("http://docs.oasis-open.org/ns/cmis/ws/200908/", "DiscoveryService"); query.setStatement("select * from cmis:folder where cmis:name LIKE '"+reg_id+"'"); QueryResponse queryresponse=null; try{ queryresponse = disvcoveryServicePort.query(query); }catch(CmisException ex){ System.out.println("The value of exception ::::::::::::"+ex.getMessage()); ex.printStackTrace(); }
String url= "http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom"; //for 1.1 //String url= "http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom"; //for 1.0 SessionFactory sessionFactory = SessionFactoryImpl.newInstance(); Map<String, String> params = new HashMap<String, String>(); params.put(SessionParameter.USER, "admin"); params.put(SessionParameter.PASSWORD, "admin"); params.put(SessionParameter.ATOMPUB_URL, url); params.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value()); params.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl"); List<Repository> repos = sessionFactory.getRepositories(params); if (repos.isEmpty()) { throw new RuntimeException("Server has no repositories!"); } Session session = repos.get(0).createSession(); ItemIterable<QueryResult> qrs = session.query("select * from cmis:folder where cmis:name LIKE '"+reg_id+"'", false); for(QueryResult q : qrs) { }
session.getBinding().getNavigationService()
http://localhost:9080/chemistry/browser/RepositoryService
SessionFactory factory = SessionFactoryImpl.newInstance(); Map<String, String> parameter = new HashMap<String, String>(); serviceUrl=alfrescoURL+"/alfresco/cmis"; // user credentials parameter.put(SessionParameter.USER, cmsUser); parameter.put(SessionParameter.PASSWORD, cmsPassword); parameter.put(SessionParameter.BINDING_TYPE, BindingType.WEBSERVICES.value()); parameter.put(SessionParameter.WEBSERVICES_ACL_SERVICE, serviceUrl + "/ACLService?wsdl"); parameter.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, serviceUrl + "/DiscoveryService?wsdl"); parameter.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, serviceUrl + "/MultiFilingService?wsdl"); parameter.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, serviceUrl + "/NavigationService?wsdl"); parameter.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, serviceUrl + "/ObjectService?wsdl"); parameter.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, serviceUrl + "/PolicyService?wsdl"); parameter.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, serviceUrl + "/RelationshipService?wsdl"); parameter.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, serviceUrl + "/RepositoryService?wsdl"); parameter.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, serviceUrl + "/VersioningService?wsdl"); parameter.put(SessionParameter.REPOSITORY_ID, repositoryId); session = factory.createSession(parameter);
public static String webservicesUrl="http://localhost:8080/alfresco/cmisws/"; public static String username="admin"; public static String password="admin"; public static Session getSession() { SessionFactory sessionFactory = SessionFactoryImpl.newInstance(); Map<String, String> parameter = new HashMap<String, String>(); parameter.put(SessionParameter.USER, username); parameter.put(SessionParameter.PASSWORD, password); final String BINDING_TYPE = BindingType.WEBSERVICES.value(); parameter.put(SessionParameter.BINDING_TYPE, BINDING_TYPE); parameter.put(SessionParameter.WEBSERVICES_ACL_SERVICE, webservicesUrl + "/ACLService?wsdl"); parameter.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, webservicesUrl + "/DiscoveryService?wsdl"); parameter.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, webservicesUrl + "/MultiFilingService?wsdl"); parameter.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, webservicesUrl + "/NavigationService?wsdl"); parameter.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, webservicesUrl + "/ObjectService?wsdl"); parameter.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, webservicesUrl + "/PolicyService?wsdl"); parameter.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, webservicesUrl + "/RelationshipService?wsdl"); parameter.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, webservicesUrl + "/RepositoryService?wsdl"); parameter.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, webservicesUrl + "/VersioningService?wsdl"); parameter.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl"); List<Repository> repos = sessionFactory.getRepositories(parameter); if (repos.isEmpty()) { throw new RuntimeException("Server has no repositories!"); } return repos.get(0).createSession(); }