Latest Posts

Archives [+]

Categories [+]

Authors [+]

Archive for February 2010

    Posted by Michael Marth FEB 23, 2010

    Posted in day, link of the day and open Add comment

    Roberto Galoppini, blogger with a focus on open source topics, has written a post comparing MySQL's value proposition and licensing terms with Day's. Along more well-known considerations about GPL and its business implications Roberto discusses his observation that Day contributes to open-source projects, not products:

    Why should we talk about Day Software? Actually they don’t pretend to be an open source vendor, but they do contribute a lot, both in terms of code and open standards definition and support. Simon Phipps’s score card would probably penalize them, but the problem here is that the score card is - quite wrongly in my view - about products instead of projects. Checking out Day’s contributions to open source projects on Ohloh gives a clear picture of why talking of Day makes sense in this context.

    Some related articles:

    Posted by Michael Marth FEB 22, 2010

    Posted in crx, link of the day and sling Add comment

    Kas Thomas has hooked up the CK editor with Apache Sling (in the form of CRX) to produce a mini CMS in 64 lines of code. Neat hack!

    Posted by Jean-Christophe Kautzmann FEB 19, 2010

    Posted in sling and tutorial Add comment

    The Apache Sling Scheduler enables you to easily schedule jobs within your application. Jobs can be executed at a specific time, regularly at a given period or at the time given by a cron expression by leveraging the Sling scheduler service.
    Let's get some hands on code.
    The job consists in writing "Executing the job" in the logs. You'd define it as follows:

    final Runnable job = new Runnable() {
        public void run() {
            log.info("Executing the job");
        }
    };

    To execute the previous job at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday, you can use the addJob() method with the following parameters:

    String schedulingExpression = "0 15 10 ? * MON-FRI";
    this.scheduler.addJob("myJob", job, null, schedulingExpression, true);

    Refer to http://www.docjar.com/docs/api/org/quartz/CronTrigger.html
     to find out how to define scheduling expressions.

    To execute the previous job every 3 minutes, you can use the addPeriodicJob() method with the following parameters:

    long period = 3*60; //the period is expressed in seconds
    this.scheduler.addPeriodicJob("myJob", job, null, period, true);

    To execute the previous job at a specific date (on January 10th 2020), you can use the fireJobAt() method with the following parameters:

    SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd");
    String date = "2020/01/10";
    java.util.Date fireDate = formatter.parse(date);
    this.scheduler.fireJobAt("myJob", job, null, fireDate);

    The code implementing a service that simultaneously executes the job based on the three different kinds of scheduling is attached to this post.

    It is also possible to schedule jobs by leveraging the whiteboard pattern.

    The following job is executed every minute by setting scheduler.expression to the cron expression "0 * * * * ?":

    package sling.docu.examples;

    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;

    /**
     * @scr.component
     * @scr.service interface="java.lang.Runnable"
     * @scr.property name="scheduler.expression" value="0 * * * * ?"
     */
    public class ScheduledCronJob implements Runnable {

        /** Default log. */
        protected final Logger log = LoggerFactory.getLogger(this.getClass());
        
        public void run() {
            log.info("Executing a cron job (job#1) through the whiteboard pattern");
        }
    //
    }

    Have fun scheduling with Sling!

    * HelloWorldScheduledService.java
    HelloWorldScheduledService.java

    Posted by Michael Marth FEB 16, 2010

    Posted in link of the day Add comment

    The developers at CityTech (a US-based partner of Day) have come up with some very good posts on CQ5 and Sling, lately. In particular, I liked Mark Daugherty's post on testing with JMockit

    When researching these frameworks for testing a recent Day CQ5 project, I discovered JMockit and got (relatively) excited about it’s ability to easily test things like final classes and private methods without modifying existing code.

    and Mark Cochran's tutorial on background processing in CQ5

    I have recently had the need to create various tasks that run on a periodic basis within Day Communique 5 (eg: periodically activating specific content, backing up content, custom report generation and notification, etc.).  I was able to achieve these through one of the less publicized features of CQ5: the Apache Sling Scheduling Service

    Posted by David Nuescheler FEB 05, 2010

    Posted in chemistry and cmis Add comment

    Today is a great day for Apache Chemistry: the OpenCMIS community just added their very exciting code base. And more importantly: the OpenCMIS community joined the Chemistry community.

    The contribution consists of a general purpose java client that already seems very well architected and already very mature in its code base, granted that CMIS is not even released as a 1.0 yet. This will definitely help to advance the efforts of Chemistry both on the Server and on the Client. I am convinced that all the lessons learned from OpenCMIS will be greatly appreciated by the Chemistry community and will have a very positive impact on the joint code base.

    From an Apache community standpoint I think it is very noteworthy that the list of contributors of OpenCMIS includes people from various companies, so I would like to take this opportunity to welcome the following people into the Chemistry community and thank them for their outstanding achievement.

    • David Caruana (Alfresco) (existing Chemistry PMC member)
    • David Ward (Alfresco)
    • Florian Müller (Open Text)
    • Jens Hübel (Open Text)
    • Martin Hermes (SAP)
    • Paul Goetz (SAP)
    • Stephan Klevenz (SAP)

    Since I had the pleasure to work with most of them before I am really looking forward to our joint work in Chemistry as a community open source project.

    Posted by Jean-Michel Pittet FEB 01, 2010

    Posted in announcements, cq5, crx, day and jsr-283 Comments 2

    I'm very excited to see CQ 5.3 generally available. Existing CQ customers can download their copy of CQ 5.3 on Daycare. If you are not an existing customer get in touch to get an evaluation copy.

    This release is a combination of over 125 new features and 1250 enhancements. I'm very thankful for the collaboration with many of our customers and the great feedback we have received.

    CQ 5.3 includes a release of CRX 2.0 - our implementation of the JCR 2.0 standard (JSR-283). The next release CRX 2.1 will be available as a stand-alone version.

    David talked about the highlights of the release in his presentations (embedded below). To get a glimps of more of the features please take a look at our release notes on our documentation site. And stay tuned to this blog and www.day.com where we will be presenting more indepth information and some updated screencasts.