/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package peconnection;
import com.filenet.api.core.Connection;
import com.filenet.api.core.Domain;
import com.filenet.api.core.Factory;
import com.filenet.api.util.UserContext;
import filenet.vw.api.VWQueue;
import filenet.vw.api.VWSecurityList;
import filenet.vw.api.VWSession;
import filenet.vw.api.VWUserInfo;
import javax.security.auth.Subject;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
/**
*
*
* @author Administrator
*/
public class Newpe {
public static void main(String args[])
{
VWQueue queue = null;
try
{
String url ="http://192.168.1.188:9080/wsi/FNCEWS40MTOM/";
String userName = "p8admin";
String password = "ecm@dm1n";
String connectionPoint = "CP1";
String email_suffix1="tecnics.com";
//creating content engine connection
Connection con=Factory.Connection.getConnection(url);
System.out.println(con);
UserContext uc = UserContext.get();
Subject subject = UserContext.createSubject(con,userName,password,null);
uc.pushSubject(subject);
Domain domain=Factory.Domain.fetchInstance(con, null, null);
System.out.print(domain.get_Name());
//create a connection to process engine
VWSession m_vwSession = new VWSession();
//System.out.println("m_vwsession created");
m_vwSession.setBootstrapCEURI(url);
m_vwSession.logon( userName, password, connectionPoint);
//System.out.print("VWsession login completed");
VWSecurityList list=m_vwSession.fetchUsers(1000,false);
//System.out.print("Security list is \n"+list);
System.out.println("starting secutity list iterating ");
while(list.hasNext())
{
//System.out.println(list.next());
VWUserInfo info=m_vwSession.fetchUserInfo(list.next().toString());
System.out.println(info +"@"+email_suffix1);
info.setEMailAddress(info +"@"+email_suffix1);
int nf = VWUserInfo.NOTIFICATION_STEP_EXPIRED_DEADLINE |
VWUserInfo.NOTIFICATION_STEP_NEW_ASSIGNMENT |
VWUserInfo.NOTIFICATION_STEP_REMINDERS |
VWUserInfo.NOTIFICATION_TRACKER_EXPIRED_DEADLINE |
VWUserInfo.NOTIFICATION_TRACKER_NEW_ASSIGNMENT |
VWUserInfo.NOTIFICATION_TRACKER_WORKFLOW_EXCEPTION;
info.setNotificationFlags(nf);
info.save();
}
System.out.println("Operation Completed");
}
catch(Exception e)
{
//System.out.println("reason is :"+e.getMessage());
e.printStackTrace();
//System.exit( 1 );
}
}
}
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package peconnection;
import com.filenet.api.core.Connection;
import com.filenet.api.core.Domain;
import com.filenet.api.core.Factory;
import com.filenet.api.util.UserContext;
import filenet.vw.api.VWQueue;
import filenet.vw.api.VWSecurityList;
import filenet.vw.api.VWSession;
import filenet.vw.api.VWUserInfo;
import javax.security.auth.Subject;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
/**
*
*
* @author Administrator
*/
public class Newpe {
public static void main(String args[])
{
VWQueue queue = null;
try
{
String url ="http://192.168.1.188:9080/wsi/FNCEWS40MTOM/";
String userName = "p8admin";
String password = "ecm@dm1n";
String connectionPoint = "CP1";
String email_suffix1="tecnics.com";
//creating content engine connection
Connection con=Factory.Connection.getConnection(url);
System.out.println(con);
UserContext uc = UserContext.get();
Subject subject = UserContext.createSubject(con,userName,password,null);
uc.pushSubject(subject);
Domain domain=Factory.Domain.fetchInstance(con, null, null);
System.out.print(domain.get_Name());
//create a connection to process engine
VWSession m_vwSession = new VWSession();
//System.out.println("m_vwsession created");
m_vwSession.setBootstrapCEURI(url);
m_vwSession.logon( userName, password, connectionPoint);
//System.out.print("VWsession login completed");
VWSecurityList list=m_vwSession.fetchUsers(1000,false);
//System.out.print("Security list is \n"+list);
System.out.println("starting secutity list iterating ");
while(list.hasNext())
{
//System.out.println(list.next());
VWUserInfo info=m_vwSession.fetchUserInfo(list.next().toString());
System.out.println(info +"@"+email_suffix1);
info.setEMailAddress(info +"@"+email_suffix1);
int nf = VWUserInfo.NOTIFICATION_STEP_EXPIRED_DEADLINE |
VWUserInfo.NOTIFICATION_STEP_NEW_ASSIGNMENT |
VWUserInfo.NOTIFICATION_STEP_REMINDERS |
VWUserInfo.NOTIFICATION_TRACKER_EXPIRED_DEADLINE |
VWUserInfo.NOTIFICATION_TRACKER_NEW_ASSIGNMENT |
VWUserInfo.NOTIFICATION_TRACKER_WORKFLOW_EXCEPTION;
info.setNotificationFlags(nf);
info.save();
}
System.out.println("Operation Completed");
}
catch(Exception e)
{
//System.out.println("reason is :"+e.getMessage());
e.printStackTrace();
//System.exit( 1 );
}
}
}