Permalink
Browse files

Remove xmlcalabash module. It replaced by xar module that can be

installed from central xars repo.
  • Loading branch information...
1 parent 8ed0246 commit 68e432a7ce0cf85ef3b35235ff977f087091184a @shabanovd shabanovd committed Jan 30, 2014
View
@@ -865,7 +865,6 @@
<module uri="http://exist-db.org/xquery/versioning/svn" class="org.exist.versioning.svn.xquery.SVNModule" />
<module uri="http://exist-db.org/xquery/xmldiff" class="org.exist.xquery.modules.xmldiff.XmlDiffModule" />
<module uri="http://exist-db.org/xquery/xmpp" class="org.exist.xquery.modules.xmpp.XMPPModule" />
- <module uri="http://xmlcalabash.com" class="org.exist.xquery.modules.xmlcalabash.XMLCalabashModule" />
-->
<!--
@@ -35,10 +35,6 @@
</and>
</condition>
- <condition property="libs.available.calabash">
- <available file="${modules.lib}/calabash.jar"/>
- </condition>
-
<condition property="include.module.oracle_ext">
<and>
<istrue value="${include.module.oracle}"/>
@@ -130,23 +126,6 @@
</target>
<!--
- Special targets for xmlcalabash module
- -->
- <target name="prepare-xmlcalabash"
- unless="libs.available.calabash" if="${include.module.xmlcalabash}" >
- <echo message="------------------------------------------------------"/>
- <echo message="Downloading libraries required by the xmlcalabash module"/>
- <echo message="------------------------------------------------------"/>
- <echo message="Calabash: ${libs.available.calabash}"/>
- <fetch classpathref="classpath.core" dest="${modules.lib}"
- url="${include.module.xmlcalabash.url}">
- <patternset>
- <include name="**/calabash.jar"/>
- </patternset>
- </fetch>
- </target>
-
- <!--
Special targets for simpleql module
-->
<uptodate property="parser.uptodate" srcfile="${src}/org/exist/xquery/modules/simpleql/SimpleQLParser.g"
@@ -243,7 +222,7 @@
<ivy:retrieve xmlns:ivy="antlib:org.apache.ivy.ant" sync="false"/>
</target>
- <target name="prepare" depends="prepare-ivy,prepare-xslfo,prepare-simpleql,prepare-jfreechart,prepare-memcached,prepare-xmpp,prepare-xmlcalabash,prepare-expathrepo,prepare-cqlparser">
+ <target name="prepare" depends="prepare-ivy,prepare-xslfo,prepare-simpleql,prepare-jfreechart,prepare-memcached,prepare-xmpp,prepare-expathrepo,prepare-cqlparser">
<mkdir dir="${classes}"/>
</target>
@@ -286,7 +265,6 @@
<exclude name="org/exist/xquery/modules/xmldiff/**" unless="${include.module.xmldiff}"/>
<exclude name="org/exist/xquery/modules/xmpp/**" unless="${include.module.xmpp}"/>
<exclude name="org/exist/xquery/modules/xslfo/**" unless="${include.module.xslfo}"/>
- <exclude name="org/exist/xquery/modules/xmlcalabash/**" unless="${include.module.xmlcalabash}"/>
<exclude name="org/exist/xquery/modules/expathrepo/**" unless="${include.module.expathrepo}"/>
<exclude name="org/exist/xquery/modules/process/**" unless="${include.module.process}"/>
<exclude name="org/exist/xquery/modules/persistentlogin/**" unless="${include.module.persistentlogin}"/>
@@ -311,8 +289,5 @@
</target>
<target name="clean-all">
- <delete file="${modules.lib}/calabash.jar" failonerror="false"/>
</target>
-
-
</project>
@@ -1,112 +0,0 @@
-package org.exist.xquery.modules.xmlcalabash;
-
-import org.apache.commons.io.output.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.io.StringReader;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.apache.log4j.Logger;
-import org.exist.Namespaces;
-import org.exist.dom.QName;
-import org.exist.memtree.DocumentImpl;
-import org.exist.memtree.SAXAdapter;
-import org.exist.xquery.BasicFunction;
-import org.exist.xquery.Cardinality;
-import org.exist.xquery.FunctionSignature;
-import org.exist.xquery.XPathException;
-import org.exist.xquery.XQueryContext;
-import org.exist.xquery.value.FunctionParameterSequenceType;
-import org.exist.xquery.value.FunctionReturnSequenceType;
-import org.exist.xquery.value.Sequence;
-import org.exist.xquery.value.SequenceType;
-import org.exist.xquery.value.Type;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-
-import com.xmlcalabash.core.XProcRuntime;
-
-public class ProcessFunction extends BasicFunction {
-
- @SuppressWarnings("unused")
- private final static Logger logger = Logger.getLogger(ProcessFunction.class);
-
- private XProcRuntime runtime = null;
-
- String outputResult;
-
- public final static FunctionSignature signature =
- new FunctionSignature(
- new QName("process", XMLCalabashModule.NAMESPACE_URI, XMLCalabashModule.PREFIX),
- "Function which invokes xmlcalabash XProc processor.",
- new SequenceType[] {
- new FunctionParameterSequenceType("pipeline", Type.STRING, Cardinality.EXACTLY_ONE, "XProc Pipeline"),
- new FunctionParameterSequenceType("output", Type.STRING, Cardinality.EXACTLY_ONE, "Output result")
- },
- new FunctionReturnSequenceType(Type.ITEM, Cardinality.ZERO_OR_ONE, "return type"));
-
- public ProcessFunction(XQueryContext context) {
- super(context, signature);
- }
-
- public Sequence eval(Sequence[] args, Sequence contextSequence)
- throws XPathException {
-
- if (args[0].isEmpty()) {
- return Sequence.EMPTY_SEQUENCE;
- }
-
- String pipelineURI = args[0].getStringValue();
- String outputURI = args[1].getStringValue();
-
- try {
-
- String[] calabash_args = {"-oresult="+outputURI,pipelineURI};
-
- PrintStream stdout = System.out;
-
- com.xmlcalabash.drivers.Main main = new com.xmlcalabash.drivers.Main();
-
- ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
- System.setOut(new PrintStream(byteStream, true));
- main.run(calabash_args);
- outputResult = byteStream.toString();
- System.setOut(stdout);
-
- } catch (Exception e) {
- System.err.println(e);
- }
-
- StringReader reader = new StringReader(outputResult);
- try {
- SAXParserFactory factory = SAXParserFactory.newInstance();
- factory.setNamespaceAware(true);
- InputSource src = new InputSource(reader);
-
- XMLReader xr = null;
-
- if (xr == null) {
- SAXParser parser = factory.newSAXParser();
- xr = parser.getXMLReader();
- }
-
- SAXAdapter adapter = new SAXAdapter(context);
- xr.setContentHandler(adapter);
- xr.setProperty(Namespaces.SAX_LEXICAL_HANDLER, adapter);
- xr.parse(src);
-
- return (DocumentImpl) adapter.getDocument();
- } catch (ParserConfigurationException e) {
- throw new XPathException(this, "Error while constructing XML parser: " + e.getMessage(), e);
- } catch (SAXException e) {
- throw new XPathException(this, "Error while parsing XML: " + e.getMessage(), e);
- } catch (IOException e) {
- throw new XPathException(this, "Error while parsing XML: " + e.getMessage(), e);
- }
-
- }
-}
@@ -1,39 +0,0 @@
-package org.exist.xquery.modules.xmlcalabash;
-
-import java.util.List;
-import java.util.Map;
-import org.exist.xquery.AbstractInternalModule;
-import org.exist.xquery.FunctionDef;
-
-public class XMLCalabashModule extends AbstractInternalModule {
-
- public final static String NAMESPACE_URI = "http://xmlcalabash.com";
- public final static String PREFIX = "xmlcalabash";
- public final static String INCLUSION_DATE = "2010-27-04";
- public final static String RELEASED_IN_VERSION = "eXist-1.5";
-
- private final static FunctionDef[] functions = {
- new FunctionDef(ProcessFunction.signature, ProcessFunction.class)
- };
-
- public XMLCalabashModule(Map<String, List<? extends Object>> parameters) {
- super(functions, parameters);
- }
-
- public String getNamespaceURI() {
- return NAMESPACE_URI;
- }
-
- public String getDefaultPrefix() {
- return PREFIX;
- }
-
- public String getDescription() {
- return "A module for performing XML Calabash XProc processing";
- }
-
- public String getReleaseVersion() {
- return RELEASED_IN_VERSION;
- }
-
-}
@@ -1,64 +0,0 @@
------
-Build
------
-
-This module relies on the presence of the following jar files in your $EXIST_HOME/extensions/modules/lib folder:
-
- calabash.jar
-
-If you are building from source then the module build process will try and download
-these files for you if you enable the module.
-
-Please read XML Calabash documentation for information on other dependencies related to using specific
-optional XProc steps.
-
-To build set in local.build.properties:
-
- include.module.xmlcalabash = true
-
-To use xmlcalabash uncomment in conf.xml
-
- <module class="org.exist.xquery.modules.xmlcalabash.XMLCalabashModule"
- uri="http://xmlcalabash.com" />
-
-This has been tested with XML Calabash v1.0.9
-
-
------
-Usage
------
-
-upload an XProc pipeline somewhere into eXist (ex. /db/test/hello.xproc)
-
-<?xml version="1.0"?>
-<p:declare-step version="1.0" xmlns:p="http://www.w3.org/ns/xproc">
- <p:input port="source">
- <p:inline><doc>Helloworld</doc></p:inline>
- </p:input>
- <p:output port="result"/>
- <p:identity/>
-</p:declare-step>
-
-
-invoke using xmlcalabash:process (in sandbox for example)
-
-let $result := xmlcalabash:process("xmldb:exist:///db/test/hello.xproc","-")
-return
- $result
-
-
-------
-Status
-------
-
-Currently there are a few limitations with this extension
-
-* func signature will change soon to accept xml for pipeline, output, as well as specify input/output/parameter ports and options ... for now its primitive
-
-* p:xquery has no context with eXist ... this is a big limitation, but there are several ways around this
-
-* use xmldb:exist type URI
-
-* no documentation, will probably add to existing XProc area
-
-I wanted to 'throw over the wall' the draft version of this extension so I can get feedback now.

9 comments on commit 68e432a

Seems a bit strange to delete code from repo without providing where it went.

I see no location in public xar for calabash code

Member

shabanovd replied Feb 15, 2014

code itself here https://github.com/shabanovd/eXist-XMLCalabash and it can be installed by "Package Manager" at Dashboard

why the hell is this under your repo ? excuse my french, but its not on to move stuff like this ?

Member

shabanovd replied Feb 15, 2014

Because there is limitation for code that go under https://github.com/eXist-db/ ... nobody vote to move it there and at last why not? (this is open source and I can put in my git what ever I like to, any objections?)

of course you can have it in your repo, its open souce, I do take umbrage with you removing it from eXist ... there are better ways to doing this. I doubt you would like me randomly removing your code from eXist ... in the future communicate these kind of changes better.

Member

shabanovd replied Feb 15, 2014

I do understand you, but your last commit to that code was Jul 10, 2010. After that this code was maintain by @adamretter and @dizzzz because decisions made by core team with core core modifications. Last November I did start work to improve xmlcalabash integration with eXist. One of change was make to xmlcalabash itself ndw/xmlcalabash1#137 and because it got in conflict with your code @wolfgangmm & I agree to remove this code and it does not mean code was remove forever.

Now, "why it in my git?", because core team decide do not put everything to eXist-db git and keep it in private gits. Like @dizzzz did for example with his extension or @wolfgangmm 's eXide and etc.

"future communicate these kind of changes better" ... not sure what you mean here ... what can be better than current code review strategy?

If you want this module to be under eXist-db git and others will have to vote for that, I'll just be happy to do that.

Owner

adamretter replied Feb 16, 2014

it was unfortunate that in this particular instance, I had a few moments to work on code for Ari, but was frustrated by the change and missed the window of enhancing xmlcalabash thingie ... apologies for me getting shirty .. though in the future, I would recc considering sending out a short note before deleting or moving things. Though generally, I will make the assumption from here on out that code can/will change location.

Owner

dizzzz replied Feb 16, 2014

Please sign in to comment.