UI5组件元数据

时间:2014-11-30 08:41:55

标签: sapui5

我正在寻找一个包含组件可能的元数据属性名称和配置参数的文档。

互联网上有很多文件都有这样的定义。问题是我如何知道属性/参数设置的名称是否是有效名称。

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",
        }
    }

7 个答案:

答案 0 :(得分:6)

有一份文件here,其中描述了所有可能的元数据。由于在设计期间没有真正的帮助,您必须查看API以检查可能的值。如果您想使用自己的属性/参数扩展它,只需确保该名称不太通用,因为可以使用每个新版本的UI5扩展Component。

答案 1 :(得分:2)

在组件本身中定义组件元数据的方法已被使用清单文件的方法所取代。您可以在documentation中找到所有可用的属性。

答案 2 :(得分:1)

Component类扩展了ManagedObject类,并为组件提供了特定的元数据。 UIComponent类为用户界面的配置或视图之间的导航提供了额外的元数据。

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

答案 3 :(得分:1)

好吧,从代码中你可以检查属性是否存在所有元素都具有的get(Property Name)方法。 否则,临时所有属性都在Tim Gerlach之前为您分享的URL中。

答案 4 :(得分:0)

如果是常规开发方法,理想情况下应该查看组件类的API。

如果您使用元数据驱动的方法进行开发,并且您可能会生成所需的代码,那么您应该从类提供的元数据信息中获取详细信息,或者从.js文件中读取它。如果您不使用SAPUI5运行时,“。js”会很有用。

希望,这有帮助。

.........
祝你好运

答案 5 :(得分:0)

最后的答案必须是通过查看源代码,因为其他任何内容,即使是API文档,也能够100%准确地反对消费来源。

答案 6 :(得分:0)

正如documentation中所提到的,Component的元数据定义已经大部分转移到一个名为 manifest.json 的单独文件中(也称为Application Descriptor)。

  

通过引入应用程序,组件和库的描述符,我们建议将组件元数据迁移到描述符。 [...]有关详细信息,请参阅Descriptor for Applications, Components, and Libraries

除了查看文档中的可用参数列表外,您可以获得的最近“帮助”是来自Web IDE的Descriptor Editor

Web IDE manifest.json Descriptor Editor

描述符编辑器提供可用选项,占位符建议和输入验证。