- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.xpn.xwiki.api.XWiki
类的一些代码示例,展示了XWiki
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XWiki
类的具体详情如下:
包路径:com.xpn.xwiki.api.XWiki
类名称:XWiki
暂无
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
public XWikiXmlRpcApiImpl()
{
this.xwikiContext = getContext();
this.xwiki = this.xwikiContext.getWiki();
this.xwikiApi = new com.xpn.xwiki.api.XWiki(this.xwiki, this.xwikiContext);
}
代码示例来源: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
if (hasAccessLevel("view", this.defaultStringEntityReferenceSerializer.serialize(sourceDocumentReference))) {
String targetDocStringRef = this.defaultStringEntityReferenceSerializer.serialize(targetDocumentReference);
if (hasAccessLevel("edit", targetDocStringRef)
&& (!overwrite || !exists(targetDocumentReference) || hasAccessLevel("delete", targetDocStringRef))) {
resetHistory, overwrite, true, getXWikiContext());
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* Priviledge API to regenerate the links/backlinks table Normally links and backlinks are stored when a page is
* modified This function will regenerate all the backlinks This function can be long to run
*
* @throws XWikiException exception if the generation fails
*/
public void refreshLinks() throws XWikiException
{
if (hasAdminRights()) {
this.xwiki.refreshLinks(getXWikiContext());
}
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* API to check rights on the current document for the current user
*
* @param level right to check (view, edit, comment, delete)
* @return true if right is granted/false if not
*/
public boolean hasAccessLevel(String level)
{
return hasAccessLevel(level, getXWikiContext().getUser(), getXWikiContext().getDoc().getFullName());
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-search-lucene-api
XWiki xwikiApi = new XWiki(xwikiContext.getWiki(), xwikiContext);
if (xwikiApi.hasAccessLevel("view", pageId)) {
Document doc = xwikiApi.getDocument(pageId);
String title = doc.getDisplayTitle();
searchResult.setAuthorName(xwikiApi.getUserName(luceneSearchResult.getAuthor(), false));
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
if (!xwikiApi.exists(pageId)) {
throw new Exception(String.format("[Page '%s' doesn't exist]", pageId));
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
LOG.debug(String.format("User %s has called removeSpace()", user.getName()));
if (!this.xwikiApi.getSpaces().contains(spaceKey)) {
throw new Exception(String.format("[Space '%s' does not exist.]", spaceKey));
List<String> pageNames = this.xwikiApi.getSpaceDocsName(spaceKey);
for (String pageName : pageNames) {
String pageFullName = String.format("%s.%s", spaceKey, pageName);
if (this.xwikiApi.exists(pageFullName)) {
Document doc = this.xwikiApi.getDocument(pageFullName);
if (doc != null) {
try {
代码示例来源:origin: org.xwiki.platform/xwiki-platform-search-lucene-api
private List<SearchResult> getRelevantResults()
{
if (this.relevantResults == null) {
this.relevantResults = new ArrayList<SearchResult>();
TopDocs docs = this.results.topDocs();
for (int i = 0; i < docs.scoreDocs.length; i++) {
try {
SearchResult result =
new SearchResult(this.searcher.doc(docs.scoreDocs[i].doc), docs.scoreDocs[i].score, this.xwiki);
if (result.isWikiContent()) {
String prefixedFullName =
((EntityReferenceSerializer<String>)
Utils.getComponent(EntityReferenceSerializer.TYPE_STRING))
.serialize(result.getDocumentReference());
if (this.xwiki.exists(result.getDocumentReference())
&& this.xwiki.hasAccessLevel("view", this.context.getUser(), prefixedFullName)) {
this.relevantResults.add(result);
}
}
} catch (Exception e) {
LOGGER.error("Error getting search result", e);
}
}
}
return this.relevantResults;
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
page.setSyntaxId(xwikiApi.getDefaultDocumentSyntax());
boolean pageAlreadyExists = this.xwikiApi.exists(extendedId.getBasePageId());
Document doc = this.xwikiApi.getDocument(extendedId.getBasePageId());
this.xwikiApi.renamePage(doc, newPageId);
doc = this.xwikiApi.getDocument(newPageId);
} else {
代码示例来源: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
/**
* 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: com.xpn.xwiki.platform/xwiki-core
/**
* Get a specific class.
*
* @param token The authentication token.
* @param className The class name.
* @return A map representing a XWikiClass object.
* @throws Exception An invalid token is provided or if the given class does not exist.
*/
public Map getClass(String token, String className) throws Exception
{
XWikiXmlRpcUser user = XWikiUtils.checkToken(token, this.xwikiContext);
LOG.debug(String.format("User %s has called getClass()", user.getName()));
if (!this.xwikiApi.exists(className)) {
throw new Exception(String.format("[Class '%s' does not exist]", className));
}
com.xpn.xwiki.api.Class userClass = this.xwikiApi.getClass(className);
return DomainObjectFactory.createXWikiClass(userClass).toRawMap();
}
代码示例来源: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-rest-server
@GET
public Classes getClasses(@PathParam("wikiName") String wikiName,
@QueryParam("start") @DefaultValue("0") Integer start, @QueryParam("number") @DefaultValue("-1") Integer number)
throws XWikiException
{
String database = Utils.getXWikiContext(componentManager).getDatabase();
try {
Utils.getXWikiContext(componentManager).setDatabase(wikiName);
List<String> classNames = Utils.getXWikiApi(componentManager).getClassList();
Collections.sort(classNames);
RangeIterable<String> ri = new RangeIterable<String>(classNames, start, number);
Classes classes = objectFactory.createClasses();
for (String className : ri) {
com.xpn.xwiki.api.Class xwikiClass = Utils.getXWikiApi(componentManager).getClass(className);
classes.getClazzs().add(
DomainObjectFactory.createClass(objectFactory, uriInfo.getBaseUri(), wikiName, xwikiClass));
}
return classes;
} finally {
Utils.getXWiki(componentManager).setDatabase(database);
}
}
}
代码示例来源: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: org.xwiki.platform/xwiki-platform-search-lucene-api
pageName = result.getWiki() + ":" + result.getSpace() + "." + result.getName();
if (result.isWikiContent() && this.xwiki.exists(pageName)
&& this.xwiki.checkAccess(pageName, "view")) {
if (resultcount >= listStartIndex) {
relResults.add(result);
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
if (Utils.getXWikiApi(componentManager).hasAccessLevel("view", pageId)) {
SearchResult searchResult = objectFactory.createSearchResult();
searchResult.setType("page");
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
@GET
public Class getClass(@PathParam("wikiName") String wikiName, @PathParam("className") String className)
throws XWikiException
{
String database = Utils.getXWikiContext(componentManager).getDatabase();
try {
Utils.getXWikiContext(componentManager).setDatabase(wikiName);
com.xpn.xwiki.api.Class xwikiClass = Utils.getXWikiApi(componentManager).getClass(className);
if (xwikiClass == null) {
throw new WebApplicationException(Status.NOT_FOUND);
}
return DomainObjectFactory.createClass(objectFactory, uriInfo.getBaseUri(), wikiName, xwikiClass);
} finally {
Utils.getXWiki(componentManager).setDatabase(database);
}
}
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
if (!this.xwikiApi.exists(extendedId.getBasePageId())) {
return storePage(token, pageMap);
本文整理了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
我是一名优秀的程序员,十分优秀!