Logo Search packages:      
Sourcecode: zope-emarket version File versions

def EMarket::EMarket::EMarket::constructAbsURL (   self,
  meta_type,
  parents,
  path,
  base,
  rel 
)


    Construct an Absolute URL based on:

    meta_type: the metatype of the object, higher in the object tree
       relative to which 'rel' is based

    parents: the PARENTS of the current object

    path: the PATH_INFO of the current object

    base: the BASE0 from Zope

    rel: the path, relative to the object with the given meta_type.
    

Definition at line 659 of file EMarket.py.

00659                                                                   :
        """

            Construct an Absolute URL based on:

            meta_type: the metatype of the object, higher in the object tree
               relative to which 'rel' is based

            parents: the PARENTS of the current object

            path: the PATH_INFO of the current object

            base: the BASE0 from Zope

            rel: the path, relative to the object with the given meta_type.
            
        """
        # put a comment here to make python-mode happy.....
        
        foundIndex = -1  # nothing found yet...
        
        for index in range(len(parents)):
            item = parents[index]

            if item.meta_type == meta_type:
                foundIndex = index
                break
        
        while path[:1]=='/': path=path[1:]
        while path[-1:]=='/': path=path[:-1]
        path=string.split(path,'/')[:-1]

        if foundIndex == 0:
            newPath = path
        elif foundIndex == -1:
            raise EMarketError  # there was no object with the given meta_type.
        else:
            newPath=path[:-foundIndex]

        if base:
            return base+'/'+string.join(newPath,'/') + '/' + rel
        else:
            return string.join(newPath,'/') + '/' + rel

    def constructCookieURL(self, REQUEST, parents, path):


Generated by  Doxygen 1.6.0   Back to index