Latest Posts

Archives [+]

Categories [+]

Authors [+]

Entries filed under 'jsr-170'

    Posted by Michael Marth JUL 02, 2010

    Posted in jcr, jsr-170 and jsr-283 Comment 1

    One particular strength of Java Content Repositories is that they provide so much infrastructure for developing content centric applications. Today, I discovered another hidden gem in JCR2 (JSR-283) that can come in very handy for app development:

    In JCR1 the class ObservationManager used to manage EventListeners that get triggered immediately when an event like a property change occurs. Starting from JCR2 the ObservationManager also provides an EventJournal for each node that can be retrieved without having to register a listener first. The EventJournal is a list of events, e.g. addition, moves or removal(!) of child nodes, complete with user id and timestamp.

    Attached to this post is a little CRX package with a servlet that renders the events for a given node. The relevant lines are:

    ObservationManager om = session.getWorkspace().getObservationManager();
    EventJournal eventJournal = om.getEventJournal(
        Event.NODE_ADDED | Event.NODE_MOVED | Event.NODE_REMOVED  | Event.PROPERTY_CHANGED
        | Event.PROPERTY_REMOVED | Event.PROPERTY_ADDED, path, false, null, null);

    Install the package and point your browser to http://localhost:7402/apps/eventy.html?path=/content (the path parameter specifies the node you are interested in). You should see a list of entries like:

    Event: Path: /content/n3, NodeAdded: , UserId: admin, Timestamp: 1272975189833, UserData: null, Info: {}
    Event: Path: /content/n3, NodeRemoved: , UserId: admin, Timestamp: 1272975212725, UserData: null, Info: {}
    ...

    And from the Javadoc:

    Events returned in the EventJournal instance will be filtered according to [...] the current session's access restrictions

    I am delighted.

    * eventjournal-1.0.zip
    CRX package: sample for EventJournal

    Posted by Michael Marth APR 08, 2010

    Posted in cmis, jackrabbit, jcr, jsr-170 and jsr-283 Add comment

    The capability to expose a Java content repository through CMIS has been around for a while (see for example Day's announcement of a publicly available CMIS server). On the other hand, Apache Jackrabbit developer Michael Duerig has committed some code to the Jackrabbit sandbox that makes available a CMIS repository through JCR. Essentially, this allows you to connect to a CMIS repository and browse it with the JSR-170/283 API.

    Being in the sandbox, this is for the adventurous to try by themselves. But if you want to: check out https://svn.apache.org/repos/asf/jackrabbit/sandbox/jackrabbit-spi2cmis/. You will need to have Apache Chemistry and Apache Jackrabbit installed (i.e. available in the local mvn repository) in order to build. Michael has put together some instructions in a README.

    To understand how to use the code have a look at the test cases. In particular, in AbstractTestCase.java there are test setups for the public CMIS repositories of Day, Alfresco and Nuxeo.

    Posted by Michael Marth DEC 17, 2009

    Posted in jcr, jsr-170 and jsr-283 Comment 1

    My colleague Sebastian Hoogenberk has run JDiff over the JCR 1 and JCR 2 Javadocs. The results are useful to get a clear overview over the changes on API level. Note that JDiff unfortunately seems to get confused with some methods and marks them both as "added" and "replaced".

    Posted by Michael Marth JUN 08, 2009

    Posted in fudbusting, jcr and jsr-170 Comment 1

    Reading "Content Integration Standards -- CMIS, JSR-170, JSR-283" I stumbled over the quote

    The conclusion was that JSR-170 is not the best fit for WCM with its nodes and properties equaling to folders and files. In Devnani’s opinion, it fits document management better.

    Apparently, there is some confusion around what nodes and properties are in a Java Content Repository. Let's shed some light on this:

    First of all, there are two specific node types defined in JSR-170: files and folders. These are node types that behave as you would expect it from a file system. For example, the node type "file" has specific properties for the creation date and the binary stream.

    If your content is nothing but files and folders (for example because your application is document management) you would use these node types. As such, in Java Content Repositories files, folders and document management-type applications are special cases of a more generic case.

    This more generic case are node types that have different properties than the ones described above. In the most flexible case "unstructured node type" the node can accomodate for any string, date, binary, boolean, etc property. One node could for example have two binary stream properties (thumbnail and full-length). This covers exactly the use case web content management where content is stored on a fine-granular model. The fine-granular model enables the presentation layer to do things like displaying an article in teaser format.

    In summary the situation is like this:

    1. Files and folders are special node types in JCR.
    2. On a modelling level DM is a special case of WCM (I recognize that on a application requirements level DM and WCM diverge).

    As a consequence I would rewrite the quote from above as:

    JSR-170 is a very good fit for WCM because the nodes and properties store content in a fine-granular way. Since folders and files are just special node types it can be equally well used for document management.

    The Jackrabbit Wiki has a list of JCR applications that are either in the content management or the document management domain. As a side-note: JCR is flexible enough to provide infrastructure for completely different application domains as well, here is a list of some of them.

    Posted by Michael Marth JUN 18, 2008

    Posted in ajax, announcements, jcr, jsr-170, jsr-283 and rest Add comment

    The large international Java conference Jazoon is soon to start. Jazoon takes place end of June in Zurich, Switzerland. There will be six presentations given by speakers from Day. Hope to see you there:

    Roy Fielding: Open Architecture

    Keynote speech, Wednesday, 2008/06/25, 09:30-10:30, Arena 5

    At the heart of most successful open source projects is an emphasis on open architecture -- at least one mechanism that allows the product to be utilized as a support network for unanticipated extensions and independently motivated functionality. Such extensibility mechanisms allow an open source project to decentralize its evolution and take advantage of Internet-scale collaboration. However, they can also be a source for unnecessary complexity and hidden barriers to entry.

    Representational State Transfer (REST) is an architectural style that I developed to describe and redefine the World Wide Web. The essential constraints of REST are designed to promote the development of open architectures within Web-based applications, such that the resulting resources are reusable across independently developed systems (today, we call these "MashUps"). The same principles can be used to design other open architectures, though not necessarily with the same constraints. This talk will focus on applying principled design techniques to the design of open architectures, as demonstrated by various examples from successful open source projects.

    Peeter Piegaze: The Next Content Repository: A sneak peek at the upcoming JCR 2.0

    Technical long talk 50 min, Wednesday, 2008/06/25, 12:00 - 12:50, Arena 9

    The Story So Far

    • JCR 1.0 a quick recap
    • JCR 1.0 successes
    • JCR 1.0 lessons learned
    Goals of JCR 2.0
    • Expose new functionality for JCR-from-scratch repositories
    • Better expose functions of existing legacy repositories through JCR
    • Simplify complex features
    Major Features and Changes
    Node Identifiers
    • More flexible constraints
    Metadata
    • Standardizing metadata node types
    Observation
    • Two semantic levels of event reporting: state-change and method
    • Journaling
    Simplified Versioning
    • Simple and full versioning options
    Shareable Nodes
    • enabling multi-filing without breaking the workspace tree semantics
    Query
    • Abstract Query Model allows multiple equivalent syntaxes
    • Java bindings and SQL bindings
    • XPath bindings and more
    Node Type Management
    • Creating and registering node types
    Access control management
    • Access control discovery
    • Access control policies
    • Access control entries

    Lars Trieloff: Creating RESTful Web Applications with AJAX and Web Forms 2.0

    Technical long talk 50 min, Wednesday, 2008/06/25, 16:30 - 17:20, Arena 5

    The talk will have following structure: Introduce the concepts REST, AJAX and Web Forms 2.0 first, then provide hands-on-examples on building applications using these concepts. REST is a principle of creating large-scale internet applications and is seen by many developers as the way to go for creating web applications. The problem with real-world REST application however is that current web browsers only implement a subset of the HTTP specification that makes it hard to create true RESTful applications that work in a web browser. AJAX is a way of creating highly dynamic web applications that use Javascript and client-side DOM manipulations for interaction with the user and background HTTP request in XML or JSON for real-time-interaction with the browser. Combining AJAX and REST allows the creation of rich internet applications running in the browser that follow the REST principles. Web Forms 2.0 is an emerging web standard that tries to overcome some limitations with classical forms in HTML pages that are today the standard way of user interaction in web applications. Web Forms 2.0 add concepts like form field repetition, different transport encodings and validation. As long as only a small fraction of web browsers support Web Forms 2.0, implementing Web Forms 2.0 with AJAX is an elegant solution for creating standards-based web applications. In the practical part of the presentation concrete coding examples of creating RESTful web applications using Web Forms 2.0 will be given. The frameworks involved in this example session will be Apache Sling, a web-framework that combines concepts of REST, server-side scripting, OSGi and JCR and the Dojo Toolkit, a powerful collection of Javascript APIs that allow the creation of widget-based applications that run in a web browser. Apache Sling is an incubating project of the Apache Software Foundation.

    David Nüscheler: Content Integration: Java(tm) Applications vs. Microsoft(R) Sharepoint

    Technical long talk 50 min, Wednesday, 2008/06/25, 17:30 - 18:20, Arena 9

    Most large organizations on the one hand develop Java(tm) Applications and on the other hand run Microsoft(R) Sharepoint for their business users.

    This generates the crucial need for Java Applications to be able to interact with content stored in Sharepoint, be it a Java based Swing Application that would like to refer to content managed by Sharepoint or a regular Intranet WebApp or Java Portlet that needs to search and manage office content residing in Sharepoint.

    This session will talk about the benefits and drawbacks of various ways of integrating Java applications and Sharepoint.

    This session will also demo and showcase the integration of both J2SE and J2EE applications through a quick and easy to use standards based integration.

    The goal of this session is to demonstrate in a practical fashion how to integrate with Microsoft Sharepoint at a Content Repository level using a "Content Repository API for Java(tm) Technology" (aka JSR-170) connector to build a Java application in a very agile fashion.

    Expect a hands-on demo of the installation and deployment of a JSR-170 based Sharepoint Connector and the development of a simple JSR-170 based application and the use of an existing JSR-170 based application backed by content from Microsoft Sharepoint.

    Agenda:
    (1) Content Integration: A Business Issue
    (2) Java vs. Microsoft Sharepoint
    (3) Various Integration Options Pro/Cons
    (4) Integration Demo using the "Content Repository API for Java(tm) Technology"
    (5) Q&A

    David Nüscheler and Bertrand Delacrétaz: The Revenge of the "Weblog in 15 minutes"

    Technical long talk 50 min, Thursday, 2008/06/26, 12:00 - 12:50, Arena 5

    Based on last years successful Jazoon session on how to build a "Weblog in 15 minutes" using AJAX and JCR, this talk is the sequel in the "AJAX meets JCR" series.

    In the meantime microjax has become a legitimate part of the Apache Sling project which is at the time of this submission in incubation.

    This talk will focus on the unique benefits of using a combination of AJAX and JCR (aka. JSR-170 & JSR-283) to satisfy modern Web 2.0 application requirements and allow for an extremely agile application development.

    To take last years "15-minute weblog" example to the next level we will talk about how microjax effortlessly complies with the real-life requirements of Search Engine Optimization (SEO), Back-button, Deep Links, WAI, Access Control, XSS protection, etc...

    This session will be interesting for an audience that works in a general J2EE environment and is eager to learn how to build Web2.0 Applications in a very efficient way without leaving the traditional heavy-weight j2ee style backend resources.

    The session overview looks as follows:

    (1) The JCR elevator pitch
    (2) microsling - JCR and AJAX
    (3) The revenge of the microjax "weblog"
    (4) The real-life: SEO, WAI, Backbutton, XSS, Access Control
    (5) Q&A

    Thomas Mueller: Java SQL Databases

    Technical short talk 20 min, Thursday, 2008/06/26, 11:00 - 11:20, Arena 3

    This talk is about what persistence mechanism to chose for your Java application, and what to consider when you decided to use a SQL database as your backend. The focus of this presentation is open source Java databases. One of those, the H2 Database Engine, is developed by the speaker.

    The API is one aspect of the persistence mechanism. Standardized high level APIs are the JPA (Java Persistence API), the JDBC API (Java Database Connectivity), and the JCR (Java Content Repository) API. Each API has advantages and disadvantages. Other APIs exist as well, but are less used (such as JDO) or are proprietary. Proprietary APIs will result in substantial cost when switching to another product to overcome the vendor lock-in (for example when using db4o).

    If you have decided to use a SQL database as the backend, you need to think about which products fit your use case best. The main factors factors to consider are: cost, stability, security, features, performance, ease-of-use, support, and documentation. Sometimes, you will want to support multiple products: one for development and unit testing, and another (or multiple) for production.

    If you already purchased a SQL database, for example Oracle or MS SQL Server, you may want to use it for production. If not, the cost of such products can be avoided by using free databases like PostgreSQL, or MySQL (which is not free in all cases). There is also a number of Java databases, most of them are free.

    Some think that Java still is slow, and a fast database can not be written in Java. However Java is no longer slow. Additionally, there is no network overhead when accessing Java databases from Java applications in embedded mode. Therefore, Java databases are much faster than other database in many situations.

    The main open source Java databases today are HSQLDB, Apache Derby, and H2. There are other Java databases, but some are not free (PointBase), and others not updated since a long time (McKoi, DaffodilDb/One$Db, Quadcap). HSQLDB, Derby and H2 are quite different. According to Ohloh, HSQLDB is the most popular one, followed by Derby and H2. The reason is probably that HSQLDB is the open source since a long time, Derby since 2004, and H2 since the end of 2005.

    HSQLDB is based on Hypersonic SQL, which was developed by the author of H2. It is now maintained by a group of people headed by Fred Toussi in England. A commercial version of HSQLDB is available as well. HSQLDB is popular because of its speed. However it does lack a few features such as locking and transaction isolation. HSQLDB is bundled with OpenOffice Base. Many use HSQLDB for testing. However, more complex queries can be very slow in HSQLDB because the query optimizer does not consider different access strategies. There is no ODBC driver for HSQLDB.

    The history of Apache Derby goes back to 1996. Cloudscape was bought by Informix in 1999, which was bought by IBM in 2001, and then contributed to Apache in 2004. IBM stopped selling Cloudscape in 2007 and will stop support in September 2008. However most Derby developers are employed by IBM. Sun offers commercial support for Java Db, which is basically Derby. Since 2007 IBM owns PointBase, the second commercial Java database. Derby offers a rich feature set. The optimizer usually chooses a good query plan. The main disadvantage is the slow performance for simple use cases (up to 10 times slower than HSQLDB or H2).

    The development of H2 was started in 2004, but it was first published in December 2005. The author of H2, Thomas Mueller, is also the original developer of Hypersonic SQL. In 2001, he joined PointBase Inc. where he wrote PointBase Micro. At that point, he had to discontinue Hypersonic SQL, but then the HSQLDB Group was formed to continued to work on the Hypersonic SQL codebase. The name H2 stands for Hypersonic 2; however H2 is built from scratch. H2 is feature rich and fast. The main disadvantages are: it is relatively new, and there is no commercial support as of today.