Overview
That document goal to describe how to add schemas to JBoss Tools schemas set in order to perform CDKtemplates validation. Also after review will be passed to JBDS team in order to include into default set for offline validation available out-of-the-box.
There are actually 5 schemas to be added to XML Catalog which will be used to validate CDK templates. And here is the their keys:
- http://jboss.org/schema/richfaces/cdk/core
- http://jboss.org/schema/richfaces/cdk/ext
- http://jboss.org/schema/richfaces/cdk/jsf/composite
- http://jboss.org/schema/richfaces/cdk/jstl/core
- http://jboss.org/schema/richfaces/cdk/xhtml-el
Importing online schemas
Choose Window - Preferences -XML - XML Catalog from the JBoss Tools main menu:
Now select User Specified Entries and click Add button. In the window appeared fill:
Location: http://www.jboss.org/schema/richfaces/cdk/cdk-template.xsd
Key Type: URL
Key: http://jboss.org/schema/richfaces/cdk/core
repeat the same for the other schemas with next parameters:
- Key: http://jboss.org/schema/richfaces/cdk/ext Location: http://www.jboss.org/schema/richfaces/cdk/cdk-extensions.xsd
- Key: http://jboss.org/schema/richfaces/cdk/jsf/composite Location: http://www.jboss.org/schema/richfaces/cdk/cdk-composite.xsd
- Key: http://jboss.org/schema/richfaces/cdk/jstl/core Location: http://www.jboss.org/schema/richfaces/cdk/cdk-jstl-core.xsd
- Key: http://jboss.org/schema/richfaces/cdk/xhtml-el Location: http://www.jboss.org/schema/richfaces/cdk/xhtml-el.xsd
Importing schemas from richfaces sources
In case schemas changes which still was not published to the jboss.org exist or you need explicitly use older or some non-official ones from other branches - you could just add them using xsd files from sources. That's perfomed in the next way:
Open the same preferences view using Preferences -XML - XML Catalog from the JBoss Tools main menu. And select User Specified Entries and click Add button again. In the window appeared not fill anything manually but just click File System button. In the dialog window choose <RF-SOURCES-FOLDER>cdk/generator/src/main/resources/META-INF/schema/cdk-template.xsd. All the fields should be properly filled in that case. Just click Ok and you will see it appeared in list. Perform the same for the other ones.
Validation
Import any module from RF-repo/ui to your workspace using m2eclipse or just mvn eclipse:eclipse and existent project import wizard.
Choose src/main/templates in the package explorer. Call context menu on folder and click on "validate" menu item. If you will see any errors or warning - that means that the schemas was succesfully downloaded and used by xml validator. But if you will not see any errors or warnings - probably it also works just the code not consist any problems
Comments