Package archipelcore :: Module archipelTaggableEntity :: Class TNTaggableEntity
[hide private]
[frames] | no frames]

Class TNTaggableEntity

source code

object --+
         |
        TNTaggableEntity

This class allow ArchipelEntity to be taggable.

Instance Methods [hide private]
 
__init__(self, pubsubserver, jid, xmppclient, permission_center, log)
Initialize the TNTaggableEntity.
source code
 
check_acp(conn, iq)
Function that verify if the ACP is valid.
source code
 
check_perm(self, conn, stanza, action_name, error_code=-1, prefix='')
function that verify if the permissions are granted
source code
 
recover_pubsubs(self, origin, user_info, arguments)
Get the global tag pubsub node.
source code
 
init_permissions(self)
Initialize the tag permissions.
source code
 
register_handlers(self)
Initialize the handlers for tags.
source code
 
unregister_handlers(self)
Unregister the handlers for tags.
source code
 
process_tags_iq(self, conn, iq)
This method is invoked when a ARCHIPEL_NS_TAGS IQ is received.
source code
 
set_tags(self, tags)
Set the tags of the current entity.
source code
 
did_clean_old_tags(self, resp, user_info)
Callback called when old tags has been removed if any.
source code
xmpp.Protocol.IQ
iq_set_tags(self, iq)
Set the current tag.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, pubsubserver, jid, xmppclient, permission_center, log)
(Constructor)

source code 

Initialize the TNTaggableEntity.

Parameters:
  • pubsubserver (string) - the JID of the pubsub server
  • jid (string) - the JID of the current entity
  • xmppclient (xmpp.Dispatcher) - the entity xmpp client
  • permission_center (TNPermissionCenter) - the permission center of the entity
  • log (TNArchipelLog) - the logger of the entity
Overrides: object.__init__

check_acp(conn, iq)

source code 

Function that verify if the ACP is valid.

Parameters:
  • conn (xmpp.Dispatcher) - the connection
  • iq (xmpp.Protocol.Iq) - the IQ to check
Raises:
  • Exception - Exception if not implemented

check_perm(self, conn, stanza, action_name, error_code=-1, prefix='')

source code 

function that verify if the permissions are granted

Parameters:
  • conn (xmpp.Dispatcher) - the connection
  • stanza (xmpp.Node) - the stanza containing the action
  • action_name (string) - the action to check
  • error_code (int) - the error code to return
  • prefix (string) - the prefix of the action
Raises:
  • Exception - Exception if not implemented

recover_pubsubs(self, origin, user_info, arguments)

source code 

Get the global tag pubsub node. Arguments here are used to be HOOK compliant see register_hook of TNHookableEntity

process_tags_iq(self, conn, iq)

source code 

This method is invoked when a ARCHIPEL_NS_TAGS IQ is received. It understands IQ of type:

  • settags
Parameters:
  • conn (xmpp.Dispatcher) - ths instance of the current connection that send the stanza
  • iq (xmpp.Protocol.Iq) - the received IQ

set_tags(self, tags)

source code 

Set the tags of the current entity.

Parameters:
  • tags (string) - the string containing tags separated by ';;'

did_clean_old_tags(self, resp, user_info)

source code 

Callback called when old tags has been removed if any.

Raises:
  • Exception - Exception if not implemented

iq_set_tags(self, iq)

source code 

Set the current tag.

Parameters:
  • iq (xmpp.Protocol.IQ) - the IQ containing the request
Returns: xmpp.Protocol.IQ
the IQ containing the answer