cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Upload Form for Folder

drozes
Champ in-the-making
Champ in-the-making
Hi guys;
I know this is probably a large question but would love any direction,links or suggestions.

This relates to the Share tier.

When a user is within a folder or subfolder of the name 'Campaigns' I need a custom upload form.
[img]http://i.imgur.com/AP1Oj.png[/img]

I have found the link http://www.ixxus.com/blog/2011/09/customising-the-upload-file-dialog-box-in-alfresco-share/ - but this seems to change it for every location.


My thoughts of how to accomplish this (without knowing how to impliment it).
1:When the user presses upload button.  Override the normal upload form.  Hit a webscript that will check the direction and return true/false if we are in the 'Campaigns' folder.  Use the boolean to display addition options.
2: If I can edit the upload button depending on which folder we are in,  I can drop in a custom upload button that will hit a webscript presentation with my own upload form.

Any and all help is appreciated.
2 REPLIES 2

erikwinlof
Confirmed Champ
Confirmed Champ
Hi,

I would go with #2.

1. Place a new uploader component after the original by creating a new module extension that takes advantage of the fact that you since Alfresco 4.0 can add in multiple components in the same region. Read this blog post to see an example: http://blogs.alfresco.com/wp/ewinlof/2011/11/09/add-remove-or-replace-components-on-shares-document-...

2. Override the toolbar.get.head.ftl to include a new custom javascript file with a javascript class that extends the Alfresco.DocListToolbar class and overrides the onFileUpload method. Make your overridden method launch your custom uploader if inside the Campaigns folder and if not reuse the original uploader launch code by calling the method you override simply by calling Alfresco.DocListToolbar.superclass.onFileUpload(this, e, p_obj)

3. Override the toolbar.get.html.ftl template and change the javascript class that is instantiated to become your new custom javascript class.

Cheers,

:: Erik

drozes
Champ in-the-making
Champ in-the-making
Thanks for your reply.

I ended up just overriding the upload.ftl files for html/flash/dnd and adding in my own element  -  Than updating the javascript files to work for me.

I think for the future though - I'll be forcing my own upload button, avoiding having to override share.