Application Development, Product to Market
  • Home
  • Notes
  • Projects
  • Resources
    • Discovery Log
    • Books I Read
    • Blogs I Visit
    • Tools I Use
  • Home
  • Notes
  • Projects
  • Resources
    • Discovery Log
    • Books I Read
    • Blogs I Visit
    • Tools I Use

Adobe CQ Appends Backcover to Pages with .pdf Extension

7/30/2013

0 Comments

 
In a previous post, I showed you how to render a PDF documentation (.pdf) with an extra image prepended to the whole PDF document using PDF Rewriter. In this post, I'll show how to render a PDF documentation with an additional PDF page appended as a back-cover. This PDF backcover can not be done by PDF Rewritter, as an Adobe staff confirmed PDF Rewriter (used Apache FOP 0.95) has yet to support merging PDF files.

**UPDATE: External links to pdf-files on http-servers and https-servers supported since Apache FOP 1.1.

For merging PDF files, I'll be using a Java PDF library - pdfbox. For this, we need pdfbox app OSGi bundle/jar (1.8.2 as of this writing or the latest version) deployed in the Felix OSGi container so we can develop a .jsp to call into the API for merging PDFs. So get the library ready in your CQ environment with these steps:

Read More
0 Comments

Adobe CQ Prepends Front Header Image to Pages with .pdf Extension

7/25/2013

0 Comments

 
In this post, I'll show you how to render PDF documentation (.pdf) with an extra image page prepended to the front of the whole PDF document, and how to embed an extra image to the top of an existing page.

According to a previous post - Adobe CQ Renders Pages with Custom Extension - making .pdf an accetable extention can be done in CQ. In fact, by default, the .pdf extension is already accetable by CQ, according to an existing Page.pdf.jsp file at
/libs/foundation/components/primary/cq/Page/Page.pdf.jsp
I'm using CQ5.6.1 which is not too reliable when I played with extension so after try and error, I modified the above file to reference proxy.jsp using full path and without carriage return at the end of line to avoid any possible 500 Internal Server Error. The Page.pdf.jsp file now saved have only one line:

Read More
0 Comments

Adobe CQ Renders Pages with Custom Extension

7/17/2013

3 Comments

 
You may already know CQ can render HTML pages with .html extension, I'd like to show you how to tell CQ to render pages with other custom extension. For example,  instead of responding to http requests end with .html, we want CQ responds to requests end with .foo.

In order to tell CQ to be able to deal with a custom request with a special page extension (e.g., .foo), you need to 

  1. Implement a component JSP file to render the page with .foo extension, and
  2. Tell CQ that .foo extension is acceptable. 

Here's the details of what you need to do:

Read More
3 Comments

Non-Blocking Function (Java Concurrency - Part 3)

7/11/2013

0 Comments

 
With regards to java concurrency, when reading some API documentation (e.g. java.util.concurrent),  there's  the term "non-blocking" and "blocking." In computer science, non-blocking means:

  • Use low-level atomic hardware primitives (machine instructions) such as compare-and-set instead of intrinsic locks to ensure thread safety (data integrity under concurrent access).
  • Performance gain and better scalability. threads does not have to be suspended/waken up by the OS using synchronization.
  • Use non-fair locking (which does not guarantee any particular access order), which can have much more system throughput than fair-locking (which grants access to the longest-waiting thread).
  • It doesn't cause other tasks (threads) to wait until the task is finished.
  • Deadlock free. The risk of deadlocks is removed. No one thread will wait to get a lock held by another thread "forever". 

Read More
0 Comments

ForkJoinPool Example (Java Concurrency - Part 2)

7/10/2013

0 Comments

 
In Java concurrency, ForkJoinPool uses a work-stealing multi-threading framework which works well for executing tasks of uneven distribution of chunk sizes. Before you read on, you need to know Java Multithreading Approaches first.

A ForkJoinPool implements ExecutorService but it differs from other (I'll refer them as 'traditional') ExecutorService mainly by virtue of employing work-stealing - all threads in the pool attempt to find and execute subtasks created by other active tasks. It automatically balance the task load between threads, while traditional ThreadPoolExecutor has no mechanism for such kind of load balancing. If no available worker thread is available, tasks will be blocked until a thread becomes available to steal work from those workers who are busy.

Read More
0 Comments

Java Multithreading Approaches (Java Concurrency - Part 1)

7/7/2013

0 Comments

 
In Java concurrency, there are two low level concurrency implementations in Java to create a thread - extend the Thread class or implement Runnable interface.  These basic approaches neither return value from the thread nor throw exception should anything goes wrong. There's a third approach since Java 1.5 - use Java Concurrency package which supports to receive return values from thread execution.

Read More
0 Comments

WeakHashMap Example

7/2/2013

0 Comments

 
Before I go into WeakHashmap, first let's look at different types of reference-object. A reference object encapsulates a reference to some other object. There are different level of reachability of references, from the strongest to the weakest. The weaker the reference, the more likely it is to be thrown away.

Read More
0 Comments

Java Serialization

7/1/2013

0 Comments

 
Java Serialization is a mechanism to transform a graph of Java objects into byte stream (an array of bytes) for storage or transmission, such that said array of bytes can be later transformed back into a graph of Java objects.

To opt a class in for Seriliazation, you 

  1. implements Serializable interface, and
  2. use ObjectInputStream/ObjectOutputStream classes, and
  3. declare serialVersionUID (strongly recommended)

Read More
0 Comments

    Categories

    All
    Algorithm
    Concurrency
    CQ
    Data Structure
    Design Pattern
    Developer Tool
    Dynamic Programming
    Entrepreneur
    Functional Programming
    IDE
    Java
    JMX
    Marketing
    Marklogic
    Memory
    OSGI
    Performance
    Product
    Product Management
    Security
    Services
    Sling
    Social Media Programming
    Software Development

    Feed Widget

    Archives

    May 2020
    March 2020
    April 2018
    March 2018
    February 2018
    December 2017
    March 2017
    November 2016
    June 2016
    May 2016
    April 2016
    October 2015
    September 2015
    August 2015
    September 2014
    July 2014
    June 2014
    May 2014
    March 2014
    January 2014
    December 2013
    November 2013
    October 2013
    September 2013
    August 2013
    July 2013
    June 2013

    RSS Feed

in loving memory of my mother  and my 4th aunt
Photos used under Creative Commons from net_efekt, schani, visnup, Dan Zen, gadl, bobbigmac, Susana López-Urrutia, jwalsh, Philippe Put, michael pollak, oskay, Creative Tools, Violentz, Kyknoord, mobilyazilar