当前位置: 首页>>代码示例>>Java>>正文


Java Response.setAcl方法代码示例

本文整理汇总了Java中com.google.enterprise.adaptor.Response.setAcl方法的典型用法代码示例。如果您正苦于以下问题:Java Response.setAcl方法的具体用法?Java Response.setAcl怎么用?Java Response.setAcl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.enterprise.adaptor.Response的用法示例。


在下文中一共展示了Response.setAcl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getACL

import com.google.enterprise.adaptor.Response; //导入方法依赖的package包/类
/** Supplies the document ACL in the response.
 * @throws DfException */
private void getACL(Response resp, IDfSysObject sysObject, DocId id)
    throws DfException {
  String aclId = sysObject.getACL().getObjectId().toString();
  logger.log(Level.FINER, "ACL for id {0} is {1}", new Object[] {id, aclId});
  resp.setAcl(new Acl.Builder().setInheritFrom(new DocId(aclId)).build());
}
 
开发者ID:googlegsa,项目名称:documentum,代码行数:9,代码来源:DocumentumAdaptor.java

示例2: getListDocContent

import com.google.enterprise.adaptor.Response; //导入方法依赖的package包/类
private void getListDocContent(Request request, Response response,
    String id) throws IOException {
  log.entering("SiteAdaptor", "getListDocContent",
      new Object[] {request, response, id});
  com.microsoft.schemas.sharepoint.soap.List l
      = siteDataClient.getContentList(id);
  Web w = siteDataClient.getContentWeb();

  if (TrueFalseType.TRUE.equals(l.getMetadata().getNoIndex())
      || isWebNoIndex(new CachedWeb(w))) {
    log.fine("Document marked for NoIndex");
    response.respondNotFound();
    log.exiting("SiteAdaptor", "getListDocContent");
    return;
  }

  boolean allowAnonymousAccess
      = isAllowAnonymousReadForList(new CachedList(l))
      && isAllowAnonymousPeekForWeb(new CachedWeb(w))
      && (!isDenyAnonymousAccessOnVirtualServer());

  if (!allowAnonymousAccess) {
    String scopeId
        = l.getMetadata().getScopeID().toLowerCase(Locale.ENGLISH);
    String webScopeId
        = w.getMetadata().getScopeID().toLowerCase(Locale.ENGLISH);

    DocId rootFolderDocId
        = encodeDocId(l.getMetadata().getRootFolder());

    Acl.Builder acl;
    if (scopeId.equals(webScopeId)) {
      acl = new Acl.Builder().setInheritFrom(new DocId(webUrl));
    } else {
      List<Permission> permissions
          = l.getACL().getPermissions().getPermission();
      acl = generateAcl(permissions, LIST_ITEM_MASK)
          .setInheritFrom(siteDocId, SITE_COLLECTION_ADMIN_FRAGMENT);
    }
    response.setAcl(new Acl.Builder().setInheritFrom(rootFolderDocId)
        .setInheritanceType(Acl.InheritanceType.PARENT_OVERRIDES)
        .build());
    context.getAsyncDocIdPusher().pushNamedResource(rootFolderDocId,
            acl.setInheritanceType(Acl.InheritanceType.PARENT_OVERRIDES)
                .build());
  }

  response.addMetadata(METADATA_OBJECT_TYPE,
      ObjectType.LIST.value());
  response.addMetadata(METADATA_PARENT_WEB_TITLE,
      w.getMetadata().getTitle());
  response.addMetadata(METADATA_LIST_GUID, l.getMetadata().getID());

  response.setDisplayUrl(sharePointUrlToUri(
        "/".equals(l.getMetadata().getDefaultViewUrl()) 
        ? l.getMetadata().getRootFolder() 
        : l.getMetadata().getDefaultViewUrl()));
  String lastModified = l.getMetadata().getLastModified();
  try {
    response.setLastModified(
        listLastModifiedDateFormat.get().parse(lastModified));
  } catch (ParseException ex) {
    log.log(Level.INFO, "Could not parse LastModified: {0}", lastModified);
  }
  HtmlResponseWriter writer = createHtmlResponseWriter(response);
  writer.start(request.getDocId(), ObjectType.LIST,
      l.getMetadata().getTitle());
  processFolder(id, "", writer);
  writer.finish();
  log.exiting("SiteAdaptor", "getListDocContent");
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:72,代码来源:SharePointAdaptor.java

示例3: getAspxDocContent

import com.google.enterprise.adaptor.Response; //导入方法依赖的package包/类
private void getAspxDocContent(Request request, Response response)
    throws IOException {
  log.entering("SiteAdaptor", "getAspxDocContent",
      new Object[] {request, response});

  CachedWeb w = rareModCache.getWeb(siteDataClient);
  if (isWebNoIndex(w)) {
    log.fine("Document marked for NoIndex");
    response.respondNotFound();
    log.exiting("SiteAdaptor", "getAspxDocContent");
    return;
  }

  String aspxId = request.getDocId().getUniqueId();
  String parentId = aspxId.substring(0, aspxId.lastIndexOf('/'));
  boolean isDirectChild = webUrl.equalsIgnoreCase(parentId);
  // Check for valid ASPX pages
  // Process only direct child for current web
  if (!isDirectChild) {
    // Alternative approach to this string comparison is to make a
    // additional web service call for SiteData.GetContentWeb and
    // check if ASPX page is available under Web.getFPFolder().getFiles()
    log.log(Level.FINE, "Document [{0}] is not a direct child of Web [{1}]",
        new Object[] {aspxId, webUrl});
    response.respondNotFound();
    log.exiting("SiteAdaptor", "getAspxDocContent");
    return;
  }

  boolean allowAnonymousAccess
      = isAllowAnonymousReadForWeb(w)
      // Check if anonymous access is denied by web application policy
      && (!isDenyAnonymousAccessOnVirtualServer());
  if (!allowAnonymousAccess) {
    response.setAcl(new Acl.Builder()
        .setInheritFrom(new DocId(parentId))
        .build());
  }
  response.addMetadata(METADATA_OBJECT_TYPE, "Aspx");      
  response.addMetadata(METADATA_PARENT_WEB_TITLE, w.webTitle);
  getFileDocContent(request, response, true);
  log.exiting("SiteAdaptor", "getAspxDocContent");
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:44,代码来源:SharePointAdaptor.java


注:本文中的com.google.enterprise.adaptor.Response.setAcl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。