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

getColumnMetadata function #39

Open
success4shambhunath opened this issue Apr 16, 2018 · 9 comments
Open

getColumnMetadata function #39

success4shambhunath opened this issue Apr 16, 2018 · 9 comments

Comments

@success4shambhunath
Copy link

In getColumnMetadata function, I'm getting same value:
columnMetadata = columnsMetadata[i];
columnName = columnMetadata.name;
columnLabel = columnMetadata.label;
body += columnName + "\t";

@rpbouman
Copy link
Member

I'm sorry - what is your question? I don't understand.

@success4shambhunath
Copy link
Author

success4shambhunath commented Apr 26, 2018

Actually, columnMetadata.name and columnMetadata.label both are returning the same values but name suppose to return e.g MATNR and label should return "Material Number".
Hope, you can understand.
Thanks,
Shambhu Nath

@rpbouman
Copy link
Member

I see what you mean. The way it works is that you can pass label info in the header query parameter. See parseHeader in the querybuilder.xsjslib.

The header parameter is parsed as JSON, and can be an array of strings, or an array of object literals. If an array of strings, then these strings will be used as aliases for the SQL columns. If an array of objects,then the label propery of each object is used as label.

What it does not currently do is grab label metadata from the database. You'll have to push it from the client side.

It would be cool to have an automatic label defaults in case the caller does not provide them. I will happily accept a pull request for that.

@success4shambhunath
Copy link
Author

Thanks Roland,
I'm getting label from the client side as you suggested, I wanted to get confirmation from you, it is correct approach to get label from client, since metadata is not pulling label.
It would be great if metadata grab label in future, So we can avoid additional logic to pull from the client.

@rpbouman
Copy link
Member

@shambhuhyd I'm willing to look into the feature but it would help if you could tell me the expected behavior in the cases you're interested in. If you could do the research and tell me where to fetch the labels from in the SAP HANA data dictionary, that would be really cool.

Thanks in advance, Roland,

@success4shambhunath
Copy link
Author

Hi Roland,
I have written table function to fetch labels, in the table function I'm using CONTENT_TEXT_HISTORY and ACTIVE_OBJECT_TEXT_CONTENT tables from the _SYS_REPO schema in that passing PACKAGE_ID & OBJECT_NAME as parameter. The CONTENT_TEXT_HISTORY table maintained labels changes history so we have to filter out maximum version to get latest labels, if objects does not have history then you would not get labels in CONTENT_TEXT_HISTORY, this kind of scenario you can get quality & production system, Then in case we have to use table ACTIVE_OBJECT_TEXT_CONTENT to get the labels,
I used this approach, I have tested and seems working fine.

HeaderLabel.txt
Tablefunction format is not allow to attached hence attached in txt format.

Thanks,
Shambhu Nath

@rpbouman
Copy link
Member

Hi @shambhuhyd , thanks man! This looks really promising, it's a nice step towards a solution. I think that for ODXL it would be best to wrap it inside a xsjs script - a table function will need authorization and I'd like to avoid that as it will make it more difficult to use ODXL.

What are your thoughts concerning how to control the label generation? What it he caller wants to specify some labels themselves, but have others be automatically supplied? I mean, how do you think the interface should look?

@success4shambhunath
Copy link
Author

success4shambhunath commented May 2, 2018

Hi Roland,
Table function you can use in calculation view, So It will behave as scripted calculation views meaning no additional security required.
We can pass select query fields in labels model to get respective labels but if caller want to labels then you can request them input from UI interface, You can collect it as array and merge in body.
However, custom labels depend on business requirements so I can't say about the interface.

@rpbouman
Copy link
Member

rpbouman commented May 3, 2018

Table function you can use in calculation view, So It will behave as scripted calculation views meaning no additional security required.

I know you can use it in calculation views, my concern is they need authorization to install the table function.

We can pass select query fields in labels model to get respective labels but if caller want to labels then you can request them input from UI interface, You can collect it as array and merge in body.

I know this is what we can do, my question is more: how does the caller command what they want? How can odxl notice what the user wants to happen for each field? For the ones they provide a value for, it is easy - they'll want the specified label. But it is not self-evident that they'll want to generated label for the ones they do not specify anything for. It seems intuitive that if the user does not specify anything in particular, nothing in particular should happen, i.e. the label will be equal to the field name.

Makes sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants