org/opengroupware/pubexport/OGoPubResourceManager.java
/**
   * Lookup an OGoPubComponentDocument with the given name relative to the
   * container.
   * 
   * @param _name - name of component/page to look up
   * @param _ctx  - the context in which to lookup
   * @return an OGoPubComponentDocument or null if none was found
   */
Lookup an OGoPubComponentDocument with the given name relative to the
container.

@param _name - name of component/page to look up
@param _ctx  - the context in which to lookup
@return an OGoPubComponentDocument or null if none was found
Lookup an OGoPubComponentDocument with the given name relative to the container . @param _name - name of component / page to look up @param _ctx - the context in which to lookup @return an OGoPubComponentDocument or null if none was found
protected OGoPubComponentDocument primaryLookupPage
    (String _name, IGoContext _ctx)
  {
    IGoObject rdoc = (IGoObject) this.container;
    if (rdoc == null)
      log.error("resource manager has no container?: " + this);
    if (_name.indexOf('/') == -1) {
      rdoc = (IGoObject)(rdoc != null
        ? rdoc.lookupName(_name, _ctx, true /* acquire */) : null); 
    }
    else {
      if (_name.startsWith("/")) {
        rdoc = OGoPubWebSite.siteRootForObject(rdoc);
      }
      for (String pc: _name.split("/")) {
        if (rdoc == null)
          break;
        if (".".equals(pc) || "".equals(pc) || "/".equals(pc))
          continue;
        if ("..".equals(pc)) {
          rdoc = (IGoObject)IGoLocation.Utility.containerForObject(rdoc);
          continue;
        }
        rdoc = (IGoObject)IGoSecuredObject.Utility.lookupName
          (rdoc, pc, _ctx, true /* acquire */);
      }
    }
    if (rdoc instanceof OGoPubComponentDocument)
      return (OGoPubComponentDocument)rdoc;
    if (rdoc != null && log.isWarnEnabled()) {
      log.warn("document located for " + _name + " is not a page:\n" + 
          rdoc + "\n  dir: " + this.container);
    }
    return null;
  }
protected OGoPubComponentDocument primaryLookupPage ( String _name , IGoContext _ctx ) { IGoObject rdoc = ( IGoObject ) this . container ; if ( rdoc == null ) log . error ( "resource manager has no container?: " + this ) ; if ( _name . indexOf ( '/' ) == - 1 ) { rdoc = ( IGoObject ) ( rdoc != null ? rdoc . lookupName ( _name , _ctx , true /* acquire */ ) : null ) ; } else { if ( _name . startsWith ( "/" ) ) { rdoc = OGoPubWebSite . siteRootForObject ( rdoc ) ; } for ( String pc : _name . split ( "/" ) ) { if ( rdoc == null ) break ; if ( "." . equals ( pc ) || "" . equals ( pc ) || "/" . equals ( pc ) ) continue ; if ( ".." . equals ( pc ) ) { rdoc = ( IGoObject ) IGoLocation . Utility . containerForObject ( rdoc ) ; continue ; } rdoc = ( IGoObject ) IGoSecuredObject . Utility . lookupName ( rdoc , pc , _ctx , true /* acquire */ ) ; } } if ( rdoc instanceof OGoPubComponentDocument ) return ( OGoPubComponentDocument ) rdoc ; if ( rdoc != null && log . isWarnEnabled ( ) ) { log . warn ( "document located for " + _name + " is not a page:\n" + rdoc + "\n  dir: " + this . container ) ; } return null ; }
Lookup an OGoPubComponentDocument with the given name relative to the
 container.
Lookup an OGoPubComponentDocument with the given name relative to the container .
// isn't that ALWAYS the clientObject in _ctx? // hm, currently it is the folder, not the client object // for caching purposes, since the lookup is likely the same. but then // the OFS already caches keys // no separators in name, direct lookup // TBD: better use IGoSecuredObject.lookupName // TODO: consolidate the lookup // Note: we cannot use lookupPath(), this breaks lookup because it //       starts one too high => need to fix that //System.err.println("LOOKUP " + _name + " IN: " + rdoc); // Hm, this is because the user can use names like // "/contact/mypage.html". Which needs to be resolved against the // site root (for multisite OFS hierarchies) // => OFSSite object?! // Note: the site root is the same like the target hierarchy //System.err.println("  root: " + rdoc); //System.err.println("  GOT: " + rdoc);