problem to create selection plugin : UUIDGenerator
Oxygen general issues.
-
- Posts: 6
- Joined: Wed Aug 09, 2006 1:03 pm
problem to create selection plugin : UUIDGenerator
Hello
I would like to create a selection plugin for oXygen to insert at the cursor position an UUID in the canonical format. For that purposes I have adapted the oXygen sample plugin UpperCase.
As long as I am expanding the "context.getSelection()" string with an additional "normal" string content the plugin is working fine by calling it - the additional string is inserted to the cursor position. But if there is any call to the UUIDGenerator included/uncommented (see code below) the plugin compiles well (without any error), loads well in oXygen but does not work at all by calling it. The selection at the cursor position is neither replaced nor altered - just nothing happens - even no error message.
Unfortunately as I am just a java newbie so it is hard for me to find out why the call to the UUIDGenerator will disturb the proper function of the plugin. For any hint I would be very grateful.
Many thanks in advance,
André
I would like to create a selection plugin for oXygen to insert at the cursor position an UUID in the canonical format. For that purposes I have adapted the oXygen sample plugin UpperCase.
Code: Select all
file : UppercasePluginExtension.java
...
import ro.sync.exml.plugin.selection.SelectionPluginResultImpl;
import org.safehaus.uuid.UUID;
import org.safehaus.uuid.UUIDGenerator;
...
public SelectionPluginResult process(SelectionPluginContext context) {
String my UUID = "test";
// myUUID = UUIDGenerator.getInstance().generateRandomBasedUUID().toString();
return new SelectionPluginResultImpl(context.getSelection()+myUUID) ;
// return new SelectionPluginResultImpl(context.getSelection().toUpperCase());
}
...
Code: Select all
file : UppercasePluginExtension.java
...
import ro.sync.exml.plugin.selection.SelectionPluginResultImpl;
import org.safehaus.uuid.UUID;
import org.safehaus.uuid.UUIDGenerator;
...
public SelectionPluginResult process(SelectionPluginContext context) {
String my UUID = "test";
myUUID = UUIDGenerator.getInstance().generateRandomBasedUUID().toString();
return new SelectionPluginResultImpl(context.getSelection()+myUUID) ;
// return new SelectionPluginResultImpl(context.getSelection().toUpperCase());
}
...
Many thanks in advance,
André
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello André,
Did you add the jar file containing the org.safehaus.uuid.UUIDGenerator class to the runtime section of plugin.xml ? The Uppercase plugin folder contains a plugin.xml file with a runtime element:
Copy the jug-asl-2.0.0.jar to the lib subfolder of the Uppercase folder, add it to the runtime element and restart <oXygen/>:
Regards,
Sorin
Did you add the jar file containing the org.safehaus.uuid.UUIDGenerator class to the runtime section of plugin.xml ? The Uppercase plugin folder contains a plugin.xml file with a runtime element:
Code: Select all
<runtime>
<library name="lib/uppercase.jar"/>
</runtime>
Code: Select all
<runtime>
<library name="lib/uppercase.jar"/>
<library name="lib/jug-asl-2.0.0.jar"/>
</runtime>
Sorin
-
- Posts: 6
- Joined: Wed Aug 09, 2006 1:03 pm
Hello Sorin
Thank you for your prompt response. No I did not add the "lib/jug-asl-2.0.0.jar" in the plugin.xml file. Now I have added it, but even after restarting oXygen the behavior of the plugin is the same as before. With the uncommented line where the UUIDGenrator is called the plugin does nothing. Is there any error.log of oXygen where also minor problems will be logged? As basis I have used the actual OxygenPluginsDevelopmentKit - is it also backward compatible with oXygen 6.2?
Thank you, with best regards,
André
Thank you for your prompt response. No I did not add the "lib/jug-asl-2.0.0.jar" in the plugin.xml file. Now I have added it, but even after restarting oXygen the behavior of the plugin is the same as before. With the uncommented line where the UUIDGenrator is called the plugin does nothing. Is there any error.log of oXygen where also minor problems will be logged? As basis I have used the actual OxygenPluginsDevelopmentKit - is it also backward compatible with oXygen 6.2?
Thank you, with best regards,
André
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
The plugins included in the OxygenPluginsDevelopmentKit should work in all versions 6.x and 7.x. Please send your code as an archive to support at oxygenxml dot com. I will try to debug it.
Regards,
Sorin
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Thank you for the files. In plugin.xml you have to replace
<library name="lib/jug-asl-2.0.0.jar"/>
with
<library name="lib/jug-lgpl-2.0.0.jar"/>
because this is the name of the jar in the lib folder of your plugin. I used in my test plugin the other jar provided by Safehaus, called jug-asl-2.0.0.jar but you use jug-lgpl-2.0.0.jar so you have to specify that in plugin.xml. With this change the plugin works in oXygen 6.2 and also in the latest version (7.2).
Regards,
Sorin
<library name="lib/jug-asl-2.0.0.jar"/>
with
<library name="lib/jug-lgpl-2.0.0.jar"/>
because this is the name of the jar in the lib folder of your plugin. I used in my test plugin the other jar provided by Safehaus, called jug-asl-2.0.0.jar but you use jug-lgpl-2.0.0.jar so you have to specify that in plugin.xml. With this change the plugin works in oXygen 6.2 and also in the latest version (7.2).
Regards,
Sorin
-
- Posts: 6
- Joined: Wed Aug 09, 2006 1:03 pm
-
- Posts: 3
- Joined: Tue Sep 19, 2006 7:49 am
-
- Posts: 6
- Joined: Wed Aug 09, 2006 1:03 pm
Hello Smithsmitty wrote:Hi André,
Can you make your plugin available to others? I have a need for a similar plugin, and I could make my own, but if one already exists and is available I would rather use that and spend my time on more meaningful things.
Smith
Please download the plugin under the following link http://www.himmel-blau.com/downloads/pu ... rtUUID.zip as it is.
best regards, André
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service