this.toBeMovedEntry = toBeMovedEntry;
// Main view is a velocity container
contentVC = createVelocityContainer("catalogentryajaxmove");
contentVC.contextPut("entryname", toBeMovedEntry.getName());
// build current path for gui
CatalogEntry tempEntry = toBeMovedEntry;
String path = "";
while (tempEntry != null) {
path = "/" + tempEntry.getName() + path;
tempEntry = tempEntry.getParent();
}
contentVC.contextPut("path", path.toString());
// Fetch all entries that can be accessed by this user. This is kept as a
// local copy for performance reasons. This is only used when a node is
// moved, when moving leafs we don't check for ownership of the category
if (toBeMovedEntry.getType() == CatalogEntry.TYPE_NODE) {
ownedEntries = getOwnedEntries(ureq);
}
CatalogManager cm = CatalogManager.getInstance();
CatalogEntry rootce = (CatalogEntry) cm.getRootCatalogEntries().get(0);
// Build tree model
treeModel = new CatalogAjaxTreeModel(rootce, toBeMovedEntry, ownedEntries, false, false);
// Create the ajax tree controller, add it to your main view
treeCtr = new TreeController(ureq, getWindowControl(), rootce.getName(), treeModel, null);
listenTo(treeCtr);
contentVC.put("treeCtr", treeCtr.getInitialComponent());
cancelLink = LinkFactory.createButton("cancel", contentVC, this);
// select link is disabled until an item is selected