cancel
Showing results for 
Search instead for 
Did you mean: 

anyURI open in a specific avm location

boneill
Star Contributor
Star Contributor
Hi All,

Is there any way to set the anyURI widget to open a specific avm path from which they can then continue to browse the child folders in order to find an item. 

The closest I can find is the 'File Picker' Folder Restriction  (see http://wiki.alfresco.com/wiki/Configuring_XForms_Widgets).

'File Picker' Folder Restriction
The 'folder_restriction' parameter must be set to a relative AVM folder path (e.g. some/relative/folder/path). This must point to the AVM folder to which you want to restrict the file picker and be relative to the ROOT folder of the web project. Only the contents of the specified folder will be available for selecting in the file picker. If the 'folder restriction' parameter is set to the example relative folder path above, then the absolute path for that AVM folder will be something like 'sandbox-store-id:/www/avm_webapps/ROOT/some/relative/folder/path' - where 'sandbox-store-id' is the ID of the sandbox being populated by the file picker and '/www/avm_webapps/ROOT/' is the path to the ROOT folder of the web project.

Unfortunately as can be seen above you can only select content from the folder you have configured to open in.  What I want to do is limit the user to a starting folder and then let the user browse from there.

Regards
2 REPLIES 2

steventux
Champ in-the-making
Champ in-the-making
if you configure
<param name="selectable_types">wcm:avmcontent,wcm:avmfolder</param>
the wcm:avmfolder should allow you to see and select subfolders.

steventux
Champ in-the-making
Champ in-the-making
Sorry bad advice
I get what you mean.
I altered FilePickerBean.java
around line 403 (I'm using SVN build)
     
// if folder path restriction (relative path) is set,
      // then calculate the absolute restriction path (in context of file
      // picker's
      // initial current path - the path at which it was opened the first time)
      // and set file picker current path to that
      if ((folderPathRestriction != null)
            && (folderPathRestriction.length() != 0))
      {
        if (!currentPath.startsWith(initialCurrentPath + folderPathRestriction)) 
        {
           currentPath = initialCurrentPath + folderPathRestriction;
        }
      }
The if (!currentPath.startsWith(initialCurrentPath + folderPathRestriction))  modifcation checks to see if we are in a subdirectory of the original path restriction. I guess you could go further and create another parameter to decide whether to operate like this or with a total restriction as before.