History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-21388
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Maxim Mossienko
Reporter: Mike Hanafey
Votes: 1
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

TLD for MyFaces Trinidad components not reliably accessible

Created: 20 Sep 07 22:45   Updated: 13 Nov 07 22:18
Component/s: XML editing
Fix Version/s: Selena RC3 (7330)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 7,274
Fixed in build: 7,324
Severity: High


 Description  « Hide
Given the small JSF page below as an example, the tags under the prefix "tr" are not reliably available in IDEA. Most times the only attribute IDEA will suggest is "jsfc", but at other times it does offer the actual list of available tags. When the problem happens xmlns:tr="http://myfaces.apache.org/trinidad" is being resolved to .../lib/trinidad-impl-1.2.2.jar!/META-INF/tr.taglib.xml when the correct taglib is really .../lib/trinidad-impl-1.2.2.jar!/META-INF/tr.tld.

Given that the number of tags and attributes in the Trinidad component library is quite large, this is a significant problem.

<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:tr="http://myfaces.apache.org/trinidad"
	xmlns:trh="http://myfaces.apache.org/trinidad/html">

<tr:form id="mainMenu">
    <tr:panelGroupLayout layout="vertical">
	<tr:image source="/images/_banner.gif"/>
	<h:commandButton value="Logoff" styleClass="mainMenuLogoff" action="logoff"/>

	<tr:navigationPane id="mainMenuTabs" hint="tabs">
	    <c:forEach items="#{mainMenu.tabs}" var="tab" varStatus="vs">
		<tr:commandNavigationItem id="mainTab${vs.index}" text="#{msg[tab.msgKey]}" action="#{tab.action}" 
                       immediate="true"/>
	    </c:forEach>
	</tr:navigationPane>
    </tr:panelGroupLayout>
</tr:form>
</jsp:root>

The top of META-INF files are included below for reference:

tr.tld
<?xml version="1.0" encoding="utf-8"?><taglib xmlns="http://java.sun.com/xml/ns/javaee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd" version="2.1">
  
  <display-name>Apache Trinidad Core</display-name>    
  <tlib-version>1.2.2</tlib-version>
  <short-name>tr</short-name>
  <uri>http://myfaces.apache.org/trinidad</uri>
  <listener>
    <listener-class>org.apache.myfaces.trinidadinternal.webapp.TrinidadListenerImpl</listener-class>
  </listener>

   <tag>
tr.taglib.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE facelet-taglib
  PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
<facelet-taglib xmlns="http://java.sun.com/JSF/Facelet">
  
  <namespace>http://myfaces.apache.org/trinidad</namespace>

  <tag>
    <tag-name>setActionListener</tag-name>
    <handler-class>org.apache.myfaces.trinidadinternal.facelets.SetActionListenerTag</handler-class>
  </tag>


 All   Comments   Work Log   Change History      Sort Order:
Stephen Friedrich - 20 Sep 07 23:36
This was already file before as IDEADEV-20171 which is resolved as fixed in build 7127.

However I, too, see the problem in build 7291 for both Trinidad and the JBoss Seam tags.


Stephen Friedrich - 22 Sep 07 00:22
Is this really included in 7294?
I hate to tell you, but at least for seam's tags it's not yet working (again).
Maybe it's because the facelet taglib is called seam-ui.taglib.xml, but the jsp descriptor is named simply taglib.tld (in jboss-seam-ui.jar of Seam 1.2.1).

Maxim Mossienko - 22 Sep 07 01:59
We replace xxx.taglib.xml with xxx.tld when base name xxx is the same

Ivan Todoroski - 22 Sep 07 02:35
Hello Maxim, this seems like an incomplete and unreliable solution. Shouldn't you actually be looking at the declared namespaces instead of the taglib filenames?

For example, first try to locate the JSP taglib (.tld) for the namespace "http://myfaces.apache.org/trinidad", and only if you can't find ir anywhere in the project, try locating a Facelets taglib (.taglib.xml) for the same namespace.

The filenames are completely arbitrary, so you shouldn't depend on them for anything.


Maxim Mossienko - 22 Sep 07 12:47
The approach taken does not require parsing / extra file scanning but indeed not reliable enough for real world jar files so we will provide better fix

Maxim Mossienko - 22 Sep 07 18:35
Please, check next build I have added the fix

Stephen Friedrich - 28 Sep 07 19:07
Much better, but now there's a different problem:
If the facelets definition file defines some tags that are not available in the jsp taglib, then Idea marks them completely in red as "unknown tag".

For example try using s:convertEntity.


Maxim Mossienko - 28 Sep 07 19:09
You may file request for updating tlds ))

Stephen Friedrich - 02 Oct 07 00:46
Your bug fix seems quite instable:
In 7318 even the trinidad tags are back to knowing "jsfc" as the only valid attribute.

(I don't really care for the problem with tags that are defined in facelets, but are missing for jsp. First because It's already fixed in Seam's CVS - though there probably won't be a 1.2.2 release. Then I just patched my local version.)


Mike Hanafey - 03 Oct 07 17:19
I can confirm that the fix is not robust. It is a bit strange. I downloaded build 7318, removed the entire "system" directory, and opened a project that uses trinidad. I then opened an existing ".jspx" file, and all of the "tr" tags were good – all available attributes are suggested, and quick doc lookup works.

Then I created a new ".jspx" file, and put in a "tr:commandButton". Now only "jsfc" was offered as an attribute. I started adding this comment. I went back to idea to confirm the behaviour, and now the behaviour was correct, all the attributes were now offered.

So I created yet another new ".jspx" file, and again on "jsfc" was offered as an attribute for "tr:commandButton". I went back to the previous new jspx file, and it too was now only offering "jspc". So I when back to old existing jspx file that was working initially, and it too had reverted to only knowning about "jsfc".

Now all of the tr tags are back working. The behaviour is completely incomprehensible. And I am only drinking coffee right now

This issue should not be marked are "Resolved".


Mike Hanafey - 03 Oct 07 21:06
I am now focussed on using the Rich Faces library (v3.1.0), this has exactly the same problem. For a new user of a component library, this bug makes IDEA essentially useless.

Please reopen this issue – at a minimum this will show the interested parties that Jetbrains realizes there is still a problem. Thanks.


Stephen Friedrich - 05 Oct 07 12:59
Err, Maxim...
Turns out that it is more important to fall back to facelets definitions if a tag is not found in jsp taglib:
There are some tags, that cannot work in a jsp environment, so they are intentionally not defined in the taglib, e.g. in Seam: <s:conversationPropagation>.
It is really ugly to have these tags completely in red.

Maxim Mossienko - 13 Nov 07 22:18
I consider this issue can be closed (adding necessary new requests as needed)