how to select folders with ${ask()} editor variable
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 65
- Joined: Fri Jan 18, 2008 5:54 pm
how to select folders with ${ask()} editor variable
Post by Ron Van den Branden »
Hi,
For a transformation scenario I'm developing in a project, I am looking for an elegant way to ask which files or folders to transform. The most user-friendly option would be a combo box that is populated by a dynamic lookup of the subfolders in a given folder (since more subfolders may be added in the course of time). Yet, I'm aware this might be a very specific use case that is not covered by Oxygen. Another issue is that the available ${ask()} variable types don't allow for multiple answers (radio and combo box only allow a single selection).
The next best option I could find for asking the path to the user, is the ${ask()} variable of type 'url'. This presents the user a with dialog window that allows for manual input of a path, or selection of a file:

Yet, the "Browse for local file" option only allows for the selection of a file. Of course, after a file has been selected and its URL has been pasted in the "URL:" text field, the user could remove the file part and enter the URL of a parent folder. Yet, this is not the most user-friendly way for the non-technical users I'm developing the project for. Is there a way to add an option "Browse for local folder" to that dialog? Or is there a better way overall to let users select folders for a transformation scenario?
Best,
Ron
For a transformation scenario I'm developing in a project, I am looking for an elegant way to ask which files or folders to transform. The most user-friendly option would be a combo box that is populated by a dynamic lookup of the subfolders in a given folder (since more subfolders may be added in the course of time). Yet, I'm aware this might be a very specific use case that is not covered by Oxygen. Another issue is that the available ${ask()} variable types don't allow for multiple answers (radio and combo box only allow a single selection).
The next best option I could find for asking the path to the user, is the ${ask()} variable of type 'url'. This presents the user a with dialog window that allows for manual input of a path, or selection of a file:

Yet, the "Browse for local file" option only allows for the selection of a file. Of course, after a file has been selected and its URL has been pasted in the "URL:" text field, the user could remove the file part and enter the URL of a parent folder. Yet, this is not the most user-friendly way for the non-technical users I'm developing the project for. Is there a way to add an option "Browse for local folder" to that dialog? Or is there a better way overall to let users select folders for a transformation scenario?
Best,
Ron
-
- Posts: 9451
- Joined: Fri Jul 09, 2004 5:18 pm
Re: how to select folders with ${ask()} editor variable
Hi Ron,
Indeed ask editor variables have their limitations.
About these questions:
Regards,
Radu
Indeed ask editor variables have their limitations.
About these questions:
I will add an improvement request for this. Just to see if I understand, the ask editor variable is used as a parameter to an XSLT-based scenario which is then read in the XSLT and the XSLT iterates resources.Is there a way to add an option "Browse for local folder" to that dialog?
Also a possibility. We also have plenty of Java-based API, for example if you have Java knowledge you can implement a plugin to add a custom toolbar action which shows a custom dialog asking the user for certain things, then use our API to create an XSLT transformer and transform with it.Or is there a better way overall to let users select folders for a transformation scenario?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 65
- Joined: Fri Jan 18, 2008 5:54 pm
Re: how to select folders with ${ask()} editor variable
Post by Ron Van den Branden »
Hi Radu,
Thanks for your thoughts.
Maybe another suggestion (if I may): it could be helpful to be able to specify a default location for the file dialog, so that it opens at the specified location. If it would be possible to e.g. pass this with a parameter to the 'url' ${ask()} editor variable, it could help the users if the dialog always opens in the current project folder.
Best,
Ron
Thanks for your thoughts.
Indeed; in this case it is used in an ANT transformation scenario which invokes the XSLT (besides doing some extra stuff like creating and cleaning up temporary files).I will add an improvement request for this. Just to see if I understand, the ask editor variable is used as a parameter to an XSLT-based scenario which is then read in the XSLT and the XSLT iterates resources.
Maybe another suggestion (if I may): it could be helpful to be able to specify a default location for the file dialog, so that it opens at the specified location. If it would be possible to e.g. pass this with a parameter to the 'url' ${ask()} editor variable, it could help the users if the dialog always opens in the current project folder.
Thanks for the suggestion. Not much Java knowledge here, unfortunately, but this motivates me to continue that Java MOOC and discover Oxygen's gems in full glory...We also have plenty of Java-based API, for example if you have Java knowledge you can implement a plugin to add a custom toolbar action which shows a custom dialog asking the user for certain things, then use our API to create an XSLT transformer and transform with it.
Best,
Ron
-
- Posts: 9451
- Joined: Fri Jul 09, 2004 5:18 pm
Re: how to select folders with ${ask()} editor variable
Hi Ron,
The third parameter which can be given to the ask editor variable is a default location like:
but we would also need to support an url_directory type of ask editor variable which would allow you to choose only folders and return the value of a folder. As I said, I've already added an improvement request for this.
Regards,
Radu
The third parameter which can be given to the ask editor variable is a default location like:
Code: Select all
${ask("test?", url, "file:/c:/eclipse")}
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 65
- Joined: Fri Jan 18, 2008 5:54 pm
Re: how to select folders with ${ask()} editor variable
Post by Ron Van den Branden »
Hi Radu,
Providing a literal URL as default location does work indeed.
Best,
Ron
Sorry; I had overlooked that due to the fact that I had to work around the current limitation that ${ask()} editor variables are evaluated too early in ANT tasks (as I reported in another thread http://www.oxygenxml.com/forum/topic11025.html). Currently, ${ask("test?", url, ${pdu})} doesn't work, but as you said in that thread, this will be fixed in a next Oxygen release.The third parameter which can be given to the ask editor variable is a default location
Providing a literal URL as default location does work indeed.
Best,
Ron
-
- Posts: 9451
- Joined: Fri Jul 09, 2004 5:18 pm
Re: how to select folders with ${ask()} editor variable
Hi Ron,
Yes, Oxygen 17.0 will evaluate the ask editor variable used in scenario parameters after all other variables have been evaluated.
Regards,
Radu
Yes, Oxygen 17.0 will evaluate the ask editor variable used in scenario parameters after all other variables have been evaluated.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 11
- Joined: Sat Feb 25, 2017 1:18 am
Re: how to select folders with ${ask()} editor variable
Hi there,
I am wondering about the status of the directory option of the ${ask()} variable. I am a similar position as above, where I am creating a downloadable package that uses ANT and XSLT to run a suite of tools against a user's project. These users are likely to be non-technical.
Best,
Joey
I am wondering about the status of the directory option of the ${ask()} variable. I am a similar position as above, where I am creating a downloadable package that uses ANT and XSLT to run a suite of tools against a user's project. These users are likely to be non-technical.
Best,
Joey
-
- Posts: 9451
- Joined: Fri Jul 09, 2004 5:18 pm
Re: how to select folders with ${ask()} editor variable
Hi Joey,
Funny that in the same day we get two questions from two different people about a feature which has not been requested very often.
Please see my reply here:
viewtopic.php?f=1&t=14223&p=41890#p41894
Regards,
Radu
Funny that in the same day we get two questions from two different people about a feature which has not been requested very often.
Please see my reply here:
viewtopic.php?f=1&t=14223&p=41890#p41894
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service