Monday of September 17, 2012
Rankaru website is updated to be viewed on a mobile web browser through mobile theme module plugin. The mobile theme allows template switching based on the the user-context information. The plugin supports drupal versions from v5 to v7, and is relatively stable based on how the theme is created.
Wednesday of September 05, 2012
This method converts your xml file contained in a XMLStreamReader to a jaxb object.
/**
* @param XMLStreamReader reader
* @param String package name where the jaxb java files are stored
* @throws JAXBException is throw if any errors occured
*/
public static Object xmlToJaxb(XMLStreamReader reader, String jaxbContextPackage)
throws JAXBException {
HashMap jaxbMap = new HashMap();
JAXBContext jaxbContext;
jaxbContext = JAXBContext.newInstance(jaxbContextPackage);
jaxbMap.put(jaxbContextPackage, jaxbContext);
Unmarshaller um = jaxbContext.createUnmarshaller();
return um.unmarshal(reader);
}
Wednesday of September 05, 2012
1. Create a valid xsd file, name sample.xsd
<!--?xml version="1.0" encoding="utf-8"?-->
<xs:schema>
<xs:element name="SAMPLEMSG">
<xs:complexType>
<xs:sequence>
<xs:element ref="name"/>
</xs:sequence>
</xs:complexType >
</xs:element>
</xs:schema>
2. Your JDK should be JDK1.6 or greater
3. Navigate to %JAVA_HOME%/bin/xjc.exe
4. Open command cosole and type >xjc sample.xsd The jaxb files will be generated ObjectFactory.java and SAMPLEMSG.java
5. Rename the package values of the java files
Tuesday of September 04, 2012
Recently I have been working with Apache Axiom and needed to conduct a unit test to verify my module. I needed to immediately feed xml data and convert it to an OMElement, below is a way to perform such conversion.
OMElement omElemHeader = AXIOMUtil.stringToOM("<xml><header>my header text</header></xml>");Friday of August 10, 2012
Play your classic nintendo games at old school apps arcade. One of the first games where I saw dancing skeletons, pigs throwing boomerang and firing arrows, octopus spiting stones and stoned soldiers was Legend of Zelda the first release. The game is still exciting and fun, and truly enjoyable after 25 years since it was first launched.