[xmlc] Re: Implement interfaces / metadata
"Jacob Kjome" <[email protected]> Mon, 06 Jun 2011 12:17:39 -0500
| Newsgroups | gmane.comp.java.enhydra.xmlc |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format... ------------=_1307384267-26124-1797 Content-Type: text/plain;charset=iso-8859-1; format="flowed" Content-Transfer-Encoding: quoted-printable You can find links to docs here... http://xmlc.ow2.org/doc/ There you'll find a link to the metadata documentation... http://xmlc.ow2.org/doc/doc/xmlc/user-manual/metadata/index.html Note that the documentation isn't entirely up-to-date.=A0 It should be,=20 generally, valid though.=A0 But I don't really recommend writing XML-base= d=20 options files.=A0 They can get verbose.=A0 Command option based files are= easier=20 to write and maintain.=A0 During compilation, XMLC will generate the XML-= based=20 options files based on a combination of your command-based options files = and=20 those options specified in the <xmlc/> Ant task. The XMLC Tomcat example app contains a command-based options.xmlc file wi= th=20 nearly all the options you might want to use, with some commented out bec= ause=20 they are not really necessary for the example app... http://websvn.ow2.org/filedetails.php?repname=3Dxmlc&path=3D%2Ftrunk%2Fxm= lc%2Fexamples%2Ftomcat%2Fres%2Foptions.xmlc The one option that is not mentioned is "-implements", because it's a=20 specific option, not a general one, thus doesn't belong in the common=20 "options.xmlc" file. Back to your question, yes, you should create a medatata file for each ma= rkup=20 file you want to have implement an interface.=A0 So, you'd supply the=20 options.xmlc file for all general options common to all files and then cr= eate=20 one metadata file per markup file that you want to have implement an=20 interface.=A0 So, you'd have... options.xmlc MyPage.html MyPage.xmlc ...where "MyPage.xmlc" has one one line... -implements com.mycompany.view.xmlc.MyPageInterface Note that, optionally, rather than manually writing Java interfaces yours= elf,=20 you could just write one or more canonical markup files that contain cert= ain=20 Ids that you want other markup files to implement as well.=A0 So, you mig= ht have=20 a markup file called "CanoncalPage.html" and to have "MyPage.html" implem= ent=20 it you'd just use... -implements com.mycompany.view.xmlc.CanonicalPageHTML ...where CanonicalPageHTML may not yet exist, but will be an interface=20 generated by XMLC.=A0 Validation of whether "MyPage.html" properly implem= ents=20 "CanonicalPage.html" will come when you compile the generated classes (ju= st as=20 it would if you manually wrote the Java interface).=A0 If someone adds an= Id to=20 CanonicalPage.html and forgets to add it to MyPage.html, you'll get a Jav= a=20 compile failure upon a rebuild of the project. At the end of it all, don't forget to copy the generated XMLC metadata fi= les=20 (which combine optons.xmlc commands, individual markup file commands, and= Ant=20 taskdef commands into single XML-based metadata files named after your ma= rkup=20 file(s)) to the same relative location you store your markup files, loade= d via=20 various contexts like the classpath, a configured XMLC reparse resource=20 directory, or even the servlet context.=A0 To be clear the metadata files= need=20 only be at the same relative location within one of the contexts.=A0 For=20 instance, metadata files could be in the classpath while the markup files= are=20 in a configured reparse resource dir.=A0 The main thing to remember is th= at the=20 relative path within any given context needs to be the same. Jake On Mon,=A0=A06 Jun 2011 11:54:57 +0200 (CEST) =A0<[email protected]> wrote: >=20 > Hi there! >=20 > I am looking for some example of configuration that leads to > implement individual interfaces for my html-files. > I prepared interfaces for my views and now I wan't the xmlc=20 > processing configured to implement them. Do I need > one metadata file per html? Where can I find the xsd for the > metadata-file? >=20 > Thanks in advance >=20 > CARSTEN ------------=_1307384267-26124-1797 Content-Type: text/plain; charset="UTF-8"; name="message-footer.txt" Content-Disposition: inline; filename="message-footer.txt" Content-Transfer-Encoding: quoted-printable -- You receive this message as a subscriber of the [email protected] mailing list= . To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=3Dhelp OW2 mailing lists service home page: http://www.ow2.org/wws ------------=_1307384267-26124-1797--