List of usage examples for java.util Vector get
public synchronized E get(int index)
From source file:com.splicemachine.db.impl.sql.compile.DMLModStatementNode.java
protected void markAffectedIndexes(Vector affectedConglomerates) throws StandardException { ConglomerateDescriptor cd;/*from w w w .j av a 2s . c om*/ int indexCount = affectedConglomerates.size(); CompilerContext cc = getCompilerContext(); indicesToMaintain = new IndexRowGenerator[indexCount]; indexConglomerateNumbers = new long[indexCount]; indexNames = new String[indexCount]; for (int ictr = 0; ictr < indexCount; ictr++) { cd = (ConglomerateDescriptor) affectedConglomerates.get(ictr); indicesToMaintain[ictr] = cd.getIndexDescriptor(); indexConglomerateNumbers[ictr] = cd.getConglomerateNumber(); indexNames[ictr] = ((cd.isConstraint()) ? null : cd.getConglomerateName()); cc.createDependency(cd); } }
From source file:gskproject.Analyze.java
private void btnDAGraphActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDAGraphActionPerformed if (tableDepartmentAccident != null) { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); JFreeChart chart = null;/*from w w w . ja v a 2s.c o m*/ if (ddDDepartment.getSelectedIndex() == 0 && ddDAccidentType.getSelectedIndex() == 0) { for (int i = 0; i < tableDepartmentAccident.size() - 1; i++) { Vector<Object> row = tableDepartmentAccident.get(i); dataset.addValue(Double.parseDouble(row.get(1).toString()), "First Aid", row.get(0).toString()); dataset.addValue(Double.parseDouble(row.get(2).toString()), "LTI", row.get(0).toString()); dataset.addValue(Double.parseDouble(row.get(3).toString()), "Near Miss", row.get(0).toString()); } chart = ChartFactory.createBarChart3D("All Departments VS All Accident Types", "Departments", "Accident Types", dataset, PlotOrientation.VERTICAL, false, true, false); } else { String dep = ddDDepartment.getSelectedItem().toString(); String acc = ddDAccidentType.getSelectedItem().toString(); if (ddDDepartment.getSelectedIndex() == 0) { for (int i = 0; i < tableDepartmentAccident.size() - 1; i++) { Vector<Object> row = tableDepartmentAccident.get(i); dataset.addValue(Double.parseDouble(row.get(ddDAccidentType.getSelectedIndex()).toString()), acc, row.get(0).toString()); } chart = ChartFactory.createBarChart3D("All Departments VS " + acc, "Departments", acc, dataset, PlotOrientation.VERTICAL, false, true, false); } else if (ddDAccidentType.getSelectedIndex() == 0) { Vector row = tableDepartmentAccident.get(ddDDepartment.getSelectedIndex() - 1); dataset.addValue(Double.parseDouble(row.get(1).toString()), dep, "First Aid"); dataset.addValue(Double.parseDouble(row.get(2).toString()), dep, "LTI"); dataset.addValue(Double.parseDouble(row.get(3).toString()), dep, "Near Miss"); chart = ChartFactory.createBarChart3D(dep + " Department VS All Accident Types", "Accident Types", dep, dataset, PlotOrientation.VERTICAL, false, true, false); } } CategoryPlot p = chart.getCategoryPlot(); p.setRangeGridlinePaint(Color.BLACK); ChartFrame frame = new ChartFrame("Dual Axis Chart", chart); frame.setSize(700, 500); frame.setVisible(true); } else { JOptionPane.showMessageDialog(this, "Please Filter Data!"); } }
From source file:eionet.gdem.dcm.business.SchemaManager.java
/** * Deletes XML Schema and related stylesheets from database. * @param user login name//from ww w . ja v a2 s . c om * @param schemaId XML Schema database ID. * @throws DCMException in case of database error occurs. */ public void deleteSchemaStylesheets(String user, String schemaId) throws DCMException { boolean hasOtherStuff = false; try { if (!SecurityUtil.hasPerm(user, "/" + Names.ACL_SCHEMA_PATH, "d")) { LOGGER.debug("You don't have permissions to delete schemas!"); throw new DCMException(BusinessConstants.EXCEPTION_AUTORIZATION_SCHEMA_DELETE); } } catch (DCMException e) { throw e; } catch (Exception e) { LOGGER.debug(e.toString(), e); throw new DCMException(BusinessConstants.EXCEPTION_GENERAL); } try { Vector stylesheets = schemaDao.getSchemaStylesheets(schemaId); if (!Utils.isNullVector(schemaDao.getSchemaQueries(schemaId)) || uplSchemaDao.checkUplSchemaFK(schemaId)) { hasOtherStuff = true; } schemaDao.removeSchema(schemaId, false, false, !hasOtherStuff); // delete stylesheet files only if db operation succeeded if (stylesheets != null) { for (int i = 0; i < stylesheets.size(); i++) { HashMap hash = (HashMap) stylesheets.get(i); String xslFile = (String) hash.get("xsl"); String xslFolder = Properties.xslFolder; if (!xslFolder.endsWith(File.separator)) { xslFolder = xslFolder + File.separator; } try { Utils.deleteFile(xslFolder + xslFile); } catch (Exception e) { LOGGER.debug("Error deleting file", e); throw new DCMException(BusinessConstants.EXCEPTION_GENERAL); } } } } catch (Exception e) { LOGGER.debug("Error removing schema", e); throw new DCMException(BusinessConstants.EXCEPTION_GENERAL); } }
From source file:webServices.RestServiceImpl.java
@GET @Path("/mapLayersInfo/{id}/{host}/{endpoint}/{qType}/{port}") @Produces(MediaType.APPLICATION_XML)/*ww w .jav a2 s. c o m*/ public List<MapInfo> getMapLayers(@PathParam("id") String id, @PathParam("host") String host, @PathParam("endpoint") String endpoint, @PathParam("qType") String qType, @PathParam("port") int port) throws EndpointCommunicationException { //Reset to default registry values endpointStore = new MapEndpointStore(); //Get host info if the map is not saved in Registry if (!host.equalsIgnoreCase("none")) { endpointStore.setEndpointQuery(host, port, endpoint + "/" + qType); } //query registry to get the layers of the map with the specific id Vector<Vector<String>> results = endpointStore.openMapFromLink(id); int chartPosition = -1; //Pose queries to endpoints to get the KML files for (int i = 0; i < results.size(); i++) { Vector<String> temp = results.get(i); //End this loop at chart info separator if (temp.get(0).equalsIgnoreCase("@@@")) { chartPosition = i + 1; break; } String kmlFile = null; String hostName = null; String endpointName = null; String[] parts = null; String[] hostArr = null; //If an endpointURI exists, get the host and the name of it if (temp.get(3) != null) { parts = temp.get(3).split("/"); hostName = parts[2]; port = 80; hostArr = hostName.split(":"); if (hostArr.length > 1) { port = Integer.parseInt(hostArr[1]); } endpointName = ""; for (int b = 3; b < parts.length - 1; b++) { //endpointName = parts[3] + "/" + parts[4]; endpointName += parts[b] + "/"; } endpointName += parts[parts.length - 1]; } /** * Query the respective endpoint to get the .kml file */ if (parts != null && temp.get(1) != null) { if (!hostName.equalsIgnoreCase("data.ordnancesurvey.co.uk")) { //Strabon endpoint try { //System.out.println("*** Query: " + temp.get(1)); //System.out.println("*** LayerName: " + temp.get(0)); //System.out.println("*** Host: " + hostName); //System.out.println("*** Port: " + port); //System.out.println("*** EndpointName: " + endpointName); kmlFile = passQuery(temp.get(1), temp.get(0), hostName, port, endpointName); //kmlFile = passQuery(query, name, host, port, endpointName.replaceAll("@@@", "/")); } catch (RuntimeException e) { e.printStackTrace(); } } else { //Ordnance Survey SPARQL endpoint try { kmlFile = passQueryOS(temp.get(1), temp.get(0)); } catch (RuntimeException e) { } catch (QueryResultParseException e) { e.printStackTrace(); } catch (TupleQueryResultHandlerException e) { e.printStackTrace(); } catch (QueryEvaluationException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } temp.set(2, kmlFile); results.set(i, temp); } } //Wrap the results ArrayList<MapInfo> mapInformation = new ArrayList<MapInfo>(); for (int i = 0; i < results.size(); i++) { MapInfo info = new MapInfo(); Vector<String> temp = results.get(i); //End this loop at chart info separator if (temp.get(0).equalsIgnoreCase("@@@")) { break; } info.init(temp); mapInformation.add(info); } //Pose queries to endpoints to get chart results and wrap results if (chartPosition != -1) { for (int i = chartPosition; i < results.size(); i++) { Vector<String> temp = results.get(i); String hostName = null; String endpointName = ""; String[] parts = null; String[] hostArr = null; //Get the host and the name of the endpoint parts = temp.get(3).split("/"); hostName = parts[2]; port = 80; hostArr = hostName.split(":"); if (hostArr.length > 1) { port = Integer.parseInt(hostArr[1]); } for (int j = 3; j < parts.length - 1; j++) { endpointName = endpointName.concat(parts[j]); endpointName = endpointName.concat("/"); } endpointName = endpointName.concat(parts[parts.length - 1]); Vector<String> resultsChart = new Vector<String>(); String format = ""; resultsChart = endpointStore.getDataForChart(hostName, endpointName, port, temp.get(2)); for (int j = 0; j < resultsChart.size(); j++) { format = format.concat(resultsChart.get(j)); format = format.concat("$"); } MapInfo info = new MapInfo("chart", temp.get(2), temp.get(3), temp.get(1), format, temp.get(4), temp.get(5), temp.get(6)); mapInformation.add(info); } } return mapInformation; }
From source file:CreateNewTable.java
private static Vector getDataTypes(Connection con) throws SQLException { String structName = null, distinctName = null, javaName = null; // create a vector of class DataType initialized with // the SQL code, the SQL type name, and two null entries // for the local type name and the creation parameter(s) Vector dataTypes = new Vector(); dataTypes.add(new DataType(java.sql.Types.BIT, "BIT")); dataTypes.add(new DataType(java.sql.Types.TINYINT, "TINYINT")); dataTypes.add(new DataType(java.sql.Types.SMALLINT, "SMALLINT")); dataTypes.add(new DataType(java.sql.Types.INTEGER, "INTEGER")); dataTypes.add(new DataType(java.sql.Types.BIGINT, "BIGINT")); dataTypes.add(new DataType(java.sql.Types.FLOAT, "FLOAT")); dataTypes.add(new DataType(java.sql.Types.REAL, "REAL")); dataTypes.add(new DataType(java.sql.Types.DOUBLE, "DOUBLE")); dataTypes.add(new DataType(java.sql.Types.NUMERIC, "NUMERIC")); dataTypes.add(new DataType(java.sql.Types.DECIMAL, "DECIMAL")); dataTypes.add(new DataType(java.sql.Types.CHAR, "CHAR")); dataTypes.add(new DataType(java.sql.Types.VARCHAR, "VARCHAR")); dataTypes.add(new DataType(java.sql.Types.LONGVARCHAR, "LONGVARCHAR")); dataTypes.add(new DataType(java.sql.Types.DATE, "DATE")); dataTypes.add(new DataType(java.sql.Types.TIME, "TIME")); dataTypes.add(new DataType(java.sql.Types.TIMESTAMP, "TIMESTAMP")); dataTypes.add(new DataType(java.sql.Types.BINARY, "BINARY")); dataTypes.add(new DataType(java.sql.Types.VARBINARY, "VARBINARY")); dataTypes.add(new DataType(java.sql.Types.LONGVARBINARY, "LONGVARBINARY")); dataTypes.add(new DataType(java.sql.Types.NULL, "NULL")); dataTypes.add(new DataType(java.sql.Types.OTHER, "OTHER")); dataTypes.add(new DataType(java.sql.Types.BLOB, "BLOB")); dataTypes.add(new DataType(java.sql.Types.CLOB, "CLOB")); DatabaseMetaData dbmd = con.getMetaData(); ResultSet rs = dbmd.getTypeInfo(); while (rs.next()) { int codeNumber = rs.getInt("DATA_TYPE"); String dbmsName = rs.getString("TYPE_NAME"); String createParams = rs.getString("CREATE_PARAMS"); if (codeNumber == Types.STRUCT && structName == null) structName = dbmsName;// w w w .j a va 2s .co m else if (codeNumber == Types.DISTINCT && distinctName == null) distinctName = dbmsName; else if (codeNumber == Types.JAVA_OBJECT && javaName == null) javaName = dbmsName; else { for (int i = 0; i < dataTypes.size(); i++) { // find entry that matches the SQL code, // and if local type and params are not already set, // set them DataType type = (DataType) dataTypes.get(i); if (type.getCode() == codeNumber) { type.setLocalTypeAndParams(dbmsName, createParams); } } } } int[] types = { Types.STRUCT, Types.DISTINCT, Types.JAVA_OBJECT }; rs = dbmd.getUDTs(null, "%", "%", types); while (rs.next()) { String typeName = null; DataType dataType = null; if (dbmd.isCatalogAtStart()) typeName = rs.getString(1) + dbmd.getCatalogSeparator() + rs.getString(2) + "." + rs.getString(3); else typeName = rs.getString(2) + "." + rs.getString(3) + dbmd.getCatalogSeparator() + rs.getString(1); switch (rs.getInt(5)) { case Types.STRUCT: dataType = new DataType(Types.STRUCT, typeName); dataType.setLocalTypeAndParams(structName, null); break; case Types.DISTINCT: dataType = new DataType(Types.DISTINCT, typeName); dataType.setLocalTypeAndParams(distinctName, null); break; case Types.JAVA_OBJECT: dataType = new DataType(Types.JAVA_OBJECT, typeName); dataType.setLocalTypeAndParams(javaName, null); break; } dataTypes.add(dataType); } return dataTypes; }
From source file:edu.xtec.colex.client.beans.ColexRecordBean.java
/** * Calculates all the conditions of the q Query object * * @throws java.lang.Exception when an Exception error occurs */// ww w .j a v a 2 s. co m protected void calculateConditions() throws Exception { getStructure(); logger.debug("1"); java.util.Enumeration eQuery = pmRequest.getParameterNames(); String param, op, name, cmp, value, id; int index; Vector ids = new Vector(); logger.debug("ids: " + ids); while (eQuery.hasMoreElements()) { param = (String) eQuery.nextElement(); logger.debug("param: " + param); if (param.startsWith("name_")) { id = param.substring(param.indexOf("_") + 1); ids.add(new Integer("" + id)); } } java.util.Collections.sort(ids); logger.debug("ids 2: " + ids.size()); for (int i = 0; i < ids.size(); i++) { id = ((Integer) ids.get(i)).toString(); op = pmRequest.getParameter("op_" + id); logger.debug("2"); if (op == null) { op = "null"; } logger.debug("3"); name = pmRequest.getParameter("name_" + id); logger.debug("4"); cmp = pmRequest.getParameter("cmp_" + id); logger.debug("5"); value = pmRequest.getParameter("value_" + id); logger.debug("6"); q.addCondition(new Condition(op, name, cmp, value)); logger.debug("7"); } }
From source file:Main.java
private static Vector getDataTypes(Connection con) throws SQLException { String structName = null, distinctName = null, javaName = null; // create a vector of class DataType initialized with // the SQL code, the SQL type name, and two null entries // for the local type name and the creation parameter(s) Vector dataTypes = new Vector(); dataTypes.add(new DataType(java.sql.Types.BIT, "BIT")); dataTypes.add(new DataType(java.sql.Types.TINYINT, "TINYINT")); dataTypes.add(new DataType(java.sql.Types.SMALLINT, "SMALLINT")); dataTypes.add(new DataType(java.sql.Types.INTEGER, "INTEGER")); dataTypes.add(new DataType(java.sql.Types.BIGINT, "BIGINT")); dataTypes.add(new DataType(java.sql.Types.FLOAT, "FLOAT")); dataTypes.add(new DataType(java.sql.Types.REAL, "REAL")); dataTypes.add(new DataType(java.sql.Types.DOUBLE, "DOUBLE")); dataTypes.add(new DataType(java.sql.Types.NUMERIC, "NUMERIC")); dataTypes.add(new DataType(java.sql.Types.DECIMAL, "DECIMAL")); dataTypes.add(new DataType(java.sql.Types.CHAR, "CHAR")); dataTypes.add(new DataType(java.sql.Types.VARCHAR, "VARCHAR")); dataTypes.add(new DataType(java.sql.Types.LONGVARCHAR, "LONGVARCHAR")); dataTypes.add(new DataType(java.sql.Types.DATE, "DATE")); dataTypes.add(new DataType(java.sql.Types.TIME, "TIME")); dataTypes.add(new DataType(java.sql.Types.TIMESTAMP, "TIMESTAMP")); dataTypes.add(new DataType(java.sql.Types.BINARY, "BINARY")); dataTypes.add(new DataType(java.sql.Types.VARBINARY, "VARBINARY")); dataTypes.add(new DataType(java.sql.Types.LONGVARBINARY, "LONGVARBINARY")); dataTypes.add(new DataType(java.sql.Types.NULL, "NULL")); dataTypes.add(new DataType(java.sql.Types.OTHER, "OTHER")); dataTypes.add(new DataType(java.sql.Types.BLOB, "BLOB")); dataTypes.add(new DataType(java.sql.Types.CLOB, "CLOB")); DatabaseMetaData dbmd = con.getMetaData(); ResultSet rs = dbmd.getTypeInfo(); while (rs.next()) { int codeNumber = rs.getInt("DATA_TYPE"); String dbmsName = rs.getString("TYPE_NAME"); String createParams = rs.getString("CREATE_PARAMS"); if (codeNumber == Types.STRUCT && structName == null) structName = dbmsName;/*from w w w. j av a 2 s . c o m*/ else if (codeNumber == Types.DISTINCT && distinctName == null) distinctName = dbmsName; else if (codeNumber == Types.JAVA_OBJECT && javaName == null) javaName = dbmsName; else { for (int i = 0; i < dataTypes.size(); i++) { // find entry that matches the SQL code, // and if local type and params are not already set, // set them DataType type = (DataType) dataTypes.get(i); if (type.getCode() == codeNumber) { type.setLocalTypeAndParams(dbmsName, createParams); } } } } int[] types = { Types.STRUCT, Types.DISTINCT, Types.JAVA_OBJECT }; rs = dbmd.getUDTs(null, "%", "%", types); while (rs.next()) { String typeName = null; DataType dataType = null; if (dbmd.isCatalogAtStart()) typeName = rs.getString(1) + dbmd.getCatalogSeparator() + rs.getString(2) + "." + rs.getString(3); else typeName = rs.getString(2) + "." + rs.getString(3) + dbmd.getCatalogSeparator() + rs.getString(1); switch (rs.getInt(5)) { case Types.STRUCT: dataType = new DataType(Types.STRUCT, typeName); dataType.setLocalTypeAndParams(structName, null); break; case Types.DISTINCT: dataType = new DataType(Types.DISTINCT, typeName); dataType.setLocalTypeAndParams(distinctName, null); break; case Types.JAVA_OBJECT: dataType = new DataType(Types.JAVA_OBJECT, typeName); dataType.setLocalTypeAndParams(javaName, null); break; } dataTypes.add(dataType); } return dataTypes; }
From source file:gskproject.Analyze.java
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed if (tableDepartmentAccident != null) { DefaultPieDataset pieDataSet = new DefaultPieDataset(); Vector<Object> row = tableDepartmentAccident.get(tableDepartmentAccident.size() - 1); pieDataSet.setValue("First Aid", Double.parseDouble(row.get(1).toString())); pieDataSet.setValue("LTI", Double.parseDouble(row.get(2).toString())); pieDataSet.setValue("Near Miss", Double.parseDouble(row.get(3).toString())); JFreeChart chart = ChartFactory.createPieChart("Overrall All Accident Types Spread", pieDataSet, true, true, true);// www .j a v a 2 s . c o m PiePlot p = (PiePlot) chart.getPlot(); ChartFrame frame = new ChartFrame("pie Chart", chart); frame.setVisible(true); frame.setSize(700, 500); } else { JOptionPane.showMessageDialog(this, "Please Filter Data!"); } }
From source file:net.rim.ejde.internal.packaging.PackagingManager.java
private String composeString(Vector<String> vector, String separator) { StringBuffer buffer = new StringBuffer(); if (vector == null) { return buffer.toString(); }// w w w .j a v a 2 s . c o m for (int i = 0; i < vector.size(); i++) { if (i == 0) { buffer.append(vector.get(i).toString()); } else { buffer.append(separator); buffer.append(vector.get(i).toString()); } } return buffer.toString(); }
From source file:hu.sztaki.lpds.pgportal.portlets.workflow.EasyWorkflowPortlet.java
private Vector getEConfParam(String pUser, String pWorkflow, PortletSession ps) throws Exception { if (((Hashtable) ps.getAttribute("findwf")).containsKey(pWorkflow)) {//findinWF.get(pWorkflow) != null //System.out.println("during processing:"+pWorkflow); return new Vector(); }/* ww w . j a va2 s . co m*/ ((Hashtable) ps.getAttribute("findwf")).put(pWorkflow, "true"); //System.out.println("WFs during processing:"+findinWF); Vector eparam = new Vector();//end user parameters Hashtable hsh = new Hashtable(); hsh.put("url", PortalCacheService.getInstance().getUser(pUser).getWorkflow(pWorkflow).getWfsID()); ServiceType st = InformationBase.getI().getService("wfs", "portal", hsh, new Vector()); // try // { PortalWfsClient pc = (PortalWfsClient) Class.forName(st.getClientObject()).newInstance(); pc.setServiceURL(st.getServiceUrl()); pc.setServiceID(st.getServiceID()); ComDataBean tmp = new ComDataBean(); tmp.setPortalID(PropertyLoader.getInstance().getProperty("service.url")); tmp.setUserID(pUser); tmp.setWorkflowID(pWorkflow); Vector wfconfigdt = pc.getWorkflowConfigData(tmp); for (int i = 0; i < wfconfigdt.size(); i++) { // replace special characters... String jobtxt = new String(((JobPropertyBean) wfconfigdt.get(i)).getTxt()); ((JobPropertyBean) wfconfigdt.get(i)).setTxt(replaceTextS(jobtxt)); JobPropertyBean jobprop = (JobPropertyBean) wfconfigdt.get(i); String gridtype = "" + jobprop.getExe().get("gridtype"); if (GEMLCA.equals("" + jobprop.getExe().get("gridtype"))) {//GLC lista frissites + hozzaferes ellenorzes Vector v = GemlcaCacheService.getInstance().getGLCList( "" + PropertyLoader.getInstance().getProperty("portal.prefix.dir") + "/users/" + pUser + "/x509up." + jobprop.getExe().get("grid"), "" + jobprop.getExe().get("grid"), 0, 0); } // input for (int j = 0; j < ((JobPropertyBean) wfconfigdt.get(i)).getInputs().size(); j++) { PortDataBean ptmp = (PortDataBean) ((JobPropertyBean) wfconfigdt.get(i)).getInputs().get(j); // replace special characters... ptmp.setTxt(replaceTextS(ptmp.getTxt())); /* System.out.println(j+" job input port getName "+ ptmp.getName()); System.out.println(" job input port getLabel "+ ptmp.getLabel());//ha nem ures v. nem null System.out.println(" job input port getData "+ ptmp.getData()); System.out.println(" job input port getDataDisabled "+ ptmp.getDataDisabled()); System.out.println(" job input port getDesc "+ ptmp.getDesc());*/ Set keys = ptmp.getLabel().keySet(); Iterator it = keys.iterator(); while (it.hasNext()) { String key = (String) it.next(); String label = (String) ptmp.getLabel().get(key); String inh = (String) ptmp.getInherited().get(key); if (!(label.equals("") || label.equals("null")) && (inh.equals("---") || inh.equals("null"))) { Hashtable ph = new Hashtable(); ph.put("wfID", pWorkflow); ph.put("jobID", "" + ((JobPropertyBean) wfconfigdt.get(i)).getId()); ph.put("jobName", "" + ((JobPropertyBean) wfconfigdt.get(i)).getName()); ph.put("type", "iport"); ph.put("typeID", "" + ptmp.getId()); ph.put("name", key); ph.put("value", "" + ptmp.getData().get(key)); ph.put("label", label); ph.put("desc", "" + ptmp.getDesc().get(key)); ph.put("gridtype", gridtype); if (key.equals("file")) { try { ph.put("storageID", PortalCacheService.getInstance().getUser(pUser) .getWorkflow(pWorkflow).getStorageID()); ph.put("userID", pUser); ph.put("portalID", PropertyLoader.getInstance().getProperty("service.url")); ph.put("inputID", "" + ptmp.getSeq()); } catch (Exception e) { e.printStackTrace(); } } eparam.add(ph); } } } // outputs for (int jo = 0; jo < ((JobPropertyBean) wfconfigdt.get(i)).getOutputs().size(); jo++) { PortDataBean ptmpo = (PortDataBean) ((JobPropertyBean) wfconfigdt.get(i)).getOutputs().get(jo); // replace special characters... ptmpo.setTxt(replaceTextS(ptmpo.getTxt())); Set keys = ptmpo.getLabel().keySet(); Iterator it = keys.iterator(); while (it.hasNext()) { String key = (String) it.next(); String label = (String) ptmpo.getLabel().get(key); String inh = (String) ptmpo.getInherited().get(key); if (!(label.equals("") || label.equals("null")) && (inh.equals("---") || inh.equals("null"))) { Hashtable ph = new Hashtable(); ph.put("wfID", pWorkflow); ph.put("jobID", "" + ((JobPropertyBean) wfconfigdt.get(i)).getId()); ph.put("jobName", "" + ((JobPropertyBean) wfconfigdt.get(i)).getName()); ph.put("type", "oport"); ph.put("typeID", "" + ptmpo.getId()); ph.put("name", key); ph.put("value", "" + ptmpo.getData().get(key)); ph.put("label", label); ph.put("desc", "" + ptmpo.getDesc().get(key)); ph.put("gridtype", gridtype); eparam.add(ph); } } } //JobPropertyBean jobprop = (JobPropertyBean) wfconfigdt.get(i); /* System.out.println(" job getName "+ jobprop.getName()); System.out.println(" job getTxt "+ jobprop.getTxt()); System.out.println(" job getDesc "+ jobprop.getDesc()); System.out.println(" job getDesc0 "+ jobprop.getDesc0()); System.out.println(" job getExe "+ jobprop.getExe()); System.out.println(" job getExeDisabled "+ jobprop.getExeDisabled()); System.out.println(" job getId "+ jobprop.getId()); System.out.println(" job getInherited "+ jobprop.getInherited()); System.out.println(" job getLabel "+ jobprop.getLabel());*/ if (((String) jobprop.getExe().get("jobistype")).equals("workflow")) {//jobistype=workflow // ha beagyazott System.out.println(" ----embedded job start - getName:" + jobprop.getName()); Vector ep = getEConfParam(pUser, (String) jobprop.getExe().get("iworkflow"), ps); if (ep != null) { for (int ie = 0; ie < ep.size(); ie++) { eparam.add(ep.get(ie)); } } System.out.println(" ----embedded job end - job getName:" + jobprop.getName()); } else { Set keys = jobprop.getLabel().keySet(); Iterator it = keys.iterator(); int isGridtype = -1; int isGrid = -1; int isResource = -1; int isjobmanager = -1; HashMap resconf = new HashMap(); while (it.hasNext()) { String key = (String) it.next(); String label = (String) jobprop.getLabel().get(key); String inh = (String) jobprop.getInherited().get(key); if (!(label.equals("") || label.equals("null")) && (inh.equals("---") || inh.equals("null"))) { Hashtable ph = new Hashtable(); ph.put("wfID", pWorkflow); ph.put("jobID", "" + ((JobPropertyBean) wfconfigdt.get(i)).getId()); ph.put("jobName", "" + ((JobPropertyBean) wfconfigdt.get(i)).getName()); ph.put("type", "exe"); ph.put("typeID", "" + jobprop.getId()); ph.put("name", key); ph.put("value", "" + jobprop.getExe().get(key)); ph.put("label", label); ph.put("desc", "" + jobprop.getDesc0().get(key)); ph.put("gridtype", gridtype); if (key.equals("binary")) { try { ph.put("storageID", PortalCacheService.getInstance().getUser(pUser) .getWorkflow(pWorkflow).getStorageID()); ph.put("userID", pUser); ph.put("portalID", PropertyLoader.getInstance().getProperty("service.url")); } catch (Exception e) { e.printStackTrace(); } } else if (key.equals("gridtype")) { if (!jobprop.getExe().get("gridtype").equals(EDGI)) {//filter out edgi config Hashtable vGridTypes = new Hashtable(); Vector t = ConfigHandler.getGridMidlewares( (List<Middleware>) ps.getAttribute("resources", ps.APPLICATION_SCOPE)); for (int gt = 0; gt < t.size(); gt++) { if (!(t.get(gt).equals(GEMLCA) || t.get(gt).equals(EDGI))) {//filter out GEMLCA and EDGI vGridTypes.put("" + t.get(gt), "0"); } } ph.put("data", vGridTypes); resconf.put("gridtype", ph); } ph = null; } else if (key.equals("grid")) { try { if (!jobprop.getExe().get("gridtype").equals(EDGI)) {//filter out edgi config ph.put("data", ConfigHandler.getGroups( (List<Middleware>) ps.getAttribute("resources", ps.APPLICATION_SCOPE), (String) jobprop.getExe().get("gridtype"))); resconf.put("grid", ph); } ph = null; } catch (Exception e) { e.printStackTrace(); } } else if (key.equals("resource")) { try { ph.put("data", ConfigHandler.getResources( (List<Middleware>) ps.getAttribute("resources", ps.APPLICATION_SCOPE), (String) jobprop.getExe().get("gridtype"), (String) jobprop.getExe().get("grid"))); } catch (Exception e0) { ph.put("data", new Vector()); } if (!jobprop.getExe().get("gridtype").equals(EDGI)) {//filter out edgi config resconf.put("resource", ph); } ph = null; } else if (key.equals("jobmanager")) { if (jobprop.getExe().get("gridtype").equals(GEMLCA)) { try { //gemlcaquery Vector v = GemlcaCacheService.getInstance().getGLCList( "" + PropertyLoader.getInstance().getProperty("portal.prefix.dir") + "/users/" + pUser + "/x509up." + jobprop.getExe().get("grid"), "" + jobprop.getExe().get("grid"), 0, 0); //gemlca sites Vector vgsites = GemlcaCacheService.getInstance().getGLCsites( "" + jobprop.getExe().get("grid"), "" + jobprop.getExe().get("resource")); ph.put("data", vgsites); } catch (Exception e0) { ph.put("data", new Vector()); } } else { try { if (SshResourceService.getI().isGroupforSshKey(ps, "" + jobprop.getExe().get("gridtype"))) { ph.put("data", SshResourceService.getI().getUserforHost(pUser, "" + jobprop.getExe().get("grid"))); } else { ph.put("data", ConfigHandler.getServices( (List<Middleware>) ps.getAttribute("resources", ps.APPLICATION_SCOPE), (String) jobprop.getExe().get("gridtype"), (String) jobprop.getExe().get("grid"), (String) jobprop.getExe().get("resource"))); } } catch (Exception e0) { ph.put("data", new Vector()); } } if (!jobprop.getExe().get("gridtype").equals(EDGI)) {//filter out edgi config resconf.put("jobmanager", ph); } ph = null; } else if ((key.equals("params")) && (jobprop.getExe().get("gridtype").equals(GEMLCA))) { // gemlca parameterek Vector vgparams = GemlcaCacheService.getInstance().getGLCparams( "" + jobprop.getExe().get("grid"), "" + jobprop.getExe().get("resource")); String ggparams = ""; if (ph.get("value") == null) {// default values for (int x = 0; x < vgparams.size(); x++) { ((HashMap) vgparams.get(x)).put("svalue", "" + ((HashMap) vgparams.get(x)).get("value")); ((HashMap) vgparams.get(x)).put("nbr", "" + x); ggparams += ((HashMap) vgparams.get(x)).get("value") + " "; } ph.put("value", ggparams.trim()); } else { String[] gsparams = ((String) ph.get("value")).split(" "); if (gsparams.length == vgparams.size()) { for (int x = 0; x < vgparams.size(); x++) { ((HashMap) vgparams.get(x)).put("svalue", "" + gsparams[x]); ((HashMap) vgparams.get(x)).put("nbr", "" + x); } } else {// default values for (int x = 0; x < vgparams.size(); x++) { ((HashMap) vgparams.get(x)).put("svalue", "" + ((HashMap) vgparams.get(x)).get("value")); ((HashMap) vgparams.get(x)).put("nbr", "" + x); ggparams += ((HashMap) vgparams.get(x)).get("value") + " "; } ph.put("value", ggparams.trim()); } } ph.put("gparams", vgparams); } //filter out edgi config if (jobprop.getExe().get("gridtype").equals(EDGI)) { } if (ph != null) { eparam.add(ph); } } } if (resconf.size() > 0) {// sort if (resconf.containsKey("gridtype")) { isGridtype = eparam.size(); eparam.add(resconf.get("gridtype")); } if (resconf.containsKey("grid")) { isGrid = eparam.size(); eparam.add(resconf.get("grid")); } if (resconf.containsKey("resource")) { ((Hashtable) resconf.get("resource")).put("grid", "" + jobprop.getExe().get("grid")); isResource = eparam.size(); eparam.add(resconf.get("resource")); } if (resconf.containsKey("jobmanager")) { ((Hashtable) resconf.get("jobmanager")).put("grid", "" + jobprop.getExe().get("grid")); isjobmanager = eparam.size(); eparam.add(resconf.get("jobmanager")); } resconf.clear(); } //dynamic management of grid, resource, jobmanager //i= next parameter if (isGridtype > -1) { if (isGrid > -1) { ((Hashtable) eparam.get(isGrid)).put("egridt", isGridtype); ((Hashtable) eparam.get(isGridtype)).put("i", isGrid); } if (isResource > -1) { ((Hashtable) eparam.get(isResource)).put("egridt", isGridtype); } if (isjobmanager > -1) { ((Hashtable) eparam.get(isjobmanager)).put("egridt", isGridtype); } } if (isGrid > -1) { if (isResource > -1) { ((Hashtable) eparam.get(isResource)).put("egrid", isGrid); ((Hashtable) eparam.get(isGrid)).put("i", isResource); } if (isjobmanager > -1) { ((Hashtable) eparam.get(isjobmanager)).put("egrid", isGrid); } } if (isResource > -1) { if (isjobmanager > -1) { ((Hashtable) eparam.get(isjobmanager)).put("eresource", isResource); ((Hashtable) eparam.get(isResource)).put("i", "" + isjobmanager); } } } } //} // catch(Exception e){e.printStackTrace();} return eparam; }