Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes
Archetypes.ReferenceEngine.ContentReference Class Reference
Inheritance diagram for Archetypes.ReferenceEngine.ContentReference:
Inheritance graph
[legend]
Collaboration diagram for Archetypes.ReferenceEngine.ContentReference:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def addHook
def delHook
def getContentObject
def manage_afterAdd
def manage_beforeDelete
def __repr__
def UID
def getSourceObject
 Convenience methods.
def getTargetObject
def targetId
 Catalog support.
def targetTitle
def Type
def addHook
 Policy hooks, subclass away.
def delHook
def beforeTargetDeleteInformSource
 OFS Operations Policy Hooks These Hooks are experimental and subject to change.
def beforeSourceDeleteInformTarget

Public Attributes

 id
 sourceUID
 targetUID
 relationship

Static Public Attributes

tuple security = ClassSecurityInfo()
string portal_type = 'Reference'
string meta_type = 'Reference'
tuple manage_options
tuple manage_view = PageTemplateFile('view_reference', _www)

Static Private Attributes

tuple __implements__ = Reference.__implements__+(IContentReference,)
 Added base level support for referencing References They respond to the UUID protocols, but are not catalog aware.

Detailed Description

Subclass of Reference to support contentish objects inside references 

Definition at line 169 of file ReferenceEngine.py.


Constructor & Destructor Documentation

def Archetypes.ReferenceEngine.ContentReference.__init__ (   self,
  args,
  kw 
)

Definition at line 174 of file ReferenceEngine.py.

00174 
00175     def __init__(self, *args, **kw):
00176         Reference.__init__(self, *args, **kw)
00177 

Here is the caller graph for this function:


Member Function Documentation

Definition at line 82 of file ReferenceEngine.py.

00082 
00083     def __repr__(self):
00084         return "<Reference sid:%s tid:%s rel:%s>" %(self.sourceUID, self.targetUID, self.relationship)

def Archetypes.ReferenceEngine.Reference.addHook (   self,
  tool,
  sourceObject = None,
  targetObject = None 
) [inherited]

Policy hooks, subclass away.

Definition at line 128 of file ReferenceEngine.py.

00128 
00129     def addHook(self, tool, sourceObject=None, targetObject=None):
00130         #to reject the reference being added raise a ReferenceException
00131         pass

def Archetypes.ReferenceEngine.ContentReference.addHook (   self,
  args,
  kw 
)

Definition at line 181 of file ReferenceEngine.py.

00181 
00182     def addHook(self, *args, **kw):
00183         # creates the content instance
00184         if type(self.contentType) in (type(''),type(u'')):
00185             # type given as string
00186             tt=getToolByName(self,'portal_types')
00187             tt.constructContent(self.contentType, self,
00188                                 REFERENCE_CONTENT_INSTANCE_NAME)
00189         else:
00190             # type given as class
00191             setattr(self, REFERENCE_CONTENT_INSTANCE_NAME,
00192                     self.contentType(REFERENCE_CONTENT_INSTANCE_NAME))
00193             getattr(self, REFERENCE_CONTENT_INSTANCE_NAME)._md=PersistentMapping()

Here is the call graph for this function:

called when the refering source Object is
about to be deleted

Definition at line 144 of file ReferenceEngine.py.

00144 
00145     def beforeSourceDeleteInformTarget(self):
00146         """called when the refering source Object is
00147         about to be deleted"""
00148         pass

OFS Operations Policy Hooks These Hooks are experimental and subject to change.

called before target object is deleted so
the source can have a say

Definition at line 139 of file ReferenceEngine.py.

00139 
00140     def beforeTargetDeleteInformSource(self):
00141         """called before target object is deleted so
00142         the source can have a say"""
00143         pass

def Archetypes.ReferenceEngine.Reference.delHook (   self,
  tool,
  sourceObject = None,
  targetObject = None 
) [inherited]

Definition at line 132 of file ReferenceEngine.py.

00132 
00133     def delHook(self, tool, sourceObject=None, targetObject=None):
00134         #to reject the delete raise a ReferenceException
00135         pass

def Archetypes.ReferenceEngine.ContentReference.delHook (   self,
  args,
  kw 
)

Definition at line 194 of file ReferenceEngine.py.

00194 
00195     def delHook(self, *args, **kw):
00196         # remove the content instance
00197         if type(self.contentType) in (type(''),type(u'')):
00198             # type given as string
00199             self._delObject(REFERENCE_CONTENT_INSTANCE_NAME)
00200         else:
00201             # type given as class
00202             delattr(self, REFERENCE_CONTENT_INSTANCE_NAME)

Here is the call graph for this function:

Definition at line 203 of file ReferenceEngine.py.

00203 
00204     def getContentObject(self):
00205         return getattr(self.aq_inner.aq_explicit, REFERENCE_CONTENT_INSTANCE_NAME)

Convenience methods.

Definition at line 91 of file ReferenceEngine.py.

00091 
00092     def getSourceObject(self):
00093         tool = getToolByName(self, UID_CATALOG, None)
00094         if tool is None: return ''
00095         brains = tool(UID=self.sourceUID)
00096         for brain in brains:
00097             obj = brain.getObject()
00098             if obj is not None:
00099                 return obj

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 100 of file ReferenceEngine.py.

00100 
00101     def getTargetObject(self):
00102         tool = getToolByName(self, UID_CATALOG, None)
00103         if tool is None: return ''
00104         brains = tool(UID=self.targetUID)
00105         for brain in brains:
00106             obj = brain.getObject()
00107             if obj is not None:
00108                 return obj

Here is the call graph for this function:

Here is the caller graph for this function:

def Archetypes.ReferenceEngine.ContentReference.manage_afterAdd (   self,
  item,
  container 
)

Reimplemented from Archetypes.ReferenceEngine.Reference.

Definition at line 206 of file ReferenceEngine.py.

00206 
00207     def manage_afterAdd(self, item, container):
00208         Reference.manage_afterAdd(self, item, container)
00209         ObjectManager.manage_afterAdd(self, item, container)

def Archetypes.ReferenceEngine.ContentReference.manage_beforeDelete (   self,
  item,
  container 
)

Reimplemented from Archetypes.ReferenceEngine.Reference.

Definition at line 210 of file ReferenceEngine.py.

00210 
00211     def manage_beforeDelete(self, item, container):
00212         ObjectManager.manage_beforeDelete(self, item, container)
00213         Reference.manage_beforeDelete(self, item, container)
00214 
00215 InitializeClass(ContentReference)

Catalog support.

Definition at line 111 of file ReferenceEngine.py.

00111 
00112     def targetId(self):
00113         target = self.getTargetObject()
00114         if target is not None:
00115             return target.getId()
00116         return ''

Here is the call graph for this function:

Definition at line 117 of file ReferenceEngine.py.

00117 
00118     def targetTitle(self):
00119         target = self.getTargetObject()
00120         if target is not None:
00121             return target.Title()
00122         return ''

Here is the call graph for this function:

def Archetypes.ReferenceEngine.Reference.Type (   self) [inherited]

Definition at line 123 of file ReferenceEngine.py.

00123 
00124     def Type(self):
00125         return self.__class__.__name__

Here is the caller graph for this function:

def Archetypes.ReferenceEngine.Reference.UID (   self) [inherited]
the uid method for compat

Definition at line 85 of file ReferenceEngine.py.

00085 
00086     def UID(self):
00087         """the uid method for compat"""
00088         return getattr(aq_base(self), UUID_ATTR)

Here is the caller graph for this function:


Member Data Documentation

Added base level support for referencing References They respond to the UUID protocols, but are not catalog aware.

This means that you can't move/rename reference objects and expect them to work, but you can't do this anyway. However they should fine the correct events when they are added/deleted, etc

Reimplemented from Archetypes.ReferenceEngine.Reference.

Definition at line 172 of file ReferenceEngine.py.

Definition at line 73 of file ReferenceEngine.py.

Initial value:
(
        (
        {'label':'View', 'action':'manage_view',
         },
        )+
        SimpleItem.manage_options
        )

Definition at line 60 of file ReferenceEngine.py.

tuple Archetypes.ReferenceEngine.Reference.manage_view = PageTemplateFile('view_reference', _www) [static, inherited]

Definition at line 70 of file ReferenceEngine.py.

Definition at line 56 of file ReferenceEngine.py.

Definition at line 55 of file ReferenceEngine.py.

Definition at line 78 of file ReferenceEngine.py.

tuple Archetypes.ReferenceEngine.ContentReference.security = ClassSecurityInfo() [static]

Reimplemented from Archetypes.ReferenceEngine.Reference.

Definition at line 178 of file ReferenceEngine.py.

Definition at line 76 of file ReferenceEngine.py.

Definition at line 77 of file ReferenceEngine.py.


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