Image loading in the editor from the server
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 35
- Joined: Fri Nov 11, 2011 10:34 am
Image loading in the editor from the server
Post by maxim.kovalev »
Hello,
At opening in Oxygen Author dita a file from the server on the client, images, a kind aren't displayed, the image lies on the server, and the editor probably searches for them by the client car.
How to explain to the editor, without changing structure dita a file, what the given images should be requested from the server, instead of on the client?
Thanks
At opening in Oxygen Author dita a file from the server on the client, images, a kind aren't displayed, the image lies on the server, and the editor probably searches for them by the client car.
How to explain to the editor, without changing structure dita a file, what the given images should be requested from the server, instead of on the client?
Thanks
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Image loading in the editor from the server
Hi Maxim,
The Oxygen Author page uses CSS to render the XML in a visual manner.
The CSS associated to the XML file also describes the location where the image should be searched.
Usually the CSS has a selector like (the sample is for XHTML):
The "content" property's value instructs the Author page to show the referenced URL as an image, the "src" attribute being resolved relative to the location of the XML file.
But you can specify another path for the image location like:
This will instruct Oxygen to join the server remote location with the value of the "src" attribute and interpret this as an URL.
This is another thread about interesting things to do when resolving an image:
http://www.oxygenxml.com/forum/post1022 ... age#p10228
Regards,
Radu
The Oxygen Author page uses CSS to render the XML in a visual manner.
The CSS associated to the XML file also describes the location where the image should be searched.
Usually the CSS has a selector like (the sample is for XHTML):
Code: Select all
img {
display: inline;
content: attr(src,url);
width:attr(width, length);
height:attr(height, length);
}
But you can specify another path for the image location like:
Code: Select all
img {
...
content: url("http://www.oxygenxml.com/images", attr(src));
...
}
This is another thread about interesting things to do when resolving an image:
http://www.oxygenxml.com/forum/post1022 ... age#p10228
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 35
- Joined: Fri Nov 11, 2011 10:34 am
Re: Image loading in the editor from the server
Post by maxim.kovalev »
Thanks, Radu
The problem in that that a way to the image is set concerning opened dita a file (
Whether there is still a possibility as or to set to the editor a way for search of pictures during file loading in the editor? For example any output agent to whom I can specify as correctly to process the given ways otherwise.
Thanks
The problem in that that a way to the image is set concerning opened dita a file (
Whether there is still a possibility as or to set to the editor a way for search of pictures during file loading in the editor? For example any output agent to whom I can specify as correctly to process the given ways otherwise.
Thanks
-
- Posts: 35
- Joined: Fri Nov 11, 2011 10:34 am
Re: Image loading in the editor from the server
Post by maxim.kovalev »
The problem in that that a way to the image is set concerning opened dita a file (<image href="../../image.jpg")
Whether there is still a possibility as or to set to the editor a way for search of pictures during file loading in the editor? For example any output agent to whom I can specify as correctly to process the given ways otherwise.
Thanks
Whether there is still a possibility as or to set to the editor a way for search of pictures during file loading in the editor? For example any output agent to whom I can specify as correctly to process the given ways otherwise.
Thanks
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Image loading in the editor from the server
Hi,
I'm sorry but I do not quite understand what you mean.
Besides creating a CSS selector which points to the correct image location, the other alternative is to use a custom ro.sync.ecss.extensions.api.StylesFilter implementation which can be set in the Extensions tab in the Document Type Edit dialog.
Another approach using the fixed CSS selector is to define it something like:
Then in the Author Component register this additional "myCustomProtocol" URLHandler which when called to open an input stream can search for the image in some place else and return an input stream to it.
I'm assuming you are customizing the Author Component for embedding it in a Web browser page.
Regards,
Radu
I'm sorry but I do not quite understand what you mean.
Besides creating a CSS selector which points to the correct image location, the other alternative is to use a custom ro.sync.ecss.extensions.api.StylesFilter implementation which can be set in the Extensions tab in the Document Type Edit dialog.
Another approach using the fixed CSS selector is to define it something like:
Code: Select all
img {
...
content: url("myCustomProtocol://server/images", attr(src));
...
}
I'm assuming you are customizing the Author Component for embedding it in a Web browser page.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 35
- Joined: Fri Nov 11, 2011 10:34 am
Re: Image loading in the editor from the server
Post by maxim.kovalev »
Thanks Radu,
I have redefined StylesFilter and have connected it through extensions.
I have redefined StylesFilter and have connected it through extensions.
Code: Select all
public class DITAStylesFilter implements StylesFilter {
public static String filePath = "";
@Override
public String getDescription () {
return null;
}
private static final String IMAGE_TAG = "image";
@Override
public Styles filter (Styles styles, AuthorNode authorNode) {
if (AuthorNode.NODE_TYPE_ELEMENT == authorNode.getType() && IMAGE_TAG.equals(authorNode.getName())) {
try {
styles.setProperty(
Styles.KEY_PLACEHOLDER_CONTENT, new URL("http://localhost:8888/"));
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
return styles;
}
}
Radu wrote:Hi,
I'm sorry but I do not quite understand what you mean.
Besides creating a CSS selector which points to the correct image location, the other alternative is to use a custom ro.sync.ecss.extensions.api.StylesFilter implementation which can be set in the Extensions tab in the Document Type Edit dialog.
Another approach using the fixed CSS selector is to define it something like:
Then in the Author Component register this additional "myCustomProtocol" URLHandler which when called to open an input stream can search for the image in some place else and return an input stream to it.Code: Select all
img {
...
content: url("myCustomProtocol://server/images", attr(src));
...
}
I'm assuming you are customizing the Author Component for embedding it in a Web browser page.
Regards,
Radu
-
- Posts: 35
- Joined: Fri Nov 11, 2011 10:34 am
Re: Image loading in the editor from the server
Post by maxim.kovalev »
But works nothing, I can not so I set parameters
Return to “DITA (Editing and Publishing DITA Content)”
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