本文整理汇总了Java中com.google.enterprise.adaptor.Request类的典型用法代码示例。如果您正苦于以下问题:Java Request类的具体用法?Java Request怎么用?Java Request使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Request类属于com.google.enterprise.adaptor包,在下文中一共展示了Request类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doEmail
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
@VisibleForTesting
void doEmail(DocumentManagement documentManagement,
OpentextDocId opentextDocId, Node node,
Request request, Response response) throws IOException {
Metadata metadata = node.getMetadata();
if (metadata != null) {
List<AttributeGroup> attributeGroups = metadata.getAttributeGroups();
if (attributeGroups != null) {
for (AttributeGroup attributeGroup : attributeGroups) {
if (!"OTEmailProperties".equals(attributeGroup.getType())) {
continue;
}
cacheEmailMetadataDefinition(documentManagement, attributeGroup);
doAttributeGroup(
response, null, attributeGroup, this.emailAttributeDefinitions);
}
}
}
doDocument(documentManagement, opentextDocId, node, request, response);
}
开发者ID:googlegsa,项目名称:opentext,代码行数:21,代码来源:OpentextAdaptor.java
示例2: testGetDocContentMarkPublicTrue
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
@Test
public void testGetDocContentMarkPublicTrue() throws IOException {
Member owner = getMember(1001, "testuser1", "User");
NodeRights nodeRights = new NodeRights();
nodeRights.setOwnerRight(getNodeRight(owner.getID(), "Owner"));
SoapFactoryMock soapFactory = new SoapFactoryMock();
NodeMock node = new NodeMock(3143, "Folder Name", "Folder");
node.setStartPointId(2000);
node.setPath(node.getName());
soapFactory.documentManagementMock.addNode(node);
soapFactory.documentManagementMock
.setNodeRights(node.getID(), nodeRights);
soapFactory.memberServiceMock.addMember(owner);
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
config.overrideKey("adaptor.markAllDocsAsPublic", "true");
adaptor.init(context);
RecordingResponse response = new RecordingResponse();
Request request = new RequestMock("EnterpriseWS/Folder+Name:3143");
adaptor.getDocContent(request, response);
assertEquals(null, response.getAcl());
}
开发者ID:googlegsa,项目名称:opentext,代码行数:26,代码来源:OpentextAdaptorTest.java
示例3: testDoDocumentNoVersions
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
@Test
public void testDoDocumentNoVersions() throws IOException {
DocId docId = new DocId("2000/Document Name:3143");
OpentextDocId testDocId = new OpentextDocId(docId);
thrown.expect(RuntimeException.class);
thrown.expectMessage(
"Document does not support versions: " + testDocId);
SoapFactoryMock soapFactory = new SoapFactoryMock();
NodeMock documentNode = new NodeMock(3143, "Document Name");
documentNode.setIsVersionable(false);
soapFactory.documentManagementMock.addNode(documentNode);
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
adaptor.init(context);
Request request = new RequestMock(docId);
RecordingResponse response = new RecordingResponse();
DocumentManagement documentManagement =
soapFactory.newDocumentManagement("token");
adaptor.doDocument(documentManagement, testDocId,
documentNode, request, response);
}
开发者ID:googlegsa,项目名称:opentext,代码行数:27,代码来源:OpentextAdaptorTest.java
示例4: testDocWithExcludedNodeType
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
@Test
public void testDocWithExcludedNodeType() throws IOException {
SoapFactoryMock soapFactory = new SoapFactoryMock();
NodeMock documentNode =
new NodeMock(3143, "Title of Document", "Alias");
documentNode.setStartPointId(2000);
documentNode.setPath(documentNode.getName());
soapFactory.documentManagementMock.addNode(documentNode);
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
config.overrideKey("opentext.excludedNodeTypes", "Alias");
adaptor.init(context);
RecordingResponse response = new RecordingResponse();
Request request = new RequestMock("EnterpriseWS/Title+of+Document:3143");
adaptor.getDocContent(request, response);
assertEquals(RecordingResponse.State.NOT_FOUND, response.getState());
}
开发者ID:googlegsa,项目名称:opentext,代码行数:22,代码来源:OpentextAdaptorTest.java
示例5: getDocContent
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
@Override
public void getDocContent(Request request, Response response)
throws IOException {
long startMillis = System.currentTimeMillis();
log.entering("SharePointAdaptor", "getDocContent",
new Object[] {request, response});
DocId id = request.getDocId();
SiteAdaptor adptorForDocId = getAdaptorForDocId(id);
if (adptorForDocId == null) {
log.log(Level.FINE,
"responding not found as site adptor for {0} is null", id);
response.respondNotFound();
log.exiting("SharePointAdaptor", "getDocContent");
return;
}
if (id.equals(virtualServerDocId)) {
adptorForDocId.getVirtualServerDocContent(request, response);
} else {
adptorForDocId.getDocContent(request, response);
}
log.log(Level.FINE, "Duration: getDocContent {0} : {1,number,#} ms",
new Object[] {request.getDocId(),
System.currentTimeMillis() - startMillis});
log.exiting("SharePointAdaptor", "getDocContent");
}
开发者ID:googlegsa,项目名称:sharepoint,代码行数:27,代码来源:SharePointAdaptor.java
示例6: testExcludeMetadata
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
private void testExcludeMetadata(Metadata attrs, String excludedAttrs,
Metadata expected) throws Exception {
String path = START_PATH + "/aaa";
String objectId = DOCUMENT.pad("aaa");
insertDocument(path);
writeAttributes(objectId, attrs);
Map<String, String> configOverrides = (excludedAttrs == null)
? ImmutableMap.<String, String>of()
: ImmutableMap.of("documentum.excludedAttributes", excludedAttrs);
ByteArrayOutputStream boas = new ByteArrayOutputStream();
Request request = new MockRequest(docIdFromPath(path, objectId));
RecordingResponse response = getDocContent(boas, configOverrides, request);
assertEquals(expected, response.getMetadata());
}
开发者ID:googlegsa,项目名称:documentum,代码行数:18,代码来源:DocumentumAdaptorTest.java
示例7: getDocContent
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
@Override
public void getDocContent(Request req, Response resp) throws IOException {
log.entering("LdapAdaptor", "getDocContent", new Object[] {req, resp});
DocId id = req.getDocId();
ParsedDocId parsed = parseDocId(id);
if (parsed == null
|| !id.equals(makeDocId(parsed.serverNumber, parsed.dn))) {
log.warning(id + " is not a valid id generated by this adaptor.");
resp.respondNotFound();
return;
}
LdapPerson fetched;
try {
LdapServer server = servers.get(parsed.serverNumber);
fetched = server.fetchOne(parsed.dn);
if (null == fetched) {
log.finer("No results found for DN " + parsed.dn + "");
resp.respondNotFound();
log.exiting("LdapAdaptor", "getDocContent", 0);
return;
}
for (Entry<String, String> metadatum : fetched.asMetadata().entrySet()) {
resp.addMetadata(metadatum.getKey(), metadatum.getValue());
}
InputStream input = new ByteArrayInputStream(fetched.asDoc(
server.getDisplayTemplate()).getBytes(CHARSET));
resp.setContentType("text/html; charset=" + CHARSET.name() + "");
IOHelper.copyStream(input, resp.getOutputStream());
log.exiting("LdapAdaptor", "getDocContent", 1);
} catch (InterruptedNamingException e) {
log.exiting("LdapAdaptor", "getDocContent", 2);
throw new IOException(e);
}
}
开发者ID:googlegsa,项目名称:ldap,代码行数:37,代码来源:LdapAdaptor.java
示例8: testGetDocContentIndexFoldersTrue
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
@Test
public void testGetDocContentIndexFoldersTrue() throws IOException {
Member owner = getMember(1001, "testuser1", "User");
NodeRights nodeRights = new NodeRights();
nodeRights.setOwnerRight(getNodeRight(owner.getID(), "Owner"));
SoapFactoryMock soapFactory = new SoapFactoryMock();
NodeMock node = new NodeMock(3143, "Folder Name", "Folder");
node.setStartPointId(2000);
node.setPath(node.getName());
soapFactory.documentManagementMock.addNode(node);
soapFactory.documentManagementMock
.setNodeRights(node.getID(), nodeRights);
soapFactory.memberServiceMock.addMember(owner);
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
config.overrideKey("opentext.indexFolders", "true");
adaptor.init(context);
RecordingResponse response = new RecordingResponse();
Request request = new RequestMock("EnterpriseWS/Folder+Name:3143");
adaptor.getDocContent(request, response);
assertEquals("http://localhost/otcs/livelink.exe"
+ "?func=ll&objAction=properties&objId=3143",
response.getDisplayUrl().toString());
assertFalse(response.isNoIndex());
}
开发者ID:googlegsa,项目名称:opentext,代码行数:29,代码来源:OpentextAdaptorTest.java
示例9: testGetDocContentIndexFoldersFalse
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
@Test
public void testGetDocContentIndexFoldersFalse() throws IOException {
Member owner = getMember(1001, "testuser1", "User");
NodeRights nodeRights = new NodeRights();
nodeRights.setOwnerRight(getNodeRight(owner.getID(), "Owner"));
SoapFactoryMock soapFactory = new SoapFactoryMock();
NodeMock node = new NodeMock(3143, "Folder Name", "Folder");
node.setStartPointId(2000);
node.setPath(node.getName());
soapFactory.documentManagementMock.addNode(node);
soapFactory.documentManagementMock
.setNodeRights(node.getID(), nodeRights);
soapFactory.memberServiceMock.addMember(owner);
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
config.overrideKey("opentext.indexFolders", "false");
adaptor.init(context);
RecordingResponse response = new RecordingResponse();
Request request = new RequestMock("EnterpriseWS/Folder+Name:3143");
adaptor.getDocContent(request, response);
assertEquals("http://localhost/otcs/livelink.exe"
+ "?func=ll&objAction=properties&objId=3143",
response.getDisplayUrl().toString());
assertTrue(response.isNoIndex());
assertEquals(
expectedMetadata(
ImmutableMap.of(
"ID", "3143",
"Name", "Folder Name",
"SubType", "Folder",
"VolumeID", "0")),
response.getMetadata());
}
开发者ID:googlegsa,项目名称:opentext,代码行数:37,代码来源:OpentextAdaptorTest.java
示例10: testGetDocContentMarkPublicFalse
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
@Test
public void testGetDocContentMarkPublicFalse() throws IOException {
Member owner = getMember(1001, "testuser1", "User");
NodeRights nodeRights = new NodeRights();
nodeRights.setOwnerRight(getNodeRight(owner.getID(), "Owner"));
SoapFactoryMock soapFactory = new SoapFactoryMock();
NodeMock node = new NodeMock(3143, "Folder Name", "Folder");
node.setStartPointId(2000);
node.setPath(node.getName());
soapFactory.documentManagementMock.addNode(node);
soapFactory.documentManagementMock
.setNodeRights(node.getID(), nodeRights);
soapFactory.memberServiceMock.addMember(owner);
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
config.overrideKey("adaptor.markAllDocsAsPublic", "false");
adaptor.init(context);
RecordingResponse response = new RecordingResponse();
Request request = new RequestMock("EnterpriseWS/Folder+Name:3143");
adaptor.getDocContent(request, response);
Acl expected = new Acl.Builder()
.setPermitUsers(Sets.newHashSet(newUserPrincipal("testuser1")))
.build();
assertEquals(expected, response.getAcl());
}
开发者ID:googlegsa,项目名称:opentext,代码行数:29,代码来源:OpentextAdaptorTest.java
示例11: testDoDocumentCws
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
@Test
public void testDoDocumentCws() throws IOException {
DocId docId = new DocId("2000/Document:3143");
OpentextDocId testDocId = new OpentextDocId(docId);
SoapFactoryMock soapFactory = new SoapFactoryMock();
NodeMock documentNode =
new NodeMock(3143, "Title of Document", "Document");
documentNode.setVersion(1, "text/plain",
new GregorianCalendar(2015, 1, 3, 9, 42, 42));
soapFactory.documentManagementMock.addNode(documentNode);
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
config.overrideKey("opentext.indexing.downloadMethod", "webservices");
adaptor.init(context);
Request request = new RequestMock(docId);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
RecordingResponse response = new RecordingResponse(baos);
DocumentManagement documentManagement =
soapFactory.newDocumentManagement("token");
adaptor.doDocument(documentManagement, testDocId,
documentNode, request, response);
assertEquals("text/plain", response.getContentType());
assertEquals("this is the content", baos.toString(UTF_8.name()));
}
开发者ID:googlegsa,项目名称:opentext,代码行数:29,代码来源:OpentextAdaptorTest.java
示例12: testDoDocumentContentServer
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
@Test
public void testDoDocumentContentServer() throws IOException {
DocId docId = new DocId("2000/Document:3143");
OpentextDocId testDocId = new OpentextDocId(docId);
SoapFactoryMock soapFactory = new SoapFactoryMock();
NodeMock documentNode =
new NodeMock(3143, "Title of Document", "Document");
documentNode.setVersion(1, "text/plain",
new GregorianCalendar(2015, 1, 3, 9, 42, 42));
soapFactory.documentManagementMock.addNode(documentNode);
HttpServer server = startServer("this is the web-based content");
try {
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
config.overrideKey("opentext.indexing.downloadMethod", "contentserver");
config.overrideKey("opentext.indexing.contentServerUrl",
"http://127.0.0.1:" + server.getAddress().getPort() + "/");
adaptor.init(context);
Request request = new RequestMock(docId);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
RecordingResponse response = new RecordingResponse(baos);
DocumentManagement documentManagement =
soapFactory.newDocumentManagement("token");
adaptor.doDocument(documentManagement, testDocId,
documentNode, request, response);
assertEquals("text/plain", response.getContentType());
assertEquals("this is the web-based content",
baos.toString(UTF_8.name()));
} finally {
server.stop(0);
}
}
开发者ID:googlegsa,项目名称:opentext,代码行数:38,代码来源:OpentextAdaptorTest.java
示例13: testDoDocumentContentHandler
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
@Test
public void testDoDocumentContentHandler() throws IOException {
DocId docId = new DocId("2000/Document:3143");
OpentextDocId testDocId = new OpentextDocId(docId);
SoapFactoryMock soapFactory = new SoapFactoryMock();
NodeMock documentNode =
new NodeMock(3143, "Title of Document", "Document");
documentNode.setVersion(1, "text/plain",
new GregorianCalendar(2015, 1, 3, 9, 42, 42));
soapFactory.documentManagementMock.addNode(documentNode);
HttpServer server = startServer("this is the handler content");
try {
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
config.overrideKey("opentext.indexing.downloadMethod",
"contenthandler");
config.overrideKey("opentext.indexing.contentHandlerUrl",
"http://127.0.0.1:" + server.getAddress().getPort() + "/");
adaptor.init(context);
Request request = new RequestMock(docId);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
RecordingResponse response = new RecordingResponse(baos);
DocumentManagement documentManagement =
soapFactory.newDocumentManagement("token");
adaptor.doDocument(documentManagement, testDocId,
documentNode, request, response);
assertEquals("text/plain", response.getContentType());
assertEquals("this is the handler content", baos.toString(UTF_8.name()));
} finally {
server.stop(0);
}
}
开发者ID:googlegsa,项目名称:opentext,代码行数:38,代码来源:OpentextAdaptorTest.java
示例14: testDoDocumentEmpty
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
@Test
public void testDoDocumentEmpty() throws IOException {
DocId docId = new DocId("2000/Document:3143");
OpentextDocId testDocId = new OpentextDocId(docId);
SoapFactoryMock soapFactory = new SoapFactoryMock();
NodeMock documentNode =
new NodeMock(3143, "Title of Document", "Document");
documentNode.setVersion(1, "text/plain",
new GregorianCalendar(2015, 1, 3, 9, 42, 42));
documentNode.getVersion().setFileDataSize(0L);
soapFactory.documentManagementMock.addNode(documentNode);
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
adaptor.init(context);
Request request = new RequestMock(docId);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
RecordingResponse response = new RecordingResponse(baos);
DocumentManagement documentManagement =
soapFactory.newDocumentManagement("token");
adaptor.doDocument(documentManagement, testDocId,
documentNode, request, response);
assertNull(response.getContentType());
assertEquals("", baos.toString(UTF_8.name()));
}
开发者ID:googlegsa,项目名称:opentext,代码行数:29,代码来源:OpentextAdaptorTest.java
示例15: testDoDocumentLarge
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
@Test
public void testDoDocumentLarge() throws IOException {
DocId docId = new DocId("2000/Document:3143");
OpentextDocId testDocId = new OpentextDocId(docId);
SoapFactoryMock soapFactory = new SoapFactoryMock();
NodeMock documentNode =
new NodeMock(3143, "Title of Document", "Document");
documentNode.setVersion(1, "text/plain",
new GregorianCalendar(2015, 1, 3, 9, 42, 42));
documentNode.getVersion().setFileDataSize(3L << 30);
soapFactory.documentManagementMock.addNode(documentNode);
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
adaptor.init(context);
Request request = new RequestMock(docId);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
RecordingResponse response = new RecordingResponse(baos);
DocumentManagement documentManagement =
soapFactory.newDocumentManagement("token");
adaptor.doDocument(documentManagement, testDocId,
documentNode, request, response);
assertNull(response.getContentType());
assertEquals("", baos.toString(UTF_8.name()));
}
开发者ID:googlegsa,项目名称:opentext,代码行数:29,代码来源:OpentextAdaptorTest.java
示例16: testDoDocumentNotModified
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
@Test
public void testDoDocumentNotModified() throws IOException {
XMLGregorianCalendar fileModifyDate =
getXmlGregorianCalendar(2015, 6, 6, 12, 12, 12);
Date lastAccessTime = new Date(
new GregorianCalendar(2016, 6, 6, 12, 12, 12).getTimeInMillis());;
DocId docId = new DocId("2000/Document:3143");
OpentextDocId testDocId = new OpentextDocId(docId);
SoapFactoryMock soapFactory = new SoapFactoryMock();
NodeMock documentNode =
new NodeMock(3143, "Title of Document", "Document");
documentNode.setVersion(1, "text/plain",
new GregorianCalendar(2015, 1, 3, 9, 42, 42));
documentNode.getVersion().setFileModifyDate(fileModifyDate);
soapFactory.documentManagementMock.addNode(documentNode);
OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
AdaptorContext context = ProxyAdaptorContext.getInstance();
Config config = initConfig(adaptor, context);
adaptor.init(context);
Request request = new RequestMock(docId, lastAccessTime);
RecordingResponse response = new RecordingResponse();
DocumentManagement documentManagement =
soapFactory.newDocumentManagement("token");
adaptor.doDocument(documentManagement, testDocId,
documentNode, request, response);
assertNull(response.getContentType());
assertEquals(RecordingResponse.State.NO_CONTENT, response.getState());
}
开发者ID:googlegsa,项目名称:opentext,代码行数:33,代码来源:OpentextAdaptorTest.java
示例17: getDocContent
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
private RecordingResponse getDocContent(ByteArrayOutputStream boas,
Map<String, ?> configOverrides, Request request)
throws DfException, IOException {
DocumentumAdaptor adaptor = getObjectUnderTest(configOverrides);
RecordingResponse response = new RecordingResponse(boas);
adaptor.getDocContent(request, response);
return response;
}
开发者ID:googlegsa,项目名称:documentum,代码行数:9,代码来源:DocumentumAdaptorTest.java
示例18: testFolderMetadata
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
private void testFolderMetadata(Metadata attrs,
Map<String, String> configOverrides, Metadata expected) throws Exception {
String now = getNowPlusMinutes(0);
String name = "FFF1";
String folderId = FOLDER.pad(name);
String folder = START_PATH + "/" + name;
insertFolder(now, folderId, folder);
writeAttributes(folderId, attrs);
ByteArrayOutputStream boas = new ByteArrayOutputStream();
Request request = new MockRequest(docIdFromPath(folder, folderId));
RecordingResponse response = getDocContent(boas, configOverrides, request);
assertEquals(expected, response.getMetadata());
}
开发者ID:googlegsa,项目名称:documentum,代码行数:16,代码来源:DocumentumAdaptorTest.java
示例19: getDocContent
import com.google.enterprise.adaptor.Request; //导入依赖的package包/类
/** This adaptor does not serve documents. */
@Override
public void getDocContent(Request req, Response resp) throws IOException {
resp.respondNotFound();
}
开发者ID:googlegsa,项目名称:activedirectory,代码行数:6,代码来源:AdAdaptor.java
示例20: getListDocContent
import com.google.enterprise.adaptor.Request; //导入依赖的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
注:本文中的com.google.enterprise.adaptor.Request类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论