Publishing an external link to Alfresco content with Expiry Date and Transformation Support

This customization allows users to publish documents externally and to acquire a link which enables non-alfresco users to view the documents which exist in the system. At the stage of publishing the document, the document public link can get an an expiry date set. It will also allow transformations of the content available within the document by simply specifying the file extension at the end of the external link.

This blog post covers the steps from a slide deck that was done as a part of the training for Alfresco Share and Repository Customization work. The final source code can be found on github at the following link , and you are welcome to suggest and improve the code on your own.

Special thanks goes to Jeff Potts and Share-extras project authors. The content available from their sites served as the base for creating the project.Each step covers an iteration which was during the development of the final result, hence there will be certain steps which modify actions taken in earlier steps.

You will find screen-shots along the way.

Note: You should have a basic understanding on Alfresco Share and Alfresco Repository development in order to continue with this post.

Step 1: Create repository behaviour

Added an aspect for a short link (used sc:webable aspect which was available from the J. Potts tutorial)

Added the behavior to create a short link and set it as the property whenever a sc:webable aspect is added

Short link is a GUID that is generated at the time the aspect is added.

Step 1 : Howto

Create a Java class which attaches to the onAddAspect behavior.

PublishWithShortUrlBehavior.java

onAddAspect was overridden and modified to set a a new property named sc:shortLink – the value will be a GUID generated at the time the action is invoked.

share-config-custom.xml was modified in order to display the shortlink in the Share user interface.﻿﻿

The additional properties were defined in the model – scModel.xml and the property labels in scModel.properties﻿

Step 2: Add an action to create the short link

Created a UI Action which enables one click publishing from the Share UI.

This would add a sc:webable aspect behind the works, and will trigger the publishing behavior.

Step 2 : Howto

Create a repository webscript backing the action. The webscript consits of the following parts:

publish.post.desc.xml

Contains the description for the publish action webscript

publish.post.json.ftl

Returns a JSON result indicating the status of the publish action call.

publish.post.json.js

The action logic. This will be adding the sc:webable aspect to a selected node. The file is based on backup.post.json.js which was available on share-extras on Google Code. When the aspect is added the PublishWithShortUrlBehavior will be triggered.

Added the stylesheet containing the publish action icon and the publish action javascript to the header of document library: document-library/actions-common.get.head.ftl

Web resources were bundled to contain the publish action related messages in slingshot-custom-publish-action-context.xml

Once completed, the action is shown in the document library view as in the below screenshot.

Publish Action and Metadata View

Step 3: External access to the document via the short link

Exposed the document access as a service. Note that this service won’t require any authentication! It should be available to anyone. The backing javascript is executed in a read-only transaction as the system user. It is run as system user as the system user has access to all the documents though it cannot be used to login to Alfresco.

Now the document will be shown when the service URI is accessed and the document short link is passed as a URI part.

Create a repository webscript to access the document using the shortlink id:

showDocument.get.desc.xml

Contains the service descriptor for the web script. The script runs as ‘system‘ user and is of ‘org.alfresco.repository.content.stream‘ kind in order to stream the document content.

showDocument.get.js

The webscript looks for the url part with the shortlink and executes a lucene search to find the node containing the shortLink. Then it streams back the content of the node. No Freemarker template is needed as the streaming webscript expects the content to stream into the model.contentNode.

This will initially be set to 30 days from the time the document short link is created.

The expiry date can be changed via the ‘Edit Metadata’ function in Share.

This is how it looks like.

Edit Metadata View once completed

When the document is requested after the expiry date, the system will show a message indicating the document has expired.

A sample screenshot on how it looks is below.

Document Expired Screenshot

Step 4 : Howto

The original PublishWithShortUrlBehavior.java was modified to set a new property named sc:expiresOn which belongs under the sc:webable aspect. The sc:expiresOn property will be using the d:datetime datatype.

web-client-config.xml and share-config-custom.xml was modified in order to make the shortlink read only, and to make the expiry date editable by the user.

When the document is requested through the short link, the showDocument.get.js will compare the expiry date against the system date and will redirect the request to a page showing a message that indicates the document has expired. It will use a status template available in webscripts to show the message.

This was created to display an error message in case a rendition being unavailable. However, now the system will return the original file instead of an error if a transformation is not available for a particular filetype.

So that’s it, and when you build and deploy your project you will see a custom action within Alfresco Share document details and document library to publish a document. It will generate a link which will be expired on a set date which is available as a meta data property within the document.

I am not surprised that a spice tea is popular in Yemen as it probably is all over the Swahili coast, but I didn't know it had a name. In Kenya it came with the Indian merchants who make up so much of the middle class there. I would think in Yemen it might have come with trade–or maybe it just developed as a natural part of the spice trade. Interesting. Thanks for that tidbit.

Interested Bystander | December 17, 2012 at 5:07 pm Hey IB,You’re 100% correct! Try living in New England; it’s wall-to-wall coverage 24/7 and it’s beyond ridiculous!I, for one, have opted to turn off the local talking heads; the TV is turned on lately for traffic and weather only and that’s about it! Leave these people alone; they have enough on their plates without worrying about the vultures ready to swoop in and make their lives even more miserable than they already are.Have some respect for the families dealing with an unimaginable tragedy.

we need to arrest mccain kly and the congressmen from phx the day the step foot back in phx. i as a citizen will gladly swear out a charge of treason against every one of them. then we send new people back with very big mouths and guts to stand up for what right. where are the rest of you americans? we got patriots in every state its very easy to send these people to jail of hell what ever this takes to bring this nightmare to and end. lock n load patriots!

Hi,I’m helping a friend with their members area. I’ve successfully installed the plugin and blocked the page, but I’m getting two login boxes. One above the header and one in the body. How do I get rid of the extra above the header?Thanks!

Hiya, Just what I was looking for! I was looking into web content for our resource site when I came across your blog post on ” The business of Artificial Intelligence – Andrew Hu’s Blog ” which I found on Google. We would love you to create articles for us, if interested. I’ve bookmarked this post for future reference. Wonderful comments here as well -

This is way better compared to having shared web hosting service or
dedicated server. Most people need to use a reverse
cell lookup website when they’re being harassed by anonymous prank calls or even just when they keep receiving calls from numbers they don’t recognise and don’t want to answer.
Thanks to the increase in popularity of satellite TV, dealers have
sprung up all over the Internet promising the best deals, the
best service, and everything else under the sun.

I’m impressed, I must say. Rarely do I encounter a bblog that’s both equally educative and interesting, and without a doubt,
you have hhit the nail on the head. The issue is something which too few people are speaking intelligently about.
I am very happy I found this during my search for something
relating to this.

I like the valuable info you provide in your articles.
I’ll bookmark your blog and check again right here frequently.
I’m fairly certain I’ll be informed plenty of new stuff right here!
Best of luck for the next!

Thanks , I’ve just been looking for information about this subject for a while and yours is the
best I have discovered so far. However, what in regards to the conclusion? Are you positive in regards to the source?

Medieval II total warr ended uup being as good as, along with perhaps besst of all, than ancient first.

Each faction ability – over 16 – is a unique ability ffor thhe player that can wrek havoc on enemy
forces. Several very rich economists have publicized the idea of trickle
ddown economics, where you give already rich people money to invest into
businesses they own, create jobs, and eventually the money will disperse amongst the poor.

The contract for tbis level range from Ree Peatpants is
“Fending off the Floren,” in which you must defeat
20 Fiety Floren (located north east of the Pixie Nursery, aand
will require 2 encounters), 20Floren, 30 Snakes, and scare
offf the Great White Snake (all located in the Floren Forest, and will require one full encounter
plus a re-entry to kill two snakes. There will be two additioonal editions off Bio – Shock Infinite, on top
of the standard copy of the game, the Premium Edition and tthe Ultimate Songbird Edition. You haqve to actually fight and beat your opponents.

The biblical principles concerning the spiritual kingdom apply to
the believer ONLY, while tthe biblical principles concerning
the physical earthly kingdom are for BOTH us aand
the unbeliever alike. Such is human death bby the
sword thawt is the lotus symbol misused for war
spilling the rivers oof blood of humanity by the male lion symbol worn on the shield in later history where in contrast the female lioon hunted
for the pharaohs that fedd the table off the great eaders
in peaceful consumption aand the lptus was not misused.
Occasionaoly those whoo noo longer practice religion and then move towards some form of self realization have thee hurdle off relieving themselves of the guidance
urge from an ascended maste or other evolved unearthly teacher.

This opens uup tons of nnew possibilities for getting around the game wprld and makes you
rethink obstacles in a satisfying way. Not that I’m one of those people who hated
Skyward Sword, or Twilight Princess, or The Wind Waker, or even Spirit
Tracks, a chapter of the series that I finnd to be unfairly reviled.
Still, for extending Torchlight’s shelf life, Epic Boss Maps gets a solid 7 on the list of
the Top 10 Best Torchlight Mods out now.

Greetings I am so grateful I found your webpage,
I really found you by error, while I was researching on Askjeeve for something else, Anyways I am here now and would just like to say
kudos for a remarkable post and a all round enjoyable blog (I also
lve the theme/design), I don’t have time to read through it all at the moment but I have saved it and
also added your RSS feeds, so when I have time I will bbe back to read more, Please do keep
up the superb work.

I have a printer hooked up to the computer in my room. My daughter has a computer in her room and no printer. How can she do her homework on her computer, but have it print out on the printer in my room? Do I need the internet on one computer or both? Maybe not at all?.

Wow, so much there I hadn’t seen before — digging around with a tongue depressor, twisty gauze wipe, grape jelly extraction. Whew, what a night! All of a sudden, I’m hungry for toast. Wonder what I should put on it. . . . .

I keep discovering new great videos! Thank you so much, Sadie! Yours are the first videos on youtube that make me workout myself and not just sit there and watch it! been doing your excercices almost every day now and very happy with it!!! I loooove yoga!!!!ï»¿ THANKS!

That unfortunately doesnâ€™t make it so. Neil WilsonNegative real interest rates in housing is all the proof needed. Some cheaper consumer goods are not enough to compensate for that stolen purchasing power.Come on, the game’s up. Credit creation is a sneaky way for the rich to exploit the poor. And to the extent it is privileged by government, it is fascist. And besides that, lending money into existence creates an unstable, dangerous and most likely non-optimal economy.Would have have defended slavery, I wonder?

Hey Joel,You’ve inspired me to bump up my goals. I’m excited about them cause they seem so crazy to me.I was wondering about other personal goals like:Get marriedDate a supermodelHave kidsDid you chose to not publish them, or are they easily possible so they were not included?- Ray

[Yes, they mean our government needs to focus on the needs of the people and not the needs of the corporations/super rich. ]In other words, it’s emotive blathering, devoid of any real thought on the matter. Thanks for confirming that much for me…

I wish I had someone to distract me from making binding! I am currently deciding which fabric I can bear to stare at for long enough to make binding from it – it has very little to do with which one will match the quilt!

Matt McGee. Matt McGee is one of the smartest SEOs out there. He really gets it. And it isnâ€™t just the whole SEO thing he understands, he understands the big picture of it and the business side. He is a local search genius, and if you arenâ€™t subscribing to his blog – you are really hurting yourself. An awesome guy and a great source for U2 music, too. My favorite post on his blog: The SEO Success Pyramid.

That incorporates a Little Aid is a prize-winning, locally-owned Washington State certified house senior Home Care Bellevue, family-Resource-Home-Care.bellevuedirect.info,
firm proud to be serving the grater Seattle as well as Bellevue neighborhoods in King aas well as South Snohomish Counties since
1999.

You’re so cool! I don’t think I’ve read through something like that before.
So wonderful to find somebody with genuine thoughts on this subject.
Seriously.. many thanks for starting this up. This web
site is one thing that’s needed on the internet, someone with a bit of originality!

Woah! I’m really loving the template/theme of
this site. It’s simple, yet effective. A lot of times it’s challenging to get that “perfect balance” between usability and visual appeal.
I must say you have done a awesome job with this. In addition, the blog loads super fast
for me on Firefox. Superb Blog!

I am tired of white people dressing up incorrectly in Native American costumes and say I didn’t mean to be ditspseecrful. Really!!!!!! They won’t do it to any other culture. Hmmmmm Also the song is stupid. Oh brother.My Ancestors were there when Columbus

When you find a good pair of glasses and they work for you, you just have to keep them. I like my little round funky glasses that I’ve had since 1996 or ’97… I just get new lenses once every year or two. I also have to keep tightening the screws in the temple so they don’t fall off.

What’s Happening i’m new to this, I stumbled
upon this I have discovered It absolutely helpful and it has
aided me out loads. I am hoping to give a contribution & assist other users like its aided me.
Great job.

The monochromatic colors are known as the different
values of any single color. After all, providing value for your clients is one of the fundamentals when it comes to doing successful business.
The implications of Sensory and Experience Design can be found in everything from product development to
package design.

The children are taught through drama, flash cards and the use of multimedia.
If you have been finding for a good school where you can send your child to get good education then you are
at the right place at the moment. The Cambridge boards, GCSE,
CBSE are based on concept clarification.

64% re two years previously, next to a era while the capture content company was shedding subscribers.
Pop sensation Taylor Swift turned a few heads when she
did not make her new album 1989 available on Spotify.
deezer gratuit – http://www.comptedeezerpremium.com,’s service will start being offered
through France Telecom September 19th.

Do you mind if I quote a few of your posts as long as I provide credit and sources back to
your website? My website is in the very same area of interest as yours and
my users would really benefit from a lot of the information you provide
here. Please let me know if this ok with you. Thanks!

What have you been doing lately? I need to get some writing done and your work has been incredible lately. Do you have a secret? What do you eat for breakfast? Seriously, this piece in particular was like reading poetry. It is so beautiful. The Bad Breaks piece I could see and feel. I cringed when I read it. The description was just so vivid.It has been a great read. Thanks.

I feel like we’ve been here before… =PAnyway, I’m curious: how do you define liberation? It seems to me that you are saying that liberation is an impossibility. Is that your position?Also, I find the comment cited your second footnote to be a false dichotomy. The hijab certainly can be both just a piece of cloth and a statement. It’s certainly a symbol in that many meanings are condensed into it, but it’s also just something some women wear in parts of the world like I wear jeans and a t-shirt. It’s not an all-or-nothing proposition.

Well, I’d love to take credit for that leapy quote, but I can’t. I first heard it from Julia Cameron, but it’s older than her too. I think it’s originally a Zen saying. (And honestly, I never thought of it as writing advice, but I like it!)j recently posted..

Thanks for stopping by, Michelle. From what I’ve read it seems no one is notified. You may notice a review missing or an author notices a review missing, but it’s hard to identify which review. I simply noticed the number of reviews for this book had decreased from 5 to 4 and I doubt, after two years, a reviewer would suddenly ask to have his or her review removed. I don’t keep close track so I have no idea who the reviewer was.I suspect you would not get an email notice.

Hey! I ould have swqorn I’ve been to this
website before but after browsing through some of the post
I realized it’s new to me. Anyways, I’m definitely happy I found it and I’ll be bookmarking and
chexking back frequently!

I loved as much as you’ll receive carried out right here.
The sketch is attractive, your authored material stylish.
nonetheless, you command get bought an shakiness over that
you wish be delivering the following. unwell unquestionably come more formerly again since exactly the same nearly a lot often inside case you shield this hike.

Have you ever considered publishing an e-book or guest authoring on other blogs?
I have a blog based on the same information you
discuss and would really like to have you share some stories/information. I know my readers would enjoy your work.
If you’re even remotely interested, feel free to shoot me an e-mail.

Heya this is somewhat of off topic but I was wondering if blogs use WYSIWYG editors or if
you have to manually code with HTML. I’m starting a blog soon but have no coding knowledge so I wanted to get guidance from someone with experience.
Any help would be greatly appreciated!

I do believe all the ideas you’ve presented in your post.
They are very convincing and can definitely work.
Still, the posts are too quick for novices. Could you please lengthen them a bit from
next time? Thank you for the post.

I have to thank you for the efforts you’ve put in penning this site.
I’m hoping to see the same high-grade blog posts by you
later on as well. In fact, your creative writing abilities has encouraged me to get my very own website now

What i do not realize is in truth how you are now not actually a lot more smartly-liked
than you may be right now. You are very intelligent. You recognize therefore considerably when it
comes to this subject, made me in my view consider it from a lot of numerous angles.

Its like men and women are not involved until it is
something to do with Woman gaga! Your personal stuffs great.
At all times take care of it up!

I am now not certain where you’re getting your information, but great
topic. I must spend a while learning much more or understanding
more. Thanks for magnificent info I was on the lookout for this info
for my mission.

Very nice Article good information Great post.Do you want to ask any queries related to your Yahoo from our experts will answer you in no time 2018,Zee TV If you really facing an issues in AOL emails service, for more information visit AOL.

I have noticed you don’t monetize your blog, don’t waste your traffic, you can earn extra cash every month because
you’ve got high quality content. If you want to know how to make extra
bucks, search for: Ercannou’s essential adsense alternative

I am now not sure the place you’re getting your info, but good topic. I needs to spend a while studying more or working out more. Thank you for fantastic information I used to be in search of this information for my mission.