3 Replies Latest reply on Apr 4, 2013 2:50 PM by Christian Sadilek

    Help : Errai-Jaxrs Format

    Charles Odili Apprentice

      Sorry to bug you guys again, just to be sure whats goin on in my app. The app is expected to expose services in a REST way, so that other clients (especially a jQuery Mobile cient) can consume the exposed data. Hence I enabled the Jackson JSON format in the app :

       

      private native void setJacksonMarshallingActive(boolean active) /*-{

                   $wnd.erraiJaxRsJacksonMarshallingActive = active;

                }-*/;

       

      which I called with setJacksonMarshallingActive(true);

      And here is a sample output containing some "type" information, so is this the Jackson format :

       

      {"^EncodedType":"java.util.ArrayList","^ObjectID":"1","^Value":[{"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.Institution","^ObjectID":"2","id" : {"^EncodedType":"java.lang.Long", "^ObjectID": "-1","^NumVal":"9"},"name" : "Benson Idahosa University","shortName" : "BIU","slogan" : "Dummy slogan","schoolType" : {"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.SchoolType","^EnumStringValue":"PrivateUniversity"},"schoolProgrammes" : {"^EncodedType":"org.hibernate.collection.internal.PersistentSet","^ObjectID":"3","^Value":[]},"catchmentAreas" : {"^EncodedType":"org.hibernate.collection.internal.PersistentBag","^ObjectID":"4","^Value":[{"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.Catchment","^EnumStringValue":"Delta"},{"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.Catchment","^EnumStringValue":"Edo"}]},"nation" : {"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.Nation","^EnumStringValue":"Nigeria"},"region" : {"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.Region","^EnumStringValue":"SubSaharanAfrica"}},{"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.Institution","^ObjectID":"5","id" : {"^EncodedType":"java.lang.Long", "^ObjectID": "-1","^NumVal":"10"},"name" : "Delta State University","shortName" : "DELSU","slogan" : "The Big Heart School","schoolType" : {"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.SchoolType","^EnumStringValue":"StateUniversity"},"schoolProgrammes" : {"^EncodedType":"org.hibernate.collection.internal.PersistentSet","^ObjectID":"6","^Value":[]},"catchmentAreas" : {"^EncodedType":"org.hibernate.collection.internal.PersistentBag","^ObjectID":"7","^Value":[{"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.Catchment","^EnumStringValue":"Delta"},{"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.Catchment","^EnumStringValue":"Edo"}]},"nation" : {"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.Nation","^EnumStringValue":"Nigeria"},"region" : {"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.Region","^EnumStringValue":"SubSaharanAfrica"}},{"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.Institution","^ObjectID":"8","id" : {"^EncodedType":"java.lang.Long", "^ObjectID": "-1","^NumVal":"7"},"name" : "University of Benin","shortName" : "UniBen","slogan" : "Knowledge for Service","schoolType" : {"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.SchoolType","^EnumStringValue":"FederalUniversity"},"schoolProgrammes" : {"^EncodedType":"org.hibernate.collection.internal.PersistentSet","^ObjectID":"9","^Value":[]},"catchmentAreas" : {"^EncodedType":"org.hibernate.collection.internal.PersistentBag","^ObjectID":"10","^Value":[{"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.Catchment","^EnumStringValue":"Bayelsa"},{"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.Catchment","^EnumStringValue":"Delta"},{"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.Catchment","^EnumStringValue":"Edo"},{"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.Catchment","^EnumStringValue":"Lagos"}]},"nation" : {"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.Nation","^EnumStringValue":"Nigeria"},"region" : {"^EncodedType":"com.bitrunk.apps.unitalk.client.shared.Region","^EnumStringValue":"SubSaharanAfrica"}}]}