Issue in wp:docPr while loading the docx file using docx4j - openxml

Processed a docx file which contains image using docx4j. After loading the file I logged document part, I found that "title" attribute is missing inside <wp:docPr> element. Let me know how to handle this. Thanks in advance
Before Docx4j Process:
<wp:docPr id="3" name="Picture 3" title="eps"/>
After Docx
<wp:docPr id="3" name="Picture 3"/>

Related

In Filemaker, is it possible to import into Container fields from XML?

The XML FMPXMLRESULT grammar documentation states:
XML export does not support exporting container field data.
which seems to imply that it's possible to import (it does also specify that you can denote a field as type "CONTAINER" in the XML). However, I have found zero documentation as to how this might be done.
Is it possible? I get that there are ways of getting e.g. an image file into Filemaker after the fact, but can I just specify it in the XML beforehand, negating the need to have additional scripts or post-processing the import (not to mention something that works in Filemaker 11 or below)?
You can import file references, but not binary data. (And you'll have to specify the field as TEXT type in the XML file.) For example:
<?xml version="1.0" encoding="UTF-8"?>
<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
<ERRORCODE>0</ERRORCODE>
<PRODUCT BUILD="01-25-2011" NAME="FileMaker"
VERSION="ProAdvanced 11.0v3" />
<DATABASE DATEFORMAT="M/d/yyyy" TIMEFORMAT="h:mm:ss a"
LAYOUT="" NAME="" RECORDS="" />
<METADATA>
<FIELD EMPTYOK="YES" MAXREPEAT="1" TYPE="TEXT" NAME="Path" />
</METADATA>
<RESULTSET FOUND="">
<ROW>
<COL>
<DATA>image:test.jpg</DATA>
</COL>
</ROW>
</RESULTSET>
</FMPXMLRESULT>
The path must be in FileMaker format; here I used a relative path to test.jpg in the same directory as the file (will only work for local files), but it can also be an absolute path, e.g.:
imagewin:/C:/Some/Path/test.jpg
Your best option is probably to import Base64-encoded data, then use the Base64Decode function to decode it.
importing images, preferably from http
I am not sure what exactly that means. If your XML contains a link to an image, then the only thing you can do with it is import the link as text. If you are using version 12 or higher, you can follow this with the Insert From URL script step (for each imported record).

Can I use css3 in my Birt Report?

I want to use CSS3 in my Birt Report. But its showing the problem of CSS2.
A BIRT exception occurred.
Plug-in Provider:Eclipse BIRT Project
Plug-in Name:BIRT Model
Plug-in ID:org.eclipse.birt.report.model
Version:4.3.1.v201308301349
Error Code:Error.StyleSheetException.SYNTAX_ERROR
Error Message:There are some syntax errors inconsistent with CSS2.
So can anyone help me like how can I use my CSS3 file for my report. Is there any plugin or some steps then please let me know.
You can use css3 in html format only, by including the css file at viewtime. But it would be ignored by pdf & other formats.
For example, we are going to include this jquery-mobile theme at viewtime:
//ajax.googleapis.com/ajax/libs/jquerymobile/1.4.2/jquery.mobile.min.css
To test this example, add a BIRT text element in the report, set type to HTML and include fragment below:
<button data-icon="star" data-theme="a" data-form="ui-btn-up-a" class=" ui-btn ui-btn-a ui-icon-star ui-btn-icon-left ui-shadow ui-corner-all">Button</button>
Run the report, you will see a great jqueryMobile-like css3 button!
You can also load the external files in the clientScripts of the report using head.js. For example, in a report's clientScripts > clientInitialize event, add:
head.js("http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js",
"http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css");
In the XML source, this appears as the last line in the following code.
<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.23" id="1">
<property name="createdBy">Eclipse BIRT Designer Version 4.4.0.v20150206-1039 Build <4.2.3.v20150206-1039></property>
<property name="units">in</property>
<method name="clientInitialize"><![CDATA[head.js("http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js", "http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css");
]]></method>

Eclipse validation error with fontawesome-webfont.svg

The Eclipse IDE validators complain about fontawesome-webfont.svg - which is part of the project http://fortawesome.github.io/
The content of element type "font-face" is incomplete, it must match "((font-face-src,(desc|title|metadata))|((desc|title|metadata)+,font-face-src,((desc|title|metadata))?))".
(EDIT: clarifying question)
Is the XML schema really being violated?
Is there an error in fontawesome-webfont.svg? How could you fix fontawesome-webfont.svg?
Is there an issue with with the Eclipse validator?
fontawesome-webfont.svg:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata></metadata>
<defs>
<font id="fontawesomeregular" horiz-adv-x="1536" >
<font-face units-per-em="1792" ascent="1536" descent="-256" />
<missing-glyph horiz-adv-x="448" />
<glyph unicode=" " horiz-adv-x="448" />
...
<glyph unicode="" horiz-adv-x="1792" />
</font>
</defs></svg>
This is the validator telling you your file is invalid. The message means that the contents of your font-face element have to match the sequence it relates. It can not be EMPTY. Try letting Eclipse generate a new XML file from the same DTD and you'll see what it needs to look like.
This is a problem related with the validator I guess, since the definition is right, if you check the definition of defs Element it allows an font element.
Also from mozilla sources:
Permitted content:
Any number of the following elements, in any order:
Animation elements
Descriptive elements
Shape elements
Structural elements
Gradient elements
and
<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view>
Normative document SVG 1.1 (2nd Edition)
So you can add to ignore in eclipse validator, please check this topic: How to exclude specific folders or files from validation in Eclipse?

OpenCms : How to access xml element content from multiple schema files

I have a doubt regarding xml structured content in OpenCms. I have two XML schemas, one for editing the top menus (menus are same across all the pages) and another schema for editing the page content. In the template jsp file i need to access xml element contents from both the schema files. How to go for that? do i have to specify something in ?
You can embed one xsd into another. First you define your menu via menu.xsd, then you include it like this in your i.e. page.xsd:
<xsd:include schemaLocation="opencms://system/modules/com.yourmodule.www/schemas/menu.xsd"/>
...
<xsd:element name="Menu" type="OpenCmsMenu" minOccurs="1" maxOccurs="1" />
where 'OpenCmsMenu' needs to be the type name as you defined it in your menu.xsd.
An alternative solution might be to generate the menus from the folder structure. That is the usual method to deal with menus in OpenCms.

Jasper report using same template to render in CSV and PDF formats

We are using one template to render the report in CSV and PDF format. But the problem is we need to have report split into pages in PDF but not in CSV. Is it possible to alter the rendering options based on the format in one template. So that we have CSV without pagination information and PDF divided into page. In such a case 2 separate templates one for CSV and one for PDF should be used? or this can be achieved using one template?
Finally found the answer. In the template following properties need to be set
<property name="net.sf.jasperreports.export.csv.exclude.origin.keep.first.band.columnHeader" value="columnHeader" />
<property name="net.sf.jasperreports.export.csv.exclude.origin.band.columnFooter" value="columnFooter" />
<property name="net.sf.jasperreports.export.csv.exclude.origin.band.pageFooter" value="pageFooter" />
<property name="net.sf.jasperreports.export.csv.exclude.origin.band.lastPageFooter" value="lastPageFooter" />
<property name="net.sf.jasperreports.export.csv.exclude.origin.band.summary" value="summary" />
Using JRCsvMetadataExporter solved similar problem. This class extracts the data from the template ignoring the rendering part. Check out the sample here