HashMap<String, String> params = new HashMap<String, String>();
params.put(SessionParameter.ATOMPUB_URL, "http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom");
params.put(SessionParameter.USER, user);//utente admin
params.put(SessionParameter.PASSWORD, password);//psw admin
params.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
params.put(SessionParameter.OBJECT_FACTORY_CLASS,"org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
try
{
SessionFactory factory = SessionFactoryImpl.newInstance();
setSessionCMIS(factory.getRepositories(params).get(0).createSession());
}
catch (Exception e)
{
logger.error("Errore nella createSessionCMIS: " + e.hashCode() + ' ' + e.toString());
}
Solved! Go to Solution.
HashMap<String, String> params = new HashMap<String, String>();
params.put(SessionParameter.ATOMPUB_URL,"http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom");
params.put(SessionParameter.BROWSER_URL,"http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom");
params.put(SessionParameter.USER, user);
params.put(SessionParameter.PASSWORD, password);
params.put(SessionParameter.BINDING_TYPE, BindingType.BROWSER.value());
//params.put(SessionParameter.OBJECT_FACTORY_CLASS,"org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
try
{
SessionFactory factory = SessionFactoryImpl.newInstance();
setSessionCMIS(factory.getRepositories(params).get(0).createSession());
}
catch (Exception e)
{
logger.error("Errore nella createSessionCMIS: " + e.hashCode() + ' ' + e.toString());
}
AlfrescoFolder destinationPath = (AlfrescoFolder) getSessionCMIS().getObjectByPath("/Sites/demo/documentLibrary/Qualità 18001/Istruzioni Operative/Documenti in redazione");
HashMap<String, String> params = new HashMap<String, String>();
//params.put(SessionParameter.ATOMPUB_URL, "http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser");
params.put(SessionParameter.BROWSER_URL,"http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser");
params.put(SessionParameter.USER, user);
params.put(SessionParameter.PASSWORD, password);
params.put(SessionParameter.BINDING_TYPE, BindingType.BROWSER.value());
//params.put(SessionParameter.OBJECT_FACTORY_CLASS,"org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
try
{
SessionFactory factory = SessionFactoryImpl.newInstance();
setSessionCMIS(factory.getRepositories(params).get(0).createSession());
}
catch (Exception e)
{
logger.error("Errore nella createSessionCMIS: " + e.hashCode() + ' ' + e.toString());
}
HashMap<String, Object> metadati= new HashMap<>();
//Metadati per configurazione tipologia documento
metadati.put(PropertyIds.OBJECT_TYPE_ID,"D:fe:offerta,P:cm:titled" );
metadati.put(PropertyIds.NAME,fileName);
metadati.put("cm:title", "prova");
metadati.put("fe:organizzazione","Demo");
metadati.put("fe:numDoc",60);
Archive content from product discussions in Italian.
This group is now closed and content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.