int maxrows = 100;
req.setMaxRows(maxrows);
req.setListHead(offset);
TModelList findTModel = null;
SaveTModel stm = new SaveTModel();
do {
findTModel = inquiry.findTModel(req);
if (findTModel.getTModelInfos() != null) {
for (int i = 0; i < findTModel.getTModelInfos().getTModelInfo().size(); i++) {
boolean go = true;
String owner = Common.GetOwner(findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey(), token, inquiry);
if (owner!=null && !usernames.contains(owner)) {
usernames.add(owner);
}
if (myitemsonly) {
if (owner == null || !owner.equalsIgnoreCase(username)) {
go = false;
}
}
if (go) {
if (owner!=null)
mapping.setProperty(findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey(), owner);
System.out.println("Exporting " + findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey() + " owner " + owner);
stm.getTModel().add(GetTmodel(findTModel.getTModelInfos().getTModelInfo().get(i), token));
}
}
}
offset = offset + maxrows;
req.setListHead(offset);
} while (false);//findTModel.getListDescription().getIncludeCount() > 0);
if (stripSig) {
int x=0;
for (int i = 0; i < stm.getTModel().size(); i++) {
x+=stm.getTModel().get(i).getSignature().size();
stm.getTModel().get(i).getSignature().clear();
}
System.out.println(x + " signatures stripped");
}
System.out.println("Storing to disk ");
JAXB.marshal(stm, fos);
fos.close();
System.out.println("Done with tModels. Export count: " + stm.getTModel().size());
}