- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.xpn.xwiki.api.XWiki.getDocument()
方法的一些代码示例,展示了XWiki.getDocument()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XWiki.getDocument()
方法的具体详情如下:
包路径:com.xpn.xwiki.api.XWiki
类名称:XWiki
方法名:getDocument
[英]Load a specific revision of a document
[中]加载文档的特定版本
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* Function to wrap a list of XWikiDocument into Document objects
*
* @param docs list of XWikiDocument
* @return list of Document objects
*/
public List<Document> wrapDocs(List< ? > docs)
{
List<Document> result = new ArrayList<Document>();
if (docs != null) {
for (java.lang.Object obj : docs) {
try {
if (obj instanceof XWikiDocument) {
XWikiDocument doc = (XWikiDocument) obj;
Document wrappedDoc = doc.newDocument(getXWikiContext());
result.add(wrappedDoc);
} else if (obj instanceof Document) {
result.add((Document) obj);
} else if (obj instanceof String) {
Document doc = getDocument(obj.toString());
if (doc != null) {
result.add(doc);
}
}
} catch (XWikiException ex) {
}
}
}
return result;
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* Loads an Document from the database. Rights are checked before sending back the document.
*
* @param fullName the full name of the XWiki document to be loaded
* @return a Document object or null if it is not accessible
* @throws XWikiException
*/
public Document getDocument(String fullName) throws XWikiException
{
DocumentReference reference;
// We ignore the passed full name if it's null to be backward compatible with previous behaviors.
if (fullName != null) {
// Note: We use the CurrentMixed Resolver since we want to use the default page name if the page isn't
// specified in the passed string, rather than use the current document's page name.
reference = this.currentMixedDocumentReferenceResolver.resolve(fullName);
} else {
reference = this.defaultDocumentReferenceResolver.resolve("");
}
return getDocument(reference);
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-search-lucene-api
new StringBuffer(this.wiki).append(":").append(this.space).append(".").append(this.name).toString();
try {
document = xwiki.getDocument(fullDocName);
if (document != null) {
this.url = document.getAttachmentURL(this.filename, "download");
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
/**
* <p>
* Get parent document for a given document.
* </p>
*
* @param doc document to get the parent from.
* @param xwikiApi the xwiki api.
* @return parent of the given document, null if none is specified.
* @throws XWikiException if getting the parent document has failed.
*/
public static Document getParentDocument(Document doc, com.xpn.xwiki.api.XWiki xwikiApi) throws XWikiException
{
if (StringUtils.isEmpty(doc.getParent())) {
return null;
}
/*
* This is ugly but we have to mimic the behavior of link generation: if the parent does not specify its space,
* use the current document space.
*/
String parentName = doc.getParent();
if (!parentName.contains(".")) {
parentName = doc.getSpace() + "." + parentName;
}
return xwikiApi.getDocument(parentName);
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* @param token The authentication token.
* @param spaceKey The space name.
* @return A list containing PageSummary objects.
* @throws Exception An invalid token is provided.
*/
public List getPages(String token, String spaceKey) throws Exception
{
XWikiXmlRpcUser user = XWikiUtils.checkToken(token, this.xwikiContext);
LOG.debug(String.format("User %s has called getPages()", user.getName()));
List result = new ArrayList();
List<String> pageNames = this.xwikiApi.getSpaceDocsName(spaceKey);
for (String pageName : pageNames) {
String pageFullName = String.format("%s.%s", spaceKey, pageName);
if (!this.xwikiApi.exists(pageFullName)) {
LOG.warn(String.format("[Page '%s' appears to be in space '%s' but no information is available.]",
pageName, spaceKey));
} else {
Document doc = this.xwikiApi.getDocument(pageFullName);
/* We only add pages we have the right to access */
if (doc != null) {
XWikiPageSummary pageSummary = DomainObjectFactory.createXWikiPageSummary(doc);
result.add(pageSummary.toRawMap());
}
}
}
return result;
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* Get information about a given space.
*
* @param token The authentication token.
* @param spaceKey The space name.
* @return A map representing a Space object.
* @throws Exception An invalid token is provided or the user doesn't have enough rights to access the space.
*/
public Map getSpace(String token, String spaceKey) throws Exception
{
XWikiXmlRpcUser user = XWikiUtils.checkToken(token, this.xwikiContext);
LOG.debug(String.format("User %s has called getSpace()", user.getName()));
if (!this.xwikiApi.getSpaces().contains(spaceKey)) {
throw new Exception(String.format("[Space '%s' does not exist]", spaceKey));
}
String spaceWebHomeId = String.format("%s.WebHome", spaceKey);
if (!this.xwikiApi.exists(spaceWebHomeId)) {
return DomainObjectFactory.createSpace(spaceKey).toRawMap();
} else {
Document spaceWebHome = this.xwikiApi.getDocument(spaceWebHomeId);
/*
* If doc is null, then we don't have the rights to access the document
*/
if (spaceWebHome != null) {
return DomainObjectFactory.createSpace(spaceWebHome).toRawMap();
} else {
throw new RuntimeException(String.format("[Space '%s' cannot be accessed]", spaceKey));
}
}
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
Document doc = xwikiApi.getDocument(pageId);
if (doc == null) {
throw new Exception(String.format("[Page '%s' cannot be accessed]", pageId));
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* Get the list of spaces.
*
* @param token The authentication token.
* @return A list of Maps that represent SpaceSummary objects.
* @throws Exception An invalid token is provided.
*/
public List getSpaces(String token) throws Exception
{
XWikiXmlRpcUser user = XWikiUtils.checkToken(token, this.xwikiContext);
LOG.debug(String.format("User %s has called getSpaces()", user.getName()));
List result = new ArrayList();
List<String> spaceKeys = this.xwikiApi.getSpaces();
for (String spaceKey : spaceKeys) {
String spaceWebHomeId = String.format("%s.WebHome", spaceKey);
if (!this.xwikiApi.exists(spaceWebHomeId)) {
result.add(DomainObjectFactory.createSpaceSummary(spaceKey).toRawMap());
} else {
Document spaceWebHome = this.xwikiApi.getDocument(spaceWebHomeId);
/*
* If doc is null, then we don't have the rights to access the document, and therefore to the space.
*/
if (spaceWebHome != null) {
result.add(DomainObjectFactory.createSpaceSummary(spaceWebHome).toRawMap());
}
}
}
return result;
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
Document doc = Utils.getXWikiApi(componentManager).getDocument(documentName);
if (doc != null) {
pages.getPageSummaries().add(
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* Get revision history of a page.
*
* @param token The authentication token.
* @param pageId The pageId in the 'Space.Page[?language=lang]' format.
* @return A list of maps representing PageHistorySummary objects.
* @throws Exception An invalid token is provided or if the page does not exist or the user has not the right to
* access it.
*/
public List getPageHistory(String token, String pageId) throws Exception
{
XWikiXmlRpcUser user = XWikiUtils.checkToken(token, this.xwikiContext);
LOG.debug(String.format("User %s has called getPageHistory()", user.getName()));
List result = new ArrayList();
Document doc = XWikiUtils.getDocument(this.xwikiApi, pageId, true);
Version[] versions = doc.getRevisions();
for (Version version : versions) {
Document docRevision = this.xwikiApi.getDocument(doc, version.toString());
/*
* The returned document has the right content but the wrong content update date, that is always equals to
* the current date. Don't know why.
*/
result.add(DomainObjectFactory.createXWikiPageHistorySummary(docRevision).toRawMap());
}
return result;
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
String pageFullName = String.format("%s.%s", spaceKey, pageName);
if (this.xwikiApi.exists(pageFullName)) {
Document doc = this.xwikiApi.getDocument(pageFullName);
if (doc != null) {
try {
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
"[Page '%s' appears to be in space '%s' but no information is available.]", pageName, spaceName));
} else {
Document childDoc = Utils.getXWikiApi(componentManager).getDocument(pageId);
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* Add a new space. It basically creates a SpaceKey.WebHome page with no content and the space title as its title.
*
* @param token The authentication token.
* @param spaceMap The map representing a Space object.
* @return The newly created space as a Space object.
* @throws Exception An invalid token is provided or the space cannot be created or it already exists and the user
* has not the rights to modify it
*/
public Map addSpace(String token, Map spaceMap) throws Exception
{
XWikiXmlRpcUser user = XWikiUtils.checkToken(token, this.xwikiContext);
LOG.debug(String.format("User %s has called addSpace()", user.getName()));
Space space = new Space(spaceMap);
if (this.xwikiApi.getSpaces().contains(space.getKey())) {
throw new Exception(String.format("[Space '%s' already exists]", space.getKey()));
}
String spaceWebHomeId = String.format("%s.WebHome", space.getKey());
Document spaceWebHome = this.xwikiApi.getDocument(spaceWebHomeId);
if (spaceWebHome != null) {
spaceWebHome.setContent("");
spaceWebHome.setTitle(space.getName());
spaceWebHome.save();
return DomainObjectFactory.createSpace(spaceWebHome).toRawMap();
} else {
throw new Exception(String.format(
"[Space cannot be created or it already exists and user '%s' has not the right to modify it]",
user.getName()));
}
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
@GET
public Space getSpace(@PathParam("wikiName") String wikiName, @PathParam("spaceName") String spaceName)
throws XWikiException
{
String database = Utils.getXWikiContext(componentManager).getDatabase();
/* This try is just needed for executing the finally clause. */
try {
Utils.getXWikiContext(componentManager).setDatabase(wikiName);
String homeId = Utils.getPageId(wikiName, spaceName, "WebHome");
Document home = null;
if (Utils.getXWikiApi(componentManager).exists(homeId)) {
home = Utils.getXWikiApi(componentManager).getDocument(homeId);
}
return DomainObjectFactory.createSpace(objectFactory, uriInfo.getBaseUri(), wikiName, spaceName, home);
} finally {
Utils.getXWikiContext(componentManager).setDatabase(database);
}
}
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
home = Utils.getXWikiApi(componentManager).getDocument(homeId);
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
spaceName));
} else {
Document doc = Utils.getXWikiApi(componentManager).getDocument(pageFullName);
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
Document doc = Utils.getXWikiApi(componentManager).getDocument(pageFullName);
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
Document doc = this.xwikiApi.getDocument(extendedId.getBasePageId());
doc = this.xwikiApi.getDocument(newPageId);
} else {
代码示例来源:origin: org.xwiki.platform/xwiki-platform-search-lucene-api
Document doc = xwikiApi.getDocument(pageId);
String title = doc.getDisplayTitle();
本文整理了Java中com.xpn.xwiki.api.XWiki.getClass()方法的一些代码示例,展示了XWiki.getClass()的具体用法。这些代码示例主要来源于Github/Sta
本文整理了Java中com.xpn.xwiki.api.XWiki.exists()方法的一些代码示例,展示了XWiki.exists()的具体用法。这些代码示例主要来源于Github/Stackov
本文整理了Java中com.xpn.xwiki.api.XWiki.getClassList()方法的一些代码示例,展示了XWiki.getClassList()的具体用法。这些代码示例主要来源于Gi
本文整理了Java中com.xpn.xwiki.api.XWiki.getDocument()方法的一些代码示例,展示了XWiki.getDocument()的具体用法。这些代码示例主要来源于Gith
本文整理了Java中com.xpn.xwiki.api.XWiki.hasAdminRights()方法的一些代码示例,展示了XWiki.hasAdminRights()的具体用法。这些代码示例主要来
本文整理了Java中com.xpn.xwiki.api.XWiki.()方法的一些代码示例,展示了XWiki.()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven
本文整理了Java中com.xpn.xwiki.api.XWiki.hasAccessLevel()方法的一些代码示例,展示了XWiki.hasAccessLevel()的具体用法。这些代码示例主要来
大家好,我在本地主机上有一个 xwiki,出于测试目的,我想通过编写一些简单的 jquery 脚本来测试 RESTful api: var username = "Admin"; var passw
有人有 xwiki 渲染框架的定制渲染器示例吗?我想要从 JSPWiki 转换为 XHTML,但 xwiki 生成的默认结果还不够。我需要应用一些逻辑来检查中间树中的 sibling / child
我想使用 XWiki 来记录一些过程,所以我下载了 xwiki-enterprise-installer-generic-5.0.1-standard.jar 并安装成功。当我运行 ./start_x
当 XWiki 搜索结果返回时,没有任何关于匹配上下文的指示。只有一个标题和一些元素返回的时间和人员。有没有办法改进结果以包含突出显示找到的匹配项的内容摘要? 最佳答案 是的,当然对于基于标准关键字的
我正在编写一个 Java 组件,用于构建维基中的所有页面。分配可以从 Java 服务组件中查看页面或空间的用户权限或组的最佳方法是什么?真的很难在 API 中找到这方面的详细信息。 最佳答案 您在AP
根据guide ,向 XWiki 添加新组件涉及将 jar 文件放入 XE_WAR_HOME/WEB-INF/lib。但是,我似乎需要在使用新组件之前重新启动 tomcat。有没有办法解决这个重启?组
我使用了XWiki Schema Definition使用 Eclipse XJC Binding Compiler 创建对象类模型。在 package-info.java 中创建以下命名空间 @ja
本文整理了Java中org.xwiki.rendering.listener.WrappingListener类的一些代码示例,展示了WrappingListener类的具体用法。这些代码示例主要来源
本文整理了Java中com.xpn.xwiki.api.XWiki类的一些代码示例,展示了XWiki类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从
本文整理了Java中com.xpn.xwiki.web.XWikiURLFactoryService类的一些代码示例,展示了XWikiURLFactoryService类的具体用法。这些代码示例主要来
本文整理了Java中org.xwiki.test.ui.XWikiWebDriver类的一些代码示例,展示了XWikiWebDriver类的具体用法。这些代码示例主要来源于Github/Stackov
本文整理了Java中org.xwiki.bridge.event.WikiDeletedEvent类的一些代码示例,展示了WikiDeletedEvent类的具体用法。这些代码示例主要来源于Githu
本文整理了Java中com.xpn.xwiki.plugin.XWikiDefaultPlugin类的一些代码示例,展示了XWikiDefaultPlugin类的具体用法。这些代码示例主要来源于Git
我是一名优秀的程序员,十分优秀!