cancel
Showing results for 
Search instead for 
Did you mean: 

custom content viewer

pichai
Champ in-the-making
Champ in-the-making
What is the best way to add a custom content viewer?

I'm new to Alfresco and a bit lost in the sea of Alfresco documentation.

I have to deal with text files generated from a legacy ERP system.  I want users to view those text files directly on the browser. Those text files need to be reformatted before they can be shown on the browser. Some of the text files are very large. It would be nice to let users interactively select to view different sections within the text file.

So the viewer could be a servlet that knows how to display the text files and interact with users. How do I integrate this servlet to Afresco?

Should I add a new aspect and a custom action?
Or I should just hack and put another link in the link section of document details. This link would point to my custom servlet.
2 REPLIES 2

rdanner
Champ in-the-making
Champ in-the-making
What is the best way to add a custom content viewer?

I'm new to Alfresco and a bit lost in the sea of Alfresco documentation.

I have to deal with text files generated from a legacy ERP system.  I want users to view those text files directly on the browser. Those text files need to be reformatted before they can be shown on the browser. Some of the text files are very large. It would be nice to let users interactively select to view different sections within the text file.

So the viewer could be a servlet that knows how to display the text files and interact with users. How do I integrate this servlet to Afresco?

Should I add a new aspect and a custom action?
Or I should just hack and put another link in the link section of document details. This link would point to my custom servlet.

The "viewer" was linked to the mime type the last time I looked. I had an issue once where I wanted some XML documents to be viewed with one viewer and others to be viewed with another (specifically… if I had a reference to an XSL i wanted to us a rich editor, if I did not, I wanted the vanilla editor.)


Check out this link as an example:
http://www.alfresco.org/forums/viewtopic.php?t=396&highlight=xml+editor

The example is a little bit complicated because it replaces some of the hard coded case logic with XML configurable "pipelines" which you can think of as inverson of control at the method level.   But it should provide you with what you need to know.

pichai
Champ in-the-making
Champ in-the-making
thanks rdanner. Your framework is nice, but I guess I need a simpler solution, as I only need a viewer, not an editor. So it could just be a modless form on a seperate window.

So far, I think the "View in Browser" link could be the integration point. I could write a servlet to handle /download/direct/* url.
Your suggestion about mimetype is helpful. I can use the mimetype service to determine whether to forward the request to another view or forward it to the original DownloadContentServlet.