Eclipse XML formatting breaks / changes value of list of Spring XML - eclipse

I have a spring list defined in xml as -
<list>
<value> </value>
</list>
However, Eclipse (Juno) has decided to format it as -
<list>
<value>
</value>
</list>
Therefore, changing my value to space + line break for any developer that might format the XML using Eclipse.
I don't want to change the Eclipse formatting rules, but how do I change the Spring XML to avoid this issue? Is there an attribute I can use instead to store the value? Thanks.

Check the schema, or use xml:space. http://www.simonstl.com/xmlprim/xmlupdate/atts.html

Related

Translate language of web page

i translate the jasperserver_message.properties to amharic which contain label and message used in the main jasper reports server user interfaceand saved jasperserver_message_am.properties.but it shows the word like these...
áá° á¢ááµá¤ áªáá­áµ ááá¥á áªá« á¥áá³á á
á°áá áá¡
i specified the locale in applicationContext-security.xml
bean id="userLocalesList"
class="com.jaspersoft.jasperserver.war.common.LocalesListImpl">
<property name="locales">
<list>
<value type="java.util.Locale">en</value>
<value type="java.util.Locale">fr</value>
<value type="java.util.Locale">it</value>
<value type="java.util.Locale">de</value>
<value type="java.util.Locale">ro</value>
<value type="java.util.Locale">ja</value>
<value type="java.util.Locale">am</value>
</list>
</property>
what can i do?
use these website ([[1]: https://www.branah.com/]) and convert (key=value)the value to UTF-16 and place to value of key
for example:
key=value
LOGIN_WELCOME_OS=Welcome to Jaspersoft
and when u localize change the value(Welcome to Jaspersoft) to your language and convert ur languge to UTF-16 using these https://www.branah.com/ website
like:- LOGIN_WELCOME_OS=ወደ ጃስፐርሶፕ እንኳን በደህና መጡ
then change the value to UTF-16
LOGIN_WELCOME_OS =\u12c8\u12f0 \u1303\u1235\u1350\u122d\u1236\u1355 \u12a5\u1295\u12b3 \u1295 \u1260\u12f0\u1205\u1293 \u1218\u1321
You have to convert to ascii format. Please use this command "native2ascii jasperserver_message_am.properties jasperserver_message_am_converted.properties" . Please rename converted(Output) file to "jasperserver_message_am.properties" and replace in "WEB-INF\bundles" folders and restart Tomcat. As an alternative you can use this site https://native2ascii.net/ for converting to ascii.

Mybatis Generator's bug: configuration items should be ordered?

If I put "<commentGenerator>" after "<jdbcConnection>", MBG proposed an error that context content should match: blablabla...
But when I put "<commentGenerator>" before "<jdbcConnection>", everything is ok. Here I have something to complain to the official website that if the order of these items is need, why you do not tell us! What an important thing! You r kidding the freshmen. Maybe it is some where I do not know, but this is a key point to build the MBG's configuration file successfully, why not put this NOTE on the top of the tutorial or somewhere eye-catching?
<generatorConfiguration >
<classPathEntry location="D:\mariadb-java-client-1.1.7.jar" />
<context id="db" >
<commentGenerator>
<property name="suppressAllComments" value="true" />
<property name="suppressDate" value="true" />
</commentGenerator>
<jdbcConnection driverClass="org.mariadb.jdbc.Driver"
connectionURL="jdbc:mariadb://localhost:3306/dbname"
userId="root"
password="password"
/>
<javaTypeResolver >
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<!-- Model Class -->
<javaModelGenerator targetPackage="org.infrastructure.model" targetProject="infrastructure\src\main\java">
<property name="enableSubPackages" value="false" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!-- XML Files -->
<sqlMapGenerator targetPackage="sqlMap" targetProject="infrastructure\src\main\config">
<property name="enableSubPackages" value="false" />
</sqlMapGenerator>
<!-- DAO -->
<javaClientGenerator type="XMLMAPPER" targetPackage="org.infrastructure.dao" targetProject="infrastructure\src\main\java">
<property name="enableSubPackages" value="false" />
</javaClientGenerator>
<!-- Tables -->
<table tableName="user" domainObjectName="User" ></table>
</context>
</generatorConfiguration>
First of all, in your xml configuration file, it doesn't contains a valid root element, which always should be like <!DOCTYPE .../>. About how to add a correct root element of mybatis generator configuration file, please see example from MyBatis GeneratorXML Configuration File Reference.
If you correctly specified root element such as following:
<!DOCTYPE generatorConfiguration PUBLIC
"-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"
>
This root element contains a typical DTD declaration located at http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd. This is the definition of the order of these items is need. And we are going to see what it looks like.
From line 47 of this document type definition, it defines element named context. The content is as following:
<!--
The context element is used to describe a context for generating files, and the source tables.
-->
<!ELEMENT context (property*, plugin*, commentGenerator?, jdbcConnection, javaTypeResolver?,javaModelGenerator, sqlMapGenerator?, javaClientGenerator?, table+)>
Which obviously defined the order of the element in context, that is:
property*, plugin*, commentGenerator?, jdbcConnection,
javaTypeResolver?,javaModelGenerator, sqlMapGenerator?,
javaClientGenerator?, table+
In this element, all children must occurs as following rules:
+ for specifying that there must be one or more occurrences of the item — the effective content of each occurrence may be different;
* for specifying that any number (zero or more) of occurrences is allowed — the item is optional and the effective content of each occurrence may be different;
? for specifying that there must not be more than one occurrence — the item is optional;
If there is no quantifier, the specified item must occur exactly one time at the specified position in the content of the element.
After we understanding its real meaning, why you could not change the order of commentGenerator and jdbcConnection should be clear.
Maybe you want to know how to make the element out of order, question How to define DTD without strict element order could be useful.
Wish it helpful.

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).

Avoid generating header comments with Hibernate generation tools

When generating DTO objects, hibernate tools generate comments in the header:
// Generated 22 avr. 2013 20:29:27 by Hibernate Tools 3.4.0.CR1
Every generation the comments change (as they contains the generation date/time).
The problem is that in my SVN I end up having many non-usefull changes, so I have to check every single generated file to see whether to commit (if it contains actuals changes) or override it (if it's only the header).
Is there a way to avoid generating said header ?
Thank you.
You would have to customize the Freemarker template which is found in hibernate-tools.jar. Navigate to the /pojo/Pojo.ftl and remove the line // Generated ${date} by Hibernate Tools ${version}.
Checking this out might help: https://forum.hibernate.org/viewtopic.php?f=6&t=989777&view=next
An example of a Hibernate tool Ant task (by specifying templatepath and hbmtemplate attributes:
<hibernatetool destdir="hibernate-model-gen/pojo" templatepath="hibernate-model-gen/customized-templates">
<jdbcconfiguration configurationfile="hibernate-model-gen/hibernate.cfg.xml" packagename="open.pub.proto.core.model" revengfile="hibernate-model-gen\gen-conf\hibernate.reveng.xml" detectmanytomany="true" />
<hbmtemplate templateprefix="pojo/" template="pojo/Pojo.ftl" filepattern="{package-name}/{class-name}.java">
<property key="jdk5" value="true" />
<property key="ejb3" value="true" />
</hbmtemplate>
</hibernatetool>

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