Blogroll

The New Domino Admin

A great source of information for Lotus Domino administrators

ecmarchitect.com

Jeff Potts' excellent ECM/Portal blog

Jared Ottley

Lots of very useful Alfresco articles

Looking for web hosting?  I have been using DreamHost for years and have found them to be reliable, inexpensive and very good at what they do!  Click below to sign up, use promo code 'unorganized' to get a free domain registration and 10 bucks off your first year of hosting!

 

dreamhostBadge

Home
Alfresco PDF Toolkit - Digital Signatures PDF Print E-mail
Written by Nathan McMinn   
Tuesday, 12 October 2010 18:35

If you work with legal documents such as contracts, PDF document security is probably a part of your requirements.  In previous releases of the Alfresco PDF Toolkit we have added text and image watermarks, document encryption and permission management.  As of version 0.94, we can now add a basic digital signature capability to the list.  Adobe PDF documents support a digital signature facility that uses a private key to add a verifiable signature to a document.  This signing facility allows subsequent consumers to verify that the document was signed by a particular key, the trust chain of that key and whether or not the document has been modified since signing.  Using iText, the Alfresco PDF Toolkit can take a JKS keystore stored in the Alfresco repository and use it to sign a PDF document.  The signature can be applied as either a visible signature block or as an invisible signature.  As usual, you can either download the AMP file (version 0.94) or grab the full source code from Google Code and build it yourself.

 

The simplest way to try this out is to create a self-signed certificate.  This can be done using the "keytool" command line application that is bundled with the JDK.  A full explanation of the keytool and certificate chains is outisde the scope of this article, so please read up on how certificates and keytool work before you implement this on any kind of scale.  To generate a simple keystore that can be used to sign a document, run keytool with the following options:

 

1
keytool -genkey -keyalg RSA -alias "Your Name" -keypass yourpass 
-keystore keystore.ks -dname "cn=Your Name, c=US"

 

Dont' forget to substitute your name, new keystore password and country.  Answer any questions that keytool asks and you will have a "keystore.ks" file created.  To use this file to sign your PDF documents, add the key to a space in Alfresco.  I store mine in my home space, but anywhere will do.  Once you have the keystore uploaded to Alfresco, create a space to receive incoming PDF documents and add a content rule that is triggered when PDF documents are added.  When you are prompted to select the action, select "Sign PDF" from the list.

 

step_1

 

Next, set your signature action parameters.  First, the signature can be applied as a visible or hidden signature.  If you select visible, a small text block will appear showing the name, location and reason for the signature.  The location and size of this block is configurable by using the signature X/Y coordinates (coordinates of the top left corner of the block), height and width.  Next, use the node selector to select the keystore file that you wish to use to sign the document.  You also have to provide the keystore password.  This is the same password you used when you created the keystore.  The signing reason and location can also be provided.  The text that is provided here will show up in the signature block, if it is visible.  Finally, select a destination space where the signed PDF will be stored.

 

 

step_2

 

Once all of the signature options are set, finish adding the rule.  Any PDF documents that are placed into the space will now be signed with the provided key and options, and will be stored in the selected destination.  With a self-signed certificate you will see a warning in Adobe Acrobat stating that the certificate chain cannot be validated.  This is expected.  If you need a fully validated chain, you can request a certificate from a CA and import it into the keystore that is used to sign the document.  This simple signing action covers most of my needs, hopefully others will find it useful as well.  As usual, feature requests and bug reports are welcome!

 

Enjoy!

Last Updated on Wednesday, 13 October 2010 09:38
 
CMIS WordPress Plugin PDF Print E-mail
Written by Nathan McMinn   
Wednesday, 29 September 2010 19:15

I was browsing the #Alfresco twitter feed a few days ago and came across somebody that wanted a WordPress plugin for Alfresco.  I've been toying around with WordPress for a while (thinking about porting my site over from Joomla), so I figured I would take a crack at it.  WordPress plugins are surprisingly easy to write, much simpler than some other frameworks.  The plugin supports a few cool features, including basic folder navigation, a display of your current location in the repository and some basic mime type detection to show the right icons for certain document types.  I'm sure it has some bugs, but it basically works.  The CMIS implementation is the phpclient code from the Apache Chemistry project (Thanks Rich!).

 

Download the zip file here, and install and activate the plugin like you would any other plugin for WordPress.  Once the plugin is installed, open the "Settings" menu on the sidebar.  If everything went right you should see a "CMIS Document Display" option listed in the panel, like so:

 

settings_panel

 

Clicking on this link takes you to the configuration panel for the plugin (no config files!  yay!).  Enter the URL to your CMIS service, the document folder you want to start in, and some valid CMIS credentials.  I use Alfresco for all my CMIS testing and development, so that's what I used for the sample URL.  Once you have everything configured to your liking, click "Update Options" to save your settings.

 

cmis_settings

 

To actually get the CMIS display embedded in a page, you have to add a little code to your php template (I put it in the index.php file for my active theme).  Don't forget to put it inside a <?php block or the code will not be executed and you will just see the code on the page, not the CMIS display.

 

1
echo cmis_listdocuments();

 

And that's it!  When you refresh the page, you should see a list of documents that are stored in the folder you specified.

folder_display

At some point I will move this project to Google Code and maybe do an official release through the WordPress plugin repository, but while it is in development check back here for updates.

 

Happy coding!

Last Updated on Friday, 01 October 2010 01:17
 
Alfresco PDF Watermarking Update - v0.93 PDF Print E-mail
Written by Nathan McMinn   
Wednesday, 29 September 2010 01:10

In order to support a few new requirements that have come my way, I have added a couple of new features to the Alfresco PDF toolkit.  Specifically, you can now use the PDF watermarking repository action to add text watermarks to documents in addition to the image watermarks that were already available.  Text watermarks support the same set of options as images, and can be applied in multiple locations, above or below the PDF content.  In addition, there is a simple "markup" that allows you to insert document metadata into the watermark.  Here's what the new parameter screen looks like:

 

text_watermark

 

There are a few new options here.  The first is the choice between text and image watermarks.  If you choose an image watermark, any text options (text, font, size) are ignored.  Text watermarks can be applied in Courier, Times or Helvetica (the basics, more might follow if people want it), and can be applied in a range of sizes.  The font/size options are basic, but they work.  Of particular note is the the "watermark text" field in the configuration.  In addition to any free form text you want to apply, you can include tags in the text that will be replaced with metadata.   Right now the following tags are supported:

<date> - replaced with today's date
<title> - replaced with the document's title
<name> - replaced with the document name
<modified> - replaced with the modified date
<created> - replaced with the creation date
<modifier> - replaced with the user ID of the last person to modify

All of the dates are currently displayed in ISO format YYYY-MM-DD.

I have a few improvements that I would like to make.  First, I would like to add the date format as a parameter so it can be customized.  Second, I would like to add a color picker so that you can set the text color for text watermarks.  In the long term I want to ditch the simple text replace "tag" thing and just allow Freemarker markup as the watermark text.  I think this will be much easier to maintain and extend, and will be much more powerful. 

 

As usual, you can download the AMP here, or you can go to the Google Code project and pull down the latest version if you want to build it yourself.

 

Enjoy!

Last Updated on Wednesday, 29 September 2010 01:57
 
Alfresco Developer Conference Sessions PDF Print E-mail
Written by Nathan McMinn   
Tuesday, 28 September 2010 15:22

If you are involved at all in Alfresco development, you have probably heard about the upcoming developer conferences.  Alfresco, being the community-centric open-source company that they are, started a process a month or so ago of soliciting session ideas and proposals from their large base of users, partners and integrators.  This is, of course, in addition to a huge schedule of sessions by some of Alfresco's engineers and other techincal folks.  I submitted two proposals for consideration, both of which were accepted.  So, looks like I will be doing a couple of presentations!  Very exciting!  Here are the brief summaries I submitted, which give a basic description of the sessions I will be presenting:


Progressive Alfresco - From simple collaboration to full integration

Deploying an ECMS can be daunting. This is especially true if the deployment plan calls for consolidating content from multiple systems onto a unified platform.  At my company, we decided to start small.  Through a series of small, progressive steps, we have gone from an environment with several document management, collaboration and web content technologies to a unified platform using Alfresco for DM and collaboration and Drupal for web content.  In stages, we replaced Documentum eRoom.net, Quickr and Liferay document libraries, integrated Alfresco document management into Drupal, J2EE web applications and Python driven reports (all via CMIS), and pushed Alfresco content to the iPhone / iPad platform via a customized version of Zia Fresh Docs.  In this session, I will discuss our strategy, potential pitfalls and how we used integration to drive Alfresco deep into the enterprise.

Alfresco Actions in Action
Creating custom Alfresco actions can be a bit confusing.  In this "learn by example" session, I will walk through the process used to create the PDF watermarking and PDF encryption actions in the pdf-toolkit project, and spend a bit of time discussing the features of each of these new actions.  If you want to preview the code that will be covered in the session, you can check out the Google Code proejct.

 

Both of these sessions will be presented at the New York developer conference.  If you are going to be there please stop on by and say hello!

Last Updated on Tuesday, 28 September 2010 16:38
 
Encrypting PDF Documents with Alfresco PDF Print E-mail
Written by Nathan McMinn   
Wednesday, 08 September 2010 19:06

Last week I released the code for a PDF watermarking action for Alfresco.  While watermarking is certainly useful, I have much more extensive needs around PDF documents.  I need digital signatures, document permissions and encryption.  Well, as of today, the last two are up and running!  Using the same iText library that powers the PDF watermarking actions, I have just completed a PDF encryption action.  To try it out, either download the updated AMP (version 0.92, available here) or build it from the project source, install the module, and restart your Alfresco server.  When you view the list of actions, you will see a new item in the list, Encrypt PDF.

 

encryption_step_1

 

The encryption action can take a few parameters.  Only one, the destination space, is required.  The rest are optional.  Notice that there are two password fields.  The first, the user password, is used to set a password that is required for user access to the document.  The second, the owner password, is the password that will be required if you attempt to modify the document permissions after it has been encrypted.  The following document permissions are also supported:

 

Allow printing
Allow copying
Allow modification of contents and annotations
Allow form fill
Allow screen reader access
Allow degraded printing
Allow document assembly

 

The last checkbox is used to set whether or not you want metadata included in the encryption operation.  If you choose to encrypt the metadata, the document will most likely not show up in any search results, as Lucene will not be able to index it.  Leaving the metadata unencrypted at least allows this portion of the document to be indexed.  Finally, there is a choice of encryption levels.  Standard PDF 40 / 128 bit encryption are supported, along with the more secure 128 bit AES.

 

encryption_step_2

 

I have tested this with a variety of PDF documents, and so far everything is working as intended.  If you run into any issues with this action or the PDF watermarking, please open an issue at the Google Code project.

 

Enjoy!

Last Updated on Friday, 10 September 2010 07:01
 
<< Start < Prev 1 2 3 4 5 6 7 8 9 10 Next > End >>

Page 5 of 12
RSS Feed Icon

About Me

 

My profile picture

 

My name is Nathan McMinn.  I'm a software engineer, beer geek, wannabe adventurer and genuinely curious guy.  Find me on Facebook, Linkedin or Twitter

Latest Comments