+ /** Override normal behaviour to initialize display of the workspace */
+ @Override
+ public synchronized Object[] getChildren() {
+ if (isLoaded()) {
+ return super.getChildren();
+ } else {
+ // initialize current object
+ try {
+ if (defaultSession == null)
+ return null;
+ else {
+ Query groupQuery = defaultSession
+ .getWorkspace()
+ .getQueryManager()
+ .createQuery(
+ "select * from [" + SlcTypes.SLC_GROUP_BASE
+ + "] as group order by group.["
+ + SlcNames.SLC_GROUP_BASE_ID + "]",
+ Query.JCR_SQL2);
+ NodeIterator groups = groupQuery.execute().getNodes();
+ while (groups.hasNext()) {
+ addChild(new GroupBaseElem(WorkspaceElem.this, groups
+ .nextNode()
+ .getProperty(SlcNames.SLC_GROUP_BASE_ID)
+ .getString()));
+ }
+ }
+ return super.getChildren();
+ } catch (RepositoryException e) {
+ throw new ArgeoException(
+ "Cannot initialize WorkspaceNode UI object."
+ + getName(), e);
+ }
+ }
+ }
+