/** * constructor * * @param entityManager persistence entity manager */ public GenericLocalServiceBean(EntityManager entityManager) { this(entityManager, ENV.get("service.use.database.replication", false)); }
protected void initAntScriptFile() { /* * on first time, we copy the scripts like antscripts.xml * to the plugin-workspace. we do this to provide user changes on that files! */ ENV.extractResource(ANTSCRIPTNAME); ENV.extractResource(ANTSCRIPTPROP); }
/** * returns the full workspace path for the given file * * @param file file name * @return path */ public static String getPath(String file) { return ENV.getConfigPath() + file; }
private static void close(Connection con) { if (con != null) { try { con.close(); } catch (SQLException e) { ManagedException.forward(e); } } }
public static String getBackupPath(String file) { return ENV.getTempPath() + file; }
/** * override this method, if you work on entity beans with generic ids. you should assign the parent object. * * @param selectedSourceItems items to move to the destination list. */ public void moveToDest(Collection<T> selectedSourceItems) { assert sourceItems.containsAll(selectedSourceItems); if (!(sourceItems.removeAll(selectedSourceItems))) { throw new ManagedException("tsl2nano.unexpectederror", null); } destItems.addAll(selectedSourceItems); }
public static final String getHelp() { return ENV.translate("help", false); }
@Override public Object action() throws Exception { //TODO should we reset the whole application - closing all sessions? session.getApplication().reset(); // ENV.get(BeanPresentationHelper.class).reset(); return page("configuration refreshed"); }
@Override public Object action() throws Exception { session.getApplication().persist(); // ENV.get(BeanPresentationHelper.class).reset(); return page("configuration refreshed"); }
public static String getFileName(String name) { return ENV.getTempPathRel() + "context-" + name + ".xml"; }
/** * constructor */ public Net(String name) { this.name = name; elements = new TreeMap<String, Node<T, D>>(); ENV.removeService(NotificationController.class); }
@Override public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException e) { ManagedException.forward(e); return null; } }
public String evalSqlFileName(String name) { return ENV.getConfigPath() + name + ".sql"; }
private static boolean useExtraCollectorDefinition() { return ENV.get("collector.use.extra.definition", false); }
public IAction<Collection<?>> runner() { if (runner == null) { String id = "scripttool.go"; String lbl = ENV.translate(id, true); runner = new CommonAction(id, lbl, lbl) { @Override public Object action() throws Exception { FileUtil.save(SERIALIZED_SCRIPTOOL, ScriptTool.this); return selectedAction != null ? selectedAction.activate() : null; } }; } return runner; }
/** * default readaccessmethod if default constructor was invoked */ private static final Method UNDEFINEDMETHOD() { try { //get yourself return AttributeDefinition.class.getDeclaredMethod("UNDEFINEDMETHOD", new Class[0]); } catch (Exception e) { ManagedException.forward(e); return null; } }
public static String getDefinitionDirectory() { return ENV.getConfigPath() + "presentation/"; }
/** * @return Returns the presentationHelper. */ public <PH extends BeanPresentationHelper<T>> PH getPresentationHelper() { if (presentationHelper == null) { presentationHelper = ENV.get(BeanPresentationHelper.class).createHelper(this); } return (PH) presentationHelper; }
/** * getPresentation * * @return */ @Override public IPresentable getPresentation() { //TODO: create presentation helper through MultipleInheritanceProxy if (presentable == null) { presentable = ENV.get(BeanPresentationHelper.class).createPresentable(this); } return presentable; }