/** To change this template, choose Tools | Templates* and open the template in the editor.*/package org.eightfoldconsulting.nimas2pdf;import java.io.IOException;import javax.xml.namespace.QName;import javax.xml.parsers.DocumentBuilderFactory;import javax.xml.parsers.ParserConfigurationException;import org.w3c.dom.*;import javax.xml.xpath.*;import org.xml.sax.SAXException;/**** @author Gregory Buchenberger*/public class OPFReader {private String title;private String publisher;private String identifier;private String daisyXML;private String subject;private String opfFile;private Document xmlDocument;private XPath xPath;public OPFReader(String opffile) {this.opfFile = opffile;initObjects();this.readOPF();}private void initObjects() {try {xmlDocument = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(opfFile);xPath = XPathFactory.newInstance().newXPath();} catch (IOException ex) {ex.printStackTrace();} catch (SAXException ex) {ex.printStackTrace();} catch (ParserConfigurationException ex) {ex.printStackTrace();}}/*** @return the title*/public String getTitle() {return title;}/*** @return the publisher*/public String getPublisher() {return publisher;}/*** @return the identifier*/public String getIdentifier() {return identifier;}/*** @return the daisyXML*/public String getDaisyXML() {return daisyXML;}/*** @return the subject*/public String getSubject() {return subject;}private Object eval(String expression,QName returnType) {try {XPathExpression xPathExpression =xPath.compile(expression);return xPathExpression.evaluate(xmlDocument, returnType);} catch (XPathExpressionException ex) {ex.printStackTrace();return null;}}private void readOPF() {// get TitleString expression = "//Title/text()";title = (String) eval(expression, XPathConstants.STRING);// get Publisherexpression = "//Publisher/text()";publisher = (String) eval(expression, XPathConstants.STRING);// get Identifierexpression = "//Identifier[1]/text()";identifier = (String) eval(expression, XPathConstants.STRING);// get Daisy XMLexpression = "//spine/itemref[1]/@idref";String itemRef = (String) eval(expression, XPathConstants.STRING);expression = "//manifest/item[@id='" + itemRef + "']/@href";daisyXML = (String) eval(expression, XPathConstants.STRING);}}
The following script will install Alfresco Labs 3.0 on Ubuntu 8.10 JeOS. Just call it something.sh and execute it as root. You’ll have to attend to it a bit (MySQL password) but it will take a while. Make sure you are connected to the internet.
#!/bin/bash # # A script to install Alfresco Labs 3.0 Stable on Intrepid Ibex # # Gregory Buchenberger # 2009/04/10 apt-get install mysql-server \ openoffice.org-headless \ openoffice.org-writer \ openoffice.org-calc \ openoffice.org-impress \ imagemagick \ openoffice.org-java-common \ openjdk-6-jdk
#pdf2swf dependencies apt-get install libfreetype6-dev \ build-essential \ linux-headers-$(uname -r) \ zlib1g-dev \ libjpeg62-dev
wget http://www.swftools.org/swftools-2009-02-16-1757.tar.gz tar -zvxf swftools-2009-02-16-1757.tar.gz cd swftools-2009-02-16-1757 ./configure make make install
#Configure MySQL echo " * Creating Alfresco database ..." echo " * Waiting for MySQL root password from user..." mysql -u root -p -e 'create database alfresco; grant all on alfresco.* to "alfresco"@"localhost" identified by "alfresco" with grant option; grant all on alfresco.* to "alfresco"@"localhost.localdomain" identified by "alfresco" with grant option;'
echo " * Installing Alfresco ..." mkdir /opt/alfresco cd /opt/alfresco wget http://downloads.sourceforge.net/alfresco/alfresco-labs-tomcat-3Stable.tar.gz tar -xvf alfresco-labs-tomcat-3Stable.tar.gz rm ./alfresco-labs-tomcat-3Stable.tar.gz
#MySQL java connector echo " * Installing MySQL Java Connector ..." cd /opt/alfresco/tomcat/lib/ wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.7.tar.gz/from/http://mirror.sourceshare.org/mysql/ tar -xvf mysql-connector-java-5.1.7.tar.gz cp ./mysql-connector-java-5.1.7/mysql-connector-java-5.1.7-bin.jar ./ rm -rf ./mysql-connector-java-5.1.7/ rm ./mysql-connector-java-5.1.7.tar.gz
mkdir /var/alfresco mkdir /var/alfresco/alf_data
#Init.d Script echo " * Creating init scripts ..." echo '#!/bin/bash # # alfresco This shell script takes care of starting and stopping alfresco # # chkconfig: - 80 20 # ### BEGIN INIT INFO # Provides: alfresco # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: # Default-Stop: # Description: Alfresco Enterprise Content Management 2.1.1 # Short-Description: start and stop alfresco ### END INIT INFO #
NAME="$(basename $0)"
unset ISBOOT
if [ "${NAME:0:1}" = "S" -o "${NAME:0:1}" = "K" ]; then
NAME="${NAME:3}"
ISBOOT="1"
fi
# Path to alfresco root dir _ALFRESCO="/opt/alfresco"
# Path to the alfresco launch script
_SCRIPT="${_ALFRESCO}/alfresco.sh"
# Alfresco program name _PROG="$NAME"
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk export PATH=$PATH:/usr/bin echo $PATH SHUTDOWN_WAIT=30
RETVAL="0"
function checkpid() {
local i
for i in $* ; do
if [ -d "/proc/${i}" ]; then
return 0
fi
done
return 1
}
function echo_failure() {
echo -en "\33[60G"
echo -n "[ "
echo -n $"FAILED"
echo -n " ]"
echo -ne "\r"
return 1
}
function echo_success() {
echo -en "\33[60G"
echo -n "[ "
echo -n $"OK"
echo -n " ]"
echo -ne "\r"
return 0
}
function getIP() {
ipaddr=""
inet=$(ip addr show dev eth0 | grep "inet")
if [ "$inet" != "" ]; then
set -- $inet
shift
echo ${1%%/*} | grep -E \([0-9]\{1,3\}.\{3\}\)[0-9]\{1,3\} > /dev/null
if [ $? -ne 1 ]; then
ipaddr=$(echo ${1%%/*} | sed -e s/[.]/-/g)
fi
fi
if [ $ipaddr = "" ]; then return -1 fi }
function updateVirtDomain() {
virt_server=${_ALFRESCO}/virtual-tomcat/conf/alfresco-virtserver.properties
virt_server_property=alfresco.virtserver.domain
if [ -e $virt_server ]; then
grep -E ^alfresco\.virtserver\.domain=\([0-9]\{1,3\}-\)\{3\}[0-9]\{1,3\} $virt_server
if [ $? -eq 0 ]; then
sed -i -r -e s/^${virt_server_property}=\([0-9]\{1,3\}-\)\{3\}[0-9]\{1,3\}/${virt_server_property}=${ipaddr}/ \
$virt_server
else
sed -i -r -e s/^${virt_server_property}=/${virt_server_property}=${ipaddr}/ \
$virt_server
fi
fi
}
# See how we were called.
function start() {
echo -n "Starting ${_PROG}: "
if [ -f "/var/run/${NAME}.pid" ]; then
read kpid < /var/run/${NAME}.pid
if checkpid $kpid 2>&1; then
echo "$NAME process already running"
return -1
else
echo "lock file found but no process running for"
echo "pid $kpid, continuing"
fi
fi
###Insert start script here###
getIP
if [ $? -ne -1 ]; then
updateVirtDomain
else
echo_failure
exit
fi
$_SCRIPT start
RETVAL="$?"
if [ "$RETVAL" -eq 0 ]; then
sleep 3
pidof -s java > /var/run/${NAME}.pid
echo_success
else
echo_failure
fi
echo
return $RETVAL
}
function status() {
RETVAL="1"
if [ -f "/var/run/${NAME}.pid" ]; then
read kpid < /var/run/${NAME}.pid
if checkpid $kpid 2>&1; then
echo "$0 is already running (${kpid})"
RETVAL="0"
else
echo "lock file found but no process running for pid $kpid"
fi
else
pid="$(pgrep -u root java)"
if [ -n "$pid" ]; then
echo "$0 running (${pid}) but no PID file exists"
RETVAL="0"
else
echo "$0 is stopped"
fi
fi
return $RETVAL
}
function stop() {
local STOP_VERBOSE="false"
echo -n "Stopping $_PROG: "
###Insert Stop script here###
$_SCRIPT stop
RETVAL="$?"
if [ "$RETVAL" -eq "0" ]; then
count="0"
if [ -f "/var/run/${NAME}.pid" ]; then
read kpid < /var/run/${NAME}.pid
until [ "$(ps --pid $kpid | grep -c $kpid)" -eq "0" ] || \
[ "$count" -gt "$SHUTDOWN_WAIT" ]; do
if [ "$STOP_VERBOSE" = "true" ]; then
echo -n -e "\nwaiting for processes $kpid to exit"
fi
sleep 1
let count="${count}+1"
done
if [ "$count" -gt "$SHUTDOWN_WAIT" ]; then
if [ "$STOP_VERBOSE" = "true" ]; then
echo -n -e "\nkilling processes which did not stop"
echo -n -e "after "
echo -n "$SHUTDOWN_WAIT seconds"
fi
kill -9 $kpid
fi
echo_success
if [ "$count" -gt "0" ]; then
echo -n -e "\n"
fi
fi
rm -f /var/run/${NAME}.pid
else
echo_failure
fi
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 2
start
;;
status)
status
;;
*)
echo "Usage: $_PROG {start|stop|restart|status}"
exit 1
esac
exit $RETVAL' > /etc/init.d/alfresco
chmod +x /etc/init.d/alfresco #update-rc.d alfresco defaults update-rc.d -f alfresco start 99 2 3 4 5 . update-rc.d -f alfresco stop 90 0 6 .
#Alfresco launch script
echo " * Creating launch scripts ..."
echo '#!/bin/sh
# Start or stop Alfresco server
# Set the following to where Tomcat is installed
ALF_HOME=/opt/alfresco
APPSERVER="${ALF_HOME}/tomcat"
# Set any default JVM values
export JAVA_OPTS="-Xms128m -Xmx512m -XX:MaxPermSize=128m -server"
if [ "$1" = "start" ]; then
"${APPSERVER}/bin/startup.sh"
elif [ "$1" = "stop" ]; then
"${APPSERVER}/bin/shutdown.sh"
fi' > /opt/alfresco/alfresco.sh
chmod +x /opt/alfresco/alfresco.sh
#Alfresco extention config echo " * Configuring extentions ..." echo 'swf.exe=/usr/local/bin/pdf2swf ooo.exe=/usr/lib/openoffice/program/soffice img.root=/usr dir.root=/var/alfresco/alf_data db.driver=org.gjt.mm.mysql.Driver db.url=jdbc:mysql://localhost/alfresco' > /opt/alfresco/tomcat/shared/classes/alfresco/extension/custom-repository.properties
echo 'hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect' > /opt/alfresco/tomcat/shared/classes/alfresco/extension/custom-hibernate-dialect.properties echo " * Finis!"
Lewes, Delaware (PRWEB) — Wikidot Inc., developer of the popular Wikidot.com platform has freed the code for its flagship product under the new GNU Affero General Public License version 3. The company has freed both its current Wikidot product, and the new Wikidot/2.0 product under development.
Wikidot Inc. founder and General Manager Michal Frackowiak explains, “our users want access to the code, and we want our users to get involved in the project. We believe that freeing our software is great for our community, and great for our business.” The Affero license gives users the right to modify, share, and even resell improvements to the code. Michal explains, “it’s like the GPLv3 but also requires service providers who extend our Wikidot code to share their improvements”.
Wikidot.com is growing popular with smart users who use its wiki functionality to build creative sites, quickly. Pieter Hintjens, founder of iMatix Corporation and CEO of Wikidot Inc., explains, “it used to take weeks to build a website. With Wikidot my team can make new rich sites in a matter of hours. It’s all about doing more with less.”
Through pure word-of-mouth, Wikidot now ranks as one of the most popular wikifarms, and is growing at the rate of 500 users a day. Michal Frackowiak concludes, “we deliver a quality product and a very reliable service. Our users are our best sales people.”
Software is available free of charge to everyone at wikidot.org.
I’ve decided to take the leap. Doing business as Eightfold Consulting LLC, I’ll be helping my own clients optimize productivity, communication, collaboration, and compliance. The name “Eightfold” comes from Buddhism and represents, for me, a new way of doing business. More ahead…
Here’s a function for adding leading zeros to a number. I have it set to add up to five zeros:
Public Function LdgZero(ByVal x)
If x < 10 Then
x = "00000" & x
ElseIf x >= 10 And x < 100 Then
x = "0000" & x
ElseIf x >= 100 And x < 1000 Then
x = "000" & x
ElseIf x >= 1000 And x < 10000 Then
x = "00" & x
ElseIf x >= 10000 And x < 100000 Then
x = "0" & x
Else : MsgBox("Does not compute.")
End If
Return x
End Function
After the Digitech Datagroup file is converted to .csv in Access the following code may be used to convert to a Laserfiche Import List (.lst) file.
1 Imports Microsoft.VisualBasic.FileIO
2 Imports System.IO.StreamReader
3 Imports System.Text.Encoding
4 Imports System.IO
5 Imports System.Data.OleDb
6 Imports System.Data.SqlClient
7 Imports sConverter1.FormsConverter
8 Module Convert
9 Dim cnOleDb As OleDbConnection
10 Dim PathDat As String
11 Dim PathImg As String
12 Dim PathLst As String
13 Dim Dat As String
14 Dim Lst As String
15 Dim LstFile As File
16 Dim filename As String
17 Dim lstSavePath As String
18 Dim dumpfile As String
19 Dim currentRow As String()
20 Public Function LdgZero(ByVal x)
21 If x < 10 Then
22 x = "00000" & x
23 ElseIf x >= 10 And x < 100 Then
24 x = "0000" & x
25 ElseIf x >= 100 And x < 1000 Then
26 x = "000" & x
27 ElseIf x >= 1000 And x < 10000 Then
28 x = "00" & x
29 ElseIf x >= 10000 And x < 100000 Then
30 x = "0" & x
31 Else : MsgBox("Does not compute.")
32 End If
33 Return x
34 End Function
35 Public Sub OpenCSV()
36 FormsConverter.OpenFileDialogDat.ShowDialog()
37 If FormsConverter.OpenFileDialogDat.FileName <> "" Then
38 PathDat = FormsConverter.OpenFileDialogDat.FileName
39 Dat = My.Computer.FileSystem.ReadAllText(PathDat)
40 FormsConverter.TextBoxQC.Text = Dat
41 FormsConverter.TextBoxDat.Text = PathDat
42 ' cnOleDb.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & PathDat & "'"
43 End If
44 End Sub
45 Public Sub ConvertCSV()
46 ' Create an instance of StreamWriter to write text to the dump file.
47 dumpfile = "C:\dumpfile.lst"
48 Dim sw As StreamWriter = New StreamWriter(dumpfile, False, ASCII)
49 ' Create an instance of the TextFieldParser called DatReader
50 Using DatReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(PathDat)
51 ' Set the field type to delimited
52 DatReader.TextFieldType = FileIO.FieldType.Delimited
53 ' Set the delimiter to comma
54 DatReader.SetDelimiters(",")
55 ' Create an array of strings called currentRow
56 ' The array starts at currentFields(0)
57 ' Start writng to the dumpfile
58 sw.WriteLine("LASERFICHE IMPORT LIST")
59 ' Execute this loop until the end of the file.
60 While Not DatReader.EndOfData
61 Try
62 'ReadFields reads all fields on the current line,
63 'returns them as an array of strings,
64 'and advances the cursor to the next line
65 'containing data
66 currentRow = DatReader.ReadFields()
67 sw.WriteLine()
68 sw.WriteLine("STARTFIELDS")
69 ' The fist line after the STARTFIELDS directive
70 ' indicates the template name. The name is provided by the user.
71 sw.WriteLine(FormsConverter.TextBoxTemplate.Text)
72 ' This is customizable for the csv format
73 ' and represents the field values for the template.
74 ' For i As Integer = 1 To 2
75 sw.WriteLine(currentRow(1))
76 ' i = i + 1
77 sw.WriteLine(currentRow(2))
78 ' Next
79
80 sw.WriteLine(LdgZero(currentRow(6)))
81 sw.WriteLine("ENDFIELDS")
82 ' The document name is provided by the data file in field 6
83 sw.WriteLine("DOCUMENT(" & currentRow(1) & " - " & currentRow(2) & ")")
84 sw.WriteLine()
85 ' STARTLIST indicates the begining of the image file locations
86 sw.WriteLine("STARTLIST")
87 ' This loop parses data field 5 and separates the digits by 8, forms the file path and name and etc.
88 Do While Len(currentRow(5)) > 0
89 Dim PathFlr As String = Format(Int(Val(Mid(currentRow(5), 1, 8)) / 1000), "00000")
90 sw.WriteLine(PathImg & "\" & PathFlr & "\" & Mid(currentRow(5), 1, 8) & ".tif")
91 currentRow(5) = Mid(currentRow(5), 9)
92 Loop
93 sw.WriteLine("ENDLIST")
94 Catch ex As Microsoft.VisualBasic.FileIO.MalformedLineException
95 MsgBox("Line " & ex.Message & _
96 "is not valid and will be skipped.")
97 End Try
98 End While
99 sw.Close()
100 End Using
101 Lst = My.Computer.FileSystem.ReadAllText(dumpfile)
102 FormsConverter.TextBoxQC.Text = Lst
103 FormsConverter.ButtonSavelst.Enabled = True
104 FormsConverter.ProgressBar1.Value = 100
105 End Sub
106 Public Sub SaveLst()
107 FormsConverter.SaveFileDialoglst.ShowDialog()
108 If FormsConverter.SaveFileDialoglst.FileName <> "" Then
109 PathLst = FormsConverter.SaveFileDialoglst.FileName()
110 Dim sw As StreamWriter = New StreamWriter(PathLst, False, ASCII)
111 sw.Write(Lst)
112 End If
113 End Sub
114 Public Sub ImagesLoc()
115 FormsConverter.FolderBrowserDialog1.ShowDialog()
116 PathImg = FormsConverter.FolderBrowserDialog1.SelectedPath
117 FormsConverter.TextBoxImageFolder.Text = PathImg
118 End Sub
119 End Module
Michael zur Muehlen is an Assistant Professor of Information Systems at Stevens Institute of Technology in Hoboken, New Jersey. He has been so kind as to offer a free download of his book, Workflow-based Process Controlling – Foundation, Design, and Application of Workflow-driven Process Information Systems. If you love it, and do not want to go blind reading a 300 page PDF, you can purchase it. The publisher’s site is in German and the book is priced in Euros, so good luck with that.
If you insist on going blind, like me, set your Acrobat zoom settings to “fit visible” and you might make it half way through before you eyes burn out….
Our next AIIM meeting is planned for October. Details follow:
Rocky Mountain AIIM Lunch Seminar
Denver, Colorado – Thursday October 4, 2007
Tim Johnson, Director
Gardner Group
About the Presentation
Document management and Collaboration are in the top 10 of the CIO’s investment agenda. The marketplace is shifting from best of breed application vendors to basic content services infrastructure vendors. Find out about the content management topics that are emerging versus those in full productivity. Review the topics that will become important to our careers in managing the future content services.
About the Speaker
Tim Johnson, as a Director at Gartner Consulting, has 25 years of experience in IT and focuses on enterprise content management, IT strategy, application portfolio analysis, and vendor selection at Gartner. Mr. Johnson has a variety of industry vertical experience including: insurance, government, financial services, healthcare, and construction engineering. Mr. Johnson is a member of the Gartner Content Management research community. He joined Gartner in 2000.
About the 2007-2008 Seminar Series
In dozens of informal conversations with participants of prior AIIM seminars, we have heard many organizations, public and private, are considering either beginning an ECM effort from scratch or refreshing the technology for an effort already underway. A common question in these conversations is: “we’re not going to build this ourselves, so how do we do a good job of managing the acquisition and implementation of something this complex?”
Your local AIIM Chapter board has put together a series of seminars to address just this set of topics, from the initial RFP issuance, through award and implementation. This process includes a Technology Trends seminar by Gartner Group to let RFP teams know what is in the market today and what to expect in the near future.
The implementation phase includes policy topics, such as record retention and taxonomy, as well as technology topics on what to look for in archive-quality media, and the all-important change management phase, or bringing staff and customers alike safely and effectively into the brave new world you are creating.
All of the sessions are run by practicing professionals who are and have been deep in the middle of each of the topics presented. No theory here; just practical experience.
Directions to the Sheraton 4 Points Hotel at I-25 and Hampden
From Downtown or the Tech Center, take Exit 201 onto Hampden..
Head EAST on Hampden less than a ¼ mile, then turn NORTH onto Locust.
The Sheraton 4 Points is on your immediate left.
Registration
Registration begins at 11:30AM, with the presentation scheduled for 12 noon.
Cost
AIIM non-Members: $30 (Click HERE for PayPal)
AIIM-Members: $20 (Click HERE for PayPal)
(Note that it is now VERY easy to pre-pay using your credit card at our
PayPal Site – See the section ‘Don’t have a PayPal account?’)
(checks and cash accepted at the door)
A buffet lunch will be served
Seating is limited, so please email me for reservations
About AIIM
For over 60 years, AIIM (The Association for Information and Image Management) has been the leading international organization focused on helping users to understand the challenges associated with managing documents, content, and business processes. AIIM is international in scope, independent, implementation-focused, and, as the representative of the entire ECM (Electronic Content Management) industry – including users, suppliers, and the channel – acts as the industry’s intermediary.
The calendar for this and all other Rocky Mountain AIIM meetings can be found on the chapter website.