cancel
Showing results for 
Search instead for 
Did you mean: 

Integration of custom content

madhu2710
Champ in-the-making
Champ in-the-making
Hi Friends,
I was trying to retrieve the content from the repository.I found a class FileContentStore (from alfresco code that I have downloaded it from its repo ) in which the content URL format
for file stores is defined as <b>store://year/month/day/GUID.bin</b>

This is how our content is stored in the repository.

The code which defines the hierarchy of storage of our content described in FileContentStore.java is

/**
     * Creates a new content URL.  This must be supported by all
     * stores that are compatible with Alfresco.
     *
     * @return Returns a new and unique content URL
     */
    public static String createNewFileStoreUrl()
    {
        Calendar calendar = new GregorianCalendar();
        int year = calendar.get(Calendar.YEAR);
        int month = calendar.get(Calendar.MONTH) + 1;  // 0-based
        int day = calendar.get(Calendar.DAY_OF_MONTH);
        int hour = calendar.get(Calendar.HOUR_OF_DAY);
        int minute = calendar.get(Calendar.MINUTE);
        // create the URL
        StringBuilder sb = new StringBuilder(20);
        sb.append(FileContentStore.STORE_PROTOCOL)
          .append(ContentStore.PROTOCOL_DELIMITER)
          .append(year).append('/')
          .append(month).append('/')
          .append(day).append('/')
          .append(hour).append('/')
          .append(minute).append('/')
          .append(GUID.generate()).append(".bin");
        String newContentUrl = sb.toString();
        // done
        return newContentUrl;
    }

Now that I want to change the path and the mimetype for the stored content from .bin to other formats so that it can be accessed from outside and retrieved.Is this possible ?

If I change this code here, how can I integrate and work as usual?
Please Help !
6 REPLIES 6

mikeh
Star Contributor
Star Contributor
It's a really, really bad idea to give people direct access to the contentstore files in alf_data. For starters, you could destroy any links between the content and the database, but also people could very easily be accessing old versions of content without realising.

Alfresco supports FTP, WebDAV and CIFS for external file access so you should be using one of those interfaces instead.

Mike

madhu2710
Champ in-the-making
Champ in-the-making
Thanks Mike,
But is it possible to write some code and integrate it and work as usual.Please can you explain the ways of Integration.

mikeh
Star Contributor
Star Contributor
What are you trying to achieve?

Mike

madhu2710
Champ in-the-making
Champ in-the-making
Hi Mike,

What exactly I wanna do is, Only the content of my website is to be managed by Alfresco but not building the whole project on Alfresco from the root.Alfresco should control the content of my site.

Whenever changes have to be made, The task shouldn't be dependent on the developer instead the publisher or the business person himself can make the changes,which can be done through Alfresco.So, the changes made to the content through Alfresco is to be saved in database(or any filesystem with a mime type that can be noticeable and retrieved) so that we can retrieve that content back and publish in our site.This is what I am looking for.Can you now help me in this regard please.

mikeh
Star Contributor
Star Contributor
It depends what framework you've got in the "we can retrieve that content back and publish in our site" step. If that step is an application that runs periodically, then you can use any of the methods mentioned above, i.e. FTP, WebDAV or CIFS to download the content and publish it to your web server.

If you want to publish links to the content, the following wiki article should be useful:
http://wiki.alfresco.com/wiki/URL_Addressability

Thanks,
Mike

jgp
Champ in-the-making
Champ in-the-making
Hi Mike,

Even i have the same problem and i didn't understand it , can you explain me clearly .

Hi Madhu if u got anything pls share with me …

Thanks in Advance