-
1. Re: XHTML files and content assist with custom tags
maxandersen Mar 12, 2008 3:15 AM (in response to kragoth)you mean a tag library or just xsd's in general ?
-
2. Re: XHTML files and content assist with custom tags
kragoth Mar 12, 2008 6:54 PM (in response to kragoth)Well, I've made progress. By creating the XSD file I can get attribute auto completion. But, I do not get tag auto complete. In that I have to know the name of my tag, but once i have put in my tag eg <gekko:inputTextbox /> it will then give content assist for my attributes.
I'm not entirely sure why it works for attributes but not tags. Seems rather odd.
The other problem I have is that most libraries eg jsf and facelets use tld's but I seem to be only able to get content assist to work with xsd files. So when I extend a jsf component I have to copy all the tld information into an xsd file which is just long and tedious.
Basically Jboss tools needs to allow the inclusion of a tld file that is not inside a jar.
Or maybe a step by step tutorial on how to get content assist working for custom tags would be nice. Especially the cases where I am extending an existing tag. -
3. Re: XHTML files and content assist with custom tags
maxandersen Mar 13, 2008 4:07 AM (in response to kragoth)report these things in jira please.
if your tld is not inside a jar, where did you put it ? -
4. Re: XHTML files and content assist with custom tags
kragoth Mar 13, 2008 6:50 PM (in response to kragoth)I'm writing my own custom tags. So I had put the tld file in my WEB-INF folder.
(NOTE: My project is not set up as a web application so I'm not sure if the location of the tld file should matter. I'm working on making it a web app but i'm restricted by a number of factors including the inability of being able to specify how i want my web app project structured. But that's another problem :P) -
5. Re: XHTML files and content assist with custom tags
campi Jul 24, 2008 6:52 AM (in response to kragoth)Hi,
I have approximatively the same problem. In your project we had some custom jsf tag lib (project using seam 2.0.1.SP1 , JSF, EJB3, JBPM) and we wrote the tld files in order to be able to have content assist for your custom jsf tag, however even if we put the tld in you classpath the content assist isn't available. If someone have any clue or advice ? -
6. Re: XHTML files and content assist with custom tags
kragoth Jul 24, 2008 7:15 PM (in response to kragoth)Yes I can help now.
I have got content assist working (to a reasonable level) by doing the following.
1. Write an XSD for your custom tags.
2. In Eclipse go to. Window -> Preferences-> Web and XML -> XML Catalog.
3. Add a new entry using your tag namespace and pointing to your xsd file.
Now you should have content assist (at the moment this does not give me the actual tags themselves, but once I have opened the tag it will give me attribute content assistance). -
7. Re: XHTML files and content assist with custom tags
campi Jul 28, 2008 4:05 AM (in response to kragoth)Thanks, I will try this. However I have found another metohd that work perfectly. See this page : http://docs.jboss.org/tools/2.1.0.GA/en/jsf/html_single/index.html#CodeAssistAndDynamicCodeAssist42BasedOnProjectData
Chapter :
3.1.2.5. Adding dynamic code assist to custom components that were added to JBoss Tools Palette
I have try this and it's working. The problem is that I had already written a complete tld file and I'm not really motivated to rewrite all the tld in the jboss tools standard ^^ (but it's seem that I'll still have to rewrite it). -
8. Re: XHTML files and content assist with custom tags
maxandersen Jul 28, 2008 12:53 PM (in response to kragoth)campi - please elaborate what you mean by "jboss tools standard" ? There is no such thing - we just understand normal TLD's
-
9. Re: XHTML files and content assist with custom tags
kragoth Jul 28, 2008 7:18 PM (in response to kragoth)I find this solution severly limiting. I am working in a team of developers. The approach of putting the tld entry into the plugin.xml is tedious and painful. How can I now add this for all developers? It would require every developer to update their plugin.xml file. Secondly, because of this structure I can't make the schema-location a dynamic reference to a file in a project either.
Is there any chance of changing this behaviour to be a project specific setting. As that makes a lot more sence. I am sure it is entirely reasonable to have different components for different projects. -
10. Re: XHTML files and content assist with custom tags
kragoth Jul 28, 2008 8:46 PM (in response to kragoth)I've just spent about an hour trying the solution mentioned above at http://docs.jboss.org/tools/2.1.0.GA/en/jsf/html_single/index.html#CodeAssistAndDynamicCodeAssist42BasedOnProjectData but I'm not having any success with it. My tags are still not in the list of tags when editing xhtml files. Is there a step missing?
-
11. Re: XHTML files and content assist with custom tags
kragoth Jul 28, 2008 10:16 PM (in response to kragoth)Does the mentioned solution only work if you "Add JSF Capabilities"? Or should it work on any xhtml file? If it only works on projects that have "Added JSF Capabilities" then maybe that feature should not force the structure of the project to be so specific.
-
12. Re: XHTML files and content assist with custom tags
maxandersen Jul 29, 2008 5:53 AM (in response to kragoth)Add jsf capabilities does not have any constraint on project structure AFAIK.
You can e.g. do it on a seam-gen'ed app if you want to. -
13. Re: XHTML files and content assist with custom tags
campi Jul 29, 2008 9:12 AM (in response to kragoth)"max.andersen@jboss.com" wrote:
campi - please elaborate what you mean by "jboss tools standard" ? There is no such thing - we just understand normal TLD's
My bad, I 'haven't probably used to right word. Actually my tld is using this dtd : http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd
I will have to rewrite it to match this tld: http://www.redhat.com/dtds/kb-schema_1_0.dtd -
14. Re: XHTML files and content assist with custom tags
campi Jul 29, 2008 9:16 AM (in response to kragoth)"Kragoth" wrote:
I've just spent about an hour trying the solution mentioned above at http://docs.jboss.org/tools/2.1.0.GA/en/jsf/html_single/index.html#CodeAssistAndDynamicCodeAssist42BasedOnProjectData but I'm not having any success with it. My tags are still not in the list of tags when editing xhtml files. Is there a step missing?
In order to have attribute completion I had to declare like this :<element-type body-content="allowed" content="mixed" name="customTagExemple" start-tag="required"> <description>Renders the custom Tag exemple.</description> <attribute-type name="title" required="true" value="java.lang.String"> <proposal type="beanProperty"/> <proposal type="bundleProperty"/> <proposal type="jsfVariables"/> </attribute-type> <attribute type="title"/> </element-type>
I needed the <attribute-type /> and the in order to have attribute completion in the element customTagExemple. Hope it's help.