DataNavigator mynav = navigator.get("feed/entry");
if (mynav != null) {
String epName = accessor.findEndpointName();
for (int i = 0; i < mynav.getCount(); i++) {
FileEntry entry = new FileEntry();
DataNavigator nav = mynav.get(i);
entry.setUserId((String) UserBean.get().getPerson().getField(LOTUS_LIVE_SUBSCRIBER_ID));
entry.setTitle(nav.stringValue("title"));
entry.setUpdated(nav.dateValue("updated"));
entry.setPublished(nav.dateValue("published"));
entry.setAuthorName(nav.stringValue("author/name"));
String id = nav.stringValue("id");
if (StringUtil.isNotEmpty(id)) {
int index = id.indexOf("snx:file!");
if (index != -1) {
index = index + "snx:file!".length();
id = id.substring(index);
}
}
//hack
id=id.replace("http://www.ibm.com/xmlns/prod/sn/cmis/00000000-0000-0000-0001-000000000000!", "");
entry.setFileId(id);
entry.setUniqueId(id);
DataNavigator propsNavigator = nav.get("object/properties");
String description = propsNavigator.get("propertyString").selectEq("@displayName", "Description").stringValue("value");
entry.setDescription(StringUtil.getNonNullString(description));
String size = propsNavigator.get("propertyInteger").selectEq("@propertyDefinitionId", "cmis:contentStreamLength").stringValue("value");
entry.setSize(calculateBytes(size));
String version = propsNavigator.get("propertyString").selectEq("@propertyDefinitionId", "cmis:versionLabel").stringValue("value");
entry.setVersion(StringUtil.getNonNullString(version));
String visibility = propsNavigator.get("propertyString").selectEq("@propertyDefinitionId", "snx:visibilityComputed").stringValue("value");
entry.setVisibility(StringUtil.getNonNullString(visibility));
String mimeType = propsNavigator.get("propertyString").selectEq("@propertyDefinitionId", "cmis:contentStreamMimeType").stringValue("value");
entry.setMimeType(mimeType);
entry.setIcon(MimeIconRegistry.getInstance().get(mimeType));
String proxyUrl = "xsp/.proxy/files/" + entry.getTitle() + "?" + PARAM_TYPE + "=" + TYPE + "&" + PARAM_ID + "="
+ entry.getFileId() + "&" + PARAM_REPOSITORY_ID + "=" + composeRepositoryID(entry) + "&"+"fileName="+entry.getTitle()+ "&" + PARAM_ENDPOINT_NAME
+ "=";
if (StringUtil.isNotEmpty(epName)) {
proxyUrl = proxyUrl + epName;
}
else {
proxyUrl = proxyUrl + TYPE;
}
entry.setProxyURL(proxyUrl);
entries.add(entry);
}
}
return entries;
}