com.atlassian.confluence.api.service.exceptions.unchecked.NotImplementedServiceException: OR clauses are unsupported in parsing to REST

Atlassian JIRA | David Taylor [Atlassian] | 2 years ago
  1. 0

    The space picker in the CQLUX allows a mix of Space categories and Spaces, so the resultant CQL could be something like: {code} (space = 'FOO' or space.type = 'global') {code} When reloading a CQL parameter into the macro browser, a request is made to the CQLMetaDataResource to split the CQL string into expressions that can be loaded into UI fields. Right now, a request with the CQL example above will result in the following stacktrace: {code} com.atlassian.confluence.api.service.exceptions.unchecked.NotImplementedServiceException: OR clauses are unsupported in parsing to REST at com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitOrClause(CQLtoRESTParseTreeVisitor.java:63) at com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitOrClause(CQLtoRESTParseTreeVisitor.java:30) at com.atlassian.querylang.antlrgen.AqlParser$OrClauseContext.accept(AqlParser.java:813) at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72) at com.atlassian.querylang.antlrgen.AqlBaseVisitor.visitClause(AqlBaseVisitor.java:436) at com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitSubClause(CQLtoRESTParseTreeVisitor.java:95) at com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitNotClause(CQLtoRESTParseTreeVisitor.java:84) at com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitAndClause(CQLtoRESTParseTreeVisitor.java:75) at com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitOrClause(CQLtoRESTParseTreeVisitor.java:65) at com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitOrClause(CQLtoRESTParseTreeVisitor.java:30) at com.atlassian.querylang.antlrgen.AqlParser$OrClauseContext.accept(AqlParser.java:813) at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72) at com.atlassian.querylang.antlrgen.AqlBaseVisitor.visitClause(AqlBaseVisitor.java:436) at com.atlassian.querylang.antlrgen.AqlParser$ClauseContext.accept(AqlParser.java:763) at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72) at com.atlassian.querylang.antlrgen.AqlBaseVisitor.visitAqlStatement(AqlBaseVisitor.java:260) at com.atlassian.querylang.antlrgen.AqlParser$AqlStatementContext.accept(AqlParser.java:522) at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:44) at com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visit(CQLtoRESTParseTreeVisitor.java:44) at com.atlassian.confluence.plugins.cql.rest.DefaultCQLMetaDataService.visitParseTree(DefaultCQLMetaDataService.java:81) at com.atlassian.confluence.plugins.cql.rest.DefaultCQLMetaDataService.parseExpressions(DefaultCQLMetaDataService.java:57) at com.atlassian.confluence.plugins.cql.rest.CQLMetaDataResource.getExpressions(CQLMetaDataResource.java:72) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) {code} It looks like we would need to implement the visitOrClause in the CQLtoRESTParseTreeVisitor.

    Atlassian JIRA | 2 years ago | David Taylor [Atlassian]
    com.atlassian.confluence.api.service.exceptions.unchecked.NotImplementedServiceException: OR clauses are unsupported in parsing to REST
  2. 0

    The space picker in the CQLUX allows a mix of Space categories and Spaces, so the resultant CQL could be something like: {code} (space = 'FOO' or space.type = 'global') {code} When reloading a CQL parameter into the macro browser, a request is made to the CQLMetaDataResource to split the CQL string into expressions that can be loaded into UI fields. Right now, a request with the CQL example above will result in the following stacktrace: {code} com.atlassian.confluence.api.service.exceptions.unchecked.NotImplementedServiceException: OR clauses are unsupported in parsing to REST at com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitOrClause(CQLtoRESTParseTreeVisitor.java:63) at com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitOrClause(CQLtoRESTParseTreeVisitor.java:30) at com.atlassian.querylang.antlrgen.AqlParser$OrClauseContext.accept(AqlParser.java:813) at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72) at com.atlassian.querylang.antlrgen.AqlBaseVisitor.visitClause(AqlBaseVisitor.java:436) at com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitSubClause(CQLtoRESTParseTreeVisitor.java:95) at com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitNotClause(CQLtoRESTParseTreeVisitor.java:84) at com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitAndClause(CQLtoRESTParseTreeVisitor.java:75) at com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitOrClause(CQLtoRESTParseTreeVisitor.java:65) at com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitOrClause(CQLtoRESTParseTreeVisitor.java:30) at com.atlassian.querylang.antlrgen.AqlParser$OrClauseContext.accept(AqlParser.java:813) at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72) at com.atlassian.querylang.antlrgen.AqlBaseVisitor.visitClause(AqlBaseVisitor.java:436) at com.atlassian.querylang.antlrgen.AqlParser$ClauseContext.accept(AqlParser.java:763) at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72) at com.atlassian.querylang.antlrgen.AqlBaseVisitor.visitAqlStatement(AqlBaseVisitor.java:260) at com.atlassian.querylang.antlrgen.AqlParser$AqlStatementContext.accept(AqlParser.java:522) at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:44) at com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visit(CQLtoRESTParseTreeVisitor.java:44) at com.atlassian.confluence.plugins.cql.rest.DefaultCQLMetaDataService.visitParseTree(DefaultCQLMetaDataService.java:81) at com.atlassian.confluence.plugins.cql.rest.DefaultCQLMetaDataService.parseExpressions(DefaultCQLMetaDataService.java:57) at com.atlassian.confluence.plugins.cql.rest.CQLMetaDataResource.getExpressions(CQLMetaDataResource.java:72) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) {code} It looks like we would need to implement the visitOrClause in the CQLtoRESTParseTreeVisitor.

    Atlassian JIRA | 2 years ago | David Taylor [Atlassian]
    com.atlassian.confluence.api.service.exceptions.unchecked.NotImplementedServiceException: OR clauses are unsupported in parsing to REST

    Root Cause Analysis

    1. com.atlassian.confluence.api.service.exceptions.unchecked.NotImplementedServiceException

      OR clauses are unsupported in parsing to REST

      at com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitOrClause()
    2. com.atlassian.confluence
      CQLtoRESTParseTreeVisitor.visitOrClause
      1. com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitOrClause(CQLtoRESTParseTreeVisitor.java:63)
      2. com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitOrClause(CQLtoRESTParseTreeVisitor.java:30)
      2 frames
    3. com.atlassian.querylang
      AqlParser$OrClauseContext.accept
      1. com.atlassian.querylang.antlrgen.AqlParser$OrClauseContext.accept(AqlParser.java:813)
      1 frame
    4. ANTLR 4 Runtime
      AbstractParseTreeVisitor.visitChildren
      1. org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72)
      1 frame
    5. com.atlassian.querylang
      AqlBaseVisitor.visitClause
      1. com.atlassian.querylang.antlrgen.AqlBaseVisitor.visitClause(AqlBaseVisitor.java:436)
      1 frame
    6. com.atlassian.confluence
      CQLtoRESTParseTreeVisitor.visitOrClause
      1. com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitSubClause(CQLtoRESTParseTreeVisitor.java:95)
      2. com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitNotClause(CQLtoRESTParseTreeVisitor.java:84)
      3. com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitAndClause(CQLtoRESTParseTreeVisitor.java:75)
      4. com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitOrClause(CQLtoRESTParseTreeVisitor.java:65)
      5. com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visitOrClause(CQLtoRESTParseTreeVisitor.java:30)
      5 frames
    7. com.atlassian.querylang
      AqlParser$OrClauseContext.accept
      1. com.atlassian.querylang.antlrgen.AqlParser$OrClauseContext.accept(AqlParser.java:813)
      1 frame
    8. ANTLR 4 Runtime
      AbstractParseTreeVisitor.visitChildren
      1. org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72)
      1 frame
    9. com.atlassian.querylang
      AqlParser$ClauseContext.accept
      1. com.atlassian.querylang.antlrgen.AqlBaseVisitor.visitClause(AqlBaseVisitor.java:436)
      2. com.atlassian.querylang.antlrgen.AqlParser$ClauseContext.accept(AqlParser.java:763)
      2 frames
    10. ANTLR 4 Runtime
      AbstractParseTreeVisitor.visitChildren
      1. org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72)
      1 frame
    11. com.atlassian.querylang
      AqlParser$AqlStatementContext.accept
      1. com.atlassian.querylang.antlrgen.AqlBaseVisitor.visitAqlStatement(AqlBaseVisitor.java:260)
      2. com.atlassian.querylang.antlrgen.AqlParser$AqlStatementContext.accept(AqlParser.java:522)
      2 frames
    12. ANTLR 4 Runtime
      AbstractParseTreeVisitor.visit
      1. org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:44)
      1 frame
    13. com.atlassian.confluence
      CQLMetaDataResource.getExpressions
      1. com.atlassian.confluence.plugins.cql.impl.CQLtoRESTParseTreeVisitor.visit(CQLtoRESTParseTreeVisitor.java:44)
      2. com.atlassian.confluence.plugins.cql.rest.DefaultCQLMetaDataService.visitParseTree(DefaultCQLMetaDataService.java:81)
      3. com.atlassian.confluence.plugins.cql.rest.DefaultCQLMetaDataService.parseExpressions(DefaultCQLMetaDataService.java:57)
      4. com.atlassian.confluence.plugins.cql.rest.CQLMetaDataResource.getExpressions(CQLMetaDataResource.java:72)
      4 frames
    14. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:606)
      4 frames