workflowDefContainer.setVisible(false);
}
BookmarkablePageLink<Void> activitiModeler =
new BookmarkablePageLink<Void>("activitiModeler", ActivitiModelerPopupPage.class);
activitiModeler.setPopupSettings(new VeilPopupSettings().setHeight(600).setWidth(800));
MetaDataRoleAuthorizationStrategy.authorize(activitiModeler, ENABLE,
xmlRolesReader.getAllAllowedRoles("Configuration", "workflowDefRead"));
workflowDefContainer.add(activitiModeler);
// Check if Activiti Modeler directory is found
boolean activitiModelerEnabled = false;
try {
String activitiModelerDirectory = WebApplicationContextUtils.getWebApplicationContext(
WebApplication.get().getServletContext()).getBean("activitiModelerDirectory", String.class);
File baseDir = new File(activitiModelerDirectory);
activitiModelerEnabled = baseDir.exists() && baseDir.canRead() && baseDir.isDirectory();
} catch (Exception e) {
LOG.error("Could not check for Activiti Modeler directory", e);
}
activitiModeler.setEnabled(activitiModelerEnabled);
BookmarkablePageLink<Void> xmlEditor =
new BookmarkablePageLink<Void>("xmlEditor", XMLEditorPopupPage.class);
xmlEditor.setPopupSettings(new VeilPopupSettings().setHeight(480).setWidth(800));
MetaDataRoleAuthorizationStrategy.authorize(xmlEditor, ENABLE,
xmlRolesReader.getAllAllowedRoles("Configuration", "workflowDefRead"));
workflowDefContainer.add(xmlEditor);
Image workflowDefDiagram = new Image("workflowDefDiagram", new Model()) {