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());
}
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));
}
<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");
}
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());
}
Content from pre 2016 and from language groups that have been closed.
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.