|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.locomotive.module.pub.PublisherLib
This class provides a series of static methods which return Database information used by the Locomotive Publisher system.
Field Summary | |
static int |
APPROVED
|
static int |
CENSORED
Constants used to denote the different statuses that a published page can be in: |
static int |
NOT_YET_APPROVED
|
static int |
NYA_AND_APPR
|
Constructor Summary | |
PublisherLib()
|
Method Summary | |
static boolean |
changeStatus(java.sql.Connection conn,
int page_id,
int status)
Changes the status of a page in the database. |
static SortableTable |
getIndexTable(java.sql.Connection conn,
int low_range,
int high_range,
int status)
Returns a table containing index information of published pages between the two ranges inclusive, beginning with most recent page. |
static int |
getMostRecentId(java.sql.Connection conn,
int userid)
Returns the most recently inserted page id of a user. |
static int |
getNumPages(java.sql.Connection conn,
int status)
Returns the number of published pages in the database according to status. |
static void |
getPageInfo(java.sql.Connection conn,
int id,
java.util.Hashtable hash_in)
Returns all the fields of a user page (identified by its id) in a SortableTable. |
static int |
getStatus(java.sql.Connection conn,
int page_id)
Changes the status of a page in the database. |
static SortableTable |
getUserPageIndex(java.sql.Connection conn,
int userid)
Returns an index of pages of a single user. |
static boolean |
insertImagesIntoPage(java.sql.Connection conn,
int id,
java.lang.String image_one,
java.lang.String image_two)
Inserts images into a page entry. |
static boolean |
insertPage(java.sql.Connection conn,
int userid,
java.lang.String title,
java.lang.String body_one,
java.lang.String body_two,
java.lang.String caption_one,
java.lang.String caption_two,
java.lang.String template)
Creates a page entry into the database for the first time. |
static boolean |
isOwner(java.sql.Connection conn,
int id,
int userid)
Verifies if a user is the owner of this page or not. |
static boolean |
reInsertPage(java.sql.Connection conn,
int id,
java.lang.String title,
java.lang.String body_one,
java.lang.String body_two,
java.lang.String image_one,
java.lang.String image_two,
java.lang.String caption_one,
java.lang.String caption_two,
java.lang.String template)
Re-inserts a page entry into the database. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int CENSORED
public static final int NOT_YET_APPROVED
public static final int APPROVED
public static final int NYA_AND_APPR
Constructor Detail |
public PublisherLib()
Method Detail |
public static boolean insertPage(java.sql.Connection conn, int userid, java.lang.String title, java.lang.String body_one, java.lang.String body_two, java.lang.String caption_one, java.lang.String caption_two, java.lang.String template)
conn
- database connectionuserid
- page creatortitle
- title of pagebody_one
- first body text fieldbody_two
- second body text fieldcaption_one
- String caption for first imagecaption_two
- String caption for second imagetemplate
- String name of template filepublic static boolean insertImagesIntoPage(java.sql.Connection conn, int id, java.lang.String image_one, java.lang.String image_two)
conn
- database connectionid
- page idimage_one
- first image filenameimage_two
- second image filenamepublic static boolean reInsertPage(java.sql.Connection conn, int id, java.lang.String title, java.lang.String body_one, java.lang.String body_two, java.lang.String image_one, java.lang.String image_two, java.lang.String caption_one, java.lang.String caption_two, java.lang.String template)
id
- id of pagebody_one
- first body text fieldbody_two
- second body text fieldimage_one
- name of first image fileimage_two
- name of second image filecaption_one
- String caption for first imagecaption_two
- String caption for second imagetemplate
- String name of template filepublic static int getMostRecentId(java.sql.Connection conn, int userid)
conn
- database connectionuserid
- userid of userpublic static void getPageInfo(java.sql.Connection conn, int id, java.util.Hashtable hash_in)
conn
- database connectionid
- page idhash_in
- Hashtable to put these values in:
id (page id)
userid
title
modified (date)
status (ie. NOT_YET_APPROVED)
template (filename)
body_one (text)
body_two
image_one (filename)
image_two (filename)
caption_one (text)
caption_twopublic static boolean isOwner(java.sql.Connection conn, int id, int userid)
conn
- database connectionid
- page iduserid
- id of userpublic static int getNumPages(java.sql.Connection conn, int status)
conn
- database connectionstatus
- constant indicating the status of the pages to countpublic static SortableTable getIndexTable(java.sql.Connection conn, int low_range, int high_range, int status)
conn
- database connectionlow_range
- index 1 is the most recent page, the lowest rangehigh_range
- should not exceed the number of published pages in
the databasestatus
- constant indicating the status of the pages to fetchpublic static SortableTable getUserPageIndex(java.sql.Connection conn, int userid)
conn
- database connectionuserid
- id of userpublic static int getStatus(java.sql.Connection conn, int page_id)
conn
- database connectionpage_id
- id of the web pagepublic static boolean changeStatus(java.sql.Connection conn, int page_id, int status)
conn
- database connectionpage_id
- id of the web pagestatus
- status to change the page to
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |