With JDSML Image Server, you can transparently request an image that shows part or whole of the master high resolution image. You can speicify the resolution, the coordinates of the region wuthin the master image, and the size of the generated image as form URL parameters.
The Image Server will do the following operation in order when a request is made:
With this in place, you only need to maintain a single copy of master high resolution version for each image. You can define a text of your choice to be embedded into the idynamic image. You also define many other maniuplations to the final images without worrying about how to maintain and associate all those images. All these different kinds of images are available with a defined URL, while you only need to worry about maintaining the single original version of the image.
Pre-installation request: Java JDK verion 1.6
In the Console/Command Prompt, typing the following command tells you the version of Java installed in your system.
java -version
If above command works, this means that can run Java from any directory in your computer. If above command is still failing after installing Java runtime, you need to add $JAVA_HOME/bin to your system path. In Linix, you may need to add symbolic link in /bin/ directory.
Furthermore, You should have Sun Java Runtime 1.6 or above installed in your machine. You can download and install JDK 1.6 from Sun Java site. If you are running Ubuntu and found out that you are running GNU version of Java runtime, you can follow the instructions given here to install Sun version of JDK 1.6.
When you are ready, download one of the archives into your local hard drive.
If you are using Linix/Unix, type the following command in your home directory will do all the job for you:
wget http://downloads.sourceforge.net/project/jimageserver/jdsml-image-server... tar xvf jdsml-image-server.1.0.tar.gz cd JavaAppServer/bin chmod 755 *.sh
If you running Windows, go into the folder where the JAP/JDSML engine is installed. and go into the bin sub directory, double click on the file run.bat.
If you are running Linix/Unix execute the following commands in the Console assuming that you have installed the JAP/JDSML engine in your home folder.
cd JavaAppServer/bin ./run.sh
After the engine starts up fully, you can point your browser to
http://localhost:3850/
You should see a welcome page, which has a link to the Image Server application, which is among many web applications you can create with this web application development framework.
The engine listens to the default port 3850, but you can change it to a different port by modifying the run.sh (in Linix) or run.bat (in Windows)
Stop the instance running (Ctrl +c will stop it), and open the run.sh (in Linix) or run.bat (in Windows) with your favorite text editor.
vi JavaAppServer/bin/run.sh
you will see the following line of command in the file:
java -cp ../WEB-INF/classes mystartup.StartAppServer setport=3850
You can modify it to listen on the standard HTTP port:
java -cp ../WEB-INF/classes mystartup.StartAppServer setport=80
Then save it and exit from the text editor.
And then run the engine again.
In Windows
run
In Linix:
./run.sh
After the engine fully starts up, point your browser to
http://localhost/
This time, you do not need to specify the port number
Create a file named jap.xml in conf/Catalaina/localhost/ subdirectory of the Tomcat directory with the following content
<Context docBase="/home/dilshat/JavaAppServer/" path="/jap"/>
Above, I have assumed that you have installed the JAP/JDSML engine into the directory /home/dilshat/JavaAppServer/, but you should replace it with the actual directory path where you have extracted the JAP/JDSML archive.
After restarting the Tomcat, you should be able to access the JAP welcome page by pointing your browser to
http://localhost:8080/jap/
If you are running JBoss, you can deploy it by creating the symbolic link in the deployment directory, go into the deploy directory of the JBoss and type the following command
ln -s /home/dilshat/JavaAppServer/ jap.war
Again, you should replace the directory part with the actual directory path where you have installed JAP/JDSML engine.
Or you can move the entire directory into the deploy directory
mv /home/dilshat/JavaAppServer/ jap.war
Alternatively, after you have configured the configuration files to point to an external directory where you would like to put your JDSML codes, you can package the entire JAP/JDSML directory into a war file, and deploy it as a single archive file into the deploy directory.
Edit the Apache website configuration file in the following path
sudo edit /etc/apache2/sites-available/default
you may need to replace the "default" with other names if you using are using as virtual host.
If you would like to integrate the JAP/JDSML engine directly to Apache, adding the following directives to the configuration file will do the job
ProxyPass /jdsml http://localhost:3850/jdsml ProxyPassReverse /jdsml http://localhost:3850/jdsml
assuming that JAP/JDSML engine is listenning to it default port, which is port 3850.
If you prefer to connect the Apache webserver to the tomcat, in which JAP/JDSML engine is deployed as a web module, adding the following directives to the configuration file will do the job.
ProxyPass /jap/jdsml http://localhost:8080/jap/jdsml ProxyPassReverse /jap/jdsml http://localhost:8080/jap/jdsml
assuming that JAP/JDSML engine is deployed to the Tomcat in the context /jap/
You may also think about creating a separate connector in Tomcat for this purpose.
This section dedicates to integrating JAP/JDSML engine, which is running on on Windows Box, into IIS.
I suppose you have placed the JAP/JDSML into your C drive.
Surely as explained previously, you can run the engine as standalone by simply double clicking on the batch file:
C:\JavaAppServer\bin\run.bat
But for the production environment you may like to run as it as Windows Service, and also you would like to achieve fault tolerance and clustering by running multiple instance.
The JAP/JDSML installation ships with a single configuration directory
JavaAppServer/conf/default/
However, it first looks for the configuration files in the following directory if it is listening to the port 3850.
JavaAppServer/conf/port3850/
If it couldn't find such a directory (port3850 does exists in the installation), it then falls back to the default directory
JavaAppServer/conf/default/
The port number (3850) to which the JAP/JDSML engine instance is listenning to is suffxed to the configuration directory (port3850). This is useful when you are running multiple instances of JAP/JDSML engine on the same computer and you wish to use different configurations for each instance.
If you have embeded JAP/JDSML engine into Tomcat, it will try to look for the subdirectory, which matches the servlet-name defined in WEB-INF/web.xml.
On the other hand, if you do not need to run multiple instances with different configurations, it is sufficient and convenient to have a single default configuration directory, which is
JavaAppServer/conf/default/
The engine listens to the default port 3850, but you can change it to a different port by modifying the run.sh (in Linix) or run.bat (in Windows) in the bin directory
Stop the instance running (Ctrl +c will stop it), and open the run.sh (in Linix) or run.bat (in Windows) with your favorite text editor.
vi JavaAppServer/bin/run.sh
you will see the following line of command in the file:
java -cp ../WEB-INF/classes mystartup.StartAppServer setport=3850
You can modify it to listen on the standard HTTP port:
java -cp ../WEB-INF/classes mystartup.StartAppServer setport=80
Then save it and exit from the text editor.
And then run the engine again.
In Windows
run
In Linix:
./run.sh
After the engine fully starts up, point your browser to
http://localhost/
This time, you do not need to specify the port number
When a resource is requested via JAP/JDSML engine, for example, when you type the URL on your browser
http://localhost:3850/index.html
The index.html file will be searched from a directory. The location of this directory is specified by a configuration file in the following configuration directory
JavaAppServer/conf/default/http/
Because the host name in the example URL is localhost. Hence, the engine first tries to find the host specific configuration file
localhost.txt
If it could not find such a file, it will fall back to the default configuration file
default.txt
If the resource is requested via the URL:
http://www.yourdomain.com:3850/
the host specific configuration file will be www.yourdomain.com.txt. If you do not want to have diffrent configuration for different virtual host, it is sufficient and simpler to have the single default configuration file:
default.txt
Below is the explanation of the content in the configuration file default.txt:
Variable name | Exmaple values | Description | |
---|---|---|---|
directory | websites/default | Relative to the JAP/JDSML engine installation directory. When you have enter the following URL in your browser http://localhost:3850/index.dsml the following file will be requested JavaAppServer/websites/default/index.dsml |
|
/var/websites/default | This is absolute directory (precedes with slash), so it is pointing to the absolute directory outside the JAP/JDSML installation directory For example, when you have type the following URL in your browser, http://localhost:3850/index.dsml the following file will be requested /var/websites/default/index.dsml |
||
virtual | jdsml | It defines a virtual directory named jdsml. The physical location of the directory, to which the virtual directory is pointing to, should be specified in jdsml.txt For example, if you type the following URL: http://localhost:3850:/jdsml/index.dsml Instead of looking for the file in the directory specified in default.txt, it will look for the file in the directory specified by the jdsml.txt configuration file. |
|
css | It defines a virtual directory named css. The physical location of the virutal directory should be specified in configuation file css.txt | ||
welcome | index.dsml | Welcome file to be returned for the URL that does not specify the name of the resource. For example, if you type the following URL
http://localhost:3850/ it will be equivalne to typing the following URL http://localhost:3850:/idex.dsml This variable can have multiple instances to specify a list of welcome files. The welcome file will be searched in the oder of appearance. | |
script.dsml.java | uk.ac.nhm.pgparser.JPagedsml | The component that will be used to process the content of the file that has the extension ".dsml". For example, when the file index.dsml is requested, the content of the index.dsml will not be returned directly to the browser for display. Instead, the software component pgparser.JPagedsml will be used to process the file, and the output of the process will then be returned to the browser for display |