CaoActionList actionList = new CaoActionList();
//TODO CapCore.getInstance().getFactory().fillWithActions(null,list, actionList);
JackElement element = (JackElement)list.getElements().next();
CaoAction action = null;
try {
if (element.getNode().getPrimaryNodeType().getPrimaryItemName().equals("jcr:content")) {
action = actionList.getAction("select.open");
}
} catch (Exception e) {
//e.printStackTrace();
}
if (action == null) {
try {
if (element.getNode().getNodes().hasNext()) {
action = actionList.getAction("select.open.list");
} else {
action = actionList.getAction("select.open.attributes");
}
} catch (Exception e) {
e.printStackTrace();
}
}
if (action != null && action.canExecute(list)) {
MForm config = action.createConfiguration(list);
return action.execute(list, config);
}
return null;
}