WPaloCubeViewConverter converter = new WPaloCubeViewConverter(
getLoggedInUser(sessionId));
List<XFolderElement> xFolderElements = new ArrayList<XFolderElement>();
// ExplorerTreeNode parentFolder = getFolder(xParentFolder);
for (XView xView : views) {
XView importedXView = importViewWith(sessionId, converter, xView);
if (xParentFolder != null) {
FolderElement folderElement = createFolderElement(sessionId, importedXView,
xParentFolder, true, isPublic, isEditable);
xFolderElements.add(createXFolderElement(folderElement,
importedXView));
List <String> roleIds = new ArrayList<String>();
List <String> roleNames = new ArrayList<String>();
IRoleManagement rm = MapperRegistry.getInstance().getRoleManagement();
if (isPublic) {
try {
Role r = (Role) rm.findByName("VIEWER");
roleIds.add(r.getId());
roleNames.add(r.getName());
} catch (Throwable t) {
}
}
if (isEditable) {
try {
Role r = (Role) rm.findByName("EDITOR");
roleIds.add(r.getId());
roleNames.add(r.getName());
} catch (Throwable t) {
}
}
importedXView.setRoleIds(roleIds);
importedXView.setRoleNames(roleNames);
}
}
return xFolderElements.toArray(new XFolderElement[0]);
}