Skip to main content

Posts

Showing posts from December, 2009

Shindig Open Social Gadget Container from Apache

http://incubator.apache.org/shindig/ Apache Shindig is an OpenSocial container and helps you to start hosting OpenSocial apps quickly by providing the code to render gadgets, proxy requests, and handle REST and RPC requests. Apache Shindig's goal is to allow new sites to start hosting social apps in under an hour's worth of work. It has Java and PHP versions.

Java API for HBase Indexing (Pigi)

http://pigi-project.org/ Pigi is: HBase native API based Configurable index system Designed for web application Simple object to HBase  mapping framework    Pigi isn't: Solution for all relation modeling problems (Pigi doesn't support constraint checks) Hibernate for HBase SQL for HBase

Xmlbean Maven plugin

 <plugin> <groupId> org.codehaus.mojo</groupId> <artifactId> xmlbeans-maven-plugin</artifactId> <version> 2.3.3</version> <executions>     <execution>         <goals>             <goal> xmlbeans</goal>         </goals>     </execution> </executions> <inherited> true</inherited> <configuration>     <schemaDirectory> src/main/xsd</schemaDirectory> </configuration> </plugin>

CXF client with XmlBean binding using Maven

Here is the sample code to generate CXF client with xmlbean binding using maven. <plugin> <groupId> org.apache.cxf</groupId> <artifactId> cxf-codegen-plugin</artifactId> <version> 2.2.4</version> <executions> <execution> <id> generate-sources</id> <phase> generate-sources</phase> <configuration> <sourceRoot> ${basedir}/target/generated-sources/cxf</sourceRoot> <wsdlOptions>     <wsdlOption>         <wsdl> ${basedir}/src/main/resources/wsdl/SampleService.wsdl</wsdl>         <extraargs>             <extraarg> -p</extraarg>             <extraarg> uk.co.card.cms.bureau</extraarg>             <extraarg> -impl</extraarg>             <extraarg> -client</extraarg>             <extraarg> -db</extraarg>             <extraarg> xmlbeans</extraarg>         </extraargs>     &l

Persistence API : JDO or JPA ?

http://www.datanucleus.org/products/accessplatform_2_0/persistence_api.html There are two standard API's for persistence - Java Data Objects (JDO) and Java Persistence API (JPA). The former (JDO) is designed for all datastores, and the latter is designed for RDBMS datastores only. When choosing the API to use in your application you should bear the following factors in mind Target datastore : JDO is designed for all datastores, whereas JPA is just designed around RDBMS and explicitly uses RDBMS/SQL terminology. If using RDBMS then you have the choice. If using, for example, an ODBMS then JDO makes much more sense Datastore interoperability : are you likely to change your datastore type at some point in the future ? If so you likely ought to use JDO due to i

Subversion Best practices

http://svnbook.red-bean.com/en/1.5/svn-book.pdf There are some standard, recommended ways to organize a repository. Most people create a trunk directory to hold the “main line” of development, a branches directory to contain branch copies, and a tags directory to contain tag copies. If a repository holds only one project, often people create these top-level directories: /trunk /branches /tags If a repository contains multiple projects, admins typically index their layout by project (see Branching and Merging 111 the section called “Planning Your Repository Organization” to read more about “project roots”): /paint/trunk /paint/branches /paint/tags /calc/trunk /calc/branches /calc/tags Of course, you're free to ignore these common layouts. You can create any sort of variation, whatever works best for you or your team. Remember that whatever you choose, it's not a permanent commitment. You can reorganize your repository at any time. Because branches and tag

XmlBean Ant script

Here is an example ant script to generate xmlbeans from XSD. < ?xml version="1.0" encoding="UTF-8"?> < project name="xmlbean" basedir="." default="xmlbean"> < echo message="${basedir}" /> < path id="xbean.path" > < fileset dir="${basedir}\lib"> < include name="*.jar"/> < /fileset> < /path> < echo message="${xbean.path}"/> < taskdef name="xmlbean" classname="org.apache.xmlbeans.impl.tool.XMLBean" classpathref="xbean.path" /> < target name="xmlbean"> < xmlbean destfile="${basedir}\schema.jar" classpathref="xbean.path" failonerror="true" javasource="1.5"> < fileset dir="${basedir}\schemas" casesensitive="yes"> < include name="*.xsd" /> < /fileset> < /xmlbean> < /ta

Returning Apache XMLBeans from a Jdbc Control

This topic assumes a strong understanding of Apache XML Beans. For additional information about XML Bean see the Apache XML Beans Site http://xmlbeans.apache.org/. The following topic explains how to return XMLBean types from custom Jdbc controls. An XMLBean is essentially an XML document with a Java API attached to it. The API is used for parsing and manipulating the data in the XML document. The data can be accessed and manipulated using the XMLBean's API. For example, assume that custBean represents the XML document above. The following Java code extracts the Fred Williams from the document. String name = custBean.getXCustomer().getXCustomerRowArray(1).getNAME(); Retrofitting database controls to return XMLBeans rather than RowSets, ResultSets, or Iterators, is a powerful technique because there are few restrictions on where XMLBeans can be imported. This is not the case with ResultSets and I

Create Apache Beehive control's instance out of beehive controller & controls

As we know beehive controls are powerful like Database control. We will access the control in a controller or control using @Control but in normal Java classes we can use this annotation. We can access control object outside beehive context by following: ControlTestContainerContext ctcc = new ControlTestContainerContext(); ctcc.beginContext(); SampleCTL CTL = Controls.instantiate(SampleCTLBean.class, null, ctcc, null); SampleCTL - control interface SampleCTLBean - Control's Bean class, which generated by beehive apt compiler. In this way we can use the beehive system controls, in Restful services, Servlet and Java application. Happy coding.