package eu.smartlm.abs.portal.data.query.ws;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
import org.gridforum.x2003.urWg.UserIdentityDocument.UserIdentity;
import eu.smartlm.abs.portal.util.StringUtil;
import eu.smartlm.schemas.x2009.x06.urec.ProductType;
public class Moment {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
EBSServiceClient client = new EBSServiceClient();
try {
File rampartDirectory = new File("/home/david/code-smartlm/smartlm-abs/trunk/smartlm-accountingandbilling-portal/target/smartlm-accountingandbilling-portal-1.0-SNAPSHOT/WEB-INF/conf/rampart");
System.out.println("Current dir : " + rampartDirectory.getCanonicalPath());
File clientPropertiesFile = new File("/home/david/code-smartlm/smartlm-abs/trunk/smartlm-accountingandbilling-portal/target/smartlm-accountingandbilling-portal-1.0-SNAPSHOT/WEB-INF/conf/rampart");
System.out.println("Clien properties : " + clientPropertiesFile.getCanonicalPath());
client.setUpConnection("", rampartDirectory.getCanonicalPath(), clientPropertiesFile.getCanonicalPath());
} catch (Exception e) {}
String startDate = "2009/02/03";
String endDate = "2010/03/01";
Set<UserIdentity> users = client.getListOfUsers(
StringUtil.getDate(startDate, false),
StringUtil.getDate(endDate, false),
new HashSet<String>(),
new HashSet<String>(),
new HashSet<String>(),
new HashSet<String>(),
new HashSet<String>(),
new HashSet<String>(),
new HashSet<String>());
for(UserIdentity user : users) {
System.out.println("USER: " + user.getLocalUserId());
}
Set<String> usersString = new HashSet<String>();
usersString.add("usera");
usersString.add("userc");
usersString.add("smartlm");
Set<ProductType> products = client.getListOfProducts(StringUtil.getDate(startDate, false),
StringUtil.getDate(endDate, false),
usersString,
new HashSet<String>(),
new HashSet<String>(),
new HashSet<String>(),
new HashSet<String>(),
new HashSet<String>(),
new HashSet<String>());
for(ProductType product : products) {
System.out.println("PRODUCT: " + product.getName());
}
}
}