private final FolderElement createFolderElement(String sessionId, XView xView,
XStaticFolder parentFolder, boolean p,
boolean isPublic, boolean isEditable) throws DbOperationFailedException,
SessionExpiredException {
FolderElement fe = null;
try {
// CubeViewReader.CHECK_RIGHTS = false;
ExplorerTreeNode root = FolderModel.getInstance().load(getLoggedInUser(sessionId));
FolderService folderService = ServiceProvider
.getFolderService(getLoggedInUser(sessionId));
ExplorerTreeNode parent = find(root, parentFolder.getId());
fe = folderService.createFolderElement(xView.getName(),
parent, null);
View view = getView(sessionId, xView);
try {
assignViewerAndEditorRole(sessionId, fe, view, isPublic, isEditable);
} catch (SQLException e) {
e.printStackTrace();
}
fe.setSourceObject(view);
// ExplorerTreeNode root = fe.getRoot();
// if (root != null)
// folderService.save(root);
saveRoot(sessionId, root);
// print(root, 0);