manoj kumar
manoj kumar

Reputation: 19

in alfresco share, while adding new item in datalist, how to add attachment file from local pc explorer instead of alfresco server?

I have created a custom datalist using xml, what i am trying to do is, while adding new item in custom datalist, how to add attchments from local pc instead of alfresco server.alfresco server image attchment

In the image while clicking attachment select button it opens up alfresco server page for adding files but i want to add files from local windows explorer while clicking select button.

Upvotes: 0

Views: 261

Answers (1)

Jeff R.
Jeff R.

Reputation: 188

The simple answer is that you can't do this without customization. Your attachment field is modeled as an association and by default it's going to use the association control (association.ftl) in share for selecting your content. See http://docs.alfresco.com/5.1/concepts/dev-extensions-share-form-controls.html and the Forms reference link at the bottom of that page.

You also need to consider your business logic. If a user uploads a file, where in the repository will it be stored? Your control would either have to assume some location (hopefully with a param you pass your control) or allow a user to browse for that folder location as well.

So, to do this, you'd need to create a custom control and configure that to be used for your datalist in your share-config-custom.xml. You might look into the tutorials for creating your own control. There are lots of examples around that you can google for as well.

The web link above provides a limited tutorial. Looking at the best way to do this yourself, you might look at what others have done to get an idea. Check out the multivalve form control https://addons.alfresco.com/addons/multivalue-form-control (click on the visit github.com link on that page to go to the source). Also the share extras CKEditor forms control http://share-extras.github.io/addons/ckeditor-forms/ might be a good one to look at.

You can also look at all the basic form controls in alfresco and use them as a basis. The free marker for them is here https://github.com/Alfresco/share/tree/master/web-framework-commons/src/main/resources/alfresco/site-webscripts/org/alfresco/components/form/controls. Most of the time, I just want to make some basic modifications to a control that already exists and I'll copy the freemarker, JavaScript, and css and use that as a starter.

Upvotes: 1

Related Questions