Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Attributes
ZopeVersionControl.VersionSupport.VersionSupport Class Reference

List of all members.

Public Member Functions

def haveRepository
def getRepository
def isAVersionableResource
def isUnderVersionControl
def isResourceUpToDate
def isResourceChanged
def getVersionInfo
def applyVersionControl
def checkoutResource
def checkinResource
def uncheckoutResource
def updateResource
def labelResource
def getVersionIds
def getLabelsForHistory
def getLabelsForVersion
def getLogEntries

Static Public Attributes

tuple manage_options
tuple security = AccessControl.ClassSecurityInfo()
tuple versionControlMain = DTMLFile('dtml/VersionControlMain', globals())
tuple versionControlLog = DTMLFile('dtml/VersionControlLog', globals())

Private Attributes

 _v_repository

Detailed Description

Mixin class to support version-controllable resources.

Definition at line 22 of file VersionSupport.py.


Member Function Documentation

Place a resource under version control.

Definition at line 84 of file VersionSupport.py.

00084 
00085     def applyVersionControl(self, REQUEST=None):
00086         """Place a resource under version control."""
00087         repository = self.getRepository()
00088         object = repository.applyVersionControl(self)
00089         if REQUEST is not None:
00090             message="The resource has been placed under version control."
00091             return object.versionControlMain(
00092                 object, REQUEST,
00093                 manage_tabs_message=message
00094                 )

Here is the call graph for this function:

def ZopeVersionControl.VersionSupport.VersionSupport.checkinResource (   self,
  message = '',
  REQUEST = None 
)
Checkout a version-controlled resource.

Definition at line 108 of file VersionSupport.py.

00108 
00109     def checkinResource(self, message='', REQUEST=None):
00110         """Checkout a version-controlled resource."""
00111         repository = self.getRepository()
00112         object = repository.checkinResource(self, message)
00113         version = object.getVersionInfo().version_id
00114         if REQUEST is not None:
00115             message="The resource has been checked in [version %s]." % version
00116             return object.versionControlMain(
00117                 object, REQUEST,
00118                 manage_tabs_message=message
00119                 )

Here is the call graph for this function:

Checkout a version-controlled resource.

Definition at line 96 of file VersionSupport.py.

00096 
00097     def checkoutResource(self, REQUEST=None):
00098         """Checkout a version-controlled resource."""
00099         repository = self.getRepository()
00100         object = repository.checkoutResource(self)
00101         if REQUEST is not None:
00102             message="The resource has been checked out."
00103             return object.versionControlMain(
00104                 object, REQUEST,
00105                 manage_tabs_message=message
00106                 )

Here is the call graph for this function:

Definition at line 165 of file VersionSupport.py.

00165 
00166     def getLabelsForHistory(self):
00167         return self.getRepository().getLabelsForHistory(self)

Here is the call graph for this function:

Definition at line 169 of file VersionSupport.py.

00169 
00170     def getLabelsForVersion(self):
00171         return self.getRepository().getLabelsForVersion(self)

Here is the call graph for this function:

Definition at line 173 of file VersionSupport.py.

00173 
00174     def getLogEntries(self):
00175         return self.getRepository().getLogEntries(self)
00176 
00177 
00178 InitializeClass(VersionSupport)
00179 
00180 

Here is the call graph for this function:

Definition at line 48 of file VersionSupport.py.

00048 
00049     def getRepository(self):
00050         # We currently only allow a single repository in a given context.
00051         if hasattr(self, '_v_repository'):
00052             return self._v_repository
00053         try:    items = self.superValues('Repository')
00054         except: items = self.aq_inner.aq_parent.superValues('Repository')
00055         result = items and items[0] or None
00056         if result is None:
00057             raise VersionControlError(
00058                 'No versioning repository was found.'
00059                 )
00060         self._v_repository = result
00061         return result
00062 

Here is the caller graph for this function:

Definition at line 161 of file VersionSupport.py.

00161 
00162     def getVersionIds(self):
00163         return self.getRepository().getVersionIds(self)

Here is the call graph for this function:

Definition at line 80 of file VersionSupport.py.

00080 
00081     def getVersionInfo(self):
00082         return self.getRepository().getVersionInfo(self)

Here is the call graph for this function:

Definition at line 41 of file VersionSupport.py.

00041 
00042     def haveRepository(self):
00043         try: result = self.getRepository()
00044         except VersionControlError:
00045             return 0
00046         return 1

Here is the call graph for this function:

Definition at line 64 of file VersionSupport.py.

00064 
00065     def isAVersionableResource(self, object):
00066         return self.getRepository().isAVersionableResource(self)

Here is the call graph for this function:

Definition at line 76 of file VersionSupport.py.

00076 
00077     def isResourceChanged(self):
00078         return self.getRepository().isResourceChanged(self)

Here is the call graph for this function:

Definition at line 72 of file VersionSupport.py.

00072 
00073     def isResourceUpToDate(self):
00074         return self.getRepository().isResourceUpToDate(self)

Here is the call graph for this function:

Definition at line 68 of file VersionSupport.py.

00068 
00069     def isUnderVersionControl(self):
00070         return hasattr(self, '__vc_info__')

def ZopeVersionControl.VersionSupport.VersionSupport.labelResource (   self,
  label,
  force = 0,
  REQUEST = None 
)
Label a version-controlled resource.

Definition at line 149 of file VersionSupport.py.

00149 
00150     def labelResource(self, label, force=0, REQUEST=None):
00151         """Label a version-controlled resource."""
00152         repository = self.getRepository()
00153         object = repository.labelResource(self, label, force)
00154         if REQUEST is not None:
00155             message="The label has been applied to this resource."
00156             return object.versionControlMain(
00157                 object, REQUEST,
00158                 manage_tabs_message=message
00159                 )

Here is the call graph for this function:

Uncheckout a version-controlled resource.

Definition at line 121 of file VersionSupport.py.

00121 
00122     def uncheckoutResource(self, REQUEST=None):
00123         """Uncheckout a version-controlled resource."""
00124         repository = self.getRepository()
00125         object = repository.uncheckoutResource(self)
00126         version = object.getVersionInfo().version_id
00127         if REQUEST is not None:
00128             message="The resource has been reverted to version %s." % version
00129             return object.versionControlMain(
00130                 object, REQUEST,
00131                 manage_tabs_message=message
00132                 )

Here is the call graph for this function:

def ZopeVersionControl.VersionSupport.VersionSupport.updateResource (   self,
  selector,
  REQUEST = None 
)
Update a version-controlled resource.

Definition at line 134 of file VersionSupport.py.

00134 
00135     def updateResource(self, selector, REQUEST=None):
00136         """Update a version-controlled resource."""
00137         repository = self.getRepository()
00138         if selector == 'LATEST_VERSION':
00139             selector = None
00140         object = repository.updateResource(self, selector)
00141         version = object.getVersionInfo().version_id
00142         if REQUEST is not None:
00143             message="The resource has been updated to version %s." % version
00144             return object.versionControlMain(
00145                 object, REQUEST,
00146                 manage_tabs_message=message
00147                 )

Here is the call graph for this function:


Member Data Documentation

Definition at line 59 of file VersionSupport.py.

Initial value:
(
        {'label': 'Version Control', 'action':'versionControlMain',
         'help':  ('ZopeVersionControl', 'VersionControl.stx'),
         'filter': isAVersionableResource,
         },
        )

Definition at line 25 of file VersionSupport.py.

tuple ZopeVersionControl.VersionSupport.VersionSupport.security = AccessControl.ClassSecurityInfo() [static]

Definition at line 32 of file VersionSupport.py.

tuple ZopeVersionControl.VersionSupport.VersionSupport.versionControlLog = DTMLFile('dtml/VersionControlLog', globals()) [static]

Definition at line 38 of file VersionSupport.py.

tuple ZopeVersionControl.VersionSupport.VersionSupport.versionControlMain = DTMLFile('dtml/VersionControlMain', globals()) [static]

Definition at line 35 of file VersionSupport.py.


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