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

Support dateRange in CA queries #30192

Open
freddyDOTCMS opened this issue Sep 30, 2024 · 0 comments · May be fixed by #30208
Open

Support dateRange in CA queries #30192

freddyDOTCMS opened this issue Sep 30, 2024 · 0 comments · May be fixed by #30208
Assignees

Comments

@freddyDOTCMS
Copy link
Contributor

Parent Issue

#30141

Problem Statement

We create a new query sintax for the CA Endpoint and ViewTool, is not really the same CubeJs syntax, let see an example on the filter attribute:

Example to get all the request by day of tis week,

in Cube JS


{
  "measures": [
    "request.count"
  ],
  "dimensions": [
    "request.url"
  ],
  "order": {
    "request.count": "desc"
  },
  "timeDimensions": [
    {
      "dimension": "request.createdAt",
      "granularity": "day",
      "dateRange": "This week"
    }
  ]
}

In our Syntax is something like:


{
  "measures": [
    "request.count"
  ],
  "dimensions": [
    "request.url"
  ],
  "order": {
    "request.count": "desc"
  },
  "timeDimensions": "request.createdAt day This week"
}

but right now we are not supporting the third attribute

Steps to Reproduce

  • Start dotCMS with the full starter
  • Start Analytics to this just: Go to ""/core/docker/docker-compose-examples/analytics"" and run the command "docker-compose up", and wait a couple of minutes, Configure the Analitycs App in dotCMS with the follow parameters:
ClientIId: analytics-customer-customer1
Client Secret: testsecret
Analytics Config URL http://localhost:8088/c/customer1/cluster1/keys
Analytics Write URL http://localhost:8081/api/v1/event
Analytics Read URL http://localhost:4001/
  • Navigate in the dotCMS FE to generate data
  • GO to the Velocity playground and run this code

#set ($queryMap = {"measures" : ["request.count"], 
                "orders": "request.createdAt desc",
                "dimensions" : ["request.whatAmI"],
                "timeDimensions": "request.createdAt day Today"
                })

#set($collection = $analytics.runReportFromMap($queryMap).getResults())

Requests Per Day

#foreach($item in $collection)
   -> Type: $item.get("request.whatAmI").get()
   -> Create Date: $item.get("request.createdAt").get()
   -> Count: $item.get("request.count").get()
   
#end


You are going to get nothing

Acceptance Criteria

The dateRange parameters in the timeDimensions must work

dotCMS Version

latest

Proposed Objective

Core Features

Proposed Priority

Priority 2 - Important

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

@jdotcms jdotcms self-assigned this Oct 1, 2024
jdotcms added a commit that referenced this issue Oct 1, 2024
@jdotcms jdotcms linked a pull request Oct 1, 2024 that will close this issue
jdotcms added a commit that referenced this issue Oct 1, 2024
jdotcms added a commit that referenced this issue Oct 2, 2024
jdotcms added a commit that referenced this issue Oct 3, 2024
jdotcms added a commit that referenced this issue Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants