📄 install_postgresql.html
字号:
above are available on the respective websites from which you will download these resources. </p><h4>Environment variables</h4><p>Once you have installed/ascertained that you have all the above components, you must set up some environment variables (these are used by the build script): </p> <UL> <LI>ANT_HOME</LI> <LI>CATALINA_HOME</LI> <LI>JAVA_HOME</LI> <LI>JUNIT_HOME</LI> <LI>XALAN_HOME</LI> </UL><p>You may skip this step (setting up environment variables) if you wish, but you must then take care of it in the build script. It is strongly recommended that you address this at this point by setting up environment variables, unless you have a strong reason not to do so.</p> <h2>4. Load the test database<a name="04-LoadTestDB"> </a></h2> <p>The Mondrian distribution is accompanied by a test database (the classic "Foodmart" database). This database must be loaded for you run the examples available with the distribution. You will have to make use of the following resources from the distribution to load the database.</p><UL> <LI><span class="code"><STRONG> mondrian.test.loader.MondrianFoodMartLoader</STRONG></span>: A data loading utility that takes an input JDBC URL or file reference (from which the schema and test data are to be taken), an output JDBC URL and connection parameters (for the target database in which the schema must be created and data loaded), and one or more flags to indicate the schema objects that must be created (tables, data, etc.). This utility is packaged in "<span class="code">%BIN_LOCATION%/lib/mondrian.jar</span>".</LI> <LI><STRONG>%BIN_LOCATION%/demo/access/MondrianFoodmart.mdb</STRONG>: MS Access database containing the complete foodmart database. This will be accessed through the DSN created by you in Sec. 3.</LI> <LI><STRONG>%BIN_LOCATION%/demo/access/FoodMartCreateData.sql</STRONG>: Text file containing "<span class="code">INSERT INTO</span>" SQL statements to load test data.</LI> </UL><p>Execute the following steps to load the test database:</p><OL> <LI><STRONG>Create a database and database user:</STRONG> Create a database user called "<span class="code">foodmart</span>" (password: "<span class="code">foodmart</span>"). Then create a database called "<span class="code">foodmartdb</span>" owned by the user "<span class="code">foodmart</span>".<BR> </LI> <LI><STRONG>Copy the JDBC driver:</STRONG> Copy the Postgres JDBC driver into "<span class="code">%BIN_LOCATION%/lib</span>".<BR> </LI> <LI><STRONG>Load the database</STRONG>: Open a command prompt window and change your current directory to "<span class="code">%BIN_LOCATION%</span>". At the command prompt, run the command <BR> <span class="code"> java -cp "<span style="color:red">%BIN_LOCATION%</span>\lib\mondrian.jar;<span style="color:red">%BIN_LOCATION%</span>\lib\log4j-1.2.9.jar;<span style="color:red">%BIN_LOCATION%</span>\lib\eigenbase-xom.jar;<span style="color:red">%BIN_LOCATION%</span>\lib\eigenbase-resgen.jar;<span style="color:red">%BIN_LOCATION%</span>\lib\<span style="color:red">postgresql-8.0-312.jdbc3.jar</span>" mondrian.test.loader.MondrianFoodMartLoader -verbose -tables -data -indexes -jdbcDrivers="org.postgresql.Driver,sun.jdbc.odbc.JdbcOdbcDriver" -inputFile=<span style="color:red">%BIN_LOCATION%</span>\demo\FoodMartCreateData.sql" -outputJdbcURL="jdbc:postgresql://localhost/<span style="color:red">foodmartdb</span>" -outputJdbcUser=<span style="color:red">foodmart</span> -outputJdbcPassword=<span style="color:red">foodmart</span> </span> <BR><BR> <span class="caution">[!]</span> Please note the following: <UL> <LI>This command must be executed as a single command. When you copy+paste the above command into an editor, whitespaces/carriage returns will be introduced that will cause syntax errors. Be sure to replace these spaces if you copy+paste this command.</LI> <LI>All items in the above command marked in <span style="color:red"> RED</span> will have to be replaced by the actual value (path, filename, database name, user name, etc.) applicable for your system.</LI> </UL> </LI> </OL> <h2>5. Install Mondrian (build the "mondrian.war" file)<a name="05-InstallationNotes"> </a></h2><p>There are three sets of activities in creating the web archive: modifying some files, copying some files and running the ant script. Each of these is detailed out in this section.</p><h4>Modify files</h4><p>The source code that we extracted from <strong> mondrian-1.1.5-src.zip</strong> contains among others, three files that require to be changed before <span class="code">mondrian.war</span> can be built. These are "<span class="code">mondrian.properties</span>", "<span class="code">build.bat</span>" and "<span class="code">build.xml</span>". Changes to each of these files is detailed below. <BR> </p> <OL> <LI><STRONG>Changes to <span class="code"> mondrian.properties</span></STRONG>: The changes in this file are predominantly changes to connection strings; the path to the Tomcat home directory is also to be specified here.<BR><BR> In particular, the following changes are to be made:<BR> <UL> <LI>Replace <span class="code" style="color:red"> Jdbc=jdbc:odbc:MondrianFoodMart;\</span><BR> with <span class="code" style="color:blue">Jdbc=jdbc:postgresql://localhost/foodmartdb?user=foodmart&#38;password=foodmart;\</span> <BR> <span class="caution">[!]</span> Please note the use of "&#38;". It is important NOT to directly use an ampersand here. <BR> </LI> <LI>Replace <span class="code" style="color:red"> JdbcDrivers=sun.jdbc.odbc.JdbcOdbcDriver;\</span><BR> with <span class="code" style="color:blue"> JdbcDrivers=org.postgresql.Driver;\</span> <BR> </LI> <LI>Replace <span class="code" style="color:red"> mondrian.foodmart.jdbcURL=jdbc:odbc:MondrianFoodMart</span><BR> with <span class="code" style="color:blue"> mondrian.foodmart.jdbcURL=jdbc:postgresql://localhost/foodmartdb?user=foodmart&#38;password=foodmart</span> <BR> <span class="caution">[!]</span> Please note the use of "&#38;". It is important NOT to directly use an ampersand here. <BR> </LI> <LI>Uncomment the line "<span class="code">tomcat.home</span>" and set the correct path.<BR> </LI> <LI>Modify the line "<span class="code">@set CLASSPATH</span>" - replace all "/" (forward-slash) with a "\" (backslash).<BR> </LI> </UL> </LI> <LI><STRONG>Changes to <span class="code">build.bat</span></STRONG>: In this file, replace <span class="code" style="color:red"> %ANT_HOME%\bin\ant %1 %2 %3 %4 %5 %6 %7 %8 %9</span> <BR>with <span class="code" style="color:blue"> "%ANT_HOME%\bin\ant" %1 %2 %3 %4 %5 %6 %7 %8 %9</span> (add quotation marks around the path). <BR>This is to address problems that can potentially be caused by spaces in the names of folders (supported in the recent versions of Windows). <BR> </LI> <LI><STRONG>Changes to <span class="code">build.xml</span></STRONG>: In this file, references to the JDBC driver and to the XALAN path need to be changed. Specifically, the changes to be made are: <UL> <LI>Replace <span class="code"><property name="mondrian.jdbcDrivers" value="<span style="color:red">sun.jdbc.odbc.JdbcOdbcDriver</span>"/></span><BR> with <span class="code"><property name="mondrian.jdbcDrivers" value="<span style="color:blue">org.postgresql.Driver</span>"/></span> <BR> </LI> <LI>Replace <span class="code"><property name="mondrian.foodmart.jdbcURL" value="<span style="color:red">${mondrian.foodmart.jdbcURL.access}</span>"/></span><BR> with <span class="code"><property name="mondrian.jdbcDrivers" value="<span style="color:blue">jdbc:postgresql://localhost/foodmartdb?user=foodmart&#38;password=foodmart</span>"/></span> <BR> <span class="caution">[!]</span> Please note the use of "&#38;". It is important NOT to directly use an ampersand here. <BR> </LI> <LI>Modify the target "jar". This task has a <span class="code">zipfileset</span> tag defined as follows:<span class="code"><blockquote> <div style="border-style: solid; border-width: 1px; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px"> <code><zipfileset<BR> dir="."<BR> includes="<BR> LICENSE.html,<BR> README.txt,<BR> VERSION.txt"/></code></div> </blockquote></span>This must be modified to include <span class="code">mondrian.properties</span> as follows:<span class="code"><blockquote> <div style="border-style: solid; border-width: 1px; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px"> <code><zipfileset<BR> dir="."<BR> includes="<BR> <span style="color:blue">mondrian.properties</span>,<BR> LICENSE.html,<BR> README.txt,<BR> VERSION.txt"/></code></div> </blockquote> </span></LI> <LI>Modify the target "copy-jars". The path to the Xalan JAR files (xalan.jar,xml-apis.jar,xercesImpl.jar) is specified as "<span class="code">{xalan.home}<span style="color:red">/bin</span></span>". This must be modified to "<span class="code">{xalan.home}</span>" (remove the "/bin").</LI> </UL> </LI> </OL> <h4>Copy files</h4> <OL> <LI>Copy the file <span class="code">%DEV_LOCATION%\mondrian.properties</span> to <span class="code">%CATALINA_HOME%\bin</span><BR> </LI> <LI>Copy the files "<span class="code">xalan.jar</span>", "<span class="code">xercesImpl.jar</span>", "<span class="code">xml-apis.jar</span>" and "<span class="code">serializer.jar</span>" from "<span class="code">%XALAN_HOME%</span>" to <span class="code"> %CATALINA_HOME%\common\endorsed</span>.<BR><BR> <span class="notice">[#]</span> These files are not really required for the build per s
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -