I am working on a sample file in Xliff 1.2 but confused with annotation.As I didnot find anywhere whether it supports custom annotation or not?
Can anyone refer links for sample xliff1.2 file with annotations(if it supports any kind of annotations)
Thanks
you can read more about this in the following link:
http://docs.oasis-open.org/xliff/v1.2/cs02/xliff-core.html#note
This is an example:
<xliff version="1.2">
<file original="Graphic Example.psd"
source-language="en-US" target-language="ja-JP"
tool="Rainbow" datatype="photoshop">
<header>
<skl>
<external-file uid="3BB236513BB24732" href="Graphic Example.psd.skl"/>
</skl>
<phase-group>
<phase phase-name="extract" process-name="extraction"
tool="Rainbow" date="20010926T152258Z"
company-name="NeverLand Inc." job-id="123"
contact-name="Peter Pan" contact-email="ppan#example.com">
<note>Make sure to use the glossary I sent you yesterday.
Thanks.</note>
</phase>
</phase-group>
</header>
<body>
<trans-unit id="1" maxbytes="14">
<source xml:lang="en-US">Quetzal</source>
<target xml:lang="ja-JP">Quetzal</target>
</trans-unit>
<trans-unit id="3" maxbytes="114">
<source xml:lang="en-US">An application to manipulate and
process XLIFF documents</source>
<target xml:lang="ja-JP">XLIFF 文書を編集、または処理
するアプリケーションです。</target>
</trans-unit>
<trans-unit id="4" maxbytes="36">
<source xml:lang="en-US">XLIFF Data Manager</source>
<target xml:lang="ja-JP">XLIFF データ・マネージャ</target>
</trans-unit>
</body>
</file>
</xliff>
Related
I have a VB.Net 4.7.2 desktop application that is throwing an exception occasionally. The exception is usually, "Root element is missing".
When this happens, I am able to view the file after the fact and the root element is there.
The file is written to the share by a remote Linux system and is accessed by this application using an SMB share.
I thought there might be a timing issue with the file being written to the share, so I implemented a retry and I still get the same exception after trying 3 times, 10 seconds apart.
The xmlPath is passed in as a parameter.
' xmlPath is the UNC path to a local network share.
Dim xmlDoc As New XmlDocument()
xmlDoc.Load(xmlPath)
When I view the XML file at the file location, here's what I see.
<reportrequest Version="1.0">
<report ReportGUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ReportCode="LENDPG_1" ABSReportCode="" Title="Lender Portal Collateral Screen Basic" Description="CS Basic Report" Price="0">
<account AccountNumber="6551198" Address="000 Main St" City="Spokane" State="WA" ZipCode="99201" />
<contact FirstName="Person" LastName="Ordering" Email="person#domain.com" Phone="000-000-0000" />
<outputtypecoll>
<outputtype Type="XML" FileName="" />
</outputtypecoll>
<featurecoll>
<feature Name="CSRDISTANCE" Value="false" />
<feature Name="CSRDBSTATUS" Value="false" />
<feature Name="CSRELEVATION" Value="false" />
<feature Name="FINDTP" Value="TRUE" />
<feature Name="DETAILS" Value="TRUE" />
</featurecoll>
<targetpropertycoll>
<targetproperty SiteIndex="0" PropertyGUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ExternalPropertyGUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" MonitoringGUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" PortfolioGUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" OrderGUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" PropertyName="My Property" Address="1 Wherever Ave" City="Sometown" State="CA" ZipCode="99999" Latitude="30.111111" Longitude="-110.88888">
<georeferenced Address="My Property" City="Sometown" State="CA" ZipCode="99999" Latitude="30.111111" Longitude="-110.88888" Fips="" County="" PostalCity="" />
<searchdistancecoll SetID="0000" SetName="LendPort Collateral" MaxDistance="5280" />
<edrdatacoll>
<edrdata Name="REPORTCOST" Value="0.00" />
<edrdata Name="BORROWER" Value="" />
<edrdata Name="LOANTYPE" Value="Other" />
<edrdata Name="LOANNUMBER" Value="" />
<edrdata Name="PROPERTYTYPE" Value="" />
<edrdata Name="DESTHOST" Value="www.xxxxxxxxxxx.com" />
</edrdatacoll>
</targetproperty>
</targetpropertycoll>
</report>
</reportrequest>
This certainly has a root element.
What can be causing this seemingly bogus exception?
Try adding this as the first line of the file
<?xml version="1.0" encoding="UTF-8"?>
EDIT:
Change this
Dim xmlDoc As New XmlDocument()
xmlDoc.Load(xmlPath)
to this
Dim xmlDoc As New XmlDocument()
Try
xmlDoc.Load(xmlPath)
Catch ex As Exception
Dim xe As XElement
xe = XElement.Load(xmlPath)
Stop
End Try
I'm learning about jpos. I got jpos programmer's guide with me and I have gone through that.
It helped me a lot in developing my switch.
I have some questions.
Whether I created my switch Correctly?
What are best practices for these situation:
I have a switch get diffrent messages (two types of channel/packager) from one switch and response back to it (qserver and qmux or only qmux or ...)
I have a switch get diffrent messages from diffrent banks and should reply them or forward messages to another (do I need qserver or just a qmux or need to have more configs on txmanager side)
now Im going to implement first situation In my switch flow is in this way:
Q2 will deploy by xml files:
Server.xml
RequestListener Class
TransactionMangare.xml
Here, in QMUX, what I don't understand is:
Q2 will deploy by xml files
(then I have QMUX.xml,Channeladaptor.xml and Listener Class [I want to know in what order it should come])
TransactionMangare.xml
messages with diffrent channel would come to me through a single port. is it possible?
as Qmux would use key (Bit41 and mti) which needs to specify channel before giving to the right one (otherwise would get 41 wrong or it would not parse it at all)
here are my deploy files:
logger.xml
<?xml version="1.0" encoding="UTF-8"?>
<logger name="Q2Logger" class="org.jpos.q2.qbean.LoggerAdaptor">
<log-listener class="org.jpos.util.SimpleLogListener" />
</logger>
server.xml
<?xml version="1.0" encoding="UTF-8"?>
<server class="org.jpos.q2.iso.QServer" logger="Q2Logger" name="TransactionServer">
<attr name="port" type="java.lang.Integer">88800</attr>
<attr name="maxSessions" type="java.lang.Integer">20</attr>
<attr name="minSessions" type="java.lang.Integer">10</attr>
<!-- packager is customised (I also need another packager for another type of messages) -->
<channel class="org.jpos.iso.channel.ASCIIChannel" name="ASCIIChannel" logger="Q2Logger" packager="com.example.transaction.packager.ISO93APackager" header="ISO51300000">
<property name="timeout" value="70000" /> <!-- 7 minutes -->
<property name="keep-alive" value="true" />
</channel>
<!-- can have realm="incoming-request-listener" -> to automatically put into space ???? -->
<request-listener class="com.example.transaction.listener.ServerRequestListener" logger="Q2Logger" name="isoListener">
<property name="space" value="transient:default" />
<property name="queue" value="CerditCardTXNQueue" />
<property name="spaceTimeout" value="60000" />
</request-listener>
</server>
txnmgr.xml
<?xml version="1.0" encoding="UTF-8"?>
<txnmgr name="CreditCardTransactionManager" logger="Q2Logger" class="org.jpos.transaction.TransactionManager">
<property name="space" value="transient:default" />
<property name="queue" value="TXNQueue" />
<property name="sessions" value="5" />
<property name="debug" value="true" />
<participant class="com.example.transaction.participants.PrepareParticipant" logger="Q2Logger" />
<participant class="com.example.transaction.participants.ValidationParticipant" logger="Q2Logger" />
<participant class="com.example.transaction.participants.ProcessParticipant" logger="Q2Logger" />
<participant class="com.example.transaction.participants.SendResponseParticipant" logger="Q2Logger"/>
</txnmgr>
Thanks,
I am trying to create a installer with IzPack. I am trying to execute a batch file before the installation.
install.xml
<izpack:installation version="5.0"
xmlns:izpack="http://izpack.org/schema/installation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://izpack.org/schema/installation http://izpack.org/schema/5.0/izpack-installation-5.0.xsd">
<guiprefs width="640" height="480" resizable="yes"/>
<variables>
<variable name="DesktopShortcutCheckboxEnabled" value="true"/>
</variables>
<locale>
<langpack iso3="eng"/>
</locale>
<resources>
<res id="ProcessPanel.Spec.xml" src="ProcessPanel.Spec.xml"/>
<res id="shortcutSpec.xml" src="shortcutSpec.xml"/>
<res id="LicencePanel.licence" src="License.txt"/>
<res id="InfoPanel.info" src="Readme.txt"/>
</resources>
<panels>
<panel classname="HelloPanel"/>
<panel classname="ProcessPanel"/>
<panel classname="LicencePanel"/>
<panel classname="TargetPanel"/>
<panel classname="PacksPanel"/>
<panel classname="InstallPanel"/>
<panel classname="ShortcutPanel"/>
<panel classname="FinishPanel"/>
</panels>
<packs>
<pack name="Base" required="yes">
<description>The base files</description>
<file src="Readme.txt" targetdir="$INSTALL_PATH"/>
<file src="License.txt" targetdir="$INSTALL_PATH"/>
<file src="phone.ico" targetdir="$INSTALL_PATH"/>
<fileset dir="lib" targetdir="$INSTALL_PATH\lib">
<include name="**"/>
</fileset>
</pack>
</packs>
<native type="izpack" name="ShellLink.dll"/>
<native type="3rdparty" name="COIOSHelper.dll" stage="both">
<os family="windows"/>
</native>
</izpack:installation>
ProcessPanel.Spec.xml
<?xml version="1.0" encoding="UTF-8" ?>
<processing>
<job name="doxyz">
<os family="windows" />
<executefile name="$INSTALL_PATH/scripts/mytest.bat">
<arg>doit</arg><arg>$variable</arg>
</executefile>
</job>
<onFail previous="true" next="false" />
<onSuccess previous="false" next="true" />
</processing>
At the compile time, I don't get any error! But when I am executing the install.jar and when I open the ProcessPanel I am getting the following error:
I used the:
izpack-dist-5.0.6
to generate the installer and my java version is:
java version "1.8.0_66" Java(TM) SE Runtime Environment
(build 1.8.0_66-b18) Java HotSpot(TM) 64-Bit Server VM (build 25.66-b18, mixed mode)
I would call this an expected behaviour.
The file $INSTALL_PATH/scripts/mytest.bat cannot be found because it isn't probably preinstalled due to the activation order of the panels. ProcessPanel is shown before InstallPanel, but InstallPanel is the one installing the file. Problems of this kind the compiler does NOT complain about, you must care about them on your own. It is more or less a problem of the logic introduced by the installer description, not of IzPack.
I am trying to make a very simplistic installer using IzPack. It should do the following two things
1. Copy and paste all the content of dist directory to UserHome/MyApp dir.
2. Execute a batch file to edit registry entry to start the jar file on user logon.
But I am stuck at the first step only! nothing is installed if I use the following XML and generate the installer. Generated installer runs and does show the InstallPanel but nothing is copied to the user_home directory.
From what it seems like I am not able to assign value to Install_path variable.
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<installation version="1.0">
<variables>
<variable name="INSTALL_PATH" value="$USER_HOME/MyApp"/>
</variables>
<info>
<appname>My App</appname>
<appversion>1.0</appversion>
<authors>
<author name="My APP Author" email="support#myapp.com"/>
</authors>
<url>http://SomeURL.net</url>
</info>
<guiprefs width="640" height="480" resizable="yes"/>
<locale>
<langpack iso3="eng"/>
</locale>
<panels>
<panel classname="InstallPanel"/>
</panels>
<packs>
<pack name="Base" required="yes">
<description>The base files</description>
<fileset dir="dist" targetdir="$INSTALL_PATH"/>
</pack>
</packs>
</installation>
UPDATE
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<installation version="1.0">
<variables>
<variable name="TargetPanel.dir.windows" value="$USER_HOME\MyTeamNinja"/>
<variable name="TargetPanel.dir.mac" value="$USER_HOME/MyTeamNinja"/>
</variables>
<info>
<appname>My App</appname>
<appversion>1.0</appversion>
<authors>
<author name="MyTeamNinja" email="support#MyTeamNinja.com"/>
</authors>
<url>http://myteam.ninja</url>
</info>
<guiprefs width="640" height="480" resizable="yes"/>
<locale>
<langpack iso3="eng"/>
</locale>
<panels>
<panel classname="DefaultTargetPanel"/>
<panel classname="InstallPanel"/>
<panel classname="SimpleFinishPanel"/>
</panels>
<packs>
<pack name="Base" required="yes">
<description>The base files</description>
<fileset dir="dist" targetdir="$INSTALL_PATH"/>
</pack>
</packs>
</installation>
Now as soon as I click the installer it starts the install but in c:\program files\My App\
what you need is a TargetPanel. it allows the user to select the destination dir. to install the files. the location selected in this panel sets the value of $INSTALL_PATH.
however, you may also override the default value of the $INSTALL_PATH.in order to override the default value of $INSTALL_PATH, you may do the following:
<variables>
<variable name="TargetPanel.dir.windows" value="$USER_HOME/MyApp"/>
<variable name="TargetPanel.dir.unix" value="$USER_HOME/MyApp"/>
</variables>
or,
<variables>
<variable name="DEFAULT_INSTALL_PATH" value="$USER_HOME/MyApp"/>
</variables>
and also, remember to include the TargetPanel before the InstallPanel in case you choose to allow the user to select the target loc. for the installation.
<panels>
<panel classname="TargetPanel"/>
<panel classname="InstallPanel"/>
</panels>
See HERE for more on this.
UPDATE:
place the entry for TargetPanel before the InstallPanel in the <panels> section.
remove the <resources> section:
<resources>
<res id="TargetPanel.dir.windows" src="$USER_HOME/MyApp"/>
<res id="TargetPanel.dir.unix" src="$USER_HOME/MyApp"/>
</resources> This is where the error is being generated. Instead use <variables> to specify default values for ${INSTALL_PATH} (see in my answer above).
also, to set a value for ${INSTALL_PATH} through <variables> you need to use name="DEFAULT_INSTALL_PATH" or TargetPanel.dir.windows/unix
UPDATE 2: The following piece of code installs in the correct location (as specified by you in the defaultInstallDir.txt).
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<installation version="1.0">
<!-- variables>
<variable name="TargetPanel.dir.windows" value="$USER_HOME\MyTeamNinja"/>
<variable name="TargetPanel.dir.mac" value="$USER_HOME/MyTeamNinja"/>
</variables -->
<!-- remove the above <varible> section and include the REQUIRED defaultInstallDir.txt to set the value for the DefaultTargetPanel -->
<resources>
<res id="TargetPanel.dir" src="defaultInstallDir.txt"/>
</resources>
<info>
<appname>My App</appname>
<appversion>1.0</appversion>
<authors>
<author name="MyTeamNinja" email="support#MyTeamNinja.com"/>
</authors>
<url>http://myteam.ninja</url>
</info>
<guiprefs width="640" height="480" resizable="yes"/>
<locale>
<langpack iso3="eng"/>
</locale>
<panels>
<panel classname="DefaultTargetPanel"/>
<panel classname="InstallPanel"/>
<panel classname="SimpleFinishPanel"/>
</panels>
<packs>
<pack name="Base" required="yes">
<description>The base files</description>
<fileset dir="dist" targetdir="$INSTALL_PATH"/>
</pack>
</packs>
</installation>
now, create a file named defaultInstallDir.txt and simply write the following within this file :
$USER_HOME/MyApp
just make sure that you include this file correctly in the installer through the src=".." attribute of the <resources> section and you're good to go.
double clicking on the installer directly installs the files in $USER_HOME/MyApp (in my case: at C:\Users\Sunny\MyApp)
I'm using struts 2.2.1 and tiles 2.2.2. I've done every step described here but I cannot get tiles work... I get the following error while deploying my war to glassfish 3.1:
[#|2011-10-04T08:43:28.117+0200|SEVERE|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=74;_ThreadName=AutoDeployer;|Exception while invoking class com.sun.enterprise.web.WebApplication start method
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:130)
In my WEB-INF/lib I've got commons-collections-3.1.jar, commons-fileupload-1.2.1.jar, struts2-core-2.2.1.jar, tiles-api-2.2.2.jar, tiles-core-2.2.2.jar, tiles-jsp-2.2.2.jar and xwork-core-2.2.1.jar.
This is my struts.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<package name="basicstruts2" extends="struts-default">
<interceptors>
<interceptor-stack name="appDefault">
<interceptor-ref name="defaultStack">
<param name="exception.logEnabled">true</param>
<param name="exception.logLevel">ERROR</param>
</interceptor-ref>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="appDefault" />
<result-types>
<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" />
</result-types>
<global-results>
<result name="exception">/jsp/exceptions/exception.jsp</result>
<result name="webServiceException">/jsp/exceptions/webserviceexception.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="java.lang.Exception" result="exception" />
<exception-mapping exception="java.io.IOException" result="exception" />
<exception-mapping exception="exceptions.WebServiceExceptionForStruts"
result="webServiceException" />
</global-exception-mappings>
<action name="tilesTest" class="test.action.TilesTest">
<result name="success" type="tiles">/welcome.tiles</result>
</action>
<action name="index">
<result>/jsp/index.jsp</result>
</action>
</package>
</struts>
After inserting the code into my struts.xml, I get this error in eclipse:
And this is my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Consumer</display-name>
<welcome-file-list>
<welcome-file>/jsp/index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
<context-param>
<param-name>tilesDefinitions</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
</web-app>
Thank you very much!
You're missing the S2 tiles plugin. It's listed in the referenced article.
Your second issue with the XML is clearly stated in the IDE error; the order of elements given in the error message isn't the order you define the elements in your XML file.
ClassNotFoundException, looks like missing jar issue. Can you see the tiles plugin jar in war that is getting deployed on glassfish server.if not check check the war creation setting in you IDE. We faced this problem when it was not pushing jars from lib to the war.
ClassNotFoundException Always alerts you that some class/jar which is referenced is missing. Make sure you have all the basic jars required for tiles.
In my case, I have these jars (besides struts2 jars) in my struts2 application to test a demo tile project.
commons-beanutils-1.7.0.jar
commons-digester-2.0.jar
commons-logging-1.1.1.jar
commons-logging-api-1.1.jar
ognl-3.0.1.jar
slf4j-api-1.6.2.jar
slf4j-simple-1.6.2.jar
struts2-tiles-plugin-2.2.3.1.jar
tiles-api-2.2.2.jar
tiles-compat-2.2.2.jar
tiles-core-2.2.2.jar
tiles-jsp-2.2.2.jar
tiles-servlet-2.2.2.jar
tiles-template-2.2.2.jar
Best of luck.
Regards,
Amir Ali