本文介绍了如何在JSP页面和Alfresco活动之间建立链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是Alfresco
活动的新手,我在Alfresco
中遇到的问题是我不了解如何在JSP
和Alfresco
活动之间建立链接.
I am new to Alfresco
activiti and my problem in Alfresco
is that I am not understanding how to make a link between a JSP
and an Alfresco
activiti.
推荐答案
如果要连接到Alfresco
存储库
private static Session getSession(String serverUrl, String username, String password) {SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
Map<String, String> params = new HashMap<>();
params.put(SessionParameter.USER, username);
params.put(SessionParameter.PASSWORD, password);
params.put(SessionParameter.ATOMPUB_URL, serverUrl);
params.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
List<Repository> repos = sessionFactory.getRepositories(params);
if (repos.isEmpty()) {
throw new RuntimeException("Server has no repositories!");
}
return repos.get(0).createSession();
}
您只需添加ServerUrl
,Username
和Password
(默认情况下为admin
,admin
)
you only have to add your ServerUrl
, Username
and a Password
(in default it will be admin
, admin
)
这篇关于如何在JSP页面和Alfresco活动之间建立链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!