Community
Participate
Working Groups
Currently the necessary API's for adding custom tags are not public. As an example, Apple's WebObjects has <webobject> tags in its HTML templates, but most of the API's that need to be hooked into are either private or final. The attached patch for 0.7 makes a series of fairly minor modifications to allow hooking into the html parser to add custom tags.
Created attachment 29525 [details] support for custom HTML tags
I'll take a look to see if we can include for 1.0. (Off hand, though, its likely we'd still java doc as "not API" as I haven't looked at whole content model picture for a while. ... that is, haven't formed long term planned). But, btw, are all these "api like" changes just for external clients to add one tag (webobject) and its attributes? ... or is there a family of "webobject elements"?
Not ALL of the changes were strictly required to add a <webobject> tag, actually. There were several classes that needed to be made public and non-final and I went ahead and made all the similar classes public and non-final as well mostly to keep things consistent (and I figured others might want to hook into those later even though I personally didn't just for this). Some things only needed to be made public so I could implement a method that returns something of that type, some things needed to be public so that I could extend them. It was kind of a mixed bag of changes -- all of them pretty minor though. I'll attach the source for what I had to implement in our code to actually add the tag since that might be a good example of why I needed to do some of the things I did.
Created attachment 29542 [details] example code for adding a WebObject tag <webobject> can basically appear anywhere, so this code hooks into all the CTD's and adds in support for them to contain a <webobject> tag. The only code that's not included is the initialization code that bootstraps this in our plugin: CMNamespaceImpl h40ns = new CMNamespaceImpl(HTML40Namespace.HTML40_URI, HTML40Namespace.HTML40_TAG_PREFIX); WebObjectsHCMDocImpl webobjectHtml40doc = new WebObjectsHCMDocImpl(CMDocType.HTML_DOC_TYPE, h40ns); HTMLCMDocumentFactory.addCMDocument(CMDocType.HTML_DOC_TYPE, webobjectHtml40doc); ComplexTypeDefinitionFactory.setInstance(new WebObjectsComplexTypeDefinitionFactory());
I'm going to resolve this bug as a duplicate of bug 157407. Even though bug 157407, it already has more votes than this bug, so please feel free to shift your votes from this bug to bug 157407. *** This bug has been marked as a duplicate of bug 157407 ***