Back to index

plone3  3.1.7
registries.py
Go to the documentation of this file.
00001 from zope.interface import Interface
00002 from zope.interface import Attribute
00003 
00004 class IResourceRegistry(Interface):
00005     """A tool for registering and evaluating resource linkage."""
00006 
00007     def registerResource(id, expression='', enabled=1):
00008         """Register a resource."""
00009 
00010     def getEvaluatedResources(context):
00011         """Get the evaluated resource links and inline styles appropriate
00012         to the context for rendering.
00013         """
00014 
00015     def unregisterResource(id):
00016         """Unregister a registered resource."""
00017 
00018     def getResource(id):
00019         """Get resource object by id.
00020         
00021         If any property of the resource is changed, then cookResources of the
00022         registry must be called."""
00023 
00024     def renameResource(old_id, new_id):
00025         """Change the id of a registered resource."""
00026 
00027     def moveResource(id, position):
00028         """Move a registered resource to the given position."""
00029 
00030     def getResourcePosition(id):
00031         """Get the position (order) of a resource given its id."""
00032 
00033     def moveResourceUp(id, steps=1, REQUEST=None):
00034         """Move the resource up 'steps' number of steps."""
00035 
00036     def moveResourceDown(id, steps=1, REQUEST=None):
00037         """Move the resource down 'steps' number of steps."""
00038 
00039     def moveResourceToTop(id, REQUEST=None):
00040         """Move the resource to the first position."""
00041 
00042     def moveResourceToBottom(id, REQUEST=None):
00043         """Move the resource to the last position."""
00044 
00045     def moveResourceBefore(id, dest_id, REQUEST=None):
00046         """Move the resource before the resource with dest_id."""
00047 
00048     def moveResourceAfter(id, dest_id, REQUEST=None):
00049         """Move the resource after the resource with dest_id."""
00050 
00051     def getResourceIds():
00052         """Return the ids of all resources."""
00053 
00054     def getResources():
00055         """Get the resource objects.
00056 
00057         For use in management screens.
00058         """
00059 
00060 class ICSSRegistry(Interface):
00061     """A tool for registering and evaluating stylesheet linkage."""
00062 
00063     id = Attribute('id',
00064                    """ The tool's ID.
00065 
00066                    o Must be set to 'portal_css'.
00067                    """)
00068 
00069     def registerStylesheet(id, expression='', media='', rel='stylesheet',
00070                            rendering='import', enabled=1):
00071         """Register a stylesheet."""
00072 
00073     def manage_addStylesheet(id, expression='', media='', rel='stylesheet',
00074                              rendering='import', enabled=True , REQUEST=None):
00075         """Add stylesheet from a ZMI form."""
00076 
00077     def manage_removeStylesheet(id, REQUEST=None):
00078         """Remove stylesheet from the ZMI."""
00079 
00080     def manage_saveStylesheets(REQUEST=None):
00081         """Save stylesheet data from form submission."""
00082 
00083 
00084 class IKSSRegistry(Interface):
00085     """A tool for registering and evaluating kineticstylesheet linkage."""
00086 
00087     id = Attribute('id',
00088                    """ The tool's ID.
00089 
00090                    o Must be set to 'portal_kss'.
00091                    """)
00092 
00093     def registerKineticStylesheet(id, expression='', enabled=1):
00094         """Register a kineticstylesheet."""
00095 
00096     def manage_addKineticStylesheet(id, expression='', 
00097                                     enabled=True , REQUEST=None):
00098         """Add kineticstylesheet from a ZMI form."""
00099 
00100     def manage_removeKineticStylesheet(id, REQUEST=None):
00101         """Remove kineticstylesheet from the ZMI."""
00102 
00103     def manage_saveKineticStylesheets(REQUEST=None):
00104         """Save kineticstylesheet data from form submission."""
00105 
00106 
00107 class IJSRegistry(Interface):
00108     """A tool for registering and evaluating script linkage."""
00109 
00110     id = Attribute('id',
00111                    """ The tool's ID.
00112 
00113                    o Must be set to 'portal_javascripts'.
00114                    """)
00115 
00116     def registerScript(id, expression='', inline=False, enabled=True):
00117         """Register a script."""
00118 
00119     def manage_saveScripts(REQUEST=None):
00120         """Save script data from form submission."""
00121 
00122     def manage_addScript(id, expression='', inline=False, enabled=True , REQUEST=None):
00123         """Add script from a ZMI form."""
00124 
00125     def manage_removeScript(id, REQUEST=None):
00126         """Remove script via the ZMI."""