...
Expand | ||
---|---|---|
| ||
This component generates some test files to make it easier to learn how to make a custom file reader. You can useCreate component +FROM URL to import the component. Copy paste the URL from here:
|
Expand | ||
---|---|---|
| ||
Refer to Customizing components Edit a Component to see how it's done if you have not done this before. |
...
Expand | |||||
---|---|---|---|---|---|
| |||||
Navigate to MatchRules.lua in the Project Tree. This is the function we need to alter:
The file reader component is deliberately simple and uses /wiki/spaces/IXB/pages/3181903910 separation of concerns to make it more obvious how to modify the code to meet new needs. We need this function to return true when the matching criteria are met. |
Expand | |||||
---|---|---|---|---|---|
| |||||
Change the matching to add in two lines so we can see the filenames we need to filter on.
These are the concepts we have used:
|
Expand | |||||
---|---|---|---|---|---|
| |||||
Create a second function, APPidList, to extract the ClientList prefixes from the custom fields and update MatchFile to call APPidList. You can replace the contents of the MatchRules.lua file with this new code:
Concepts used:
|
Expand | |||||
---|---|---|---|---|---|
| |||||
We can quickly do this by adding one line to AppidList after line 2:
You should see something like: Concepts used: |
Expand | |||||
---|---|---|---|---|---|
| |||||
Create a third function, APPmatchPrefix, to determine if the filename matches the prefix. You can copy the code below:
See the screenshot below and add a line to MatchFile to call and invoke AppmatchPrefix. Concepts used:
|
...
There is no limit to how you can streamline the usage of a custom component - if that helps address a bottleneck, then it is well worth it.
...