/** * Set the file path for the flow being edited by this layout * * @param path the path on disk for the flow being edited */ public void setFilePath(File path) { m_filePath = path != null ? path : new File("-NONE-"); if (path != null) { File absolute = new File(path.getAbsolutePath()); getEnvironment().addVariable(KFGUIConsts.FLOW_DIRECTORY_KEY, absolute.getParent()); } }
/** * Add a a variable to the internal map of this properties object and to the * global system-wide environment; * * @param key the name of the variable * @param value its value */ public void addVariableSystemWide(String key, String value) { addVariable(key, value); // local // system wide if (this != getSystemWide()) { getSystemWide().addVariableSystemWide(key, value); } System.setProperty(key, value); }
/** * Set the file path for the flow being edited by this layout * * @param path the path on disk for the flow being edited */ public void setFilePath(File path) { m_filePath = path != null ? path : new File("-NONE-"); if (path != null) { File absolute = new File(path.getAbsolutePath()); getEnvironment().addVariable(KFGUIConsts.FLOW_DIRECTORY_KEY, absolute.getParent()); } }
/** * Add a a variable to the internal map of this properties object and to the * global system-wide environment; * * @param key the name of the variable * @param value its value */ public void addVariableSystemWide(String key, String value) { addVariable(key, value); // local // system wide if (this != getSystemWide()) { getSystemWide().addVariableSystemWide(key, value); } System.setProperty(key, value); }
/** * Load a binary serialized KnowledgeFlow * * @param fileName the name of the file to load from * @throws Exception if something goes wrong */ @SuppressWarnings("unchecked") public void loadBinary(String fileName) throws Exception { if (!fileName.endsWith(".kf")) { throw new Exception("File must be a binary flow (*.kf)"); } InputStream is = new FileInputStream(fileName); ObjectInputStream ois = new ObjectInputStream(is); m_beans = (Vector<Object>) ois.readObject(); // don't need the graphical connections ois.close(); if (m_env != null) { String parentDir = (new File(fileName)).getParent(); if (parentDir == null) { parentDir = "./"; } m_env.addVariable("Internal.knowledgeflow.directory", parentDir); } }
/** * Load a binary serialized KnowledgeFlow * * @param fileName the name of the file to load from * @throws Exception if something goes wrong */ @SuppressWarnings("unchecked") public void loadBinary(String fileName) throws Exception { if (!fileName.endsWith(".kf")) { throw new Exception("File must be a binary flow (*.kf)"); } InputStream is = new FileInputStream(fileName); ObjectInputStream ois = new ObjectInputStream(is); m_beans = (Vector<Object>) ois.readObject(); // don't need the graphical connections ois.close(); if (m_env != null) { String parentDir = (new File(fileName)).getParent(); if (parentDir == null) { parentDir = "./"; } m_env.addVariable("Internal.knowledgeflow.directory", parentDir); } }
/** * Load an XML serialized KnowledgeFlow * * @param fileName the name of the file to load from * @throws Exception if something goes wrong */ @SuppressWarnings("unchecked") public void loadXML(String fileName) throws Exception { if (!fileName.endsWith(".kfml")) { throw new Exception("File must be an XML flow (*.kfml)"); } BeanConnection.init(); BeanInstance.init(); XMLBeans xml = new XMLBeans(null, null, 0); Vector<?> v = (Vector<?>) xml.read(new File(fileName)); m_beans = (Vector<Object>) v.get(XMLBeans.INDEX_BEANINSTANCES); if (m_env != null) { String parentDir = (new File(fileName)).getParent(); if (parentDir == null) { parentDir = "./"; } m_env.addVariable("Internal.knowledgeflow.directory", parentDir); } else { System.err.println("++++++++++++ Environment variables null!!..."); } }
/** * Load an XML serialized KnowledgeFlow * * @param fileName the name of the file to load from * @throws Exception if something goes wrong */ @SuppressWarnings("unchecked") public void loadXML(String fileName) throws Exception { if (!fileName.endsWith(".kfml")) { throw new Exception("File must be an XML flow (*.kfml)"); } BeanConnection.init(); BeanInstance.init(); XMLBeans xml = new XMLBeans(null, null, 0); Vector<?> v = (Vector<?>) xml.read(new File(fileName)); m_beans = (Vector<Object>) v.get(XMLBeans.INDEX_BEANINSTANCES); if (m_env != null) { String parentDir = (new File(fileName)).getParent(); if (parentDir == null) { parentDir = "./"; } m_env.addVariable("Internal.knowledgeflow.directory", parentDir); } else { System.err.println("++++++++++++ Environment variables null!!..."); } }
/** * Load a flow layout. * * @param fFile the file to load * @param newTab true if the flow should be loaded into a new tab */ public void loadLayout(File fFile, boolean newTab) { File absoluteF = fFile.getAbsoluteFile(); if (!newTab) { m_flowGraphs.get(getCurrentTabIndex()).loadLayout(fFile, false); m_flowGraphs.get(getCurrentTabIndex()).getEnvironment() .addVariable(FLOW_PARENT_DIRECTORY_VARIABLE_KEY, absoluteF.getParent()); } else { String tabTitle = fFile.toString(); tabTitle = tabTitle.substring(tabTitle.lastIndexOf(File.separator) + 1, tabTitle.length()); if (tabTitle.lastIndexOf('.') > 0) { tabTitle = tabTitle.substring(0, tabTitle.lastIndexOf('.')); } addTab(tabTitle); VisibleLayout current = getCurrentLayout(); current.loadLayout(fFile, false); current.getEnvironment().addVariable(FLOW_PARENT_DIRECTORY_VARIABLE_KEY, absoluteF.getParent()); // set the enabled status of the toolbar widgets setActiveTab(getCurrentTabIndex()); } }
/** * Load a flow layout. * * @param fFile the file to load * @param newTab true if the flow should be loaded into a new tab */ public void loadLayout(File fFile, boolean newTab) { File absoluteF = fFile.getAbsoluteFile(); if (!newTab) { m_flowGraphs.get(getCurrentTabIndex()).loadLayout(fFile, false); m_flowGraphs.get(getCurrentTabIndex()).getEnvironment() .addVariable(FLOW_PARENT_DIRECTORY_VARIABLE_KEY, absoluteF.getParent()); } else { String tabTitle = fFile.toString(); tabTitle = tabTitle.substring(tabTitle.lastIndexOf(File.separator) + 1, tabTitle.length()); if (tabTitle.lastIndexOf('.') > 0) { tabTitle = tabTitle.substring(0, tabTitle.lastIndexOf('.')); } addTab(tabTitle); VisibleLayout current = getCurrentLayout(); current.loadLayout(fFile, false); current.getEnvironment().addVariable(FLOW_PARENT_DIRECTORY_VARIABLE_KEY, absoluteF.getParent()); // set the enabled status of the toolbar widgets setActiveTab(getCurrentTabIndex()); } }
BufferedImage content = data.getPrimaryPayload(); getStepManager().getExecutionEnvironment().getEnvironmentVariables() .addVariable("image_count", "" + m_imageCounter++); String fileName = getFile().toString(); if (fileName == null || fileName.length() == 0) {
BufferedImage content = data.getPrimaryPayload(); getStepManager().getExecutionEnvironment().getEnvironmentVariables() .addVariable("image_count", "" + m_imageCounter++); String fileName = getFile().toString(); if (fileName == null || fileName.length() == 0) {
getStepManager().getExecutionEnvironment().getEnvironmentVariables(); for (Map.Entry<String, String> e : vars.entrySet()) { env.addVariable(e.getKey(), e.getValue());
getStepManager().getExecutionEnvironment().getEnvironmentVariables(); for (Map.Entry<String, String> e : vars.entrySet()) { env.addVariable(e.getKey(), e.getValue());
getStepManager() .logDetailed("Setting variable: " + key + " = " + value); currentEnv.addVariable(key, value);
getStepManager() .logDetailed("Setting variable: " + key + " = " + value); currentEnv.addVariable(key, value);
@Override public Filter getFilter() { AddUserFields temp = new AddUserFields(); Environment env = new Environment(); env.addVariable("NOM", "aNomValue"); String params = "-A douglas@numeric@42 -A nomAtt@nominal@aValue -A " + "aDate@date:yyyy-MM-dd@2012-07-09 -A varTest@nominal@${NOM}"; try { String[] opts = Utils.splitOptions(params); temp.setEnvironment(env); temp.setOptions(opts); } catch (Exception ex) { ex.printStackTrace(); } return temp; }
@Override public Filter getFilter() { AddUserFields temp = new AddUserFields(); Environment env = new Environment(); env.addVariable("NOM", "aNomValue"); String params = "-A douglas@numeric@42 -A nomAtt@nominal@aValue -A " + "aDate@date:yyyy-MM-dd@2012-07-09 -A varTest@nominal@${NOM}"; try { String[] opts = Utils.splitOptions(params); temp.setEnvironment(env); temp.setOptions(opts); } catch (Exception ex) { ex.printStackTrace(); } return temp; }
getEnvironment().addVariable("Internal.knowledgeflow.directory", absolute.getParent());
getEnvironment().addVariable("Internal.knowledgeflow.directory", absolute.getParent());