Canvas enables you to optimize the SASS compilation process for your web application. But it is essential that you optimize the SASS compilation process before you proceed to with the build and deploy deployment of your web application. For detailed information on building a web application, refer Building Your First Web Application. To optimize SASS compilation for reducing the server startup time, perform the following steps:
Note |
---|
It is mandatory |
...
that the following steps should be performed only after you execute and generate the database scripts for your web application. |
Uncomment the antcall target function in the build xml (e.g. buildModelHouse.xml) file present in your project source folder, e.g. D:\SVN_REPO\19.1.7.3\Sources\CTModelHouse\Sources\CTModelHouseServerBuilder\src\main\ant\buildModelHouse.xml. The following code snippet serves as a sample reference:
Note It is assumed that the project or application name is ModelHouse. In the SVN repository path of your project, you must access the build xml of your project placed within your project ServerBuilder folder. In the following example, the build xml file name is buildModelHouse.xml and the project ServerBuilder folder name is CTModelHouseServerBuilder.
Code Block language xml <!-- Css compresion is done here --> <antcall target="-build.modelhouse.compresscss" /> <antcall target="package_compile_sass" /> <!-- Uncomment the antcall target function --> <jar destfile="${MODEL_WAR_FILE_NAME}"> <fileset dir="${WAR_ROOT}"> <include name="**/*.*" /> </fileset> <manifest> <attribute name="Created-By" value="${unit.name}" /> <attribute name="Build-Jdk" value="${java.version}" /> <attribute name="Bundle-Name" value="modelhouse war" /> <attribute name="Bundle-Version" value="${product.version}" /> <attribute name="Bundle-Description" value="Web application archive for the modelhouse" /> <attribute name="Implementation-Vendor" value="${company.name}" /> <attribute name="Implementation-Title" value="${product.name}" /> <attribute name="Implementation-Version" value="${product.version}" /> <attribute name="Build-Id" value="${buildVersion}" /> <attribute name="Build-Date" value="${DATE}"/> </manifest> </jar>
Once you execute and generate the database scripts for your web application, you You must specify the database or schema name in the same build xml file (e.g. buildModelHouse.xml), present in your project source folder, e.g. D:\SVN_REPO\19.1.7.3\Sources\CTModelHouse\Sources\CTModelHouseServerBuilder\src\main\ant\buildModelHouse.xml. The following code snippet serves as a sample reference:
Note For setting up a development environment using Canvas Technology and to execute and generate DB scripts for your web application, refer Setup Development Environment for Canvas Technology.
Code Block language xml <!-- Prepare the CSS Files (compile sass, merge and minify) --> <target name="package_compile_sass"> <echo>Compiling SASS and CSS File merge / minify</echo> <java classname="com.intellectdesign.canvas.utils.BuidSassCompilationUtil" fork="yes" failonerror="yes"> <arg value="com.mysql.cj.jdbc.Driver" /> <arg value="jdbc:mysql://localhost:3306/multi_16745" /> <!-- Specify Thethe database or schema name, ise.g. "multi_16745" --> <arg value="ctuser" /> <!-- To connect to the specified database or schema, provide the appropriate schema username, e.g. "ctuser" --> <arg value="canvas" /> <!-- To connect to the specified database or schema, provide the appropriate schema password, e.g. "canvas" --> <arg value="/ctmodelhouse" /> <!-- Specify the context root of the web application, e.g. "/ctmodelhouse" --> <arg value="MODELHOUSE" /> <!-- Specify the web application name, e.g. "MODELHOUSE" --> <arg value="${WAR_ROOT}/CTRIAFramework/UIArena/theme/system/cssconfig.xml" /> <arg value="${WAR_ROOT}" /> <classpath refid="sasscompilecompressjars" /> </java> </target>
After you perform the aforementioned steps, you can proceed with the build and deployment of your web application.