You are not logged in.
MsgViewer is email-viewer utility for .msg e-mail messages, implemented in pure Java. MsgViewer works on Windows/Linux/Mac Platforms. Also provides a java api to read mail messges (msg files) programmatically.
https://sourceforge.net/projects/msgviewer/
Thx Sean, works like a charm.
Padding Zeros to a Field with XSLT
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<!-- identity transform -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="//*[local-name()='CustomerCode']">
<!-- Define a variable to contain the length of the input value
The dot you see in the expression is the current element we are working on.
In this case CustomerCode is the Input Value. See the match above-->
<xsl:variable name="inputLength" select="string-length(.)" />
<xsl:copy>
<!-- Now we create a variable to hold our padding.
It is a substring of our 10 zeros less the length of our input -->
<xsl:variable name="padding" select="substring('0000000000',1,10 - $inputLength)"/>
<!-- Finally we simply concatinate our padding which is the correct length with the input value.
Don't forget the dot you see there is the current element we matched on in this case CustomerCode Input Value -->
<xsl:value-of select="concat($padding,.)" />
</xsl:copy>
</xsl:template>
<xsl:template match="//*[local-name()='SiteCode']">
<!-- Define a variable to contain the length of the input value
The dot you see in the expression is the current element we are working on.
In this case SiteCode is the Input Value. See the match above-->
<xsl:variable name="inputLength" select="string-length(.)" />
<xsl:copy>
<!-- Now we create a variable to hold our padding.
It is a substring of our 10 zeros less the length of our input -->
<xsl:variable name="padding" select="substring('0000000000',1,10 - $inputLength)"/>
<!-- Finally we simply concatinate our padding which is the correct length with the input value.
Don't forget the dot you see there is the current element we matched on in this case SiteCode Input Value -->
<xsl:value-of select="concat($padding,.)" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Here is the input XML you can test with
<?xml version="1.0" encoding="UTF-8"?>
<XServiceBroker xmlns="http://www.sxi.co.za/XMLSchema">
<CustomerCode>1222B3</CustomerCode>
<SiteCode>ZB22B3</SiteCode>
</XServiceBroker>
Credit goes to Kevin.
Hi Ruan
How does the data looks like ?
Steph
Setup the licence About To Expire Notification to a central XLayer server to process the notification.
Add the following style sheet to folder: X:\SXI\XPress\Dispatch\stylesheet
LicAboutToExpireChangeDest.xsl
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.sxi.co.za/XMLSchema" xmlns:sxi="http://www.sxi.co.za/XMLSchema">
<xsl:output indent="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="//sxi:Destination">
<xsl:element name="{local-name()}">
<!-- Replace the IP below to the central XLayer Notification Server IP -->
<xsl:value-of select="'192.168.50.71'"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Add the following to the Dispatch Initialisation.xml in the ContentTransformations
<!-- This will transform the Notification Doc using the LicAboutToExpireChangeDest.xsl style sheet to send the notification for licence About To Expire to the central XLayer Notification Server IP -->
<Transformation sendOriginal="no" stylesheetPath="X:\SXI\XPress\Dispatch\stylesheet\LicAboutToExpireChangeDest.xsl">
<Condition xpath="/sxi:XNotification/sxi:NotificationGroup/@name" value="LicAboutToExpire"/>
</Transformation>
When done restart the XPressDispatch service.
It's working correct with this Date Converter rule, I changed the Output Date Format to "yyyyy/MM/dd HH:mm:ss".
The seconds are not provided in the input, it will default to "00".
<sxi:Rules>
<sxi:DateConverter InputDateFormat="dd MMMM yyyy h:mm a" OutputDateFormat="yyyy/MM/dd HH:mm:ss"/>
</sxi:Rules>
I have tested the AM / PM .
Tested with Input "24 December 2018 7:52 PM"
Output ----------- <DateTime>2018/12/24 19:52:00</DateTime>
Tested with input "24 December 2018 7:52 AM"
Output ----------- <DateTime>2018/12/24 07:52:00</DateTime>
Hi Sean,
There is no input for the seconds, I will test it and let you know.
Thx.
I need some help on covering the fallowing Date Time stamp from 24 December 2018 7:52 AM to 2018/12/24 07:52:00.
This Script will monitor the XmlOut folder to Count files in the XmlOut folder and output it to XML file for X-ServiceBroker to read the file from the DOS Script below, by adding it to X-ServiceBroker Schedules in the Initialisation.xml you can trigger it there.
@echo off
setlocal enabledelayedexpansion
REM Here I call the GetUnixTime to get Unix Time to use it in the file name
call :GetUnixTime UNIX_TIME
ECHO ### Checking the number of files in XmlOut ###
set numFiles=0
for %%x in (C:\SXI\XPress\XmlOut\*.*) do (
set file[!numFiles!]=%%~nfx
set /a numFiles+=1
)
REM ### Set Dest and Action
set Dest=127.0.0.1
set ActionName=Test
set Provider=CountFile
ECHO ### Number of files found: %numFiles%
REM ### Set the XML Output attributes
echo ^<?xml version="1.0" encoding="UTF-8"?^> >> C:\SXI\XPress\XmlOut\X-ServiceBroker~%Provider%~%UNIX_TIME%.xml
echo ^<XServiceBroker xmlns="http://www.sxi.co.za/XMLSchema"^> >> C:\SXI\XPress\XmlOut\X-ServiceBroker~%Provider%~%UNIX_TIME%.xml
echo ^<XHeader^> >> C:\SXI\XPress\XmlOut\X-ServiceBroker~%Provider%~%UNIX_TIME%.xml
echo ^<XPress^> >> C:\SXI\XPress\XmlOut\X-ServiceBroker~%Provider%~%UNIX_TIME%.xml
echo ^<Destination^>%Dest%^</Destination^> >> C:\SXI\XPress\XmlOut\X-ServiceBroker~%Provider%~%UNIX_TIME%.xml
echo ^</XPress^> >> C:\SXI\XPress\XmlOut\X-ServiceBroker~%Provider%~%UNIX_TIME%.xml
echo ^<XServiceBroker^> >> C:\SXI\XPress\XmlOut\X-ServiceBroker~%Provider%~%UNIX_TIME%.xml
echo ^<ActionName^>%ActionName%^</ActionName^> >> C:\SXI\XPress\XmlOut\X-ServiceBroker~%Provider%~%UNIX_TIME%.xml
echo ^<Provider^>%Provider%^</Provider^> >> C:\SXI\XPress\XmlOut\X-ServiceBroker~%Provider%~%UNIX_TIME%.xml
echo ^</XServiceBroker^> >> C:\SXI\XPress\XmlOut\X-ServiceBroker~%Provider%~%UNIX_TIME%.xml
echo ^</XHeader^> >> C:\SXI\XPress\XmlOut\X-ServiceBroker~%Provider%~%UNIX_TIME%.xml
echo ^<Count^> >> C:\SXI\XPress\XmlOut\X-ServiceBroker~%Provider%~%UNIX_TIME%.xml
echo ^<TotalFiles^>%numFiles%^</TotalFiles^> >> C:\SXI\XPress\XmlOut\X-ServiceBroker~%Provider%~%UNIX_TIME%.xml
echo ^</Count^> >> C:\SXI\XPress\XmlOut\X-ServiceBroker~%Provider%~%UNIX_TIME%.xml
echo ^</XServiceBroker^> >> C:\SXI\XPress\XmlOut\X-ServiceBroker~%Provider%~%UNIX_TIME%.xml
endlocal
REM The GetUnixTim will be: 1341791426 seconds have elapsed since 1970-01-01 00:00:00
:GetUnixTime
setlocal enableextensions
for /f %%x in ('wmic path win32_utctime get /format:list ^| findstr "="') do (
set %%x)
set /a z=(14-100%Month%%%100)/12, y=10000%Year%%%10000-z
set /a ut=y*365+y/4-y/100+y/400+(153*(100%Month%%%100+12*z-3)+2)/5+Day-719469
set /a ut=ut*86400+100%Hour%%%100*3600+100%Minute%%%100*60+100%Second%%%100
endlocal & set "%1=%ut%" & goto :EOF
EXIT 0
<Schedules>
<Schedule name="FileCountTriger">
<AT>*/15 * * * *</AT>
<Action>
<Path>c:\sxi</Path>
<Command>filecount.cmd</Command>
<Arguments/>
</Action>
</Schedule>
</Schedules>
Please add to this post if you have a better solution for us to use.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" method="xml" encoding="utf-8" omit-xml-declaration="yes"/>
<!-- Stylesheet to remove all namespaces from a document -->
<!-- NOTE: this will lead to attribute name clash, if an element contains
two attributes with same local name but different namespace prefix -->
<!-- Nodes that cannot have a namespace are copied as such -->
<!-- template to copy elements -->
<xsl:template match="*">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@* | node()"/>
</xsl:element>
</xsl:template>
<!-- template to copy attributes -->
<xsl:template match="@*">
<xsl:attribute name="{local-name()}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
<!-- template to copy the rest of the nodes -->
<xsl:template match="comment() | text() | processing-instruction()">
<xsl:copy/>
</xsl:template>
</xsl:stylesheet>
On-line Style Sheets website, This one works with XSLT 2.0
http://xslttest.appspot.com/
Thanks Kevin, I have managed to understand how to configure the Global Notifications in Workflow
Got to work.
By using the class's in X-Scheduler you can trigger the flowing in X-Scheduler DbDataCopy, FTP, SFTPFetch, SFTPSend, ServiceBrokerTrigger.
Here is an example for a ServiceBroker Trigger
<Schedule name="test"> ---> EntryPoint "test" in the ServiceBrokerTrigger.xml file.
<AT>*/5 * * * *</AT> ---> Runs ever 5 min
<Action>
<Path>C:\Program Files\SXI\X-Scheduler\tasks</Path> -------> Where the Class file is.
<Command>ServiceBrokerTrigger.class</Command>
<Arguments>test</Arguments> ---> EntryPoint "test" in the ServiceBrokerTrigger.xml file.
</Action>
</Schedule>
Stephan
Hi
How do I setup X-Scheduler to do a ServiceBroker Trigger ?
Stephan