From: <mwl...@us...> - 2007-07-20 18:19:59
|
Revision: 426 http://svn.sourceforge.net/cishell/?rev=426&view=rev Author: mwlinnem Date: 2007-07-20 11:19:57 -0700 (Fri, 20 Jul 2007) Log Message: ----------- Initial import. Added Paths: ----------- trunk/testing/META-INF/ trunk/testing/META-INF/MANIFEST.MF trunk/testing/OSGI-INF/ trunk/testing/OSGI-INF/algorithm.properties trunk/testing/OSGI-INF/component.xml trunk/testing/OSGI-INF/l10n/ trunk/testing/OSGI-INF/l10n/bundle_en.properties trunk/testing/OSGI-INF/metatype/ trunk/testing/OSGI-INF/metatype/METADATA.XML trunk/testing/build.properties trunk/testing/src/ trunk/testing/src/org/ trunk/testing/src/org/cishell/ trunk/testing/src/org/cishell/testing/ trunk/testing/src/org/cishell/testing/convertertester/ trunk/testing/src/org/cishell/testing/convertertester/algorithm/ trunk/testing/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java trunk/testing/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java Added: trunk/testing/META-INF/MANIFEST.MF =================================================================== --- trunk/testing/META-INF/MANIFEST.MF (rev 0) +++ trunk/testing/META-INF/MANIFEST.MF 2007-07-20 18:19:57 UTC (rev 426) @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: ConverterTester Algorithm +Bundle-SymbolicName: org.cishell.testing.convertertester.algorithm +Bundle-Version: 0.0.1 +Bundle-ClassPath: . +Bundle-Localization: plugin +Import-Package: org.cishell.framework, + org.cishell.framework.algorithm, + org.cishell.framework.data, + org.cishell.testing.convertertester.core.tester, + org.osgi.framework;version="1.3.0", + org.osgi.service.component;version="1.0.0", + org.osgi.service.log;version="1.3.0", + org.osgi.service.metatype;version="1.1.0", + org.osgi.service.prefs;version="1.1.0" +X-AutoStart: true +Service-Component: OSGI-INF/component.xml Added: trunk/testing/OSGI-INF/algorithm.properties =================================================================== --- trunk/testing/OSGI-INF/algorithm.properties (rev 0) +++ trunk/testing/OSGI-INF/algorithm.properties 2007-07-20 18:19:57 UTC (rev 426) @@ -0,0 +1,7 @@ +#menu_path=Visualization/SubMenu/additions +label=My Algorithm +description=This algorithm does this and this... +in_data=file:mime/type or java.lang.ClassName or null +out_data=file:mime/type or java.lang.ClassName or null +service.pid=org.my.algorithm.MyAlgorithm +remoteable=false Added: trunk/testing/OSGI-INF/component.xml =================================================================== --- trunk/testing/OSGI-INF/component.xml (rev 0) +++ trunk/testing/OSGI-INF/component.xml 2007-07-20 18:19:57 UTC (rev 426) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component name="org.my.algorithm.MyAlgorithm.component" immediate="false"> + <implementation class="org.cishell.testing.convertertester.algorithm"/> + <properties entry="OSGI-INF/algorithm.properties"/> + <reference name="LOG" interface="org.osgi.service.log.LogService"/> + <reference name="MTS" interface="org.osgi.service.metatype.MetaTypeService"/> + + <service> + <provide interface= + "org.cishell.framework.algorithm.AlgorithmFactory"/> + </service> +</component> \ No newline at end of file Added: trunk/testing/OSGI-INF/l10n/bundle_en.properties =================================================================== --- trunk/testing/OSGI-INF/l10n/bundle_en.properties (rev 0) +++ trunk/testing/OSGI-INF/l10n/bundle_en.properties 2007-07-20 18:19:57 UTC (rev 426) @@ -0,0 +1,7 @@ +#Localization variables for OSGI-INF/metatatype/METADATA.XML +# +#Samples: +#input=Input +#desc=Enter an integer (that will be converted to a string) +#name=Input->String +#name_desc=Converts inputted integer to string Added: trunk/testing/OSGI-INF/metatype/METADATA.XML =================================================================== --- trunk/testing/OSGI-INF/metatype/METADATA.XML (rev 0) +++ trunk/testing/OSGI-INF/metatype/METADATA.XML 2007-07-20 18:19:57 UTC (rev 426) @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0"> + <OCD name="My Algorithm" id="org.my.algorithm.MyAlgorithm.OCD" + description="This algorithm does this and this... "> + </OCD> + <Designate pid="org.my.algorithm.MyAlgorithm"> + <Object ocdref="org.my.algorithm.MyAlgorithm.OCD" /> + </Designate> +</metatype:MetaData> Added: trunk/testing/build.properties =================================================================== --- trunk/testing/build.properties (rev 0) +++ trunk/testing/build.properties 2007-07-20 18:19:57 UTC (rev 426) @@ -0,0 +1,5 @@ +source.. = src/ +output.. = build/ +bin.includes = META-INF/,\ + .,\ + OSGI-INF/ Added: trunk/testing/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java =================================================================== --- trunk/testing/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java (rev 0) +++ trunk/testing/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java 2007-07-20 18:19:57 UTC (rev 426) @@ -0,0 +1,29 @@ +package org.cishell.testing.convertertester.algorithm; + +import java.util.Dictionary; + +import org.cishell.framework.CIShellContext; +import org.cishell.framework.algorithm.Algorithm; +import org.cishell.framework.data.Data; +import org.cishell.testing.convertertester.core.tester.ConverterTester; +import org.osgi.framework.BundleContext; + +public class ConverterTesterAlgorithm implements Algorithm { + Data[] data; + Dictionary parameters; + CIShellContext context; + ConverterTester tester; + + public ConverterTesterAlgorithm(Data[] data, Dictionary parameters, + CIShellContext csContext, BundleContext bContext ) { + this.data = data; + this.parameters = parameters; + this.context = csContext; + + this.tester = new ConverterTester(bContext, csContext); + } + + public Data[] execute() { + return null; + } +} \ No newline at end of file Added: trunk/testing/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java =================================================================== --- trunk/testing/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java (rev 0) +++ trunk/testing/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java 2007-07-20 18:19:57 UTC (rev 426) @@ -0,0 +1,37 @@ +package org.cishell.testing.convertertester.algorithm; + +import java.util.Dictionary; + +import org.cishell.framework.CIShellContext; +import org.cishell.framework.algorithm.Algorithm; +import org.cishell.framework.algorithm.AlgorithmFactory; +import org.cishell.framework.data.Data; +import org.osgi.framework.BundleContext; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.metatype.MetaTypeProvider; +import org.osgi.service.metatype.MetaTypeService; + + +public class ConverterTesterAlgorithmFactory implements AlgorithmFactory { + private MetaTypeProvider provider; + private BundleContext bContext; + + protected void activate(ComponentContext ctxt) { + //You may delete all references to metatype service if + //your algorithm does not require parameters and return + //null in the createParameters() method + MetaTypeService mts = (MetaTypeService)ctxt.locateService("MTS"); + this.bContext = ctxt.getBundleContext(); + provider = mts.getMetaTypeInformation(this.bContext.getBundle()); + } + protected void deactivate(ComponentContext ctxt) { + provider = null; + } + + public Algorithm createAlgorithm(Data[] data, Dictionary parameters, CIShellContext context) { + return new ConverterTesterAlgorithm(data, parameters, context, bContext); + } + public MetaTypeProvider createParameters(Data[] data) { + return provider; + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |