我正在使用 Alfresco 5.1 社区,并且我正在尝试获取当前登录人员的属性值,例如,在我拥有的用户中:
"{http://www.someco.org/model/people/1.0}customProperty"
我怎样才能在java中获得这个?
是自定义属性,因此在http://localhost:8080/alfresco/service/api/people中不会出现。我怎样才能做到这一点?
我尝试这样做至少获得nodeRef:
protected ServiceRegistry getServiceRegistry() {
ProcessEngineConfigurationImpl config = Context.getProcessEngineConfiguration();
if (config != null) {
// Fetch the registry that is injected in the activiti spring-configuration
ServiceRegistry registry = (ServiceRegistry) config.getBeans().get(ActivitiConstants.SERVICE_REGISTRY_BEAN_KEY);
if (registry == null) {
throw new RuntimeException("Service-registry not present in ProcessEngineConfiguration beans, expected ServiceRegistry with key" + ActivitiConstants.SERVICE_REGISTRY_BEAN_KEY);
}
return registry;
}
throw new IllegalStateException("No ProcessEngineConfiguration found in active context");
}
public void writeToCatalina() {
PersonService personService = getServiceRegistry().getPersonService();
System.out.println("test");
String name = AuthenticationUtil.getFullyAuthenticatedUser();
System.out.println(name);
NodeRef personRef = personService.getPerson(name);
System.out.println(personRef);
}
但我得到了:
在活动上下文中找不到 ProcessEngineConfiguration
帮我 !