Code Monkey home page Code Monkey logo

core's Introduction

JiBX is a tool for binding XML data to Java objects.

This is the top-level project. The sub-projects are:

- core - main jibx code
- jibx-parent - maven shared project settings
- plugins - Maven and eclipse plugins
- web-services jibx/ws
- schema-library - Pre-built JiBX bindings

To check out a sub-project, follow the github instructions.
To check out all the projects, check out this project and use the initsubmodules script:

git clone https://github.com/jibx/jibx
cd jibx
bin/git/initsubmodules.sh

NOTE: If you want readonly access, replace line 1 with this: git clone -b readonly git://github.com/jibx/jibx.git

-- If you make a change to a submodule, use this script to sync the main(jibx) directory:

bin/git/commitpush.sh "Commiting a submodule"

To build all the projects, do the following:

cd jibx-parent
mvn install
cd ../core/build
ant -f build-ivy.xml
ant
cd ..
mv jibx_*.zip lib/
mvn install

cd ../plugins/maven-plugin/
mvn install

cd ../../schema-library
mvn install

Developers:

To release to maven central, you will need to sign up with nexus. Just follow these instructions:

https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide

For jibx, you will need to make some changes to your ~/.m2/settings.xml file:

  1. Your sourceforge vcs user name (You should probably also set your o/s for auto-ssh sign in): 
    <servers> 
    ...
        <server>
            <id>jibx.git.sourceforge.net</id>
            <username>doncorley</username>
            <password>***enter-your-password-here***</password>
        </server>
        <server>
            <id>jibx.svn.sourceforge.net</id>
            <username>doncorley</username>
            <password>***enter-your-password-here***</password>
        </server>
        <server>
            <id>jibx.cvs.sourceforge.net</id>
            <username>doncorley</username>
            <password>***enter-your-password-here***</password>
        </server>
    </servers> 
  2. Your nexus account information:
    <server>
      <id>sonatype-nexus-snapshots</id>
      <username>doncorley</username>
      <password>***enter-your-password-here***</password>
    </server>
    <server>
      <id>sonatype-nexus-staging</id>
      <username>doncorley</username>
      <password>***enter-your-password-here***</password>
    </server>
  3. Your sourceforge user and password for documentation uploads
    <server>
      <id>sourceforge.net</id>
      <username>doncorley</username>
      <password>***enter-your-password-here***</password>
      <filePermissions>775</filePermissions>
      <directoryPermissions>775</directoryPermissions>
    </server>
  4. Your root directory and gpg passphrase:
  <profiles>
    <profile>
      <id>global-properties</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <gpg.passphrase>**Your passphrase**</gpg.passphrase>
        <workspace>/home/don/workspace-jibx/jibx</workspace>
        <jibx-root>/home/don/workspace-jibx/jibx</jibx-root>
        <sourceforge-user>doncorley</sourceforge-user>
      </properties>
    </profile>
  </profiles>
  
----------------------------------------------------------------------
# A release is similar to a install, follow these steps:
# Make sure all dependencies are up-to-date
cd ../core
rm lib/*.jar
rm lib/*.zip
cd build
# Edit the build.xml and set the correct release version
ant -f build-ivy.xml
ant
cd ..
rm lib/*.jar
rm lib/*.zip
cd build
# Edit the build.xml and set the correct release version
ant -f build-ivy.xml
ant
cd ..
mv jibx*.zip lib/
# Edit build.xml and set the next snapshot version
############## Upload core/lib/jibx_x_x_x.zip to sourceforge.
cd ..
# --NOTE---- Fix the obr location(s) ------------------
# Edit the jibx-parent file and change any <jibx-xxx> properties to point to the next release version
# Change any external parent references to the release version
# Push all changes to the git repository
cd jibx-parent
mvn release:prepare
mvn release:perform
# Edit the jibx-parent file and change any <jibx-xxx> properties to point to the next snapshot version
cd ../core
mvn versions:update-parent
mvn versions:commit
git commit -am "Preparing for release"
git push
mvn release:prepare
mvn release:perform
# Now you should remove the fake source directories that were added so maven could upload jibx source
rm -fr build/maven/jibx-run/src
rm -fr build/maven/jibx-tools/src
rm -fr build/maven/jibx-bind/src
rm -fr build/maven/jibx-schema/src
rm -fr build/maven/jibx-extras/src
# Wait for release to sync
# Now for the plugin
cd ../plugins/maven-plugin
mvn versions:update-parent
mvn versions:use-releases
mvn versions:commit
git commit -am "Preparing for release"
git push
mvn release:prepare
mvn release:perform
cd target/checkout/jibx-maven-plugin
#ssh -t doncorley,[email protected] create
mvn site site:deploy
#-----
#ssh doncorley,[email protected]
#ssh -t doncorley,[email protected] create
#cd /home/project-web/jibx/htdocs/
#rm -fr jibx-maven-plugin
#cp -r jibx-maven-plugin jibx-maven-plugin
#---- Note: Add Externals here
cd ../../../../../../external
mvn versions:update-parent
mvn versions:use-releases
mvn versions:commit
git commit -am "Preparing for release"
git push
mvn release:prepare
mvn release:perform
#----
cd ../schema-library
# Edit archetype pom file to reflect the release version
mvn versions:update-parent
mvn versions:commit
git commit -am "Preparing for release"
git push
mvn release:prepare
mvn release:perform
cd target/checkout/schema-utilities/site
mvn site site:deploy
rm org.opentravel/_2010B/opentravel-schema/schema/src/main/schema/ota-schema/*.xsd
rm org.opentravel/_2011B/opentravel-schema/schema/src/main/schema/ota-schema/*.xsd
rm org.opentravel/_2011A/opentravel-schema/schema/src/main/schema/ota-schema/*.xsd
#---- Note: Add Artifacts here
cd ../artifacts
mvn versions:update-parent
mvn versions:use-releases
mvn versions:commit
git commit -am "Preparing for release"
git push
mvn release:prepare
mvn release:perform

----------------------------------------------------------------------

To deploy a snapshot, just enter your project directory and type:
mvn deploy

Don

core's People

Contributors

archiecobbs avatar doncorley avatar dsosnoski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

core's Issues

Where are your XSDs?

I find it more than a little ironic that this project ships no XSDs for any of its config file formats except the codegen-customizations.xsd and that one is malformed. Apparently nobody has checked the README in the last 5 years either. Maybe some EYODF is required.
Before I waste a lot of time integrating JiBX could someone please advise if this project is in fact dead.

Problem with codegen

Hello,

Sorry if i'm are not clear, i'm french and i don't write in English every day :-).

On jira, there was a bug JIBX-497 which text was : "Correction for JIBX-434 not merged in JiBX 1.2.5".
A correction was done for version 1.2.4.3 of jibx. The code modification is here : 7699924.
This correction has not been reported in version 1.2.5 and following versions.

The problem is : when having not Ascii characters like "é", the generated source can not be compiled.

Could it be possible to merge the correction in version 1.3.x ?

Thanks a lot,

Christophe ROBINE.

Support for Java string Unicode supplementary plane codepoints incomplete

In our application we are using the jibx 1.4.2 marshalling API in the following manner (error handling omitted for brevity):

final IBindingFactory factory = BindingDirectory.getFactory(SomeClass.class);
final IMarshallingContext mctx = factory.createMarshallingContext();
mctx.setIndent(4); // pretty print
mctx.startDocument("UTF-8", null, new FileOutputStream(settingsFile));
mctx.marshalDocument(settings);

When attempting to serialize a structure SomeClass using a value-style="attribute" for String field which contains a character belonging to the Unicode supplementary plane such as "\ud83d\udc27" this causes jibx to throw an exception:

Caused by: java.io.IOException: Illegal character code 0xd83e in attribute value text

A similar issue was fixed shortly before jibx 1.4.2 has been released through this commit, but the fix was only applied to the ICharacterEscaper implementations. Problem is that the above shown example effectively calls org.jibx.runtime.impl.MarshallingContext.startDocument(String enc, Boolean alone, OutputStream outs), which delegates to org.jibx.runtime.impl.MarshallingContext.setOutput(OutputStream outs, String enc). This method begins with a special handling for detecting the encoding types "UTF-8" and "ISO-8859-1" and calls setOutput(outs, enc, createEscaper(enc)) affected by the fix only otherwise. The special handling for "UTF-8" and "ISO-8859-1" invoke org.jibx.runtime.impl.UTF8StreamWriter and org.jibx.runtime.impl.ISO88591StreamWriter, respectively, but both stream writers use writeAttributeText in this case where an equivalent fix has not been applied (Their writeTextContent and writeCData methods seem to be affected by the issue as well).

Codegen customization to remove setters for lists

We are trying to generate code from an XSD where the lists are represented as collections. We do not want to include the setters since there is an underlying storage model where the collection implementations can not be replaced.

We could not find any XML configuration customizations that would allow us to disable the setters and writing a ClassDecorator doesn't seem to work since there is no interface to remove a method in the finish method nor a way to prevent the setter creation in the start method.

Any advice would be helpful.

Decorator for @Nullable annotations

Hi,

I was wondering if you would consider adding a new decorator to the codegen that adds a @Nullable annotation on getters that might return a null value, based on the cardinality defined in the XSD.

For example,

<xs:element name="Foo" type="xs:string" minOccurs="0"/>

would generate the following getter:

@javax.annotation.Nullable
public String getFoo() { }

Also, things like choices would also result in nullable getters:

<xs:sequence>
    <xs:choice>
        <xs:element name="foo" type="xs:string"/>
        <xs:element name="bar" type="xs:string"/>
    </xs:choice>
</xs:sequence>

would result in:

@javax.annotation.Nullable
public String getFoo() { }

@javax.annotation.Nullable
public String getBar() { }

I started working on such a decorator, I think I have something that works pretty well on my XSD but I'm not sure it's 100% correct, and I would rather use an officiel decorator that is bundled with JiBX.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.