Closed jrchudy closed 3 years ago
Make sure wid, pid, cid are set :
Provide other attributes depending on the request :
Consume pcid and ppid that might be in the url:
Provide other attributes depending on the request :
Add pcid query parameter to links to Chaise :
Requests being made:
All other plot types, 1 main get request
Make sure wid, pid, cid are set : The selectors for violin plot include context header params, but the http.get for all plot types (and violin plot get) don't include them
Consume pcid and ppid that might be in the url:
Provide other attributes depending on the request :
Add pcid query parameter to links to Chaise :
Consume pcid and ppid that might be in the url:
Provide other attributes depending on the request :
Add pcid query parameter to links to Chaise :
Link to action list documentation. The list of requests which need defination for schema_table and action are as follows:
a. Main request:
lineplotConfig.traces[].path
grouping
-> "main" || "trace"stack path
-> "entity" || "attribute" || "trace" (if we choose trace here, then grouping
will be "main")ui context
-> might not be needed since we know this will be a lineplot
ui context
, then we'll use the plot type, "lineplot"verb
-> "load"As discussed in slack messages, the schema:table
can be the first one defined or a latter defined one after a join. This is based on an alias being present and then referenced later in the path.
a. Specific to Violin Plot:
data request:
grouping
-> "main" || "trace"stack path
-> "entity" || "attribute" || "trace" (if we choose trace here, then grouping
will be "main")ui context
-> value of plot_type
property ("violin" in this case)verb
-> "load"gene selector:
grouping
-> "filter"stack path
-> "set/facet"ui context
-> "gene"verb
-> "load"study selector:
grouping
-> "filter"stack path
-> "set/facet"ui context
-> "study"verb
-> "load"b. For all other plots(bar,pie..):
grouping
-> "main" || "trace"stack path
-> "entity" || "attribute" || "trace" (if we choose trace here, then grouping
will be "main")ui context
-> value of plot_type
propertyverb
-> "load"As discussed, incorporation of the stack attribute is not done as a part of this issue
Created issue #115 to track the remaining tasks from this issue (task 5 above). The actions for plot app are defined in the action list document and will be handled in that issue.
Tasks 1-4 are complete and merged into master.
Looking at the current implementation of deriva webapps, some of them are not properly utilizing the logging mechanism that we have in Chaise. The following are the required changes to achieve this:
1. Make sure wid, pid, cid are set
These three attribute are the bare minimum for logging. And their values should be set on page load and all the requests after it should use the same values.
chaise.config
module handles this.cid
,pid
,wid
.ERMrest.resolve
. This function will "introspect" the model. It will also create an internal "server" object which will be used for any subsequent request sent using the Reference API. So you would have to make sure the general attributes (cid
,pid
,wid
) are passed with resolve. You can see an example of it here and here.2. (previously 4) Consume
pcid
andppid
that might be in the urlAs you can see in the logging document,
ppid
andpcid
are logged alongside the "main request" of each app. We should do the same thing here. Which is,pcid
andppid
query parameter values. You can use theUriUtils. getQueryParams
function for that purpose. You can see how the singular version of this function is used here in plot app.pcid
andppid
.3. Provide other attributes depending on the request
Each request to server must send proper log attributes (context header),
.read
calls, the second parameter is log object. You have to make sure at least the following are defined in there:action
: A string explaining what the request is about. @jrchudy you or Devanshi should list the requests that apps are sending and we can go over what should we use for action string. This can be done by just going through the code and finding theread
or.get
requests.schema_table
: The schema and table names in "schema:table" format.catalog
: The catalog number.stack
: You can ignore this for now. This requires more thought!headers
object with proper key name is passed. It should have the same attributes that I explained in the previous bullet. You can find an example of it here4. Add pcid query parameter to links to Chaise
In each app, there might be links to other deriva-webapps or chaise apps. We should make sure all these links include
pcid
andppid
query parameters. You can find an example of this in boolean-search. Forpcid
you should use theappName
constant that is defined for each app. If it's not defined (since it's not an AngularJS app), you can just hard code it. I think that's how treeview is doing it.Josh: For treeview, the values are being set at the beginning of the app and reused each time
getHeader
is called. When creating links for treeview app to navigate to chaise pages,pcid
should use this definedcid
from above.5. Add actions and properly logging to Plot app
In Plot app, for the violin plot type, we currently create 2 different references for fetching data for the selectors and then there's an http.get request to fetch the data for the plot. These 3 data requests need to have actions defined for them since they currently don't have a defined action. The 2 selector requests do use the
contextHeaderParams
, but need to be checked for accuracy.For all of the other plot types, there is a single http.get request being sent to fetch the data with no context headers defined. This case needs context headers and a defined action.