BS2000 File Filter and Accessing Shared Files of a Foreign User ID
File filter
If a user ID contains files of several projects, you can define filters to select only
files of one project. For instance, if there are files of your project, prefixed with
myproj.
, and files of another project, prefixed with otherproj.
,
You can define a filter to select files of your project only. As usual, filters are defined
by selecting New >
Filter in the context menu of BS2000 files.
-
In Filter name you can define a name for the filter that will be visible in BS2000 Explorer, e.g. My Project.
-
To change existing filter directory, select it and choose Edit directory.
In the next window enter dot (.) or Browse
and select Default pubset. It is also possible to specify a library,
a sub-folder or a POSIX directory (if enabled).
-
In Filter Strings you can define custom wildcard (or regular expression) pattern
to display only requested file names. By default the asterisk (*) pattern is added.
More information regarding creating Filter String can be found in
Creating Filter Strings.
-
You can add further filter strings (click Add button below Filter Strings section),
e.g. if you are interested in files with more than one prefix, e.g.
myproj.*
and
common.*
-
Selecting option Global filter will result in creating filter for each BS2000 Connection
(for new created connections as well). The filter preferences (such like filter strings) will be shared across
all connections. If you disable this option, the filter will be removed from other connections and it will be
visible only in current connection.
If the Show files only option is activated, the list of libraries (POSIX directories) is suppressed.
In the following example the pattern is set to display all files :
After Finish has been clicked the new filter appears in the
BS2000 Explorer view and can be expanded:
Properties of a filter can be viewed via the Properties action of its context menu.
To add additional Filter directory click Add directory button. You can
specify here e.g. only elements of type S
from myproj.plam
library.
If you select Show files only for Default pubset then our tree will be presented as below:
|
You can also create or modify Filter directory path manually by providing the correct BS2000 path.
To be more consistent with BS2000 and OpenFT the Filter directories paths in BS2000 Explorer are as follows:
- $USERID. as path user's default pubset.
- $USERID.PLAMLIB or PLAMLIB as path to specific BS2000 Plam Library.
- $USERID.PLAMLIB/X or PLAMLIB/X as path to specific BS2000 Plam Library's Type.
- :PUBSET:$USERID. as path to user's files on specific pubset
- / as path to POSIX File System root.
- /home/user as path to POSIX File System directory: /home/user.
It is also possible to specify multiple pubsets in filter directory by using asterisk "*" wildcard.
For example, filter directory :P*:. will display all files from pubsets starting with "P".
|
Filters to access shared files owned by another user ID
Shared files owned by other user IDs can be accessed by defining an appropriate filter.
-
As Filter directory enter /$ followed by the other user ID or BS2000 path: $USERID. .
-
As Filter String enter * or a more specific wildcard pattern.
If there is a huge number of shared files in the specified user ID and * is
defined as file name filter, it may take a very long time to expand the file tree. To accelerate
expansion it is recommended to define more specific file name filters.
Here is an example of a filter for some shared files in user ID $TSOS:
Expanding this filter delivers:
Creating Filter Strings
In BS2000 Explorer you can define the Filter Strings in two different ways.
The first one is default wildcard pattern and the second way is by using regular expression.
To use regular expressions you need to select Regular expression (ASCII) during creation or modification
given Filter String. Here is the example of filter string displaying only files that contains 3 digits in name:
To use regular expressions by default, you need to select Enable regular expressions in Filter Strings in
Window > Preferences > BS2000 Remote IDE > BS2000 Explorer.
After change confirmation, each new Filter String will be created as regular expression by default (note that this mechanism
will not convert existing wildcart patterns).
|
The BS2000 Explorer does not support Starts with (^), Ends with ($)
and separator (|) notation in Regular Expressions:
- If file name must starts from given sign (for e.g. "S") then you need to provide regular expressions
as
S.* . The same methods must be applied for files ending with given sign: .*S .
- If you provide just:
S as regular expression, then only file (or Plam library)
with name "S" will be displayed.
- To display all files containing (or starts / ends with) "S"
then you need to set Filter String as:
.*S.* (regular expressions is fully matched)
The above rules also apply for standard Filter String but instead of ".*" you need to use "*" wildcard.
Filter Strings used to filter out BS2000 files are not case sensitive in contrast with
POSIX files (where case sensitivity while filtering is taken into account).
|
Nested filter strings
BS2000 Explorer provides mechanism for handling nested filter string. This means that you can now use slash (/
)
to separate patterns for sub-directories (for e.g. elements of Plam Libraries). To display all files in Default pubset that
starts with myproject
and to show only elements of type S
of Plam Libraries (if any)
we need to create filter string:
(For regular expressions you need to use Filter String: myproj.*/s/.*
)
Here is example of using such Filter (myproj.plam
and myproject.lib
contains more library types):