Class ItemAdminService

Description

The ItemAdminService provides all kind of methods for write access to any Item and Item Language Version of all Itemtypes.

Initialize the ItemAdminService with the required Itemtype!

  • version: $Id: ItemAdminService.php,v 1.25 2006/11/26 22:04:09 kpapst Exp $
  • copyright: Copyright (C) 2002-2006 Kevin Papst
  • author: Kevin Papst
  • license: GNU Public License
MasterItemType
   |
   --Itemtype
      |
      --ItemService
         |
         --ItemAdminService
Direct descendents
Class Description
FileAdminService The FileAdminService provides all kind of writing services for Files.
ImageAdminService The ImageAdminService provides all kind of writing services for Images.
MenuAdminService Class used for administrating BIGACE "Menu" Items
Method Summary
ItemAdminService ItemAdminService ( $itemtype)
void addCategoryLink ( $itemid,  $categoryid)
void changeItem ( $id,  $languageid,  $data)
int createItem ( $data)
void createLanguageVersion ( $id,  $copyLangID,  $data)
void deleteAllProjectNum ( $id,  $langid)
void deleteAllProjectText ( $id,  $langid)
void deleteItem ( $id)
int deleteItemLanguage ( $id,  $langid)
AdminRequestResult getMaxPositionForParentID ( $parentid,  $languageid)
void initItemAdminService ( $itemtype)
boolean isAllowed ( $file)
boolean lowerPosition ( $id,  $langid)
boolean moveItem ( $itemid,  $newParentID)
boolean raisePosition ( $id,  $langid)
void refreshHistoryVersionContent ( $itemid,  $languageid,  $modifiedDate)
AdminRequestResult registerUploadedFile (Array $file, Array $data)
void removeAllCategoryLinks ( $itemid)
void removeCategoryLink ( $itemid,  $categoryid)
boolean setItemPosition (long $id, int $position)
void setProjectNum ( $id,  $langid,  $key,  $value)
void setProjectText ( $id,  $langid,  $key,  $value)
void updateContent ( $id,  $langid,  $content, [ $data = array()])
void updateItemContent ( $id,  $langid,  $content, [ $data = array()])
void updateItemWithUpload ( $id,  $file,  $languageID)
Methods
Constructor ItemAdminService (line 67)
ItemAdminService ItemAdminService ( $itemtype)
  • $itemtype
addCategoryLink (line 361)
void addCategoryLink ( $itemid,  $categoryid)
  • $itemid
  • $categoryid
changeItem (line 468)

Changes an existing File in the System.

THIS METHOD CREATES A DATABASE BACKUP!

void changeItem ( $id,  $languageid,  $data)
  • $id
  • $languageid
  • $data
createItem (line 623)

Inserts a brand new Item into the System.

THIS ONLY INSERTS THE DATABASE ENTRY. IF YOU NEED A FILESYSTEM ENTRY, YOU HAVE TO CREATE IT FIRST AND SUBMIT ITS NAME WITHIN THE PASSED ARRAY.

  • return: the new Item ID
int createItem ( $data)
  • $data
createLanguageVersion (line 658)

Creates a NEW language for the given Item.

Copies the settings from the given Language Version of this Item if they are not passed.

void createLanguageVersion ( $id,  $copyLangID,  $data)
  • $id
  • $copyLangID
  • $data
deleteAllProjectNum (line 400)
void deleteAllProjectNum ( $id,  $langid)
  • $id
  • $langid
deleteAllProjectText (line 410)
void deleteAllProjectText ( $id,  $langid)
  • $id
  • $langid
deleteItem (line 210)

Deletes an Item from BIGACE, including all Language Versions, its rights and categorys.

If you try to delete the TOP_LEVEL it will return FALSE.

void deleteItem ( $id)
  • $id
deleteItemLanguage (line 142)

This returns:

  • -2 if last language version has childs
  • -1 if item was completely removed,
  • 1 if language version was deleted,
  • 0 if nothing was performed,

  • return: the deleted Flag, see method description for details
int deleteItemLanguage ( $id,  $langid)
  • $id
  • $langid
getMaxPositionForParentID (line 341)

Get the highest Position within the given Tree.

Will read the childs of the given ParentID and search the highest value. If the returned Result is successful, you get the Max Position by calling

  1. getID()
.

  • return: the Result
AdminRequestResult getMaxPositionForParentID ( $parentid,  $languageid)
  • $parentid
  • $languageid
initItemAdminService (line 75)

Has to be called by implementing classes.

  • access: protected
void initItemAdminService ( $itemtype)
  • $itemtype
isAllowed (line 121)

Returns whether the uploaded file type is allowed by the System.

This depends on the File type.

  • return: whether the given File is supported by this Itemtype or not
boolean isAllowed ( $file)
  • $file
lowerPosition (line 309)

Moves the Item a position down.

  • return: whether the Position was changed or not
boolean lowerPosition ( $id,  $langid)
  • $id
  • $langid
moveItem (line 320)

Moves an Item to a new Parent ID.

No further check is performed, so make sure, the new Parent is not the Page itself or a child of the current Page!

  • return: whether the Page was moved or not
boolean moveItem ( $itemid,  $newParentID)
  • $itemid
  • $newParentID
raisePosition (line 300)

Moves the Item a position up.

  • return: whether the Position was changed or not
boolean raisePosition ( $id,  $langid)
  • $id
  • $langid
refreshHistoryVersionContent (line 708)

Gets the specified History version and uses its Content to replace the Content of the Items published Version.

The replaced version (the actual one) will become a history version, to make sure no information will be lost.

void refreshHistoryVersionContent ( $itemid,  $languageid,  $modifiedDate)
  • $itemid
  • $languageid
  • $modifiedDate
registerUploadedFile (line 572)

Registers a File that was posted to the system.

If your HTML FORM input field for a File looked like that:

  1. <input name="NewFile" type="file">
you can use
  1. $_FILES['NewFile']
to receive this File.

To specify the File setting, pass an Array like this:

  1. array("name" => "foo""description" => "bar""langid" => "LanguageID")

  • return: the Result for this Upload
AdminRequestResult registerUploadedFile (Array $file, Array $data)
  • Array $file: the File information, which are automatically extracted by the PHP Core
  • Array $data: Information to further specifiy this Item
removeAllCategoryLinks (line 386)
void removeAllCategoryLinks ( $itemid)
  • $itemid
removeCategoryLink (line 374)
void removeCategoryLink ( $itemid,  $categoryid)
  • $itemid
  • $categoryid
setItemPosition (line 291)

Sets the new Item position.

  • return: whether the change worked or not
boolean setItemPosition (long $id, int $position)
  • long $id: id the Item ID to set the new position for
  • int $position: position the new Position
setProjectNum (line 420)
void setProjectNum ( $id,  $langid,  $key,  $value)
  • $id
  • $langid
  • $key
  • $value
setProjectText (line 432)
void setProjectText ( $id,  $langid,  $key,  $value)
  • $id
  • $langid
  • $key
  • $value
updateContent (line 480)

Updates the Content in the File that is fetched from Item->getFullURL().

If the file does not exists it will simply create it.

THIS METHOD CREATES A FILESYSTEM AND A DATABASE BACKUP!

void updateContent ( $id,  $langid,  $content, [ $data = array()])
  • $id
  • $langid
  • $content
  • $data
updateItemContent (line 505)

Overwrite this method to pipe update Calls to your ItemService implementation.

void updateItemContent ( $id,  $langid,  $content, [ $data = array()])
  • $id
  • $langid
  • $content
  • $data

Redefined in descendants as:
updateItemWithUpload (line 515)

Updates the given Items Content with the last uploaded File.

THIS METHOD CREATES A FILESYSTEM AND A DATABASE BACKUP!

void updateItemWithUpload ( $id,  $file,  $languageID)
  • $id
  • $file
  • $languageID

Inherited Methods

Inherited From ItemService

ItemService::ItemService()
ItemService::countAllItems()
ItemService::countLevel()
ItemService::getItem()
ItemService::getItemLanguageEnumeration()
ItemService::getItemtype()
ItemService::getLastEditedItems()
ItemService::getLightTree()
ItemService::getLightTreeForLanguage()
ItemService::getTree()
ItemService::getTreeForLanguage()
ItemService::getTreeWalker()
ItemService::getWayHome()
ItemService::initItemService()
ItemService::isChildOf()
ItemService::isLeaf()

Inherited From Itemtype

Itemtype::Itemtype()
Itemtype::getClass()
Itemtype::getClassName()
Itemtype::getCommand()
Itemtype::getDirectory()
Itemtype::getItemtypeID()
Itemtype::initItemtype()

Inherited From MasterItemType

MasterItemType::MasterItemType()
MasterItemType::countItemtypes()
MasterItemType::getClassForItemType()
MasterItemType::getClassNameForItemType()
MasterItemType::getCommandForItemType()
MasterItemType::getDirectoryForItemType()
MasterItemType::getItemTypeForCommand()
MasterItemType::getSelectColumns()

Documentation generated by phpDocumentor 1.3.1