* @throws SharepointException
*/
public static GlobalState initState(
SharepointClientContext sharepointClientContext)
throws SharepointException {
GlobalState globalState = new GlobalState(clientFactory,
TestConfiguration.googleConnectorWorkDir, TestConfiguration.feedType);
if (null != Site1_URL && Site1_URL.trim().length() > 0) {
WebState webstate1 = globalState.makeWebState(sharepointClientContext, TestConfiguration.Site1_URL);
if (null != Site1_List1_URL && Site1_List1_URL.trim().length() > 0) {
ListState liststate11 = new ListState(Site1_List1_GUID, "inTitle",
SPConstants.DOC_LIB, Calendar.getInstance(), "", Site1_List1_URL,
webstate1);
List<SPDocument> docs = new ArrayList<SPDocument>();
if (null != Site1_List1_Item1_URL
&& Site1_List1_Item1_URL.trim().length() > 0) {
SPDocument doc = new SPDocument("111", Site1_List1_Item1_URL,
Calendar.getInstance(), ActionType.ADD);
docs.add(doc);
}
if (null != Site1_List1_Item2_URL
&& Site1_List1_Item2_URL.trim().length() > 0) {
SPDocument doc = new SPDocument("112", Site1_List1_Item2_URL,
Calendar.getInstance(), ActionType.ADD);
docs.add(doc);
}
liststate11.setCrawlQueue(docs);
webstate1.AddOrUpdateListStateInWebState(liststate11, new DateTime());
}
if (null != Site1_List2_URL && Site1_List2_URL.trim().length() > 0) {
ListState liststate12 = new ListState(Site1_List2_GUID, "inTitle",
SPConstants.GENERIC_LIST, Calendar.getInstance(), "",
Site1_List2_URL, webstate1);
List<SPDocument> docs = new ArrayList<SPDocument>();
if (null != Site1_List2_Item1_URL
&& Site1_List2_Item1_URL.trim().length() > 0) {
SPDocument doc = new SPDocument("121", Site1_List2_Item1_URL,
Calendar.getInstance(), ActionType.ADD);
docs.add(doc);
}
if (null != Site1_List2_Item2_URL
&& Site1_List2_Item2_URL.trim().length() > 0) {
SPDocument doc = new SPDocument("122", Site1_List2_Item2_URL,
Calendar.getInstance(), ActionType.ADD);
docs.add(doc);
}
liststate12.setCrawlQueue(docs);
webstate1.AddOrUpdateListStateInWebState(liststate12, new DateTime());
}
}
if (null != Site2_URL && Site2_URL.trim().length() > 0) {
WebState webstate2 = globalState.makeWebState(sharepointClientContext, TestConfiguration.Site2_URL);
if (null != Site2_List1_URL && Site2_List1_URL.trim().length() > 0) {
ListState liststate21 = new ListState(Site2_List1_GUID, "inTitle",
SPConstants.DOC_LIB, Calendar.getInstance(), "", Site2_List1_URL,
webstate2);
List<SPDocument> docs = new ArrayList<SPDocument>();
if (null != Site2_List1_Item1_URL) {
SPDocument doc = new SPDocument("211", Site2_List1_Item1_URL,
Calendar.getInstance(), ActionType.ADD);
docs.add(doc);
}
if (null != Site2_List1_Item2_URL) {
SPDocument doc = new SPDocument("212", Site2_List1_Item2_URL,
Calendar.getInstance(), ActionType.ADD);
docs.add(doc);
}
liststate21.setCrawlQueue(docs);
webstate2.AddOrUpdateListStateInWebState(liststate21, new DateTime());
}
if (null != Site2_List2_URL && Site2_List2_URL.trim().length() > 0) {
ListState liststate22 = new ListState(Site1_List2_GUID, "inTitle",
SPConstants.GENERIC_LIST, Calendar.getInstance(), "",
Site2_List2_URL, webstate2);
List<SPDocument> docs = new ArrayList<SPDocument>();
if (null != Site2_List2_Item1_URL) {
SPDocument doc = new SPDocument("221", Site2_List2_Item1_URL,
Calendar.getInstance(), ActionType.ADD);
docs.add(doc);
}
if (null != Site2_List2_Item2_URL) {
SPDocument doc = new SPDocument("222", Site2_List2_Item2_URL,
Calendar.getInstance(), ActionType.ADD);
docs.add(doc);
}
liststate22.setCrawlQueue(docs);
webstate2.AddOrUpdateListStateInWebState(liststate22, new DateTime());
}
}
if (null != Site3_URL && Site3_URL.trim().length() > 0) {
WebState webstate3 = globalState.makeWebState(sharepointClientContext, TestConfiguration.Site3_URL);
if (null != Site3_List1_URL && Site3_List1_URL.trim().length() > 0) {
ListState liststate31 = new ListState(Site3_List1_GUID, "inTitle",
SPConstants.DOC_LIB, Calendar.getInstance(), "", Site3_List1_URL,
webstate3);
List<SPDocument> docs = new ArrayList<SPDocument>();
if (null != Site3_List1_Item1_URL) {
SPDocument doc = new SPDocument("311", Site3_List1_Item1_URL,
Calendar.getInstance(), ActionType.ADD);
docs.add(doc);
}
if (null != Site3_List1_Item2_URL) {
SPDocument doc = new SPDocument("312", Site3_List1_Item2_URL,
Calendar.getInstance(), ActionType.ADD);
docs.add(doc);
}
liststate31.setCrawlQueue(docs);
webstate3.AddOrUpdateListStateInWebState(liststate31, new DateTime());
}
if (null != Site3_List2_URL && Site3_List2_URL.trim().length() > 0) {
ListState liststate32 = new ListState(Site3_List2_GUID, "inTitle",
SPConstants.GENERIC_LIST, Calendar.getInstance(), "",
Site3_List2_URL, webstate3);
List<SPDocument> docs = new ArrayList<SPDocument>();
if (null != Site3_List2_Item1_URL) {
SPDocument doc = new SPDocument("321", Site3_List2_Item1_URL,
Calendar.getInstance(), ActionType.ADD);
docs.add(doc);
}
if (null != Site3_List2_Item2_URL) {
SPDocument doc = new SPDocument("322", Site2_List2_Item2_URL,
Calendar.getInstance(), ActionType.ADD);
docs.add(doc);
}
liststate32.setCrawlQueue(docs);
webstate3.AddOrUpdateListStateInWebState(liststate32, new DateTime());
}
}
if (null != Site4_URL && Site4_URL.trim().length() > 0) {
WebState webstate4 = globalState.makeWebState(sharepointClientContext, TestConfiguration.Site4_URL);
if (null != Site4_List1_URL && Site4_List1_URL.trim().length() > 0) {
ListState liststate41 = new ListState(Site4_List1_GUID, "inTitle",
SPConstants.DOC_LIB, Calendar.getInstance(), "", Site4_List1_URL,
webstate4);
List<SPDocument> docs = new ArrayList<SPDocument>();