elementFilterType.setElementName("title");
elementFilterType.setElementSource("LEAD");
elementFilterType.setElementFilter("title");
QueryResponseDocument outputMsg = this.createStub(uid).queryWithContext(cqrdoc);
QueryResponseType outputType = outputMsg.getQueryResponse();
StatusEnumType.Enum statusType = outputType.getStatus();
if (statusType.equals(StatusEnumType.SUCCESS)) {
if (outputType.isSetMessage()) {
logger.fine(outputType.getMessage());
}
if (outputType.isSetQueryResponseSet()) {
QueryResponseSetType queryResponseSetType = outputType.getQueryResponseSet();
List<ElementResponseType> elemRespList = queryResponseSetType.getElementResponseList();
for (ElementResponseType elemResp : elemRespList) {
List<MetadataElementDocument.MetadataElement> metadataElementList = elemResp.getMetadataElementList();
for (MetadataElementDocument.MetadataElement metadataElement : metadataElementList) {
String title = metadataElement.getName();
String projectGuid = null;
String projectName = null;
if ("title".equals(title)) {
projectName = metadataElement.getStringValue();
projectGuid = elemResp.getObjectId();
}
if (projectGuid != null && projectName != null) {
MyLeadQueryResultItem myLeadItem = new MyLeadQueryResultItem();
myLeadItem.setResouceID(projectGuid);
myLeadItem.setTitle(projectName);
projects.add(myLeadItem);
}
break;
}
}
}
} else {
if (outputType.isSetMessage()) {
throw new MyLeadException("When trying to get a list of " +
"projects for user [" + uid + "] received the " +
"following fault message from MyLEAD Agent: " + outputType.getMessage());
}
if (outputType.isSetOperationSummary()) {
throw new MyLeadException("When trying to get a list of " +
"projects for user [" + uid + "] received the " +
"following fault message from MyLEAD Agent: " + outputType.getOperationSummary());
}
if (outputType.isSetOperationSummaryStreamUrl()) {
throw new MyLeadException("When trying to get a list of " +
"projects for user [" + uid + "] received the " +
"following fault message from MyLEAD Agent: " + outputType.getOperationSummaryStreamUrl());
}
}
return projects;
} catch (RuntimeException e) {