public JobSummaryServlet(final Props props) { this.props = props; this.viewerName = props.getString("viewer.name"); this.viewerPath = props.getString("viewer.path"); this.webResourcesPath = new File(new File(props.getSource()).getParentFile().getParentFile(), "web"); this.webResourcesPath.mkdirs(); setResourceDirectory(this.webResourcesPath); }
@Override public void uploadProjectProperty(final Project project, final Props props) throws ProjectManagerException { try { uploadProjectProperty(project, props.getSource(), props); } catch (final IOException e) { throw new ProjectManagerException("Error uploading project property file", e); } }
@Override public void updateProjectProperty(final Project project, final Props props) throws ProjectManagerException { try { updateProjectProperty(project, props.getSource(), props); } catch (final IOException e) { throw new ProjectManagerException("Error uploading project property file", e); } }
public static Map<String, Object> toHierarchicalMap(final Props props) { final Map<String, Object> propsMap = new HashMap<>(); propsMap.put("source", props.getSource()); propsMap.put("props", toStringMap(props, true)); if (props.getParent() != null) { propsMap.put("parent", toHierarchicalMap(props.getParent())); } return propsMap; }
@Override public void uploadProjectProperties(final Project project, final List<Props> properties) throws ProjectManagerException { for (final Props props : properties) { try { uploadProjectProperty(project, props.getSource(), props); } catch (final IOException e) { throw new ProjectManagerException("Error uploading project property file", e); } } }
node.setPropsSource(parent.getSource());
oldProps = this.projectLoader.fetchProjectProperty(project, prop.getSource());
@Test public void testUploadOrUpdateProjectProperty() throws Exception { final Props props = new Props(); props.setSource("source1"); props.put("key1", "value1"); props.put("key2", "value2"); createThreeProjects(); final Project project = this.loader.fetchProjectByName("mytestProject"); this.loader.uploadProjectProperty(project, props); final Props sameProps = this.loader.fetchProjectProperty(project, props.getSource()); Assert.assertEquals(sameProps.get("key1"), "value1"); Assert.assertEquals(sameProps.get("key2"), "value2"); props.put("key2", "value9"); this.loader.updateProjectProperty(project, props); final Props sameProps2 = this.loader.fetchProjectProperty(project, props.getSource()); Assert.assertEquals(sameProps2.get("key2"), "value9"); }
public static Map<String,Object> toHierarchicalMap(Props props) { Map<String,Object> propsMap = new HashMap<String,Object>(); propsMap.put("source", props.getSource()); propsMap.put("props", toStringMap(props, true)); if (props.getParent() != null) { propsMap.put("parent", toHierarchicalMap(props.getParent())); } return propsMap; } }
@Override public void uploadProjectProperty(final Project project, final Props props) throws ProjectManagerException { try { uploadProjectProperty(project, props.getSource(), props); } catch (final IOException e) { throw new ProjectManagerException("Error uploading project property file", e); } }
@Override public void uploadProjectProperties(final Project project, final List<Props> properties) throws ProjectManagerException { for (final Props props : properties) { try { uploadProjectProperty(project, props.getSource(), props); } catch (final IOException e) { throw new ProjectManagerException("Error uploading project property file", e); } } }
@Override public void updateProjectProperty(final Project project, final Props props) throws ProjectManagerException { try { updateProjectProperty(project, props.getSource(), props); } catch (final IOException e) { throw new ProjectManagerException("Error uploading project property file", e); } }
/** * To hierarchical map map. * * @param props the props * @return the map */ public static Map<String, Object> toHierarchicalMap(final Props props) { final Map<String, Object> propsMap = new HashMap<>(); propsMap.put("source", props.getSource()); propsMap.put("props", toStringMap(props, true)); if (props.getParent() != null) { propsMap.put("parent", toHierarchicalMap(props.getParent())); } return propsMap; }
public void setJobOverrideProperty(Project project, Props prop, String jobName) throws ProjectManagerException { prop.setSource(jobName+".jor"); Props oldProps = projectLoader.fetchProjectProperty(project, prop.getSource()); if(oldProps == null) { projectLoader.uploadProjectProperty(project, prop); } else { projectLoader.updateProjectProperty(project, prop); } return; }
@Override public void updateProjectProperty(Project project, Props props) throws ProjectManagerException { Connection connection = getConnection(); try { updateProjectProperty(connection, project, props.getSource(), props); connection.commit(); } catch (SQLException e) { throw new ProjectManagerException("Error uploading project property files", e); } catch (IOException e) { throw new ProjectManagerException("Error uploading project property file", e); } finally { DbUtils.closeQuietly(connection); } }
@Override public void uploadProjectProperties(Project project, List<Props> properties) throws ProjectManagerException { Connection connection = getConnection(); try { for (Props props: properties) { uploadProjectProperty(connection, project, props.getSource(), props); } connection.commit(); } catch (SQLException e) { throw new ProjectManagerException("Error uploading project property files", e); } catch (IOException e) { throw new ProjectManagerException("Error uploading project property files", e); } finally { DbUtils.closeQuietly(connection); } }
@Override public void uploadProjectProperty(Project project, Props props) throws ProjectManagerException { Connection connection = getConnection(); try { uploadProjectProperty(connection, project, props.getSource(), props); connection.commit(); } catch (SQLException e) { throw new ProjectManagerException("Error uploading project property files", e); } catch (IOException e) { throw new ProjectManagerException("Error uploading project property file", e); } finally { DbUtils.closeQuietly(connection); } }