App components - properties, queries, and views

Hello,

My questions below all relate to exposing artifacts from an application component so they may be consumed by another application.

  1. Is it possible to expose an application property in app-component.xml? I am able to provide it in the file but not in Studio. Moreover, if I re-create the descriptor in Studio my properties are overwritten.
  2. Is it possible to expose Entities from the component in order to create REST queries in the consuming application? I am able to create queries in the component and use them in the consuming application, however, it would be nice to be able to define them apart from the component.
  3. Same question as #2 but related to views rather than queries.

Thanks!

Hi Matt,

> Is it possible to expose an application property in app-component.xml?

Yes, since platform 6.6. See for example a lot of properties exposed in com/haulmont/cuba/app-component.xml.

You can add properties only manually in the file, and Studio does not save them when you regenerate the descriptor, so be careful. How do you suppose to add them automatically? Just all properties defined in app.properties/web-app.properties?

> Is it possible to expose Entities from the component in order to create REST queries in the consuming application? I am able to create queries in the component and use them in the consuming application, however, it would be nice to be able to define them apart from the component.

To define what? Queries? You should be able to define queries in the app for all entities from components and the app itself. The same is for views. Let us know if you have any trouble with this.

Thanks, Konstantin.

It does behave as you described. I’m not sure why Studio wasn’t allowing me to create REST queries yesterday but it’s working today.