Webforms + Filepicker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2007 01:05 PM
I've some questions about the filepicker ui control.
- How can I filter what kind of resources the filepicker can show? Something similar was asked here but I didn't understand how to modify the XSD file to render a web form to create a filepicker control that filters sone files instead of others.
- Always here there's something about "metadata": through a JSP callout i can show some categories but how can I create a directory on-the-fly or modify the filepicker in the same form when I select a category insted of another one? These two functionalities are suggested in that post too.
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2008 05:00 AM
I'm not longer using Alfresco, but i think they fixed it moving all the upload-file buxfixes to Alfresco Community, after releasing Alfresco Enterprise. In fact Kevin wrote "Otherwise, stay tuned for the 2.1 Community refresh we'll do in a few weeks time.". Alfresco 2.1 Community was released some months ago, so it seems strange they didn't fix this issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2008 08:46 AM
and i'm having this version:
Alfresco started (Community Network): Current version 2.1.0 (484) schema 64 - Installed version 2.1.0 (484) schema 64
It's the latest release i found on source forge.. following the Wiki download pages!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2008 07:30 AM
Thanks
Prateek

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2008 04:42 AM
i want to show only few folder in my FilePicker . What should i write in <param name="selectable_types">wcm:avmfolder</param> so that only selectables folders will be shown.
Thanks
Prateek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2008 09:17 AM
Here is the section I added to web-client-config-wcm.xml to add a folder_restricted_file_picker appearance:
====================================
<widget xforms-type="xf:upload"
appearance="folder_restricted_file_picker"
javascript-class-name="alfresco.xforms.FilePicker">
<param name="selectable_types">wcm:avmcontent</param>
<param name="filter_mimetypes">image/*</param>
<param name="folder_restriction">images</param>
</widget>
===================================
Here is the schema I used
===================================
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:alf="http://www.alfresco.org" elementFormDefault="qualified">
<xs:simpleType name="FilePickerType">
<xs:restriction base="xs:anyURI" />
</xs:simpleType>
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="filepicker" type="FilePickerType" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:appinfo>
<alf:appearance>folder_restricted_file_picker</alf:appearance>
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
===================================
i've got information from http://wiki.alfresco.com/wiki/Configuring_XForms_Widgets
i finally end up getting this error: 'images' not found in /.
what do i do now??!!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2008 09:18 AM
Here is the section I added to web-client-config-wcm.xml to add a folder_restricted_file_picker appearance:
====================================
<widget xforms-type="xf:upload"
appearance="folder_restricted_file_picker"
javascript-class-name="alfresco.xforms.FilePicker">
<param name="selectable_types">wcm:avmcontent</param>
<param name="filter_mimetypes">image/*</param>
<param name="folder_restriction">images</param>
</widget>
===================================
Here is the schema I used
===================================
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:alf="http://www.alfresco.org" elementFormDefault="qualified">
<xs:simpleType name="FilePickerType">
<xs:restriction base="xs:anyURI" />
</xs:simpleType>
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="filepicker" type="FilePickerType" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:appinfo>
<alf:appearance>folder_restricted_file_picker</alf:appearance>
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
===================================
i've got information from http://wiki.alfresco.com/wiki/Configuring_XForms_Widgets
i finally end up getting this error: 'images' not found in /.
what do i do now??!!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2008 09:11 AM
1. Change a section in web-client-config-wcm.xml to add the appearance folder_restricted_file_picker
<widget xforms-type="xf:upload"
appearance="folder_restricted_file_picker"
javascript-class-name="alfresco.xforms.FilePicker">
<param name="selectable_types">wcm:avmcontent</param>
<param name="filter_mimetypes">image/*</param>
<param name="folder_restriction">images</param>
</widget>
Here's the explanation:
selectable_types wcm:avmcontent Picks only files (not folders)
filter_mimetypes image/* Picks only files which are images
folder_restriction images Folder in ROOT from where files are picked
2. Create the following schema
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:alf="http://www.alfresco.org" elementFormDefault="qualified">
<xs:simpleType name="FilePickerType">
<xs:restriction base="xs:anyURI" />
</xs:simpleType>
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="filepicker" type="FilePickerType" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:appinfo>
<alf:appearance>folder_restricted_file_picker</alf:appearance>
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
3. Disable the button “Add Content”
i. Go to file_picker_widget in C:\Alfresco\tomcat\webapps\alfresco\scripts\ajax
ii. Go to line having “addContentLink.filePickerWidget = this;”
iii. Comment this line by prefixing //
iv. Save
4. Restart the server.
5. Create a Web Form and use the schema created.
6. Create a Web Project and add this Web Form.
7. Create a folder in ROOT and add files in it
i. In Alfresco, navigate to the web project.
ii. Click on the “My Sandbox” icon.
iii. Go to Create>Create Folder; Title: images
iv. Click on the newly created folder.
v. Go to Create>Add Content.
vi. Browse to the files and upload them. You will be able to add only image files!
vii. Click “OK”
8. Now use the Create Content option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2008 08:17 AM
I don't understand well what you want to do in your second post, but about first post maybe try to replace with this code :
<param name="folder_restriction">/images</param>
I think you forgot "/" before folder name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2008 09:58 AM
can u plz help me in creating an xslt to display the image??
ive tried out these lines:
<img src=".{root/filepicker}" alt="Image"/>
<xsl:value-of select="root/filepicker"/>
i'm not able to see the image.
the path displayed (of the image ) is \filename.extension
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2008 10:06 AM
<xsl:template match="/"><xsl:element name="img"> <xsl:attribute name="src"> <xsl:value-of select="/root/filepicker"/> </xsl:attribute></xsl:element></xsl:template>
