From: <hu...@us...> - 2006-10-11 19:42:40
|
Revision: 260 http://svn.sourceforge.net/cishell/?rev=260&view=rev Author: huangb Date: 2006-10-11 11:51:25 -0700 (Wed, 11 Oct 2006) Log Message: ----------- fixed a bug on windows where the '\' was getting deleted when a file is passed into the executable Modified Paths: -------------- trunk/templates/org.cishell.templates/META-INF/MANIFEST.MF trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java Modified: trunk/templates/org.cishell.templates/META-INF/MANIFEST.MF =================================================================== --- trunk/templates/org.cishell.templates/META-INF/MANIFEST.MF 2006-10-11 18:50:51 UTC (rev 259) +++ trunk/templates/org.cishell.templates/META-INF/MANIFEST.MF 2006-10-11 18:51:25 UTC (rev 260) @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: CIShell Template Code Provider -Bundle-SymbolicName: org.cishell.templates +Bundle-SymbolicName: org.cishell.templates;singleton:=true Bundle-Version: 0.1.0.qualifier Bundle-Localization: plugin X-AutoStart: true Modified: trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java =================================================================== --- trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java 2006-10-11 18:50:51 UTC (rev 259) +++ trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java 2006-10-11 18:51:25 UTC (rev 260) @@ -212,7 +212,16 @@ for (int i=0; i < data.length; i++) { String file = ((File) data[i].getData()).getAbsolutePath(); + + if (File.separatorChar == '\\') { + file = file.replace(File.separatorChar, '/'); + } + str = str.replaceAll("\\$\\{inFile\\["+i+"\\]\\}", file); + + if (File.separatorChar == '\\') { + str = str.replace('/',File.separatorChar); + } } for (Enumeration i=parameters.keys(); i.hasMoreElements(); ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2008-01-23 17:54:57
|
Revision: 601 http://cishell.svn.sourceforge.net/cishell/?rev=601&view=rev Author: bh2 Date: 2008-01-23 09:52:13 -0800 (Wed, 23 Jan 2008) Log Message: ----------- Added a fix to the cishell template code plugin to allow static executables to be called from java code. You now just need to instantiate the StaticExecutableAlgorithmFactory giving it the top level directory where the algorithm is and a BundleContext. If the alg is correctly laid out like other executable projects and is contained in the bundle of the given BundleContext, everything should work! Also bumped the version to 0.9.0. Modified Paths: -------------- trunk/templates/org.cishell.templates/META-INF/MANIFEST.MF trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java Modified: trunk/templates/org.cishell.templates/META-INF/MANIFEST.MF =================================================================== --- trunk/templates/org.cishell.templates/META-INF/MANIFEST.MF 2008-01-23 15:24:44 UTC (rev 600) +++ trunk/templates/org.cishell.templates/META-INF/MANIFEST.MF 2008-01-23 17:52:13 UTC (rev 601) @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: CIShell Template Code Provider Bundle-SymbolicName: org.cishell.templates;singleton:=true -Bundle-Version: 0.3.0 +Bundle-Version: 0.9.0 Bundle-Localization: plugin X-AutoStart: true Import-Package: org.cishell.framework, Modified: trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java =================================================================== --- trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java 2008-01-23 15:24:44 UTC (rev 600) +++ trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java 2008-01-23 17:52:13 UTC (rev 601) @@ -41,6 +41,13 @@ BundleContext bContext; String algName; MetaTypeProvider provider; + + public StaticExecutableAlgorithmFactory() {} + + public StaticExecutableAlgorithmFactory(String algName, BundleContext bContext) { + this.algName = algName; + this.bContext = bContext; + } protected void activate(ComponentContext ctxt) { bContext = ctxt.getBundleContext(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2008-03-25 15:15:21
|
Revision: 693 http://cishell.svn.sourceforge.net/cishell/?rev=693&view=rev Author: bh2 Date: 2008-03-25 08:13:37 -0700 (Tue, 25 Mar 2008) Log Message: ----------- updated to cishell 1.0 spec Modified Paths: -------------- trunk/templates/org.cishell.templates/META-INF/MANIFEST.MF trunk/templates/org.cishell.templates/src/org/cishell/templates/dataset/DatasetFactory.java trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java Modified: trunk/templates/org.cishell.templates/META-INF/MANIFEST.MF =================================================================== --- trunk/templates/org.cishell.templates/META-INF/MANIFEST.MF 2008-03-25 15:13:32 UTC (rev 692) +++ trunk/templates/org.cishell.templates/META-INF/MANIFEST.MF 2008-03-25 15:13:37 UTC (rev 693) @@ -2,13 +2,13 @@ Bundle-ManifestVersion: 2 Bundle-Name: CIShell Template Code Provider Bundle-SymbolicName: org.cishell.templates;singleton:=true -Bundle-Version: 0.9.0 +Bundle-Version: 1.0.0 Bundle-Localization: plugin X-AutoStart: true -Import-Package: org.cishell.framework, - org.cishell.framework.algorithm, - org.cishell.framework.data, - org.cishell.service.guibuilder, +Import-Package: org.cishell.framework;version="1.0.0", + org.cishell.framework.algorithm;version="1.0.0", + org.cishell.framework.data;version="1.0.0", + org.cishell.service.guibuilder;version="1.0.0", org.osgi.framework;version="1.3.0", org.osgi.service.component;version="1.0.0", org.osgi.service.log;version="1.3.0", Modified: trunk/templates/org.cishell.templates/src/org/cishell/templates/dataset/DatasetFactory.java =================================================================== --- trunk/templates/org.cishell.templates/src/org/cishell/templates/dataset/DatasetFactory.java 2008-03-25 15:13:32 UTC (rev 692) +++ trunk/templates/org.cishell.templates/src/org/cishell/templates/dataset/DatasetFactory.java 2008-03-25 15:13:37 UTC (rev 693) @@ -87,7 +87,7 @@ public Data[] execute() { try { Data data = new BasicData(getDataset(),format); - data.getMetaData().put(DataProperty.LABEL, label); + data.getMetadata().put(DataProperty.LABEL, label); return new Data[]{data}; } catch (IOException e) { Modified: trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java =================================================================== --- trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java 2008-03-25 15:13:32 UTC (rev 692) +++ trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java 2008-03-25 15:13:37 UTC (rev 693) @@ -124,7 +124,7 @@ String label = props.getProperty( "outFile[" + i + "].label", f.getName()); - data[i].getMetaData().put(DataProperty.LABEL, label); + data[i].getMetadata().put(DataProperty.LABEL, label); String type = props.getProperty("outFile[" + i + "].type", DataProperty.OTHER_TYPE); @@ -137,13 +137,15 @@ type = DataProperty.TREE_TYPE; } else if (type.equalsIgnoreCase(DataProperty.TEXT_TYPE)) { type = DataProperty.TEXT_TYPE; - } else if (type.equalsIgnoreCase(DataProperty.GRACE_TYPE)) { - type = DataProperty.GRACE_TYPE; - } else { + } else if (type.equalsIgnoreCase(DataProperty.PLOT_TYPE)) { + type = DataProperty.PLOT_TYPE; + } else if (type.equalsIgnoreCase(DataProperty.TABLE_TYPE)) { + type = DataProperty.TABLE_TYPE; + }else { type = DataProperty.OTHER_TYPE; } - data[i].getMetaData().put(DataProperty.TYPE, type); + data[i].getMetadata().put(DataProperty.TYPE, type); } } else { Iterator iter = nameToFileMap.values().iterator(); @@ -151,7 +153,7 @@ File f = (File) iter.next(); data[i] = new BasicData(f, "file:text/plain"); - data[i].getMetaData().put(DataProperty.LABEL, f.getName()); + data[i].getMetadata().put(DataProperty.LABEL, f.getName()); i++; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2008-03-27 19:06:44
|
Revision: 732 http://cishell.svn.sourceforge.net/cishell/?rev=732&view=rev Author: bh2 Date: 2008-03-27 12:06:37 -0700 (Thu, 27 Mar 2008) Log Message: ----------- stopped using guibuilder in Static Executable Runner. now using just the logger and throwing AEEs. Modified Paths: -------------- trunk/templates/org.cishell.templates/META-INF/MANIFEST.MF trunk/templates/org.cishell.templates/src/org/cishell/templates/dataset/DatasetFactory.java trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java Modified: trunk/templates/org.cishell.templates/META-INF/MANIFEST.MF =================================================================== --- trunk/templates/org.cishell.templates/META-INF/MANIFEST.MF 2008-03-27 18:59:44 UTC (rev 731) +++ trunk/templates/org.cishell.templates/META-INF/MANIFEST.MF 2008-03-27 19:06:37 UTC (rev 732) @@ -7,7 +7,6 @@ Import-Package: org.cishell.framework;version="1.0.0", org.cishell.framework.algorithm;version="1.0.0", org.cishell.framework.data;version="1.0.0", - org.cishell.service.guibuilder;version="1.0.0", org.osgi.framework;version="1.3.0", org.osgi.service.component;version="1.0.0", org.osgi.service.log;version="1.3.0", Modified: trunk/templates/org.cishell.templates/src/org/cishell/templates/dataset/DatasetFactory.java =================================================================== --- trunk/templates/org.cishell.templates/src/org/cishell/templates/dataset/DatasetFactory.java 2008-03-27 18:59:44 UTC (rev 731) +++ trunk/templates/org.cishell.templates/src/org/cishell/templates/dataset/DatasetFactory.java 2008-03-27 19:06:37 UTC (rev 732) @@ -24,6 +24,7 @@ import org.cishell.framework.CIShellContext; import org.cishell.framework.algorithm.Algorithm; +import org.cishell.framework.algorithm.AlgorithmExecutionException; import org.cishell.framework.algorithm.AlgorithmFactory; import org.cishell.framework.data.BasicData; import org.cishell.framework.data.Data; @@ -84,15 +85,14 @@ this.ciContext = ciContext; } - public Data[] execute() { + public Data[] execute() throws AlgorithmExecutionException { try { Data data = new BasicData(getDataset(),format); data.getMetadata().put(DataProperty.LABEL, label); return new Data[]{data}; } catch (IOException e) { - e.printStackTrace(); - throw new RuntimeException(e); + throw new AlgorithmExecutionException(e); } } } Modified: trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java =================================================================== --- trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java 2008-03-27 18:59:44 UTC (rev 731) +++ trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java 2008-03-27 19:06:37 UTC (rev 732) @@ -36,7 +36,6 @@ import org.cishell.framework.data.BasicData; import org.cishell.framework.data.Data; import org.cishell.framework.data.DataProperty; -import org.cishell.service.guibuilder.GUIBuilderService; import org.cishell.templates.Activator; import org.osgi.framework.BundleContext; import org.osgi.service.log.LogService; @@ -47,7 +46,6 @@ */ public class StaticExecutableRunner implements Algorithm { protected final String tempDir; - protected final GUIBuilderService guiBuilder; protected final Data[] data; protected Dictionary parameters; protected Properties props; @@ -69,8 +67,6 @@ if (parameters == null) parameters = new Hashtable(); - guiBuilder = (GUIBuilderService) ciContext - .getService(GUIBuilderService.class.getName()); tempDir = makeTempDirectory(); } @@ -227,12 +223,9 @@ // if the process failed unexpectedly... if (process.exitValue() != 0 && !killedOnPurpose) { - // display the error message using gui builder - guiBuilder.showError( - "Algorithm Could Not Finish Execution", - "Sorry, the algorithm could not finish execution.", - "Please check the console window for the error log messages and report the bug.\n" - + "Thank you."); + throw new AlgorithmExecutionException( + "Algorithm exited unexpectedly (exit value: "+process.exitValue()+ + "). Please check the console window for any error messages."); } // get the files output from the process This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |