corinis.modules
Class PhotoLibrary

java.lang.Object
  extended by corinis.modules.abstracts.Module
      extended by corinis.modules.abstracts.EntryManipulate
          extended by corinis.modules.PhotoLibrary
All Implemented Interfaces:
corinis.modules.interfaces.IEntry, corinis.modules.interfaces.IEntryManipulate, corinis.modules.interfaces.IMainEntry, corinis.modules.interfaces.IProcessEvents, corinis.modules.interfaces.IThrowsEvents, corinis.modules.interfaces.IUserElement

public class PhotoLibrary
extends corinis.modules.abstracts.EntryManipulate
implements corinis.modules.interfaces.IMainEntry, corinis.modules.interfaces.IUserElement, corinis.modules.interfaces.IThrowsEvents, corinis.modules.interfaces.IProcessEvents


Field Summary
 PhotoLibraryView photolibraryView
           
 
Fields inherited from class corinis.modules.abstracts.Module
AUTH_CREATE, AUTH_DELETE, AUTH_MODIFY, AUTH_VIEW, moduleData
 
Constructor Summary
PhotoLibrary(Core score)
          Inits the class
 
Method Summary
 org.w3c.dom.Element callModule(org.w3c.dom.Element root)
          Executes a call with an xml tree.
 org.w3c.dom.Element createEntry()
           
 org.w3c.dom.Element createMainEntry()
          Creates a new Entry.
See the class documentation for the values of width/height and prviewwidth and previewheight.
 org.w3c.dom.Element deleteEntry()
          Deletes a photo out of a library.
 org.w3c.dom.Element deleteMainEntry()
          Deletes a photo library.
 org.w3c.dom.Element getEntries()
          Get a PhotoLibrary with all its pictures.
 org.w3c.dom.Element getEntry()
          This function retrieves a single picture.
 java.lang.String[][] getEvents()
          function to get the Events which are thrown in the module
 int[] getImageSize(long album)
           
 org.w3c.dom.Element getMainEntries()
          Get all the Photolibraries.
 org.w3c.dom.Element getMainEntry()
          Function to retrieve a photo library.
 org.w3c.dom.Element getRandomEntries()
          Get a PhotoLibrary with some random pictures.
 org.w3c.dom.Element modifyEntry()
          Modifies an entry.
 org.w3c.dom.Element modifyMainEntry()
          Modifies an entry.
 org.w3c.dom.Element moveEntry()
          Moves an entry from one location to another db
 
Methods inherited from class corinis.modules.abstracts.Module
CheckTables, eventerCall, getCore, getHiddenFields, getLastAuthorityChecked, getModuleAuthorities, getModuleDataView, getModuleName, getProfilerFields, getXMLModuleName, isCheckAuthority, reinit, search, setUpModule, skipAuthorityCheck, sortTree, sortTree
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

photolibraryView

public PhotoLibraryView photolibraryView
Constructor Detail

PhotoLibrary

public PhotoLibrary(Core score)
Inits the class

Parameters:
score - the core class, has to be initialized first
Method Detail

getEvents

public java.lang.String[][] getEvents()
function to get the Events which are thrown in the module

Specified by:
getEvents in interface corinis.modules.interfaces.IThrowsEvents
Returns:
Event/Description String

callModule

public org.w3c.dom.Element callModule(org.w3c.dom.Element root)
Executes a call with an xml tree. This function is called by the eventer and by the cms.
Dom:
 <MODULE>
        <FUNCTION>getEntries</FUNCTION>
        <ID> - the id of the photoLibrary to show
 </MODULE>
 
 
 <MODULE>
        <FUNCTION>getEntry</FUNCTION>
        <ID> - the id of the picture to show
 </MODULE>
 

Specified by:
callModule in interface corinis.modules.interfaces.IProcessEvents
Parameters:
root - the call information
doc - the document
Returns:
true if successfull

createMainEntry

public org.w3c.dom.Element createMainEntry()
Creates a new Entry.
See the class documentation for the values of width/height and prviewwidth and previewheight.

Authorities checked: PHOTOLIBRARY_CREATE
Request parameter:
PhotoLibrary_createMainEntry - Required for function to be executed
PhotoLibrary_name - A short description
PhotoLibrary_description - Additional description
PhotoLibrary_previewwidth - the height of the preview image to create
PhotoLibrary_previewheight - the height of the preview image to create
PhotoLibrary_finalwidth - the height of the image to create
PhotoLibrary_finalheight - the height of the image to create
PhotoLibrary_personal - Personal photolibrary where the rights will be altered accordingly
Possible Errors:
Authority missing
Field missing

Return DOM:
  
 <PHOTOLIBRARY>
  <DELETEENTRY success="true">
    <FIELDS>
    </FIELDS>
  </CREATEENTRY>
 </PHOTOLIBRARY>
 or
 <PHOTOLIBRARY>
  <DELETEENTRY success="false">
    <FIELDS>
      <FIELD>
        <FIELDNAME> - The name of a field with an error
        <ERROR> - The Error within this field
      </FIELD>
    </FIELDS>
  </CREATEENTRY>
 </PHOTOLIBRARY>
 

Returns:
the standard xml tree or null if nothing done

deleteMainEntry

public org.w3c.dom.Element deleteMainEntry()
Deletes a photo library.

Authorities checked: DELETE
Request parameter:
deleteEntry - Required for function to be executed
id - The id
Possible Errors:
Authority missing
Field missing

Return DOM:
  
 <PHOTOLIBRARY>
  <DELETEENTRY success="true">
    <FIELDS>
    </FIELDS>
  </CREATEENTRY>
 </PHOTOLIBRARY>
 or
 <PHOTOLIBRARY>
  <DELETEENTRY success="false">
    <FIELDS>
      <FIELD>
        <FIELDNAME> - The name of a field with an error
        <ERROR> - The Error within this field
      </FIELD>
    </FIELDS>
  </CREATEENTRY>
 </PHOTOLIBRARY>
 

Returns:
standard xml

deleteEntry

public org.w3c.dom.Element deleteEntry()
Deletes a photo out of a library.

Authorities checked: DELETE
Request parameter:
deleteEntry - Required for function to be executed
id - The id
Possible Errors:
Authority missing
Field missing

Return DOM:
  
 <PHOTOLIBRARY>
  <DELETEENTRY success="true">
    <FIELDS>
    </FIELDS>
  </CREATEENTRY>
 </PHOTOLIBRARY>
 or
 <PHOTOLIBRARY>
  <DELETEENTRY success="false">
    <FIELDS>
      <FIELD>
        <FIELDNAME> - The name of a field with an error
        <ERROR> - The Error within this field
      </FIELD>
    </FIELDS>
  </CREATEENTRY>
 </PHOTOLIBRARY>
 

Specified by:
deleteEntry in interface corinis.modules.interfaces.IEntryManipulate
Overrides:
deleteEntry in class corinis.modules.abstracts.EntryManipulate
Returns:
the parsed standard xml

modifyMainEntry

public org.w3c.dom.Element modifyMainEntry()
Modifies an entry.

Authorities checked: MODIFY
Request parameter:
modifyMainEntry - Required for function to be executed
name - A short description
description - Additional description
previewwidth - the height of the preview image to create
previewheight - the height of the preview image to create
finalwidth - the height of the image to create
finalheight - the height of the image to create
personal - Personal photolibrary where the rights will be altered accordingly
Possible Errors:
Authority missing
Field missing

Return DOM:
  
 <PHOTOLIBRARY>
  <MODIFYENTRY success="true">
    <FIELDS>
    </FIELDS>
  </MODIFYENTRY>
 </PHOTOLIBRARY>
 or
 <PHOTOLIBRARY>
  <MODIFYENTRY success="false">
    <FIELDS>
      <FIELD>
        <FIELDNAME> - The name of a field with an error
        <ERROR> - The Error within this field
      </FIELD>
    </FIELDS>
  </MODIFYENTRY>
 </PHOTOLIBRARY>
 

Returns:
the parsed standard xml

modifyEntry

public org.w3c.dom.Element modifyEntry()
Modifies an entry.

Authorities checked: MODIFY
Request parameter:
modifyEntry - Required for function to be executed
id - the id of the picture name - A short description
description - Additional description
Possible Errors:
Authority missing
Field missing

Return DOM:
    
 <PHOTOLIBRARY>
  <MODIFYENTRY success="true">
    <FIELDS>
    </FIELDS>
  </MODIFYENTRY>
 </PHOTOLIBRARY>
 or
 <PHOTOLIBRARY>
  <MODIFYENTRY success="false">
    <FIELDS>
      <FIELD>
        <FIELDNAME> - The name of a field with an error
        <ERROR> - The Error within this field
      </FIELD>
    </FIELDS>
  </MODIFYENTRY>
 </PHOTOLIBRARY>
 

Specified by:
modifyEntry in interface corinis.modules.interfaces.IEntryManipulate
Overrides:
modifyEntry in class corinis.modules.abstracts.EntryManipulate
Returns:
the parsed standard xml

getEntries

public org.w3c.dom.Element getEntries()
Get a PhotoLibrary with all its pictures.

Authorities checked: PHOTOLIBRARY_VIEW
Request parameter: PhotoLibrary_mainId - The id of an Album to show

Return DOM

 <PHOTOLIBRARY>
    <LIBRARY> 
      <ID> The id
      <NAME> A short description
      <DESCRIPTION> Additional description
      <PREVIEWWIDTH> the height of the preview image to create
      <PREVIEWHEIGHT> the height of the preview image to create
      <OWNERID> The owner of this library (can always change it)
      <OWNERNAME> user name of the changer
      <PERSONAL> Personal photolibrary where the rights will be altered accordingly
      <NUMPHOTOS> 
      <CHANGEDATE> Date of the last change
      <CHANGEUSERNAME> user name of the changer
      <CHANGEUSERID> user id of the changer
      <CHANGEUSERIP> the ip of the changerchangeusernam
 
      <ELEMENT>
        <ID> The id of the picture - use /PHOTOLIBRARY/ALBUMWEBPATH + /PHOTOLIBRARY/LIBRARY/ID + ID + tn. + EXT for the thumbnail, without tn for the real image
        <NAME> The name of the image
        <EXT> The extension of the image (use for the image display)
        <FILESIZE> The filesize of the image
        <DESCRIPTION> The description
        <ENTRYDATE> The creation date of the image
      </ELEMENT>
         ...
    </LIBRARY>
 </PHOTOLIBRARY>
 

Specified by:
getEntries in interface corinis.modules.interfaces.IEntry
Returns:
the Machine enties

getRandomEntries

public org.w3c.dom.Element getRandomEntries()
Get a PhotoLibrary with some random pictures. The number of pictures is specified in photolibraryView.randomPictures.

Authorities checked: PHOTOLIBRARY_VIEW
Request parameter: PhotoLibrary_mainId - The id of an Album to show

Return DOM

 <PHOTOLIBRARY>
    <LIBRARY> 
      <ID> The id
      <NAME> A short description
      <DESCRIPTION> Additional description
      <PREVIEWWIDTH> the height of the preview image to create
      <PREVIEWHEIGHT> the height of the preview image to create
      <OWNERID> The owner of this library (can always change it)
      <OWNERNAME> user name of the changer
      <PERSONAL> Personal photolibrary where the rights will be altered accordingly
      <NUMPHOTOS> 
      <CHANGEDATE> Date of the last change
      <CHANGEUSERNAME> user name of the changer
      <CHANGEUSERID> user id of the changer
      <CHANGEUSERIP> the ip of the changerchangeusernam
 
      <ELEMENT>
        <ID> The id of the picture - use /PHOTOLIBRARY/ALBUMWEBPATH + /PHOTOLIBRARY/LIBRARY/ID + ID + tn. + EXT for the thumbnail, without tn for the real image
        <NAME> The name of the image
        <EXT> The extension of the image (use for the image display)
        <FILESIZE> The filesize of the image
        <DESCRIPTION> The description
        <ENTRYDATE> The creation date of the image
      </ELEMENT>
         ...
    </LIBRARY>
 </PHOTOLIBRARY>
 

Returns:
the Machine enties

getMainEntries

public org.w3c.dom.Element getMainEntries()
Get all the Photolibraries.

Authorities checked: VIEW
Request parameter: none

Return DOM

 <PHOTOLIBRARY>
    <ENTRY> 
      <ID> The id
      <NAME> A short description
      <DESCRIPTION> Additional description
      <PREVIEWWIDTH> the height of the preview image to create
      <PREVIEWHEIGHT> the height of the preview image to create
      <OWNERID> The owner of this library (can always change it)
      <OWNERNAME> user name of the changer
      <PERSONAL> Personal photolibrary where the rights will be altered accordingly
      <NUMPHOTOS> The number of photos in a library
      <CHANGEDATE> Date of the last change
      <CHANGEUSERNAME> user name of the changer
      <CHANGEUSERID> user id of the changer
      <CHANGEUSERIP> the ip of the changerchangeusernam
                Possible random pictures if randomPictures is >0
      <ELEMENT>
        <ID> The id of the picture - use /PHOTOLIBRARY/ALBUMWEBPATH + /PHOTOLIBRARY/LIBRARY/ID + ID + tn. + EXT for the thumbnail, without tn for the real image
        <NAME> The name of the image
        <EXT> The extension of the image (use for the image display)
        <FILESIZE> The filesize of the image
        <DESCRIPTION> The description
        <ENTRYDATE> The creation date of the image
      </ELEMENT>
 
    </ENTRY>
    ...
 </PHOTOLIBRARY>
 

Specified by:
getMainEntries in interface corinis.modules.interfaces.IMainEntry
Returns:
The DOM as shown above, null if a fatal error occured

getMainEntry

public org.w3c.dom.Element getMainEntry()
Function to retrieve a photo library. (Only basic information, no photos)

Authorities checked: VIEW
Request parameter: mainId - The id of the element to retrieve

Return DOM

 <PHOTOLIBRARY>
    <ENTRY> 
      <ID> The id
      <NAME> A short description
      <DESCRIPTION> Additional description
      <PREVIEWWIDTH> the height of the preview image to create
      <PREVIEWHEIGHT> the height of the preview image to create
      <OWNERID> The owner of this library (can always change it)
      <OWNERNAME> user name of the changer
      <PERSONAL> Personal photolibrary where the rights will be altered accordingly
      <NUMPHOTOS> 
      <CHANGEDATE> Date of the last change
      <CHANGEUSERNAME> user name of the changer
      <CHANGEUSERID> user id of the changer
      <CHANGEUSERIP> the ip of the changerchangeusernam
    </ENTRY>
    ...
 </PHOTOLIBRARY>
 

Specified by:
getMainEntry in interface corinis.modules.interfaces.IMainEntry
Returns:
the Machine enties

getImageSize

public int[] getImageSize(long album)
Parameters:
album - the id of the album to get the image size
Returns:
the image size array (0/1.. preview width/height; 2/3.. final width/height);

getEntry

public org.w3c.dom.Element getEntry()
This function retrieves a single picture.

Authorities checked: VIEW
Request parameter: id- The id of the photo

Return DOM

 <PHOTOLIBRARY>
    <LIBRARY> 
      <ID> The id
      <NAME> A short description
      <DESCRIPTION> Additional description
      <PREVIEWWIDTH> the height of the preview image to create
      <PREVIEWHEIGHT> the height of the preview image to create
      <OWNERID> The owner of this library (can always change it)
      <OWNERNAME> user name of the changer
      <PERSONAL> Personal photolibrary where the rights will be altered accordingly
      <NUMPHOTOS> The total number of pictures
      <CHANGEDATE> Date of the last change
      <CHANGEUSERNAME> user name of the changer
      <CHANGEUSERID> user id of the changer
      <CHANGEUSERIP> the ip of the changerchangeusernam
      <LASTELEMENT turnover=true/false> turnover keeps track if the first element is reached (turnover=true)
        <ID> The id of the picture - use /PHOTOLIBRARY/ALBUMWEBPATH + /PHOTOLIBRARY/LIBRARY/ID + ID + tn. + EXT for the thumbnail, without tn for the real image
        <NAME> The name of the image
        <EXT> The extension of the image (use for the image display)
        <FILESIZE> The filesize of the image
        <DESCRIPTION> The description
        <ENTRYDATE> The creation date of the image
      </LASTELEMENT>
      <ELEMENT>
        <ID> The id of the picture - use /PHOTOLIBRARY/ALBUMWEBPATH + /PHOTOLIBRARY/LIBRARY/ID + ID + tn. + EXT for the thumbnail, without tn for the real image
        <NAME> The name of the image
                <POSITION> the position of the current image (0=first)
        <EXT> The extension of the image (use for the image display)
        <FILESIZE> The filesize of the image
        <DESCRIPTION> The description
        <ENTRYDATE> The creation date of the image
      </ELEMENT>
      <NEXTELEMENT turnover=true/false> turnover keeps track if the last element is reached (turnover=true)
        <ID> The id of the picture - use /PHOTOLIBRARY/ALBUMWEBPATH + /PHOTOLIBRARY/LIBRARY/ID + ID + tn. + EXT for the thumbnail, without tn for the real image
        <NAME> The name of the image
        <EXT> The extension of the image (use for the image display)
        <FILESIZE> The filesize of the image
        <DESCRIPTION> The description
        <ENTRYDATE> The creation date of the image
      </LASTELEMENT>
    </LIBRARY>
    <ALBUMWEBPATH> The path to the webalbum
 </PHOTOLIBRARY>
 

Specified by:
getEntry in interface corinis.modules.interfaces.IEntry
Returns:
the Machine enties

createEntry

public org.w3c.dom.Element createEntry()
Specified by:
createEntry in interface corinis.modules.interfaces.IEntryManipulate

moveEntry

public org.w3c.dom.Element moveEntry()
Moves an entry from one location to another db

Returns:
the parsed standard xml