11-11-2009 06:33 AM
11-12-2009 10:30 AM
Set<NodeRef> node = personService.getAllPeople();
Iterator<NodeRef> users = node.iterator();
while(users.hasNext()){
NodeRef usu = users.next();
System.out.println(usu.toString());
System.out.println("El id: "+usu.getId());
System.out.println("El StoreRef: "+usu.getStoreRef());
}
11-13-2009 05:54 AM
Set<NodeRef> people = personService.getAllPeople();
Iterator<NodeRef> users = people.iterator();
while(users.hasNext()){
NodeRef usu = users.next();
System.out.println(usu);
System.out.println(nodeService.exists(usu));
System.out.println(nodeService.getType(usu));
System.out.println(nodeService.getProperty(usu,ContentModel.PROP_NAME));
System.out.println(nodeService.getProperty(usu,ContentModel.PROP_USERNAME));
}
11-16-2009 07:25 AM
<bean id="MiJob" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="org.alfresco.web.quarz.quarzjob"/>
<property name="jobDataAsMap">
<map>
<entry key="actionService" value-ref="actionService"/>
<entry key="personService" value-ref="personService"/>
<entry key="nodeService" value-ref="nodeService" />
<entry key="transactionService" value-ref="transactionService"/>
<entry key="authenticationComponent" value-ref="authenticationComponent"/>
<entry key="authenticationService" value-ref="authenticationService" />
</map>
</property>
</bean>
Set<NodeRef> people = personService.getAllPeople();
Iterator<NodeRef> users = people.iterator();
while (users.hasNext()) {
NodeRef usu = users.next();
String username = nodeService.getProperty(usu, ContentModel.PROP_USERNAME).toString();
String correo = nodeService.getProperty(usu, ContentModel.PROP_EMAIL).toString();
String pass = "nuevo";
char[] cadenapass = new char[pass.length()];
for (int i=0; i<pass.length(); i++){
cadenapass[i] = pass.charAt(i);
}
String password = new String(cadenapass);
if (authenticationService.authenticationExists(username)){
authenticationService.setAuthentication(username, cadenapass);
System.out.println("Cambio de contraseña de "+username+":"+password+
" y envio de correo a "+correo);
}
else
System.out.println("El usuario "+ username + " no existe");
}
11-17-2009 06:38 AM
try{
Set<NodeRef> people = personService.getAllPeople();
Iterator<NodeRef> users = people.iterator();
while (users.hasNext()) {
NodeRef usu = users.next();
String username = nodeService.getProperty(usu, ContentModel.PROP_USERNAME).toString();
String correo = nodeService.getProperty(usu, ContentModel.PROP_EMAIL).toString();
String pass = this.generatePass(); //Generador automatico de passwords
if (authenticationService.authenticationExists(username)){
UserTransaction transaction = transactionService.getNonPropagatingUserTransaction();
transaction.begin();
authenticationService.setAuthentication(username, pass.toCharArray());
transaction.commit();
}
else
System.out.println("El usuario "+ username + " no existe");
}
}catch(Exception e){
System.out.println(e.getMessage());
}
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.