Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Suite_Manager Class Reference
Inheritance diagram for Suite_Manager:
Page Asset MySource_Object

Public Member Functions

 __construct ($assetid=0)
 
 create (Array &$link)
 
 _getName ($short_name=FALSE)
 
 canDelete ()
 
 canClone ()
 
 getProducts ($includeCurrent=TRUE, $includeDeleted=TRUE, $excludeTypes=array(), $includeStatus=array())
 
 getLiveProducts ()
 
 getProduct ($suiteid=NULL)
 
 getProductBySystemid ($systemid)
 
 getProductBySystemidURL ($systemid, $url)
 
 getProductByToken ($token)
 
 getSystemId ()
 
 getProductAttribute ($suiteid, $attrName)
 
 getCurrentProduct ()
 
 getProductsByType ($type)
 
 updateProduct ($suiteid, $attrName, $attrValue)
 
 registerProduct ($systemid, $type, $url, $connection)
 
 removeProduct ($suiteid, $current=FALSE)
 
 printFrontend ()
 
 getAPI ($system, $method)
 
 encodeJson ($data)
 
 decodeJson ($data)
 
 generateSystemKeyPair ()
 
 sendMessage ($targetid, $msgType, array $options=array())
 
 sendRequest ($targetid, $format, $system, $action, $message=Array())
 
 createConnectionToken ()
 
 syncWithLiveProducts ()
 
 syncProductDetails (array $product_info, array $new_product_info)
 
 syncDeletedProducts (array $deleted, array &$markedForDeletion, array &$markedForAddition)
 
 syncConnectedProducts ($requesterSuiteid, array $connected, array &$markedForDeletion, array &$markedForAddtion)
 
 getSuiteProductInfo (array $current_product)
 
 getSuiteMessageResult ($response)
 
 sendCURLAPIRequest ($url, $msg, $userAgent='')
 
 createSuiteMessageDOMTemplate ($targetid)
 
 parseSuiteXML ($xml, $fields=array())
 
 logReceivedMessage ($systemid, $msgType)
 
 logSentMessage ($systemid, $msgType)
 
 logErrorMessage ($errorMessage='')
 
 encryptAPIData ($url, array $msg, $userAgent)
 
 decryptAPIData ()
 
 encryptData ($suiteid, $data)
 
 decryptData ($data, $password)
 
 buildResponseXMLDom (&$parentNode, $content)
 
- Public Member Functions inherited from Page
 __construct ($assetid=0)
 
 _getAllowedLinks ()
 
 printBody ()
 
- Public Member Functions inherited from Asset
 Asset ($assetid=0)
 
 create (Array &$link)
 
 load ($assetid)
 
 _loadDataPaths ()
 
 reload ()
 
 canDelete ()
 
 delete ($release_lock=TRUE, $check_locked=TRUE)
 
 useSystemVersion ()
 
 loadSystemVersion ()
 
 saveSystemVersion ()
 
 clearSystemVersion ()
 
 revertToSystemVersion ()
 
 revertNoticeLinksToSystemVersion ()
 
 _updated ($update_parents=TRUE)
 
 type ()
 
 getTypeAncestors ($include_asset=TRUE)
 
 incrementVersion ($number='micro', $update_parents=TRUE)
 
 getLanguages ()
 
 setLanguages (Array $languages)
 
 setCharset ($charset)
 
 setForceSecure ($force_secure)
 
 remapAssetids (Array $map)
 
 morph ($new_type_code)
 
 _morphCleanup ($new_type_code)
 
 onRequestKeywords (Asset $broadcaster, Array $vars=Array())
 
 canClone ()
 
 cloneComponents (Asset $clone, Array $components, $override=FALSE)
 
 cloneComponentsAdditional (Asset $clone, Array $components)
 
 cloneLinks (Asset $clone)
 
 getStatus ()
 
 getAvailableStatii ()
 
 getStatusDescription ()
 
 processStatusChange ($new_status, $update_parents=TRUE, $run_updated=TRUE)
 
 setDate ($date_type, $time=NULL, $userid=NULL)
 
 lockTypes ()
 
 canForceablyAcquireLock ($lock_type)
 
 getEditingLocks ($keywords)
 
 _getAllowedLinks ()
 
 createLink (Asset $minor, $link_type, $value='', $sort_order=NULL, $dependant='0', $exclusive='0', $moving=FALSE, $locked=0)
 
 prepareLink (Asset $asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive)
 
 canCreateLink (Asset $minor, $link_type, $exclusive)
 
 canMoveLink (Asset $minor, Asset $old_major, $link_type)
 
 describeLink ($linkid)
 
 isDeletableLink ($linkid)
 
 canDeleteLink ($linkid)
 
 deleteLink ($linkid, $check_locked=TRUE)
 
 linksUpdated ()
 
 canCloneLink ()
 
 saveAttributes ($dont_run_updated=FALSE, $log_message=TRUE)
 
 setAttrValue ($name, $value)
 
 attr ($name)
 
attrByRef ($name)
 
 getAttribute ($name, $mute_errors=FALSE)
 
 getAssetKeywords ($descriptions=FALSE)
 
 getAvailableKeywords ()
 
 getKeywordReplacement ($keyword)
 
 getAssetWebPathKeywordReplacement ()
 
 getCustomKeywordReplacements ($keywords=Array(), $invoke_backend=FALSE)
 
 processCustomKeywords ($keywords=Array())
 
 getContent ()
 
 setContent ()
 
 getEffectiveLastUpdatedTime ($assetids)
 
 readAccess (Array $assetids=Array())
 
 writeAccess ($lock_type='', Array $assetids=Array(), $only_workflow=TRUE)
 
 adminAccess ($lock_type='', Array $assetids=Array())
 
 backendAccess ()
 
 liveEditAccess ($lock_type)
 
 canliveEdit ($lock_type)
 
 effectiveUnrestricted ()
 
 checkAccess ($perm, $lock_type, Array $assetids=Array(), $only_workflow=TRUE)
 
 accessEffective ()
 
 permissionsUpdated ()
 
 printFrontend ()
 
 printFrontendAsset (Asset $asset, $design=NULL)
 
 getValidProtocols ()
 
 printHead ()
 
 printBody ()
 
 getCurrentPaintLayoutName ()
 
 getCurrentDesignName ()
 
 printBodyWithPaintLayout ($layout_id='')
 
 initLimbo ()
 
 printLimbo ()
 
 paintBackend (Backend_Outputter $o)
 
 getPrefix ()
 
 processBackend (Backend_Outputter $o, Array &$link)
 
 getEI ()
 
 getEditFns ()
 
 getBackendHref ($screen='', $backend_page=TRUE)
 
 getURL ($base_url=NULL, $ignore_rollback=FALSE, $base_contextid=NULL)
 
 getURLs ()
 
 getHref ($base_url=NULL, $ignore_rollback=FALSE)
 
 getWebDataPath ()
 
 getWebPaths ()
 
 saveWebPaths ($paths, $auto_add_remaps=TRUE)
 
 getLookups ($field='')
 
 getDesignLookups ()
 
 getLookupValues ($inherited=NULL, $prefix='', $like_search=TRUE, $ignore_override=FALSE)
 
 deleteLookupValue ($layout_name, $layout_value)
 
 setPaintLayouts ($layouts)
 
 updateLookups ($auto_add_remaps=TRUE)
 
 setLookupValues (Array $values)
 
 getAssetStatusDescriptionKeywordReplacement ()
 
 getAssetStatusColourKeywordReplacement ()
 
 replaceKeywordsInString ($string)
 
 fastTrack ($tasks)
 
 unFastTrack ($tasks)
 
 shouldFastTrack ($task, $assetid=NULL)
 
 getFaskTrackedTaskAssetids ($task)
 
 getDependantParentsURL ()
 
- Public Member Functions inherited from MySource_Object
 MySource_Object ()
 
 __sleep ()
 
 __wakeup ()
 

Static Public Member Functions

static getResponseFromXMLDom ($parentNode)
 

Additional Inherited Members

- Data Fields inherited from Asset
 $id = 0
 
 $version = ''
 
 $name = ''
 
 $short_name = ''
 
 $status
 
 $languages = ''
 
 $charset = ''
 
 $force_secure = '0'
 
 $created
 
 $created_userid
 
 $updated
 
 $updated_userid
 
 $published
 
 $published_userid
 
 $status_changed
 
 $status_changed_userid
 
 $_is_cacheable = FALSE
 
 $vars = Array()
 
 $_available_keywords = Array()
 
 $data_path_suffix = ''
 
 $data_path = ''
 
 $data_path_public = ''
 
 $_ser_attrs = FALSE
 
- Protected Member Functions inherited from Page
 _preCreateCheck (Array &$link)
 
 _createAdditional (Array &$link)
 
 _getName ($short_name=FALSE)
 

Detailed Description

Definition at line 31 of file suite_manager.inc.

Constructor & Destructor Documentation

__construct (   $assetid = 0)

Constructor

Parameters
int$assetidthe asset id to be loaded

Definition at line 89 of file suite_manager.inc.

Member Function Documentation

_getName (   $short_name = FALSE)

Returns name of the asset

Parameters
boolean$short_namewhether or not we are after the shortname or the full name
Returns
string private
See Also
Asset::_getName()

Definition at line 148 of file suite_manager.inc.

buildResponseXMLDom ( $parentNode,
  $content 
)

Build XML DOM structure for the reponse type.

The passed content will be converted to DOM tree structure and appended to the parent node.

Parameters
object&$parentNodeParent DOM node to have the content tree.
mixed$contentContent to create.
Returns
void public

Definition at line 2011 of file suite_manager.inc.

canClone ( )

returns FALSE always because we don't want to be able to clone a funnelback manager

Returns
boolean public

Definition at line 174 of file suite_manager.inc.

canDelete ( )

Can this asset have its last significant link removed (putting it in the trash)?

Returns
boolean public

Definition at line 161 of file suite_manager.inc.

create ( Array &  $link)

Create this asset

Parameters
array&$linkinformation used to create the initial link
Returns
mixed int|boolean public
See Also
Asset::create()

Definition at line 106 of file suite_manager.inc.

createConnectionToken ( )

Returns a unique connection token.

Returns
string

Definition at line 1122 of file suite_manager.inc.

createSuiteMessageDOMTemplate (   $targetid)

Return the template message XML in DOM document format.

Every suite messages are based on this template. It includes systemid, system type and the URL of the system.

Parameters
string$targetidSuite ID of the system the message is for.
Returns
object public

Definition at line 1462 of file suite_manager.inc.

decodeJson (   $data)

Decode a string into JSON

Parameters
string$dataThe content to encode into JSON
Returns
string public

Definition at line 805 of file suite_manager.inc.

decryptAPIData ( )

Decrypt the posted data with the current system's private key.

Returns
void public

Definition at line 1763 of file suite_manager.inc.

decryptData (   $data,
  $password 
)

Decrypt the passed data with the given password.

It decrypts the given password with the current product's private key. Then it uses the decrypted password to decrypt the data. It returns the decrypted string or FALSE on error.

Parameters
string$dataData to decrypt.
string$passwordKey encrypted password.
Returns
mixed public

Definition at line 1896 of file suite_manager.inc.

encodeJson (   $data)

Encode a string into JSON

Parameters
mixed$dataThe content to encode into JSON
Returns
string public

Definition at line 782 of file suite_manager.inc.

encryptAPIData (   $url,
array  $msg,
  $userAgent 
)

Encrypt the outgoing API message with the destined system's public key.

This runs as a modifier on sendCURLAPIRequest() action and checks $msg array. If _enc and _pubKeySystemid fields are included, then it encrypts the data with the destined system's public key.

Parameters
string$urlURL of the system to send the request.
array$msgArray of messages to send.
string$userAgentOptional User Agent string to send.
Returns
array public

Definition at line 1728 of file suite_manager.inc.

encryptData (   $suiteid,
  $data 
)

Encrypt the passed data with the public key of the given system.

It encrypts the data with the password based encryption algorithm. Then the password will be encrypted with the public key of the given system. The returned array includes both of the password and encrypted data.

Parameters
string$suiteidUnique ID of the product.
mixed$dataData to encrypt.
Returns
array public

Definition at line 1852 of file suite_manager.inc.

generateSystemKeyPair ( )

Generates private/public RSA keypairs for the current product.

It also creates a self signed certificate and stores it in DB. This certificate will be sent to other product as a part of sign-in process.

Returns
void public

Definition at line 901 of file suite_manager.inc.

getAPI (   $system,
  $method 
)

Determine whether the current API exists or not.

Parameters
string$systemThe system (read: asset) to load.
string$methodThe method the system should be able to handle.
Returns
mixed public

Definition at line 752 of file suite_manager.inc.

getCurrentProduct ( )

Get the current product information

Returns
array public

Definition at line 428 of file suite_manager.inc.

getLiveProducts ( )

Get the list of live suite products.

Returns
array public

Definition at line 237 of file suite_manager.inc.

getProduct (   $suiteid = NULL)

Get the product information for the given suiteid.

Parameters
string$suiteidUnique ID of the product.
Returns
array public

Definition at line 263 of file suite_manager.inc.

getProductAttribute (   $suiteid,
  $attrName 
)

Returns the attribute of the product.

Parameters
string$suiteidSuite ID of the product.
string$attrNameAttribute name to get.
Returns
mixed public

Definition at line 406 of file suite_manager.inc.

getProductBySystemid (   $systemid)

Get the product information for the given systemid.

Parameters
string$systemidSystem ID of the product.
Returns
array public

Definition at line 303 of file suite_manager.inc.

getProductBySystemidURL (   $systemid,
  $url 
)

Get the product information for the given systemid and API URL.

Parameters
string$systemidSystem ID of the product.
string$urlAPI URL of the product.
Returns
array public

Definition at line 331 of file suite_manager.inc.

getProductByToken (   $token)

Get the product information for the given token.

Parameters
string$tokenUnique token assigned to the connection.
Returns
array public

Definition at line 361 of file suite_manager.inc.

getProducts (   $includeCurrent = TRUE,
  $includeDeleted = TRUE,
  $excludeTypes = array(),
  $includeStatus = array() 
)

Get the list of all suite products.

Parameters
boolean$includeCurrentIf TRUE, the result includes the current product.
boolean$includeDeletedIf TRUE, the result includes the products marked for deletion.
array$excludeTypesIf specified, the types will be excluded from the result.
array$includeStatusIf specified, only statuses specified will be returned.
Returns
array public

Definition at line 192 of file suite_manager.inc.

getProductsByType (   $type)

Get the product list of the given type.

Parameters
string$typeType of product to get.
Returns
array

Definition at line 456 of file suite_manager.inc.

static getResponseFromXMLDom (   $parentNode)
static

Get the response type from the XML DOM structure.

Parameters
object$parentNodeParent DOM node to have the content tree.
Returns
mixed

Definition at line 2095 of file suite_manager.inc.

getSuiteMessageResult (   $response)

Helper function to get the result from suite message response string.

Parameters
string$responseSuite message response string.
Returns
mixed public

Definition at line 1387 of file suite_manager.inc.

getSuiteProductInfo ( array  $current_product)

Returns the sync data to send to other product.

Parameters
array$current_productThe Current Product Info Array.
Returns
array public

Definition at line 1345 of file suite_manager.inc.

getSystemId ( )

Returns the current system ID.

Returns
string

Definition at line 389 of file suite_manager.inc.

logErrorMessage (   $errorMessage = '')

Log the passed error message to file.

Parameters
string$errorMessageError message to log.
Returns
void public

Definition at line 1682 of file suite_manager.inc.

logReceivedMessage (   $systemid,
  $msgType 
)

Log the received message to file.

Parameters
string$systemidSource systemid where the message is from.
string$msgTypeType of message received.
Returns
void public

Definition at line 1615 of file suite_manager.inc.

logSentMessage (   $systemid,
  $msgType 
)

Log the sent message to file.

Parameters
string$systemidDestined systemid.
string$msgTypeType of message sent.
Returns
void public

Definition at line 1651 of file suite_manager.inc.

parseSuiteXML (   $xml,
  $fields = array() 
)

Parse the passed XML file and return.

Parameters
string$xmlSquizSuite specific XML message string.
array$fieldsThe required fields to parse.
Returns
array public

Definition at line 1562 of file suite_manager.inc.

printFrontend ( )

Print the frontend to this asset.

Returns
void public

Definition at line 586 of file suite_manager.inc.

registerProduct (   $systemid,
  $type,
  $url,
  $connection 
)

Register a new product.

Parameters
string$systemidThe name of the product.
string$typeThe type of the product to invite.
string$urlThe URL of the product to invite.
string$connectionThe connection details of the product.
Returns
string public

Definition at line 524 of file suite_manager.inc.

removeProduct (   $suiteid,
  $current = FALSE 
)

Remove the product from the suite.

Parameters
string$suiteidUnique ID of the product.
boolean$currentIf TRUE, can remove the current product.
Returns
boolean public

Definition at line 562 of file suite_manager.inc.

sendCURLAPIRequest (   $url,
  $msg,
  $userAgent = '' 
)

Send POST API request to the destinated system.

It sends API request via POST to the destined system.

Parameters
string$urlURL of the system to send the request.
array$msgArray of messages to send.
string$userAgentOptional User Agent string to send.
Returns
array public

Definition at line 1420 of file suite_manager.inc.

sendMessage (   $targetid,
  $msgType,
array  $options = array() 
)

Send suite specific message to other system.

Parameters
string$targetidSuite ID of the destined system.
string$msgTypeType of message to send.
array$optionsThe details of the message.
Returns
void public

Definition at line 951 of file suite_manager.inc.

sendRequest (   $targetid,
  $format,
  $system,
  $action,
  $message = Array() 
)

Send a request to another system.

Parameters
string$targetidID of the destination system.
string$formatThe format to return the results as.
string$systemThe system on the destination system.
string$actionThe action on the destination system.
array$messageThe message to send.
Returns
array public

Definition at line 1041 of file suite_manager.inc.

syncConnectedProducts (   $requesterSuiteid,
array  $connected,
array &  $markedForDeletion,
array &  $markedForAddtion 
)

Sync the connection products.

Parameters
string$requesterSuiteidThe suite ID of the current system.
array$connectedList of connected products.
array&$markedForDeletionList of deleted products.
array&$markedForAdditionList of added products.
Returns
void public

Definition at line 1290 of file suite_manager.inc.

syncDeletedProducts ( array  $deleted,
array &  $markedForDeletion,
array &  $markedForAddition 
)

Sync the deleted products.

Parameters
array$deletedList of deleted products.
array&$markedForDeletionList of deleted products.
array&$markedForAdditionList of added products.
Returns
void public

Definition at line 1255 of file suite_manager.inc.

syncProductDetails ( array  $product_info,
array  $new_product_info 
)

Sync the product details like product name, URL etc.

Parameters
array$product_infoThe Product Information to sync with.
array$new_product_infoThe response from the product.
Returns
void public

Definition at line 1227 of file suite_manager.inc.

syncWithLiveProducts ( )

Pull other suite system's information and sync itself.

This action will be run directly by the cron job. It requests suite info to all live connected products and updates the information accordingly.

Returns
void public

Definition at line 1142 of file suite_manager.inc.

updateProduct (   $suiteid,
  $attrName,
  $attrValue 
)

Update the product information for the given suiteid.

Parameters
string$suiteidUnique ID of the product.
string$attrNameAttribute name to update.
mixed$attrValueAttribute value to update.
Returns
mixed

Definition at line 479 of file suite_manager.inc.


The documentation for this class was generated from the following file: