Page 1 of 1

Define input file mask for transformation senario

Posted: Thu Feb 14, 2013 1:12 am
by daliboris
When transforming folder with transformation scenario, it would be useful to have something like "file mask" or "file pattern" defined in scenario. For example, if there are multiple files in the same directory (e.g. XML and HTML files), I want transform only XML files (ie. files with ".xml" extenstion). I didn't find how to achieve this with transformation scenario.

I tried use "XML URL: ${cfdu}/*.xml", but this gives me an error.

Combination of parameters "XML URL: ${currentFileURL}" and (new) "XML File Pattern: *.xml" would useful.

I see only one possible problem: what if there is current file opened in editor and this file does not match the pattern. Should be transformed, or not? I think it shouldn't.

Re: Define input file mask for transformation senario

Posted: Thu Feb 14, 2013 7:09 pm
by adrian
Hello,

Please note that a transformation scenario can only be configured to process a single file, so you cannot specify a file filter pattern or mask. However, a scenario that has XML URL: ${currentFileURL} can be applied to a selection of files and directories from the Project view (in turn for each file).

Currently it is not possible to filter the file extension in a scenario, but there are a few possible workarounds:
  • select in the project view only the files that you want involved (instead of an entire directory with mixed files) and then associate the scenario with that selection (right click on the selection from the Project view and from the contextual menu choose Transform > Configure Transformation Scenario(s).)
  • create a logical folder in the project (right click on the root of the project and from the contextual menu choose New > Logical Folder) and link there only the files you want to transform and associate the scenario with that logical folder (either add the files manually or drag and drop them). All the files from that logical folder will also be associated when you associate the logical folder.
  • hide the files that you don't want involved in the transformation. Go to main menu > Project > Filters and in the field Matching files will be hidden type: *.html The transformation on a folder will only by applied to the the files visible in the Project view.
We will consider adding support for such a use case in a future version of Oxygen. I've submitted a feature request for this on our issue tracking tool.

Regards,
Adrian