How to load images
Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
-
- Posts: 67
- Joined: Thu Oct 29, 2020 12:01 am
How to load images
Post by manojdcoder »
Let's say I have the document below
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept props="something.." base="title.." id="a4">
<title id="v461357">Operating Guidelines</title>
<conbody>
<p>
<image href="Arm_Cuff_250X178_cae7dfb8-462a-40ae-bf41-0bde1b99160f.jpg" id="image_jyb_llz_lnb" />
</p>
</conbody>
</concept>
When the document is loaded in Editor, it tries to load image from "http://localhost:8080/web-author-compon ... 99160f.jpg" - where https//localhost:25608/ is the base path of document url.
I would like to customize the image path - may be point it to a different server / host, pass some additional parameter. Is there a way to intercept the request?
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept props="something.." base="title.." id="a4">
<title id="v461357">Operating Guidelines</title>
<conbody>
<p>
<image href="Arm_Cuff_250X178_cae7dfb8-462a-40ae-bf41-0bde1b99160f.jpg" id="image_jyb_llz_lnb" />
</p>
</conbody>
</concept>
When the document is loaded in Editor, it tries to load image from "http://localhost:8080/web-author-compon ... 99160f.jpg" - where https//localhost:25608/ is the base path of document url.
I would like to customize the image path - may be point it to a different server / host, pass some additional parameter. Is there a way to intercept the request?
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: How to load images
Post by cristi_talau »
Hello,
The default DITA CSS uses the value of the href attribute as the relative URL of the image, to be resolved against the URL of the topic. You can write your own CSS as part of a framework [1] to compute the URL in a different way. You can use some Oxygen-specific CSS extensions like oxy_concat(), oxy_substring() or even oxy_xpath() [2] based on the href value.
An example of such a CSS rule is the following:
Best,
Cristian
[1] https://www.oxygenxml.com/doc/versions/ ... works.html
[2] https://www.oxygenxml.com/doc/versions/ ... tions.html
The default DITA CSS uses the value of the href attribute as the relative URL of the image, to be resolved against the URL of the topic. You can write your own CSS as part of a framework [1] to compute the URL in a different way. You can use some Oxygen-specific CSS extensions like oxy_concat(), oxy_substring() or even oxy_xpath() [2] based on the href value.
An example of such a CSS rule is the following:
Code: Select all
*[class~="topic/image"] {
content: url(oxy_concat('https://oxygenxml.com/images/', attr(href)));
}
Cristian
[1] https://www.oxygenxml.com/doc/versions/ ... works.html
[2] https://www.oxygenxml.com/doc/versions/ ... tions.html
-
- Posts: 67
- Joined: Thu Oct 29, 2020 12:01 am
Re: How to load images
Post by manojdcoder »
Thank you for your reply. I followed custom framework sample, tried implementing a DITA extension, added the following CSS file to framework description
Looks like it loads only my CSS file instead of merging it with existing DITA framework. Any thoughts what I'm missing?
Code: Select all
<field name="authorExtensionDescriptor">
<authorExtension>
<field name="cssDescriptors">
<cssFile-array>
<cssFile>
<field name="href">
<String>${framework}/css/dita.css</String>
</field>
<field name="title">
<String></String>
</field>
<field name="alternate">
<Boolean>false</Boolean>
</field>
</cssFile>
</cssFile-array>
</field>
<field name="mergeCSSsFromDocument">
<Boolean>true</Boolean>
</field>
</authorExtension>
</field>
-
- Posts: 515
- Joined: Wed May 20, 2009 2:40 pm
Re: How to load images
Hello,
It seems that there is no CSS file from the base DITA framework specified in the list of your framework CSS files. Did you delete the "${baseFramework}/..." entries from the CSS list when creating the extension? You should try again to create the extension framework, leave the default CSS entries unmodified and just add your CSS file there.
Best Regards,
Mihaela
It seems that there is no CSS file from the base DITA framework specified in the list of your framework CSS files. Did you delete the "${baseFramework}/..." entries from the CSS list when creating the extension? You should try again to create the extension framework, leave the default CSS entries unmodified and just add your CSS file there.
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 67
- Joined: Thu Oct 29, 2020 12:01 am
Re: How to load images
Post by manojdcoder »
I manually created the framework, copied appropriate scripts from the sample project [here][https://github.com/oxygenxml/legalDocML]
I'm not sure how I can keep existing dita framework working and just merge my CSS files on top of it. Is there a documentation you could point me to?
I'm not sure how I can keep existing dita framework working and just merge my CSS files on top of it. Is there a documentation you could point me to?
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: How to load images
Post by cristi_talau »
Hello,
Here we describe how to create a framework extension [1]. This assumes you have Oxygen XML Editor installed.
Best,
Cristian
[1] https://www.oxygenxml.com/doc/versions/ ... zzf_pns_vz
Here we describe how to create a framework extension [1]. This assumes you have Oxygen XML Editor installed.
Best,
Cristian
[1] https://www.oxygenxml.com/doc/versions/ ... zzf_pns_vz
-
- Posts: 67
- Joined: Thu Oct 29, 2020 12:01 am
Re: How to load images
Post by manojdcoder »
Thanks for the link.
But I'm using the Web Author Integration Project - https://github.com/oxygenxml/web-author ... ntegration , any pointers for this type of project?
But I'm using the Web Author Integration Project - https://github.com/oxygenxml/web-author ... ntegration , any pointers for this type of project?
-
- Posts: 67
- Joined: Thu Oct 29, 2020 12:01 am
Re: How to load images
Post by manojdcoder »
Is it possible for you to give an example of custom .framework XML file that extends dita. In all my attempts it either loads my custom css file or only the bundled dita framework css files, not both.
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: How to load images
Post by cristi_talau »
Hello,
For Web Author Component Integration starter project, only the framework packaging is different [1]. However, frameworks can be uploaded from the Admin page as well after the resulting web application is installed.
Regarding the example framework, you can take a look at the LightWeight DITA framework included in the default Web Author installation.
What you should do after extending the framework is to leave all the inherited CSS files there and add your, and give it no title and mark it as non-alternate.
Best,
Cristian
[1] https://github.com/oxygenxml/web-author ... frameworks
For Web Author Component Integration starter project, only the framework packaging is different [1]. However, frameworks can be uploaded from the Admin page as well after the resulting web application is installed.
Regarding the example framework, you can take a look at the LightWeight DITA framework included in the default Web Author installation.
What you should do after extending the framework is to leave all the inherited CSS files there and add your, and give it no title and mark it as non-alternate.
Best,
Cristian
[1] https://github.com/oxygenxml/web-author ... frameworks
-
- Posts: 67
- Joined: Thu Oct 29, 2020 12:01 am
Re: How to load images
Post by manojdcoder »
Thank you for the directions.
I already had a plugin, I noticed that I can add CSS to by plugin itself which was easier than extending a framework.
Once again, thank you very much for your support.
I already had a plugin, I noticed that I can add CSS to by plugin itself which was easier than extending a framework.
Once again, thank you very much for your support.
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