%-- image_frame.jsp
___________________________________________________
| |
| Image and Upload File Manager |
| |
| Copyright (C) 2000-2008 Revize LLC |
| All rights reserved. |
| |
|___________________________________________________|
$Revision: 2.0 $
$Date: 22 May 2008 02:44:50 $
$Author: nickm $
////////////////////////////////////////////////////////////////////////////////
// Image Manager Change Log //
////////////////////////////////////////////////////////////////////////////////
---------------------
10-28-04 DO Changes
---------------------
Deleted 11-14-03 dead code
-Added support for developer supplied maxwidth and maxheight
-Reordered width/height and hspace/vspace to match properties display
-caller now correctly calculated using location.host (not location.domain)
-Image size constaints are displayed in preview frame when file is uploaded
-Image properties can be displayed by clicking on hidden link after the top
heading in the right frame
---------------------
11-14-03 DO Changes
---------------------
Created RZ.im object for global objects.
Corrected numerous problems with absolute vs relative and multi-level locations.
The filelocation global javascript variable depreciated because it usage needed
review and correct throughout all the frames and pages. It is now in the RZ.im
object.
Eliminated newfilelocation url parameter, java and javascript variable.
New function image_frame.jsp::findImageIdx() developed to find a match in the
frameset JavaScript arrays. Must now use location and filename with extension
to determine reference file record. Added new location hidden field to
image_list.jsp form.
Eliminated function image_upload.html::RZfileExists(); Now using new
image_frame.jsp::findImageIdx() function.
Eliminated function image_upload.html::getFolderLocation(); Was only used by
depreciated function image_upload.html::RZfileExists(). RZ.im.currentFolder
global contains the upload file location.
Moved test for legacy location to image_list.jsp::browseFunction() from
image_list_functions.js::loadfile() function.
Remamed frameset JavaScript fileName[] array to imageFilename[]
Rename other FileName to filename (one of my rules - single word in dictionary)
Changed all alerts to call new message function in frameset to that displays
the message with an option to enter debug mode if trace or debug enabled.
Recoded image_list_functions.js::setup(), which highlights and retains the
initial selection and list states for all scenarios.
Eliminated image_list_functions.js::initialize() function since it was only
called from image_list_functions.js::setup() - code moved into setup()
Eliminated image_list_functions.js::blockNewFolder() function since is is only
one line of code and only called from once.
Deleted lots of dead code but some left for review by Mindfire.
Depreciated checkForRTEImage() function and associated global variables:
rootLocation, imagePathFileName, imageInfo and imageLoc. Logic moved to new
initImageIdx() function.
-------------------------------------------------------------------
11-23-03 DO: testing remaining, known issues and future suggestions
-------------------------------------------------------------------
-Opening a folder should automatically select it
-Selecting a folder should automatically open it
-When "select none" button is clicked, the highlighted file on list should be cleared
-When file uploaded and use indicates it should replace existing file, display should
indicate (new file)
-Uploading files should reset/delete prior upload selection
-Filenames with invalid label character's should get selected after upload
-Allow selection of files not in ref table (see: 'Not in Reference File Table' message
in image_upload.html)
-RZ.im.isLegacyAbsoluteLocation not tested
-Listing Frame should be split into two frames so Browse always appears and only
listing scrolls (scrollTo can then be eliminiated image_list.jsp::setup() function)
-When replacing RTE image, prompt to retain prior properties (except height & width)
-The following should be options: image properties, browse, create folder, delete file
******************************** not yet done *********************************
validate use of imageLocation in frames (it uses fileLocation)
Use findImageIdx to determine displayImageIdx; replaces the following functions:
RZfileExists, checkIfExist, getCurrentIndex
Remove blanks from label
////////////////////////////////////////////////////////////////////////////////
// Image/File Manager Notes //
////////////////////////////////////////////////////////////////////////////////
This is the main frame set for the image and file upload support screens. It was
originally developed for uploading images, therefore the html page names
and internal variables use "image" in the names.
It is currently designed to run from ...www/revize/util and is called from the
snippet_helper_editform.js::RZselectFile() function. The RZselectFile() function
is called in the following manners:
1) via the "change image" button placed directly on the edit form
2) via the "change image" button contained on the link manager screen
3) via the "image" icon contained in the RTE
For Revize 4.0, the following enhancements were added:
1) Image properties (height, width, vspace, hspace, border & align) stored in the
reference file table (previously these properties were only available when
called via the RTE)
2) An image resizing capibility was added based on specified height and width
(the original implementation did not retain proportions)
3) Ability for Content Editor to select and create repository folders
(the original implementation did not allow the developer to restrict create)
The following additional support files are required:
(this list of files has not been validated since the original release)
QUESTION: Is this list up-to-date? If not, please update.
/revize/util/image_error.jsp Clone of: \client\error.jsp (used in xml Requests)
/revize/util/image_list.jsp Right frame which displays files in repository
/revize/util/image_preview.jsp Center Frame which displays the image
/revize/util/image_return.jsp Frame used for normal return from Xml requests
/revize/util/image_upload.jsp Top frame containing upload information
/revize/util/cacheControl.jsp Prevents image pages from being cached
/revize/util/snippet_helper.js JavaScript Developer library
/revize/images/edit/noimage.gif Placeholder image for edit form
/revize/images/edit/cleardot.gif Placeholder image for preview screen
How Image support works:
-----------------------
1. The "Change Image" button or RTE "Image" icon or calls the RZselectFile()
function (contained in snipper_helper_editform.jsp). Legacy snippets may
call RZselectImage() which in turn calls RZselectFile().
2. RZselectFile() either opens this file in a new browser window OR gives
focus to an image processing window left open from a prior request call
and refreshes with current arguments
3. This page (image_frame.jsp) is called by with the following arguments:
QUESTION: Is this list up-to-date? If not, please update.
-webSpaceName: WebSpace Name
-fileType: Type of file: image or file
-fileLocation: Location (path / sub-directory in Revize repository)
-extensions: Permitted extensions for new uploads
-displayElement: HTML Edit Form object used to display image
-valueElement: HTML Edit Form field where uploaded filename is stored
-fileId: current selected file Id (can be negative - which means no selection)
4. The following frames are opened by this page:
QUESTION: Is this list up-to-date? If not, please update.
Left Bottom: image_upload.html - used for uploading new images
Left Top: image_blank.html (gets set to image_preview.html)
Right: another frame set contianing the following frames:
top frame: imageListFrame src="image_list.html"
(the image_frame.jsp onLoad handler then loads
image_list.jsp)
bottom frame: deleteImageFrame src="image_delete.html"
5. JSP code on this frame gets a complete list of all images currently stored
in the repository and saves them in JavaScript arrays. These are referred to
as frameset arrays in comments embedded throughout all the code pages. This
enables checking for duplicate names and display of files in the right frame.
The Id of the placeholder image (either noimage.gif or cleardot.gif) and
all properties of the current image are saved for later use as JavaScript
variables. Most JavaScript variables are displayed in the Trace window.
Previewing Images
-----------------
The image-preview.html frame initially displays the image scr passed via
the url query string. If no image src is specified, the blank image
located at ...www/revize/images/edit/cleardot.gif is displayed.
If the file is not an image, the filename is displayed.
A dark blue border with a margin surrounds the image or filename.
The file description is displayed under the image or filename. Additional
image properties appear when managing images.
The image preview frame represents no image selection using the cleardot.gif
from the /revize/images/edit/ directory. The edit page html form page always
represents no image selection with the "Your Image Here" graphic (noimage.gif)
stored under the /revize/images/edit directory. We do not want rely on the
repository containing these images for very old backward compatibility.
Published pages simply display whatever image is associated with the Id
stored in the underlaying record specified via an image