dea.albums
Class AddPicData

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bydea.albums.BaseServlet
              extended bydea.albums.AddPicData
All Implemented Interfaces:
IDebugLevels, java.io.Serializable, Servlet, ServletConfig

public class AddPicData
extends BaseServlet

Servlet / command line utility for bulk loading new pic data into the DB.

Author:
David Abigt

Rev 2.0.1 Added ftp of album_update for web pages to key off of for last updated. Also cleaned up code.
Rev 2.0.0 Made into one step process. Now the program reads parms from album.properties instead of the DB and can be pointed at the main DB since it now (in this order):
Reads the files in the stage.in directoy tree.
If file is a JPG or GIF and is not already listed in the DB, two copies are made
While maintaining the aspect ratio one is resized to a max width of web.width and the other to icon.width.
The copies are then comverted to the correct compression level (4 - 96%) (NEW)
These images are then written out to the same relative path in the deploy.dir + web.out tree with L_preappended to the web image file name and S_ to the icon file.
If the file is a wmv video file is if moved to the deploy.dir + web.out path.
Note there should be an image file with the name of the video and a jpg extension in the same dir as video file.
Then thes files are ftped to the hosting server. (NEW)
At this point the image info is saved to the DB.
As a last step, if the raw file has not already been moved, the file is moved from the stage.in tree to same relative path in the deploy.dir + raw.out tree.

Rev 2.0.1 Add support for wmv video files.

See Also:
Serialized Form

Field Summary
static float JPPG_QUALITY
           
static java.lang.String VERSION
           
 
Fields inherited from class dea.albums.BaseServlet
display
 
Fields inherited from interface dea.common.IDebugLevels
BASIC, DEBUG_ALL, ERROR, METH_DETAIL, METH_ENTER, METH_EXIT, METH_EXT, METH_GET, METH_SET, METH_VARS, SHOW_PASS
 
Constructor Summary
AddPicData()
           
 
Method Summary
 void addFiles()
          add any new files in the raw pics dir or below to the DB guessing at as much info as we can
static void main(java.lang.String[] args)
          run from command line
 java.lang.String performTask(HttpServletRequest request, HttpServletResponse response)
          add any new files in the raw pics dir or below to the DB guessing at as much info as we can
 void walkTree(java.io.File dir, Db db)
          Walk the file tree and pass file names to PicData.create()
 
Methods inherited from class dea.albums.BaseServlet
callPage, emptyToNull, getParameter, init, service
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
See Also:
Constant Field Values

JPPG_QUALITY

public static final float JPPG_QUALITY
See Also:
Constant Field Values
Constructor Detail

AddPicData

public AddPicData()
Method Detail

performTask

public java.lang.String performTask(HttpServletRequest request,
                                    HttpServletResponse response)
                             throws java.lang.Exception
add any new files in the raw pics dir or below to the DB guessing at as much info as we can

Parameters:
request - HttpServletRequest
response - HttpServletResponse
Throws:
java.lang.Exception

addFiles

public void addFiles()
              throws java.sql.SQLException,
                     java.io.FileNotFoundException,
                     java.io.IOException,
                     java.lang.ClassNotFoundException
add any new files in the raw pics dir or below to the DB guessing at as much info as we can

Throws:
java.sql.SQLException
java.io.FileNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

walkTree

public void walkTree(java.io.File dir,
                     Db db)
              throws java.sql.SQLException,
                     java.io.FileNotFoundException,
                     java.io.IOException,
                     java.lang.ClassNotFoundException
Walk the file tree and pass file names to PicData.create()

Throws:
java.sql.SQLException
java.io.FileNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

main

public static void main(java.lang.String[] args)
run from command line



Copyright © 2001-2005 Round Mountain Rescue Ranch. All Rights Reserved.