\Pydio\ShareShareCenter

The basic concept of plugin. Only needs a manifest.xml file.

Summary

Methods
Properties
Constants
__construct()
__clone()
getWorkDirForPluginId()
init()
performChecks()
isEnabled()
loadManifest()
getManifestLabel()
getManifestDescription()
serialize()
unserialize()
getManifestRawContent()
getRegistryContributions()
updateDependencies()
dependsOn()
getActiveDependencies()
getConfigsDefinitions()
loadConfigs()
getConfigs()
getClassFile()
missingExtensions()
hasMissingExtensions()
manifestLoaded()
getId()
getName()
getType()
getBaseDir()
getDependencies()
logDebug()
logInfo()
logNotice()
logWarning()
logError()
detectStreamWrapper()
getPluginInformation()
getPluginInformationHTML()
reloadXPath()
hasMixin()
publicRoute()
loadMinisite()
loadPubliclet()
getShareCenter()
currentContextIsLinkDownload()
checkHash()
getShareStore()
getPublicAccessManager()
isShared()
preProcessDownload()
migrateLegacyShares()
switchAction()
nodeSharedMetadata()
updateNodeSharedData()
cleanUserShares()
cleanWorkspaceShares()
forwardEventToShares()
forwardEventToSharesAction()
filterHttpVarsForLeafPath()
filterHttpVarsFromUniqueNode()
createSharedMinisite()
createSharedRepository()
shareNode()
listShares()
listSharesAsNodes()
compositeShareToJson()
shareToJson()
$loadingState
No constants found
getPluginWorkDir()
getPluginCacheDir()
getXPath()
getContextualOption()
loadRegistryContributions()
initXmlContributionFile()
parseSpecificContributions()
unserializeManifest()
loadDependencies()
cachedNodesFromManifest()
loadConfigsDefinitions()
loadOptionsDefaults()
exposeConfigInManifest()
loadMixins()
nodeAttrToHash()
nodesEqual()
getAuthorization()
getRightsManager()
updateToMaxAllowedValue()
checkRepoWithSameLabel()
toggleWatchOnSharedRepository()
createOrLoadSharedRepository()
shareObjectFromParameters()
$baseDir
$id
$name
$type
$manifestLoaded
$externalFilesAppended
$enabled
$registryContributions
$contributionsLoaded
$options
$pluginConf
$pluginConfDefinition
$dependencies
$extensionsDependencies
$streamData
$mixins
$cachedXPathResults
$manifestDoc
N/A
findMirrorNodesInShares()
applyForwardEvent()
$xPath
$manifestXML
$serializableAttributes
$accessDriver
$repository
$urlBase
$shareStore
$publicAccessManager
$watcher
$rightsManager
$currentContext
N/A

Properties

$loadingState

$loadingState : 

Type

$baseDir

$baseDir : 

Type

$id

$id : 

Type

$name

$name : 

Type

$type

$type : 

Type

$manifestLoaded

$manifestLoaded : 

Type

$externalFilesAppended

$externalFilesAppended : 

Type

$enabled

$enabled : 

Type

$registryContributions

$registryContributions : 

Type

$contributionsLoaded

$contributionsLoaded : 

Type

$options

$options : array

Type

array

$pluginConf

$pluginConf : 

Type

$pluginConfDefinition

$pluginConfDefinition : 

Type

$dependencies

$dependencies : 

Type

$extensionsDependencies

$extensionsDependencies : 

Type

$streamData

$streamData : 

Type

$mixins

$mixins : 

Type

$cachedXPathResults

$cachedXPathResults : 

Type

$manifestDoc

$manifestDoc : \DOMDocument

The manifest.xml loaded

Type

\DOMDocument

$xPath

$xPath : \DOMXPath

XPath query

Type

\DOMXPath

$manifestXML

$manifestXML : string

Internally store XML during serialization state.

Type

string

$serializableAttributes

$serializableAttributes : 

Type

$urlBase

$urlBase : 

Type

Methods

__construct()

__construct(string  $id, string  $baseDir) 

Construction method

Parameters

string $id
string $baseDir

__clone()

__clone() 

Make sure to clone the XML manifest document, otherwise if the plugin changes it dynamically, it can mess up things.

getWorkDirForPluginId()

getWorkDirForPluginId(  $pluginId) : string

Parameters

$pluginId

Returns

string

init()

init(\Pydio\Core\Model\ContextInterface  $ctx, array  $options = array()) : void

Plugin initializer

Parameters

\Pydio\Core\Model\ContextInterface $ctx
array $options

performChecks()

performChecks() 

Perform initialization checks, and throw exception if problems found.

Throws

\Exception

isEnabled()

isEnabled() : boolean

Returns

boolean

loadManifest()

loadManifest() : void

Load the main manifest.xml file of the plugni

Throws

\Exception

getManifestLabel()

getManifestLabel() : mixed|string

Get the plugin label as defined in the manifest file (label attribute)

Returns

mixed|string

getManifestDescription()

getManifestDescription() : mixed|string

Get the plugin description as defined in the manifest file (description attribute)

Returns

mixed|string

serialize()

serialize() : string

Serialized all declared attributes and return a serialized representation of this plugin.

The XML Manifest is base64 encoded before serialization.

Returns

string

unserialize()

unserialize(  $string) : void

Load this plugin from its serialized reprensation. The manifest XML is base64 decoded.

Parameters

$string

getManifestRawContent()

getManifestRawContent(string  $xmlNodeName = "", string  $format = "string", boolean  $externalFiles = false) : \DOMElement|\DOMNodeList|string

Legacy function, should better be used to return XML Nodes than string. Perform a query on the manifest.

Parameters

string $xmlNodeName
string $format
boolean $externalFiles

Returns

\DOMElement|\DOMNodeList|string

getRegistryContributions()

getRegistryContributions(\Pydio\Core\Model\ContextInterface  $ctx, boolean  $extendedVersion = true) : array<mixed,\DOMElement>

Return the registry contributions. The parameter can be used by subclasses to optimize the size of the XML returned : the extended version is called when sending to the client, whereas the "small" version is loaded to find and apply actions.

Parameters

\Pydio\Core\Model\ContextInterface $ctx
boolean $extendedVersion

Can be used by subclasses to optimize the size of the XML returned.

Returns

array<mixed,\DOMElement>

dependsOn()

dependsOn(string  $pluginName) : boolean

Check if this plugin depends on another one.

Parameters

string $pluginName

Returns

boolean

getActiveDependencies()

getActiveDependencies(\Pydio\Core\PluginFramework\PluginsService  $pluginService) : array

Get dependencies

Parameters

\Pydio\Core\PluginFramework\PluginsService $pluginService

Returns

array

getConfigsDefinitions()

getConfigsDefinitions() : array

Returns

array

loadConfigs()

loadConfigs(array  $configData) : void

Load the configs passed as parameter. This method will + Parse the config definitions and load the default values + Merge these values with the $configData parameter + Publish their value in the manifest if the global_param is "exposed" to the client.

Parameters

array $configData

getConfigs()

getConfigs() : array

Return this plugin configs, merged with its associated "core" configs.

Returns

array

getClassFile()

getClassFile() : array|boolean

Return the file path of the specific class to load

Returns

array|boolean

missingExtensions()

missingExtensions() : array

Returns

array

hasMissingExtensions()

hasMissingExtensions() : boolean

Returns

boolean

manifestLoaded()

manifestLoaded() : boolean

Returns

boolean

getId()

getId() : string

Returns

string

getName()

getName() : string

Returns

string

getType()

getType() : string

Returns

string

getBaseDir()

getBaseDir() : string

Returns

string

getDependencies()

getDependencies() : array

Returns

array

logDebug()

logDebug(string  $prefix, array|string  $message = "") : void

Write a debug log with the plugin id as source

Parameters

string $prefix

A quick description or action

array|string $message

Variable number of message args (string or array)

logInfo()

logInfo(string  $prefix, array|string  $message) : void

Write an info log with the plugin id as source

Parameters

string $prefix

A quick description or action

array|string $message

Variable number of message args (string or array)

logNotice()

logNotice(string  $prefix, array|string  $message) : void

Write a notice log with the plugin id as source

Parameters

string $prefix

A quick description or action

array|string $message

Variable number of message args (string or array)

logWarning()

logWarning(string  $prefix, array|string  $message) : void

Write a warning log with the plugin id as source

Parameters

string $prefix

A quick description or action

array|string $message

Variable number of message args (string or array)

logError()

logError(string  $prefix, array|string  $message) : void

Write an error log with the plugin id as source

Parameters

string $prefix

A quick description or action

array|string $message

Variable number of message args (string or array)

detectStreamWrapper()

detectStreamWrapper(boolean  $register = false, \Pydio\Core\Model\ContextInterface  $ctx = null) : array|boolean

Detect if this plugin declares a StreamWrapper, and if yes loads it and register the stream.

Parameters

boolean $register
\Pydio\Core\Model\ContextInterface $ctx

Returns

array|boolean

getPluginInformation()

getPluginInformation() : array

Returns

array

getPluginInformationHTML()

getPluginInformationHTML(  $defaultAuthor,   $defaultUriBase) : string

Parameters

$defaultAuthor
$defaultUriBase

Returns

string

reloadXPath()

reloadXPath() : void

hasMixin()

hasMixin(  $mixinName) : boolean

Parameters

$mixinName

Returns

boolean

publicRoute()

publicRoute(  $serverBase,   $route,   $params) 

Parameters

$serverBase
$route
$params

loadMinisite()

loadMinisite(array  $data, string  $hash = '', null  $error = null) 

Loader for minisites

Parameters

array $data
string $hash
null $error

loadPubliclet()

loadPubliclet(array  $data) : void

Loader for legacy publiclets

Parameters

array $data

currentContextIsLinkDownload()

currentContextIsLinkDownload() : boolean

Returns

boolean

checkHash()

checkHash(String  $outputData, String  $hash) : boolean

Check if the hash seems to correspond to the serialized data.

Kept there only for backward compatibility

Parameters

String $outputData

serialized data

String $hash

Id to check

Returns

boolean

preProcessDownload()

preProcessDownload(\Psr\Http\Message\ServerRequestInterface  $requestInterface, \Psr\Http\Message\ResponseInterface  $responseInterface) 

Added as preprocessor on Download action to handle download Counter.

Parameters

\Psr\Http\Message\ServerRequestInterface $requestInterface
\Psr\Http\Message\ResponseInterface $responseInterface

Throws

\Exception

migrateLegacyShares()

migrateLegacyShares(\Psr\Http\Message\ServerRequestInterface  $requestInterface, \Psr\Http\Message\ResponseInterface  $responseInterface) 

Parameters

\Psr\Http\Message\ServerRequestInterface $requestInterface
\Psr\Http\Message\ResponseInterface $responseInterface

switchAction()

switchAction(\Psr\Http\Message\ServerRequestInterface  $requestInterface, \Psr\Http\Message\ResponseInterface  $responseInterface) : null

Parameters

\Psr\Http\Message\ServerRequestInterface $requestInterface
\Psr\Http\Message\ResponseInterface $responseInterface

Throws

\Exception
\Pydio\Core\Exception\PydioException

Returns

null

cleanUserShares()

cleanUserShares(\Pydio\Core\Model\ContextInterface  $ctx, String  $userId) 

Hook user.after_delete make sure to clear orphan shares

Parameters

\Pydio\Core\Model\ContextInterface $ctx
String $userId

cleanWorkspaceShares()

cleanWorkspaceShares(\Pydio\Core\Model\ContextInterface  $ctx, String  $workspaceId) 

Hook workspace.delete make sure to clear shares

Parameters

\Pydio\Core\Model\ContextInterface $ctx
String $workspaceId

forwardEventToSharesAction()

forwardEventToSharesAction(  $actionName,   $httpVars,   $fileVars) 

Parameters

$actionName
$httpVars
$fileVars

filterHttpVarsForLeafPath()

filterHttpVarsForLeafPath(array  $httpVars, \Pydio\Access\Core\Model\UserSelection  $userSelection) : integer

Parameters

array $httpVars
\Pydio\Access\Core\Model\UserSelection $userSelection

Throws

\Exception

Returns

integer

filterHttpVarsFromUniqueNode()

filterHttpVarsFromUniqueNode(array  $httpVars, \Pydio\Access\Core\Model\AJXP_Node  $ajxpNode) 

Parameters

array $httpVars
\Pydio\Access\Core\Model\AJXP_Node $ajxpNode

createSharedMinisite()

createSharedMinisite(array  $httpVars, boolean  $update) : mixed

Parameters

array $httpVars
boolean $update

Throws

\Exception

Returns

mixed —

An array containing the hash (0) and the generated url (1)

createSharedRepository()

createSharedRepository(array  $httpVars, boolean  $update, array  $users = array(), array  $groups = array(), \Pydio\Access\Core\Model\AJXP_Node  $originalNode = null) : \Pydio\Access\Core\Model\Repository

Parameters

array $httpVars
boolean $update
array $users
array $groups
\Pydio\Access\Core\Model\AJXP_Node $originalNode

Throws

\Exception

Returns

\Pydio\Access\Core\Model\Repository

listShares()

listShares(boolean|string  $currentUser, string  $parentRepositoryId = "", null  $cursor = null) : array

Parameters

boolean|string $currentUser

if true, currently logged user. if false all users. If string, user ID.

string $parentRepositoryId
null $cursor

Returns

array

listSharesAsNodes()

listSharesAsNodes(\Pydio\Core\Model\ContextInterface  $ctx,   $rootPath, boolean|string  $currentUser, string  $parentRepositoryId = "", null  $cursor = null, integer  $clearBroken = -1) : array<mixed,\Pydio\Access\Core\Model\AJXP_Node>

Parameters

\Pydio\Core\Model\ContextInterface $ctx
$rootPath
boolean|string $currentUser

if true, currently logged user. if false all users. If string, user ID.

string $parentRepositoryId
null $cursor
integer $clearBroken

Returns

array<mixed,\Pydio\Access\Core\Model\AJXP_Node>

getPluginWorkDir()

getPluginWorkDir(boolean  $check = false) : string

Parameters

boolean $check

Throws

\Exception

Returns

string

getPluginCacheDir()

getPluginCacheDir(boolean  $shared = false, boolean  $check = false) : string

Parameters

boolean $shared
boolean $check

Throws

\Exception

Returns

string

getXPath()

getXPath() : \DOMXPath

Returns

\DOMXPath

getContextualOption()

getContextualOption(\Pydio\Core\Model\ContextInterface  $ctx,   $optionName) : mixed|null

Parameters

\Pydio\Core\Model\ContextInterface $ctx
$optionName

Returns

mixed|null

loadRegistryContributions()

loadRegistryContributions(\Pydio\Core\Model\ContextInterface  $ctx, boolean  $dry = false) 

Main function for loading all the nodes under registry_contributions.

Parameters

\Pydio\Core\Model\ContextInterface $ctx
boolean $dry

initXmlContributionFile()

initXmlContributionFile(\Pydio\Core\Model\ContextInterface  $ctx, string  $xmlFile, array  $include = array("*"), array  $exclude = array(), boolean  $dry = false) 

Load an external XML file and include/exclude its nodes as contributions.

Parameters

\Pydio\Core\Model\ContextInterface $ctx
string $xmlFile

Path to the file from the base install path

array $include

XPath query for XML Nodes to include

array $exclude

XPath query for XML Nodes to exclude from the included ones.

boolean $dry

Dry-run of the inclusion

parseSpecificContributions()

parseSpecificContributions(\Pydio\Core\Model\ContextInterface  $ctx, \DOMNode  $contribNode) : void

Extend parent

Parameters

\Pydio\Core\Model\ContextInterface $ctx
\DOMNode $contribNode

unserializeManifest()

unserializeManifest() 

Load DOMDocument from serialized value. Must be called after checking that property $this->manifestXML is not null.

loadDependencies()

loadDependencies() : void

Load the declared dependant plugins

cachedNodesFromManifest()

cachedNodesFromManifest(  $query) : array|mixed

Parameters

$query

Returns

array|mixed

loadConfigsDefinitions()

loadConfigsDefinitions() : void

Load the global parameters for this plugin

loadOptionsDefaults()

loadOptionsDefaults() : array

Load the default values for this plugin options

Returns

array

exposeConfigInManifest()

exposeConfigInManifest(  $configName,   $configValue) : void

Add a name/value pair in the manifest to be published to the world.

Parameters

$configName
$configValue

loadMixins()

loadMixins() : void

Check if the plugin declares mixins, and load them using PluginsService::patchPluginWithMixin method

nodeAttrToHash()

nodeAttrToHash(\DOMNode  $node) : array

Transform a simple node and its attributes to a HashTable

Parameters

\DOMNode $node

Returns

array

nodesEqual()

nodesEqual(\DOMNode  $node1, \DOMNode  $node2) : boolean

Compare two nodes at first level (nodename and attributes)

Parameters

\DOMNode $node1
\DOMNode $node2

Returns

boolean

getAuthorization()

getAuthorization(\Pydio\Core\Model\ContextInterface  $ctx, string  $nodeType, string  $shareType = "any") : boolean

Compute right to create shares based on plugin options

Parameters

\Pydio\Core\Model\ContextInterface $ctx
string $nodeType

"file"|"folder"

string $shareType

"any"|"minisite"|"workspace"

Returns

boolean

updateToMaxAllowedValue()

updateToMaxAllowedValue(array  $httpVars, string  $parameterName, string  $optionName) 

Update parameter value based on current max allowed option.

Parameters

array $httpVars
string $parameterName
string $optionName

checkRepoWithSameLabel()

checkRepoWithSameLabel(  $label, \Pydio\Access\Core\Model\Repository|null  $editingRepo = null) : boolean

Parameters

$label
\Pydio\Access\Core\Model\Repository|null $editingRepo

Returns

boolean

toggleWatchOnSharedRepository()

toggleWatchOnSharedRepository(  $childRepoId,   $userId, boolean  $toggle = true, null  $parentUserId = null) 

Parameters

$childRepoId
$userId
boolean $toggle
null $parentUserId

createOrLoadSharedRepository()

createOrLoadSharedRepository(array  $httpVars, boolean  $update) : \Pydio\Access\Core\Model\Repository

Parameters

array $httpVars
boolean $update

Throws

\Exception

Returns

\Pydio\Access\Core\Model\Repository

shareObjectFromParameters()

shareObjectFromParameters(array  $linkData, array  $hiddenUserEntries, array  $shareObjects, string  $type = "public", string  $invitationLabel = "") : \Pydio\Share\Model\ShareLink

Parameters

array $linkData
array $hiddenUserEntries
array $shareObjects
string $type
string $invitationLabel

Throws

\Exception

Returns

\Pydio\Share\Model\ShareLink

findMirrorNodesInShares()

findMirrorNodesInShares(\Pydio\Access\Core\Model\AJXP_Node  $node, String|null  $direction) : \Pydio\Share\array()

Parameters

\Pydio\Access\Core\Model\AJXP_Node $node
String|null $direction

"UP", "DOWN"

Returns

\Pydio\Share\array()

applyForwardEvent()

applyForwardEvent(null  $fromMirrors = null, null  $toMirrors = null, boolean  $copy = false, null  $direction = null) 

Parameters

null $fromMirrors
null $toMirrors
boolean $copy
null $direction

Throws

\Exception