summaryrefslogtreecommitdiffstats
path: root/cps-path-parser/src/main
AgeCommit message (Collapse)AuthorFilesLines
2023-07-20Apostrophe handling in CpsPathParserdanielhanrahan2-20/+31
Apostrophe is not currently handled correctly, and having apostrophe in the xpath will lead to various errors. For example, normalizing this xpath works: /path[@name="I'm quoted"] -> /path[@name='I\'m quoted'] However the resulting xpath will throw a PathParsingException if parsed! (Thus path normalization is not idempotent.) - Use '' for escaping apostrophe in single quoted leaf value, to comply with XPath standard (and use "" for escaping in "). - Use Liquibase to make existing data comply with new rules. - Leaf values in data leaves are now unescaped, e.g. "I'm quoted" - Quoting is now consistent for leaf/text/contains conditions. Issue-ID: CPS-1769 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: Iafc287f738254d7f99706c6bc548091c0ecd5aa0
2023-07-17Allow duplicate leaf names in Cps Path leaf conditiondanielhanrahan4-135/+24
Presently, a query using the same leaf name twice will fail: //books[@price > 10 and @price < 20] It is caused by storing data leaves in a Map. This is fixed by storing data leaves in a List<DataLeaf>. Issue-ID: CPS-1779 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: Ie6990ea5e622cf37e986b720a0a07fb69ce4f03b
2023-05-30Add <,> operators support to cps-pathRudrangi Anupriya4-24/+111
Issue-ID: CPS-1273 Change-Id: I5d562463b9a49abfe0436047a637857d10596fff Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2023-04-25Ordering of leaf elements to support combination of AND/OR in cps-pathRudrangi Anupriya1-2/+2
Issue-ID: CPS-1629 Change-Id: Ib9df87e8171f4d53c49d80d27e3c6cf75aa3b209 Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2023-04-21Add contains condition support to cps-pathRudrangi Anupriya3-1/+24
Issue-ID: CPS-1272 Change-Id: Ic81d1322cacc64a8752916324b801d02be47d34f Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2023-04-14Add OR operator to cps-pathRudrangi Anupriya4-11/+85
Issue-ID: CPS-1215 Change-Id: I91fdf5bddcc4fc12a8cf9dbce75f77c832c55871 Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2023-02-28Skip deleting list xpaths that are list elementsdanielhanrahan2-5/+12
List elements cannot be lists. Filtering list elements before trying to delete lists by xpaths doubles performance when deleting list elements (which doubles performance of CM handle de-registration). Issue-ID: CPS-1511 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: Ieb6002212d006396d468f27f853708b5aa1e31f2
2022-12-22Add fix for posting nodes with xPath with '/'emaclee3-2/+17
- YangUtils method changed from using REGEX to cps path parser - unit test added for cps path util Issue-ID: CPS-1433 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: Ibb9efdd09423f9bade4a4a557d7d9ed49aa44ef4
2022-12-19Fix Delete uses case with '/' in pathToineSiebelink4-5/+35
-Extend and use cpsPath parser (util) classes instead of regex Issue-ID: CPS-1409 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I230c9eb71cc34264983830b39149511b95c4b4a6
2022-04-25Fix Absolute Path to list with Integer/String keyLathish5-30/+218
- Introduced normalizedXpath to normalize the xpath and cpspath - Introduced normalizedAncestorpath to normalize the ancestor path in xpath and cpspath - Added new condition in the ANTLR Grammar to capture the invalid path in the xpath - Introduced PathParsingException to replace the IllegalStateException Issue-ID: CPS-961 Change-Id: Ie10f5c6cfc466387e79eec184b933297d1d79587 Signed-off-by: Lathish <lathishbabu.ganesan@est.tech>
2021-07-20Support text() conditionToineSiebelink4-77/+74
- Added Antlr parsing of text() condition (as an optional additional to any query) - Implemented text-condition combined with descendants - Refactor descendants queries into using one more flexible Custom (native) Query builder - Refactor ALL cpsPath queries to now use FragmentRepositoryCpsPathQuery (custom query builder) - Refactor Antrl code to simply parsing of cpsPath and allow all combinations (no more query types, addresses CPS-436) - Minor clean up of some minor convention issues in CpsAdminServiceImplSpec.groovy (found during groovy demo) - Update .rst documentation of xPaths - Fixed incorrect matching of additional list indexes using more precise SIMILAR-TO regex in postgreSQL - Documented special chararter limitation (CPS-500) - Checked for consistent use of term 'CPS path' in documentation and error message - Included (updated) copyright in all .SQL test files Issue-ID: CPS-452 Issue-ID: CPS-436 Issue-ID: CPS-500 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: If422d25cafd2850d25c9a28dea16ba7a5f93dddb
2021-07-13Editing of Nordix Licenses to ONAP guidelineslukegleeson4-3/+7
Issue-ID: CPS-489 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I415534515b3d8325f41d5dc1d02c6e0ae70c6cf1
2021-06-03Improve error handling on unexpected 'postfix'ToineSiebelink2-1/+9
Issue-ID: CPS-450 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ia8be460f4235f7f0c24498f861dbe42137111772
2021-06-01Fix last SQ violationToineSiebelink2-2/+2
Issue-ID: CPS-89 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I9621a60e89574bbb8b222b7342c5d387c302afdb
2021-06-01Introducing Antlr4 for cpsPath parsingToineSiebelink4-0/+348
-created new module for cpPathParser -added antlr rule for cpsPathWithSingleLeafCondition -added antlr rule for cpsPathWithDescendant (and with leaf conditions) -added antlr rule for ancestor axis -added unit test (copied from existing CpsPathQuerySpec) -udpated cps-ri to use new cpPathQuery from parser module -'imported' lexer rules from publix xPath grammar -Re-used existing CpsPathException but conversion happens in cps-ri to prevent additional dependency in cps-path-parser module Issue-ID: CPS-376 Change-Id: I2c5df98969402cbf69f6573c52705879450ce606 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>