Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validity / Visibility should have an inverse attribute #49

Closed
end2endzone opened this issue Apr 28, 2020 · 2 comments
Closed

Validity / Visibility should have an inverse attribute #49

end2endzone opened this issue Apr 28, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@end2endzone
Copy link
Owner

end2endzone commented Apr 28, 2020

The Validity / Visibility xml element in Configuration Files should have an attribute to inverse the logic of the validity/visibility. For instance, inverse the fileextensions attribute.

A typical use case is the following:

  • A split file menu accept only a single file. When executed, it generates multiple files of which the first "part" has the file extension 001.
  • A join files menu accept all files that matches fileextensions="001"

Edit:
To prevent the split file menu to be displayed when user selects a *.001 file (we don't need to split a file twice), the menu should also not accept files that matches fileextensions="001".

In the end, the split file menu validity should be:

  1. accept only a single file.
  2. accept files which file extension is not 001.

The validity element should look like this:

<validity maxfiles="1" maxfolders="0" fileextensions="001" inverse="fileextensions" />
@end2endzone end2endzone added the enhancement New feature or request label Apr 28, 2020
@end2endzone
Copy link
Owner Author

end2endzone commented Apr 28, 2020

More examples:

  • <validity fileextensions="001" inverse="fileextensions" />, valid when the file is not a *.001 file.
  • <validity maxfiles="1" maxfolders="0" inverse="maxfiles" />, valid when more than one file is selected.
  • <validity properties="process.started" inverse="properties" />, valid when the property is not yet specified.
  • <validity exists="${env.USERPROFILE}\config.ini" inverse="exists" />, valid only when the user's configuration file is not yet created.

The inverse attribute should be a list (separated with ; character) to allow insersing multiple attributes.

The attribute should allow the all value to inverse all attributes.

@end2endzone end2endzone self-assigned this Aug 1, 2020
end2endzone added a commit that referenced this issue Aug 4, 2020
…ith tests.

Modified Validator::Validate() to support the new 'inverse' attribute.
Created new TestValidator.* unit tests for the new 'inverse' attribute.
For issue #49.
end2endzone added a commit that referenced this issue Aug 4, 2020
…dity> elements.

Fixed a bug in Validator::operator=() which was not copying 'inverse' attributes.
For issue #49.
end2endzone added a commit that referenced this issue Aug 4, 2020
end2endzone added a commit that referenced this issue Aug 4, 2020
end2endzone added a commit that referenced this issue Aug 4, 2020
* feature-issue49:
  Created more unit tests to back up the statement in the `inverse` attribute documentation. For issue #49.
  Updated documentation of `inverse` attribute of <visibility> and <validity> elements. For issue #49.
  Implemented parsing of attribute 'inverse' for <visibility> and <validity> elements. Fixed a bug in Validator::operator=() which was not copying 'inverse' attributes. For issue #49.
  Implemented Validator::GetInverse(), SetInverse() and Is Inversed() with tests. Modified Validator::Validate() to support the new 'inverse' attribute. Created new TestValidator.* unit tests for the new 'inverse' attribute. For issue #49.
  Enabled building of branch on appveyor.
@end2endzone
Copy link
Owner Author

Feature implemented in master branch in commit 455192c.

end2endzone added a commit that referenced this issue Aug 4, 2020
@end2endzone end2endzone added this to the 0.5.0 milestone Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant