cancel
Showing results for 
Search instead for 
Did you mean: 

Editing Simple View in Share

berenoune
Champ in-the-making
Champ in-the-making
I am using Alfresco Community 4.2.b from the alfresco-community-4.2.b-installer-win-x32.exe installer.

At the http://127.0.0.1:8080/share/page/repository link, the current Simple View contains this format
Thumbnail — Name — Version —————- Actions
————- Date — Creator — Size

I want it to be
Name — Version — Created Date — Effectivity Date — Approved By — Actions

all in one line.

I've read from different sources that I need to change the following:
\share\WEB-INF\classes\alfresco\<strong>share-documentlibrary-config.xml</strong>
\share\components\documentlibrary\<strong>documentlist.js</strong>

But, I am not sure of which parts to edit in those 2 files.
4 REPLIES 4

jpfi
Champ in-the-making
Champ in-the-making

afaust
Legendary Innovator
Legendary Innovator
Hello,

for the "Name - Version - Created Date - Effectivity Date - Approved By" part, you should use a special metadata template line for the "title", e.g.

<blockcode>
    <config evaluator="string-compare" condition="DocumentLibrary">
        <metadata-templates>
            <template id="default">
                <!– This should get merged with the out-of-the-box "default" template –>
                <title>{nameAndVersion} - {createdDate} - {effectivityDate} - {approvedBy}</title>
                <line index="10" id="date" view="detailed">{date}{size}</line>
            </template>
        </metadata-templates>
    </config>
</blockcode>

Unfortunately, due to your special format, you need to provide your own set of <a href="http://docs.alfresco.com/4.0/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Fconcepts%2Fdoclib-clie...">renderers</a> for "nameAndVersion", "createdDate", "effectivityDate" and "approvedBy" - I doubt you can reuse any existing ones. You might also want to provide some custom layouting via CSS files in addition to the renderer code you need to provide via JS.

Bear in mind, that you can't - as far as I know - distinguish between simple and detailed view concerning the "title" metadata line, so your modification affects all views. But using this approach, you don't need to modify documentlist.js or share-documentlibrary-config.xml, you can just add a custom JS file and some configuration in share-config-custom.xml ("DocLibCustom" config-section for added JS and CSS dependencies).

The other potential alternative I see is far more complex: Implementing your own document list view renderer. Only by doing this might you be able to remove the thumbnail as well (structurally speaking - you can remove it visually by custom CSS even for the standard simple view).

Regards
Axel

Edit: Hmm, until now, I never got smilies in blockcode… Dunno how to get rid of it.

erikwinlof
Confirmed Champ
Confirmed Champ
Hi,

Its a bit hard to actually see what you are trying to achieve but it looks like you should read this blog post:
http://blogs.alfresco.com/wp/developer/2011/09/26/share-document-library-extensions-in-v4-0/

Read the section on about "Metadata Templates" and you'll realize that you want to override the metadata template with id "default" and place your custom config in you share-config-custom.xml file.

Cheers, Erik

berenoune
Champ in-the-making
Champ in-the-making
Thank you. +Mark Comment as Useful.

In the repository area, when I upload a <strong>png</strong> file and access it, it displays the Document Actions, Share link, Properties, Workflows, Version History, and Publishing History of the file.

In the properties of the <strong>PNG</strong> file, it displays the following:<blockquote>Name:
Title:
Description:
Mimetype:
Author:
Size:
Creator:
Created Date:
Modifier:
Modified Date:
Date and Time:
Image Width:
Image Height:
Exposure Time:
F Number:
Flash Activated:
Focal Length:
ISO Speed:
Camera Manufacturer:
Camera Model:
Camera Software:
Orientation:
Horizontal Resolution:
Vertical Resolution:
Resolution Unit:</blockquote>

OR, In the properties of the <strong>DOCX</strong> file, it displays the following: <blockquote>Name:
Title:
Description:
Mimetype:
Author:
Size:
Creator:
Created Date:
Modifier:
Modified Date:</blockquote>

Can I just use the codes for these two and get the created date? Where can I find the code for these?

<strong>edit:</strong> After searching for a while, I've found this file
<strong>\alfresco\WEB-INF\classes\alfresco\templates\webscripts\org\alfresco\slingshot\documentlibrary\item.lib.ftl</strong>
I want to be able to display the properties in the repository list view (Simple View). I'd like to display the createdOn, createdBy, createdByUser, modifiedOn, modifiedBy, modifiedByUser, (size and version using this renderer approach). How do I make a renderer to access these properties?