UI5 Component Metadata

I am looking for a document with possible metadata property names and configuration settings for a component.

There are many documents online with this definition. The question is, how do I know if a property / parameter name is a valid name.

metadata : { name : "XXXXX", version : "1.0", includes : [], dependencies : { libs : ["sap.m", "sap.ui.layout"], components : [] }, rootView : "XXXXX", config : { resourceName : "i18n", resourceBundle : "XXXX", serviceConfig : { name : "main", serviceUrl : "XXXXX", } } 
+6
source share
7 answers

There is a document here that describes all the possible metadata. Since there is no real help during development, you should look at the API to check for possible values. If you want to extend it with your own properties / parameters, just make sure that the name is not too general, as the component can be expanded with each new version of UI5.

+6
source

The approach for defining component metadata in the component itself has been replaced by an approach using a manifest file. You will find all available properties in the documentation .

+2
source

The Component class extends the ManagedObject class and provides specific metadata for components. The UIComponent class provides additional metadata for customizing user interfaces or navigating between views.

 The metadata defined in component.js is common for faceless components and UI components. The following parameters are available: abstract: Specifies if your component class is an abstract class that serves as a base for other components version: Version of your component; this parameter belongs to the design-time metadata and is currently not used; it may be used in the future in the design-time repository includes: Array of strings containing the paths to CSS and JavaScript resources for your component; will be added to the header of the HTML page and loaded by the browser. The resources will be resolved relative to the location of Component.js. dependencies: Used to specify all external dependencies, such as libraries or components. Like the includes for resources that are added to the application's HTML, the dependencies are loaded by SAPUI5 core before the component is initialized. Everything that is referenced here can be used in your component code right from the start. Specify here external dependences such as libraries or components, that will be loaded by SAPUI5 core in the initialization phase of your Component and can be used after it. libs: Path to the libraries that should be loaded by SAPUI5 core to be used in your component components: Full path to the components that should be loaded by SAPUI5 core to be used in your component ui5version: Minimum version of SAP UI5 that the component requires; it helps to be ensure that the features of SAPUI5 runtime used in this component are available. As SAPUI5 currently does not enforce the use of the correct version, it is only used for information purposes. properties: Defined for components in the same way as for a control or view library: Specify the library the component belongs to config: Static configuration; specify the name-value pairs that you need in the component customizing: Customizing for components and views, see Extending SAPUI5 Applications sap.ui.viewExtensions: Used for providing custom view content in a specified extension point in the standard application sap.ui.viewModifications: Used for overriding control properties in the standard application sap.ui.viewReplacements: Used for replacing a standard view with a custom view sap.ui.controllerExtensions: Used for replacing a standard controller with a custom controller for more Information go to the url: https://sapui5.netweaver.ondemand.com/sdk/#docs/guide/0187ea5e2eff4166b0453b9dcc8fc64f.html 
+1
source

Well, from the code, you can check if a property exists with the get (Property Name) method that all elements have. Otherwise, all ad hoc properties are located in this URL that Tim Gerlach shared to you earlier.

+1
source

If this is a common development approach, you should ideally take a look at the component class APIs.

If you use a metadata-based approach for development, and you can generate the code you need, you must get the data from the metadata information provided by the class, or read it from a .js file. ".js" will be useful if you are not using the SAPUI5 runtime.

Hope this helps.

.........
Good luck

0
source

The final answer should be to view the source code, since nothing else, not even the API documentation, can be 100% more accurate from the source of consumption.

0
source

As mentioned in the documentation , the definition of Component metadata has largely moved to a separate file called manifest.json (aka. Application Descriptor)).

With the introduction of the descriptor for applications, components, and libraries, we recommend that you transfer component metadata to the descriptor. [...] For more information, see the descriptor for applications, components, and libraries .


Besides viewing the list of available options in the document, the closest “help” you can get is the “Descriptor Editor” from the Internet IDE.

Java IDE manifest.json descriptor editor

The descriptor editor provides options, placeholder suggestions, and input confirmation.

0
source

Source: https://habr.com/ru/post/978891/


All Articles