Home » Language IDEs » ServerTools (WTP) » How to extend Web Page Editor??? migration from europa to galileo(migration of visual web page editor from europa to galileo doesnt work)
How to extend Web Page Editor??? migration from europa to galileo [message #495592] |
Thu, 05 November 2009 13:00 |
Nicolas Sax Messages: 3 Registered: November 2009 |
Junior Member |
|
|
extended my Web Page Editor in Eclipse Europa by creating a Plugin Project and using Design-Time Tag Metadata.
In Eclipse Europa everything worked fine. Now I would like to upgrade to Galileo, the online help documentation seems to be the same, so i thought the plugin should still be working.
To describe what i wanted:
I created a new Tag in an xml file(that is included into my plugin project) for a Tag library:
<entity id="spocPage" type="tag">
<trait id="dt-info">
<value xsi:type="dti:DTInfo">
<tag-convert-info>
<operation id="CustomTransformOperation">
<parameter value="com.company.product.jsf.common.SpocPageOperation"/>
</operation>
<operation id="CopyChildrenOperation"/>
</tag-convert-info>
<tag-decorate-info id="vpd-decorate-design"
needBorderDecorator="true"
/>
</value>
</trait>
</entity>
As the online help describes the transform method in the class SpocPageOperation(i appended it) should be called.
But if i debug the plugin project, and set a breakpoint at the strart of the transform method nothing happens, the method is never called.
So the element i just created on the Web page editor doesn't appear as i described it in the transform method, i just can see a bold red name of the tag written down.
I tried a lot of things, but because of the docoumentation that is similar to europa i thought i dont have to...
So maby you know where i could find the error.
[Updated on: Fri, 04 December 2009 14:30] Report message to a moderator
|
|
|
Re: How to extend Web Page Editor??? migration from europa to galileo [message #495974 is a reply to message #495592] |
Fri, 06 November 2009 20:22 |
Ian Trimble Messages: 137 Registered: July 2009 |
Senior Member |
|
|
Nicolas,
I apologize for not seeing this posting and then telling you to use this forum when you resorted to getting our attention in the wtp-dev mailing list. You were following protocol, and I missed it. So, I responded via email, but wanted to follow up here as this is where we hope more users will see the information.
There were some fairly significant changes made in this area for Galileo. As you have correctly pointed out, the documentation was not updated to reflect the changes this was an oversight for which I apologize. I have logged a bug to track updating of the documentation (https://bugs.eclipse.org/bugs/show_bug.cgi?id=294506).
First, why were there changes? Well, we identified a couple of issues that we couldn't ignore and had to address. The first issue was that, due to limitations we imposed on ourselves in the design, it wasn't going to be a simple matter to write new operations and get them into appropriate plug-ins they would all need to be "custom operations" or the metadata would have to be included in plug-ins where it really didn't belong (in short, we wanted Trinidad metadata in a Trinidad plug-in, and our previous design got in the way of that). The second issue was that a "custom operation" could not have parameters, while the "built-in operations" could this both got in our way and we also saw it as an undesirable design. So we changed things somewhat to address these issues.
There is now no difference between our "built-in" operations and "custom" ones there is one type of operation, and it must be registered via an extension point, and referenced slightly differently in metadata.
Before using your own operations, you must register them using the " org.eclipse.jst.pagedesigner.pageDesignerExtension/tagTransf ormOperation " extension point element. An excerpt of a plugin.xml file registering the "CopyAttributeOperation" follows:
<plugin>
...
<extension point=" org.eclipse.jst.pagedesigner.pageDesignerExtension">
...
<tagTransformOperation
class=" org.eclipse.jst.pagedesigner.dtmanager.converter.operations. internal.CopyAttributeOperation "
id="CopyAttributeOperation">
</tagTransformOperation>
...
</extension>
...
</plugin>
The value of the class attribute is the fully-qualified classname of the operation. The id is how we will reference the operation in metadata this id will be qualified with the ID of the plug-in that declares this extension point, which in this case is "org.eclipse.jst.pagedesigner" (so this operation's qualified id is "org.eclipse.jst.pagedesigner.CopyAttributeOperation").
Metadata that uses this operation must be declared via extension point as described in the help the basic registration and format of the metadata file is the same as is documented, I will describe the changes to the metadata format below.
Where before you would use the above-registered operation like this, "<operation id="CopyAttributeOperation"><parameter value="type"/></operation>", you now need to use the plugin-qualified id, like this:
<operation id="org.eclipse.jst.pagedesigner.CopyAttributeOperation>
<parameter value="type"/>
</operation>
There is no longer a "CustomTransformOperation" you register your operation and then reference it just as is described above for the (previously "built-in") CopyAttributeOperation.
So, for your particular case, you will need to register your operation in your plug-in, something like so:
<plugin>
...
<extension point=" org.eclipse.jst.pagedesigner.pageDesignerExtension">
...
<tagTransformOperation
class=" com.swisslog.spoc7.jsf.common.SpocPageOperation"
id="SpocPageOperation">
</tagTransformOperation>
...
</extension>
...
</plugin>
Then, your metadata needs to change like so (I'm assuming you performed the above registration in a fictitious plug-in with the id "com.company.product.pluginid" you will need to change to suit your exact structure, of course):
<operation id="com.company.product.pluginid.SpocPageOperation">
<!-- your operation can now have parameters here, if so desired -->
</operation>
You'll also now need to qualify the CopyChildrenOperation all previous "built-in" operations are registered in the "org.eclipse.jst.pagedesigner" plug-in, so with that as a qualifier, it becomes:
<operation id=" org.eclipse.jst.pagedesigner.CopyChildrenOperation"/>
With these changes, you should be back in business. Please feel free to contact me directly should you have further questions directly related to this conversion process. Again, my apologies for the oversight in not correcting the documentation I am now going to log a bug. (I seem to recall that we DID describe this change somewhere, on some WTP wiki page or in the newsgroup, perhaps, although I can't seem to locate that announcement at present.)
- Ian (JSF Tools Project)
|
|
|
Re: How to extend Web Page Editor??? migration from europa to galileo [message #498908 is a reply to message #495974] |
Thu, 19 November 2009 07:25 |
Nicolas Sax Messages: 3 Registered: November 2009 |
Junior Member |
|
|
Thanks for your response.
I could solve the first part of my problem with your description.
Now i got stuck at another point.
Everything is working also with my own transform methods.
Except if i call TransformOperations in my transform method.
I tried a lot of things... decompiled the code of eclipse to analyze how you did it.
But finally i could not find any fault.
It would be great if you could have a look at the code below.
package com.company.product.jsf.common;
import org.eclipse.jst.pagedesigner.dtmanager.converter.ITransformOperation;
import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.AbstractTransformOperation;
import org.eclipse.jst.pagedesigner.dtmanager.converter.operations.TransformOperationFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
public class SelectBooleanCheckbox extends AbstractTransformOperation {
public SelectBooleanCheckbox() {
}
/**
* Generates a checkbox that has a label
*/
@Override
public Element transform(Element srcElement, Element curElement) {
Document doc = srcElement.getOwnerDocument();
Element divElement = createElement("div");
ITransformOperation operation;
Element checkbox = appendChildElement("input", divElement);
operation = TransformOperationFactory.getInstance().getTransformOperation(
TransformOperationFactory.OP_CreateAttributeOperation, new String[] { "type", "checkbox" });
operation.transform(srcElement, checkbox);
String label = srcElement.getAttribute("label");
if (label == null) {
label = "no label";
}
Element span = appendChildElement("span", divElement);
span.appendChild(doc.createTextNode(label));
return divElement;
}
}
Thx again,
Kind Regards
Nicolas
[Updated on: Fri, 04 December 2009 14:30] Report message to a moderator
|
|
| | | |
Goto Forum:
Current Time: Wed Sep 25 04:22:01 GMT 2024
Powered by FUDForum. Page generated in 0.81576 seconds
|