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
08-17-2007 06:45 AM
With 2.1.0, we provide 5 default appearances of the file-picker. Different appearances can be used for different elements within the same web form using the appearance annotation.
These default configs can be found in web-client-config-wcm.xml. These enable you to limit selection based on file or folder, mimetype.
<widget xforms-type="xf:upload" javascript-class-name="alfresco.xforms.FilePicker"> <param name="selectable_types">wcm:avmcontent,wcm:avmfolder</param> </widget> <widget xforms-type="xf:upload" appearance="image_file_picker" javascript-class-name="alfresco.xforms.FilePicker"> <param name="selectable_types">wcm:avmcontent</param> <param name="filter_mimetypes">image/*</param> </widget> <widget xforms-type="xf:upload" appearance="html_file_picker" javascript-class-name="alfresco.xforms.FilePicker"> <!– allow folder selection to handle index pages –> <param name="selectable_types">wcm:avmcontent,wcm:avmfolder</param> <param name="filter_mimetypes">text/html</param> </widget> <widget xforms-type="xf:upload" appearance="folder_picker" javascript-class-name="alfresco.xforms.FilePicker"> <param name="selectable_types">wcm:avmfolder</param> <param name="filter_mimetypes">*</param> </widget> <widget xforms-type="xf:upload" appearance="file_picker" javascript-class-name="alfresco.xforms.FilePicker"> <param name="selectable_types">wcm:avmcontent</param> </widget>
To use an element from an XML for create directories, you'll want to refer to the element using the xml node variable in your Freemarker expression in your output path. The reference for this can be found in the Help instructions next to the output path field.
Let us know if any more questions.
Kevin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2007 11:49 AM
I'll make some experiments with appearance for the filepicker and with Freemarker expression in output path: I'll let you know if there are problems.
Another question: since configuration for filepicker appearances is in web-client-config-wcm.xml, have I also the possibility to change that configuration to customize filepicker? For example, I could create a filepicker that filters PDF files with a definition like the following one:
<widget xforms-type="xf:upload" appearance="pdf_file_picker" javascript-class-name="alfresco.xforms.FilePicker"> <param name="selectable_types">wcm:avmcontent</param> <param name="filter_mimetypes">application/pdf</param></widget>
If the answer is positive, where could I find a reference for web-client-config-wcm.xml customization?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2007 05:14 PM
We'll be working on documentation on the wiki starting next week in prep for the final release of 2.1.0 Enterprise, targeted end of the month.
Glad to see you're potentially finding utility in the new config options.
Kevin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2007 04:34 AM
This is the definition in XSD I wrote to create the form
<?xml version="1.0"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:az="http://www.sky.it/contentmodels/az" xmlns:alf="http://www.alfresco.org" targetNamespace="http://www.sky.it/contentmodels/az"> <xs:element name="enterprise"> <xs:complexType> <xs:sequence> <xs:element name="logo" type="xs:anyURI"> <xs:annotation> <xs:appinfo> <alf:label>Logo path</alf:label> <alf:alert>A logo is required to create content</alf:alert> <alf:appearance>image_file_picker</alf:appearance> </xs:appinfo> </xs:annotation> </xs:element> <xs:element name="name" type="xs:normalizedString"/> <xs:element name="code" type="xs:normalizedString" /> </xs:sequence> </xs:complexType> </xs:element></xs:schema>
While alert and label are correctly shown, filepicker doesn't filter anything. Where am I wrong?
edit: I almost forgot. I'm using Alfresco Community Release 2.1
edit2: I edited the file web-client-config-wcm.xml in /<alfresco-root>/tomcat/webapps/alfresco/WEB-INF/classes/alfresco and I noticed there's nothing like
<widget xforms-type="xf:upload" appearance="image_file_picker" javascript-class-name="alfresco.xforms.FilePicker"> <param name="selectable_types">wcm:avmcontent</param> <param name="filter_mimetypes">image/*</param> </widget>
and so on. There is just ONE line referring to xf:upload<widget xforms-type="xf:upload" javascript-class-name="alfresco.xforms.FilePicker"/>
I tried to modify web-client-config-wcm.xml adding xf:upload image_file_picker appearance but nothing changed in the rendered form. I also tried to modify RictTextEditor config to add HTML code button and the modification worked, so it seems there's some issue with xf:upload appearance hack: can u confirm it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2007 05:40 AM
Are you using Community Final? This enhancements was not in Community RC1.
You can tell if it is by the web-client-config-wcm.xml file. If you do
not see the default appearances for the file-picker, that release version
does not support the filtered file-picker widget. You should have to
modify any code or config file other than your own XSD to get a
default file-picker filtered on images.
Kevin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2007 04:01 PM
Where can i find the version of Alfresco currently installed on my system?
edit: damn, I've opened the README file and these are the first three lines:
==============================Alfresco 2.1 Release Candidate==============================
Ok, so I've downloaded Alfresco 2.1 RCWith the new version, I will be able to create all the customizations of filepicker just modifying ONLY the web-client-config-wcm.xml file, right?
edit2: I've downloaded Alfresco 2.1 and in web-client-config-wcm.xml file (located in <alfresco-root>/tomcat/webapps/alfresco/WEB-INF/classes/alfresco) there's just ONE line for filepicker. I'm going crazy: where are the appearances you were talking about?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2007 06:02 AM
You are not going crazy; I'm being crazy unclear.
This check-in was done post Community Final (what is currently posted on SourceForge) after our 2.1 Enterprise branch split. Normally post branch we only do bug fixes marked "Major" in JIRA (Community gets all "Blocker" and "Critical" bugs fixed, as well as many Majors are possible). In this particular case, because of all the forum activities around the file-picker widget and TinyMCE editor, we've added an enhancement (which will get back-ported to an updated Community release once we finalize and ship Enterprise end of this month).
You can get access to the v2.1 branch and the current 2.1 Enterprise BETA (it is much more stable than Community) either via subscription or by requesting a trial eval. Otherwise, stay tuned for the 2.1 Community refresh we'll do in a few weeks time.
Sorry for being unclear. That's what happens when you answer questions too quickly!
Kevin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2007 01:23 PM
You can get access to the v2.1 branch and the current 2.1 Enterprise BETA (it is much more stable than Community) either via subscription or by requesting a trial eval.
I'm sorry to bother you… but where can I get the 2.1 version? On alfresco.com if I click download I can request a trial for 2.0 version… Where am I wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2008 03:57 PM
tell me if i'm wrong!
I would love to be able to select only folder, and be able to set the default path to open the "select box"

thx
