[oXygen-user] Graphic href attributes

Oxygen XML Editor Support support at oxygenxml.com
Thu Aug 16 03:51:27 CDT 2012


Hi David,

Thanks for the details.

Just to see if I understand properly how you are inserting <graphic>s 
currently:

You probably invoke the content completion in the Author page, select 
<graphic>. Then invoke the in-place attributes editor using "ALT-ENTER" 
and use the "Browse" button to browse to the image.

Indeed that Browse button only inserts URL-like references. Actually 
most of the dialogs in Oxygen use the URL syntax.

So indeed a solution if you are using the Author page would be 
developing a custom Author operation. Our API is Java so you would need 
a Java developer to achieve this.
Our Author SDK is available here:

> http://www.oxygenxml.com/oxygen_sdk.html#XML_Editor_Authoring_SDK

And here's how you can add a new custom action:

> http://www.oxygenxml.com/doc/ug-oxygen/index.html?q=/doc/ug-oxygen/tasks/addCustomActionHowTo.html

To make a long story short, you would have to implement this interface 
"ro.sync.ecss.extensions.api.AuthorOperation", you can look at the Java 
sources for "ro.sync.ecss.extensions.docbook.InsertGraphicOperation" 
which are available in the Author SDK.

That implementation would use our API to open a file chooser in which 
the user chooses the image:

> ro.sync.exml.workspace.api.Workspace.chooseFile(String, String[], String)

and then inserts a small XML snippet at the caret position using our API.

Then you make a JAR library containing your implementation and copy it 
to your custom framework directory.

In the Oxygen Preferences->"Document Type Association" page you can edit 
your custom document type and in the "Classpath" tab add your additional 
JAR.
Then in the Author tab there is an "Actions" tab where you should add a 
new action which uses the newly implemented operation.
Then this action can be added to the menus, toolbars, contextual menus 
in the Author page. You can take a look at the Docbook document type to 
see how actions are defined and used there.

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 8/15/2012 5:33 PM, Hintz, David wrote:
> Hi Radu,
>
> Thanks for your response.  Our custom schema is not Docbook-based (I'm not even familiar with that schema).  We have a custom framework/document type that we've built from scratch (although I may have started with an existing .framework file).  But, I can't find anything in the documentation concerning how you create a custom action for inserting a graphic. We're just starting out with Oxygen are are trying to determine if it fits our needs.  Currently, our publishing application takes an absolute path (e.g., D:\{path}) and transforms it into an entity that is valid across user platforms.  That application is not expecting the path to begin with "file:/".  I understand that, in general, the URI format includes that nomenclature, but if there is an easy way to suppress it, that would be our preference over modifying our application.  If you can point me to a description of creating a custom action, it would be appreciated.
>
> Thanks again,
> Dave
>
> -----Original Message-----
> From: oxygen-user-bounces at oxygenxml.com [mailto:oxygen-user-bounces at oxygenxml.com] On Behalf Of Oxygen XML Editor Support
> Sent: Wednesday, August 15, 2012 12:41 AM
> To: oxygen-user at oxygenxml.com
> Subject: Re: [oXygen-user] Graphic href attributes
>
> Hi David,
>
> The majority of XML vocabularies expect the href's in general to be in the URI format (and if possible to be relative to the source file) in order to be more portable between platforms.
> Is your custom schema Docbook-based?
> If you have a custom schema this means that you have also defined a custom document type.
> This would mean that the action for inserting an image is a custom action created by you so basically you could change it to perform whatever you wish with it. Or are you using parts of the document type we have defined for Docbook for your schema?
>
> Regards,
> Radu
>
> Radu Coravu
> <oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
>
> On 8/15/2012 12:14 AM, Hintz, David wrote:
>> When we insert a graphic element from our custom schema and browse to
>> the graphic we're inserting, we'd like just the absolute path to be
>> inserted in the XML.  For example, we'd like:
>>
>>      <graphic href="D:/image.jpg"/>
>>
>> and  not:
>>
>>     <graphic href="file:/D:/image.jpg"/>
>>
>> Is that possible?
>>
>> Dave Hintz
>>
>> Siemens
>>
>>
>>
>> _______________________________________________
>> oXygen-user mailing list
>> oXygen-user at oxygenxml.com
>> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>>
> _______________________________________________
> oXygen-user mailing list
> oXygen-user at oxygenxml.com
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>


More information about the oXygen-user mailing list