02-04-2008 11:48 AM
…
…
…
HashMap<QName, Serializable> properties = new HashMap<QName, Serializable>();
properties.put(ContentModel.PROP_USERNAME, userName);
properties.put(ContentModel.PROP_HOMEFOLDER, home);
properties.put(ContentModel.PROP_PASSWORD, password);
properties.put(ContentModel.PROP_FIRSTNAME, firstName);
properties.put(ContentModel.PROP_LASTNAME, lastName);
properties.put(ContentModel.PROP_EMAIL, email);
properties.put(ContentModel.PROP_ORGID, orgId);
I have to add something? How can i do?Help me please.Thanks02-07-2008 08:58 AM
02-08-2008 03:33 AM
02-19-2008 04:44 AM
org.alfresco.web.bean.users.CreateUserWizard.finishImpl(FacesContext context, String outcome)
is only present in SDK-2.9B and not in SDK-2.1. I tried out SDK-2.9B, but this time, I get the org.alfresco.module.blogIntegration.BlogIntegrationServiceImpl Exception that doesn't seem to be solved (see http://forums.alfresco.com/viewtopic.php?p=33492)HashMap<QName, Serializable> properties = new HashMap<QName, Serializable>();
properties.put(ContentModel.PROP_USERNAME, userName);
properties.put(ContentModel.PROP_HOMEFOLDER, home);
properties.put(ContentModel.PROP_PASSWORD, password);
properties.put(ContentModel.PROP_FIRSTNAME, firstName);
properties.put(ContentModel.PROP_LASTNAME, lastName);
properties.put(ContentModel.PROP_EMAIL, email);
properties.put(ContentModel.PROP_ORGID, orgId);
PersonService ps = serviceRegistry.getPersonService();
ps.createPerson(properties);
02-19-2008 05:13 AM
// ensure the user can access their own Person object
this.permissionService.setPermission(newPerson, this.userName, permissionService.getAllPermission(), true);
02-19-2008 09:34 AM
authenticationService.createAuthentication(userName, userName.toCharArray());
which made everything run smoothly.package org.alfresco.sample;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.search.ResultSet;
import org.alfresco.service.cmr.search.SearchService;
import org.alfresco.service.cmr.security.AuthenticationService;
import org.alfresco.service.cmr.security.PersonService;
//import org.alfresco.service.cmr.security.*;
import org.alfresco.repo.security.person.*;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.Property;
import javax.jcr.PropertyIterator;
import javax.jcr.Repository;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.ApplicationContextHelper;
import org.springframework.context.ApplicationContext;
public class FirstFoundationClient
{
public static void main(String[] args)
{
// initialise app content
ApplicationContext ctx = ApplicationContextHelper.getApplicationContext();
// get registry of services
final ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
// use TransactionWork to wrap service calls in a user transaction
TransactionService transactionService = serviceRegistry.getTransactionService();
RetryingTransactionCallback<Object> exampleWork = new RetryingTransactionCallback<Object>()
{
public Object execute() throws Exception
{
doExample(serviceRegistry);
return null;
}
};
transactionService.getRetryingTransactionHelper().doInTransaction(exampleWork);
System.exit(0);
}
public static void doExample(ServiceRegistry serviceRegistry) throws Exception
{
//
// authenticate
//
AuthenticationService authenticationService = serviceRegistry.getAuthenticationService();
authenticationService.authenticate("admin", "admin".toCharArray());
//
// locate the company home node and the node where we'll create users' spaces: /Company Home/users
//
SearchService searchService = serviceRegistry.getSearchService();
StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
//*** cm:users users folder
ResultSet resultSet = searchService.query(storeRef, SearchService.LANGUAGE_LUCENE, "PATH:\"/app:company_home/cm:users\"");
NodeRef usersStorageSpace = resultSet.getNodeRef(0);
//
// create a new node, it's the home space of a new user
//
String userName = "myUserName";
//*** user home creation
Map<QName, Serializable> contentProps = new HashMap<QName, Serializable>();
contentProps.put(ContentModel.PROP_NAME, userName);
NodeService nodeService = serviceRegistry.getNodeService();
ChildAssociationRef association = nodeService.createNode(usersStorageSpace, ContentModel.ASSOC_CONTAINS, QName.createQName(NamespaceService.CONTENT_MODEL_PREFIX, userName), ContentModel.TYPE_FOLDER, contentProps);
NodeRef userSpace = association.getChildRef();
Map<QName, Serializable> titledProps = new HashMap<QName, Serializable>();
titledProps.put(ContentModel.PROP_TITLE, userName);
titledProps.put(ContentModel.PROP_DESCRIPTION, userName);
nodeService.addAspect(userSpace, ContentModel.ASPECT_TITLED, titledProps);
//*** create the person and the user's profile for this person
HashMap<QName, Serializable> properties = new HashMap<QName, Serializable>();
properties.put(ContentModel.PROP_USERNAME, userName);
properties.put(ContentModel.PROP_HOMEFOLDER, userSpace);
properties.put(ContentModel.PROP_PASSWORD, "password");
properties.put(ContentModel.PROP_FIRSTNAME, "john");
properties.put(ContentModel.PROP_LASTNAME, "foo");
properties.put(ContentModel.PROP_EMAIL, "foo@there.com");
properties.put(ContentModel.PROP_ORGID, "orgid");
PersonService newPerson = serviceRegistry.getPersonService();
newPerson.createPerson(properties);
//*** the missing part!
authenticationService.createAuthentication(userName, userName.toCharArray());
}
}
07-22-2013 01:41 AM
04-17-2008 06:03 AM
Exception in thread "main" org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.alfres
co.module.blogIntegration.BlogIntegrationServiceImpl] for bean with name 'blogIntegrationService' defined in class path
resource [alfresco/blog-context.xml]; nested exception is java.lang.ClassNotFoundException: org.alfresco.module.blogInte
gration.BlogIntegrationServiceImpl
Caused by: java.lang.ClassNotFoundException: org.alfresco.module.blogIntegration.BlogIntegrationServiceImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:183)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:317)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1044)
at org.springframework.beans.factory.support.AbstractBeanFactory.isBeanClassMatch(AbstractBeanFactory.java:1072)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.
java:165)
at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:6
91)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationCo
ntext.java:395)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:328)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:55)
at org.alfresco.sample.FirstFoundationClient.main(FirstFoundationClient.java:69)
04-17-2008 07:37 AM
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'email
Server' defined in class path resource [alfresco/bootstrap-context.xml]: Instantiation of bean failed; nested exception
is java.lang.NoClassDefFoundError: org/subethamail/smtp/MessageHandlerFactory
Caused by: java.lang.NoClassDefFoundError: org/subethamail/smtp/MessageHandlerFactory
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.getDeclaredConstructor(Class.java:1985)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:60)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:4
5)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapable
BeanFactory.java:701)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapa
bleBeanFactory.java:687)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanF
actory.java:388)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.jav
a:141)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:
236)
at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:701)
at org.springframework.context.support.AbstractApplicationContext.registerListeners(AbstractApplicationContext.java:519
)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:343)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:55)
at org.alfresco.sample.FirstFoundationClient.main(FirstFoundationClient.java:69)
Caused by: java.lang.ClassNotFoundException: org.subethamail.smtp.MessageHandlerFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
… 21 more
04-21-2008 04:44 AM
12:34:09,436 User:System WARN [remoting.rmi.RmiRegistryFactoryBean] Could not detect RMI registry - creating new one
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'wordPressBlogIntegration' defined in class path resource [alfresco/blog-context.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: marquee/xmlrpc/XmlRpcException
Caused by: java.lang.NoClassDefFoundError: marquee/xmlrpc/XmlRpcException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.getDeclaredConstructor(Class.java:1985)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:60)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:45)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:701)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:687)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:388)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:55)
at org.alfresco.sample.FirstFoundationClient.main(FirstFoundationClient.java:69)
Caused by: java.lang.ClassNotFoundException: marquee.xmlrpc.XmlRpcException
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
… 19 more
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.