08-06-2014 10:16 AM
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();
}
08-09-2014 02:38 AM
08-17-2014 02:39 PM
08-17-2014 09:39 PM
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()
08-18-2014 08:24 AM
08-18-2014 09:59 AM
08-18-2014 09:50 AM
http://localhost:9080/chemistry/browser/RepositoryService
08-18-2014 10:04 AM
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);
08-18-2014 10:28 AM
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();
}
08-18-2014 11:34 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.