cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1688701 - in /cxf/web: pom.xml src/main/java/org/apache/cxf/cwiki/SiteExporter.java src/main/resources/confluence-rest.wadl
Date Wed, 01 Jul 2015 18:23:04 GMT
Author: dkulp
Date: Wed Jul  1 18:23:03 2015
New Revision: 1688701

URL: http://svn.apache.org/r1688701
Log:
Start flipping to REST 

Added:
    cxf/web/src/main/resources/confluence-rest.wadl
Modified:
    cxf/web/pom.xml
    cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java

Modified: cxf/web/pom.xml
URL: http://svn.apache.org/viewvc/cxf/web/pom.xml?rev=1688701&r1=1688700&r2=1688701&view=diff
==============================================================================
--- cxf/web/pom.xml (original)
+++ cxf/web/pom.xml Wed Jul  1 18:23:03 2015
@@ -49,6 +49,16 @@
         </dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+            <version>${cxf.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-rs-client</artifactId>
+            <version>${cxf.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-transports-http</artifactId>
             <version>${cxf.version}</version>
         </dependency>
@@ -61,6 +71,11 @@
             <artifactId>tagsoup</artifactId>
             <version>1.2.1</version>
         </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-core</artifactId>
+            <version>2.5.4</version>
+        </dependency>
 
         <dependency>
             <groupId>org.testng</groupId>
@@ -111,6 +126,30 @@
                 </plugin>
             </plugins>
         </pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.cxf</groupId>
+                <artifactId>cxf-wadl2java-plugin</artifactId>
+                <version>${cxf.version}</version>
+                <executions>
+                    <execution>
+                        <id>generate-sources</id>
+                        <phase>generate-sources</phase>
+                        <configuration>
+                            <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
+                            <wadlOptions>
+                                <wadlOption>
+                                    <wadl>${basedir}/src/main/resources/confluence-rest.wadl</wadl>
+                                </wadlOption>
+                            </wadlOptions>
+                        </configuration>
+                        <goals>
+                            <goal>wadl2java</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
     </build>
 
 

Modified: cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java
URL: http://svn.apache.org/viewvc/cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java?rev=1688701&r1=1688700&r2=1688701&view=diff
==============================================================================
--- cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java (original)
+++ cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java Wed Jul  1 18:23:03 2015
@@ -71,6 +71,11 @@ import org.xml.sax.ContentHandler;
 import org.xml.sax.InputSource;
 import org.xml.sax.XMLReader;
 
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+
+
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.util.Base64Utility;
 import org.apache.cxf.helpers.CastUtils;
@@ -79,6 +84,7 @@ import org.apache.cxf.helpers.FileUtils;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.interceptor.LoggingInInterceptor;
 import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
 import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.cxf.transport.http.HTTPConduit;
 import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
@@ -89,6 +95,8 @@ import org.apache.velocity.runtime.resou
 import org.ccil.cowan.tagsoup.Parser;
 import org.ccil.cowan.tagsoup.XMLWriter;
 
+import application.ContentResource;
+
 /**
  * 
  */
@@ -96,8 +104,9 @@ public class SiteExporter implements Run
 
     static final String HOST = "https://cwiki.apache.org";
     static final String ROOT = HOST + "/confluence";
-    static final String RPC_ROOT = "/rpc/soap-axis/confluenceservice-v";
+    static final String RPC_ROOT = "/rpc/soap-axis/confluenceservice-v";    
     static final String SOAPNS = "http://soap.rpc.confluence.atlassian.com";
+    static final String REST_API = ROOT + "/rest/api";
     
     static final String SEPARATOR = "&nbsp;&gt;&nbsp;";
     
@@ -116,6 +125,7 @@ public class SiteExporter implements Run
     static File rootOutputDir = new File(".");
     static String loginToken;
     static Dispatch<Document> dispatch;
+    static ContentResource contentResource;
     static AtomicInteger asyncCount = new AtomicInteger();
     static Map<String, Space> spaces = new ConcurrentHashMap<String, Space>();
     static List<SiteExporter> siteExporters;
@@ -192,6 +202,13 @@ public class SiteExporter implements Run
         outputDir.mkdirs();
     }
     
+    public static synchronized ContentResource getContentResource() {
+        if (contentResource == null) {
+            contentResource = JAXRSClientFactory.create(REST_API, ContentResource.class,

+                                                        userName, password, null);
+        }
+        return contentResource;
+    }
     public static synchronized Dispatch<Document> getDispatch() {
         if (dispatch == null) {
             Service service = Service.create(new QName(SOAPNS, "Service"));
@@ -254,6 +271,7 @@ public class SiteExporter implements Run
         //forcePage("JavaDoc");
         //forcePage("DOSGi Architecture");
         //forcePage("Book In One Page");
+        //forcePage("Security");
         //forcePage("FAQ");
         
         /*
@@ -718,41 +736,26 @@ public class SiteExporter implements Run
         return content;
     }
 
-    private String renderPage(AbstractPage p) throws ParserConfigurationException {
-        Document doc = DOMUtils.newDocument();
-        Element el = doc.createElementNS(SOAPNS, "ns1:renderContent");
-        Element el2 = doc.createElement("in0");
-        el.appendChild(el2);
-        el2.setTextContent(loginToken);
-        el2 = doc.createElement("in1");
-        el.appendChild(el2);
-        el2.setTextContent(spaceKey);
-        
-        el2 = doc.createElement("in2");
-        el.appendChild(el2);
-        el2.setTextContent(p.getId());
-
-        el2 = doc.createElement("in3");
-        el.appendChild(el2);
-
-        el2 = doc.createElement("in4");  //apachesoap map
-        el.appendChild(el2);
-
-        Element el4 = doc.createElement("item");
-        el2.appendChild(el4);
-        
-        Element el3 = doc.createElement("key");
-        el3.setTextContent("style");
-        el4.appendChild(el3);
-        el3 = doc.createElement("value");
-        el3.setTextContent("clean");
-        el4.appendChild(el3);
-
-        
-        doc.appendChild(el);
-        doc = getDispatch().invoke(doc);
-        
-        return doc.getDocumentElement().getFirstChild().getTextContent().trim();
+    private String renderPage(AbstractPage p) throws ParserConfigurationException, IOException
{
+        ContentResource content = getContentResource();
+        InputStream ins = content.getContentById(p.getId(), null, null, "body.export_view")
+                .readEntity(InputStream.class);
+        
+        JsonParser parser = new JsonFactory().createParser(ins);
+        JsonToken tok = parser.nextToken();
+        boolean inExportView = false;
+        while (tok != null) {
+            if (tok == JsonToken.FIELD_NAME) {
+                if (parser.getCurrentName().equals("export_view")) {
+                    inExportView = true;
+                }
+            } else if (tok == JsonToken.VALUE_STRING && inExportView && parser.getCurrentName().equals("value"))
{
+                return parser.getText();
+            }
+            tok = parser.nextToken();
+        }
+        System.out.println("No text for page \"" + p.getTitle() + "\"");
+        return "";
     }
 
     public String unwrap(String v) throws Exception {
@@ -1068,8 +1071,11 @@ public class SiteExporter implements Run
         parser.setContentHandler(createContentHandler(page, w, id, divCls));
         parser.parse(new InputSource(new StringReader(content)));
         content = w.toString();
-        content = content.substring("<html><body>".length());
-        content = content.substring(0, content.lastIndexOf("</body></html>"));
+        
+        if (content.indexOf("html>") != -1) {
+            content = content.substring("<html><body>".length());
+            content = content.substring(0, content.lastIndexOf("</body></html>"));
+        }
         
         int idx = content.indexOf('>');
         if (idx != -1

Added: cxf/web/src/main/resources/confluence-rest.wadl
URL: http://svn.apache.org/viewvc/cxf/web/src/main/resources/confluence-rest.wadl?rev=1688701&view=auto
==============================================================================
--- cxf/web/src/main/resources/confluence-rest.wadl (added)
+++ cxf/web/src/main/resources/confluence-rest.wadl Wed Jul  1 18:23:03 2015
@@ -0,0 +1,451 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<application xmlns="http://wadl.dev.java.net/2009/02">
+    <resources base="https://cwiki.apache.org/confluence/rest/api/latest/">
+        <resource path="/content">
+            <method name="POST" id="createContent">
+                <request>
+                    <representation mediaType="application/json"/>
+                </request>
+                <response>
+                    <representation mediaType="application/json"/>
+                </response>
+            </method>
+            <method name="GET" id="getContent">
+                <request>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="page"
type="xs:string" style="query" name="type"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string"
style="query" name="spaceKey"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string"
style="query" name="title"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string"
style="query" name="status"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string"
style="query" name="postingDay"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="" type="xs:string"
style="query" name="expand"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int" style="query"
name="start"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="25" type="xs:int"
style="query" name="limit"/>
+                </request>
+                <response>
+                    <representation mediaType="application/json"/>
+                </response>
+            </method>
+            <resource path="/{id}">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="id"/>
+                <method name="GET" id="getContentById">
+                    <request>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string"
style="query" name="status"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int"
style="query" name="version"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="history,space,version"
type="xs:string" style="query" name="expand"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+                <method name="PUT" id="update">
+                    <request>
+                        <representation mediaType="application/json"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+                <method name="DELETE" id="delete">
+                    <request>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string"
style="query" name="status"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+            <resource path="/{id}/history/{version}/macro/hash/{hash}">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="id"/>
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int" style="template"
name="version"/>
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="hash"/>
+                <method name="GET" id="getMacroBodyByHash">
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+            <resource path="/{id}/history/{version}/macro/id/{macroId}">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="macroId"/>
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="id"/>
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int" style="template"
name="version"/>
+                <method name="GET" id="getMacroBodyByMacroId">
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+            <resource path="/{id}/history">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="id"/>
+                <method name="GET" id="getHistory">
+                    <request>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="previousVersion,nextVersion,lastUpdated"
type="xs:string" style="query" name="expand"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+            <resource path="/search">
+                <method name="GET" id="search">
+                    <request>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string"
style="query" name="cql"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string"
style="query" name="cqlcontext"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default=""
type="xs:string" style="query" name="expand"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int"
style="query" name="start"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="25"
type="xs:int" style="query" name="limit"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+        </resource>
+        <resource path="/content/{id}/property">
+            <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="id"/>
+            <method name="GET" id="findAll">
+                <request>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string"
style="query" name="expand"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int" style="query"
name="start"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="10" type="xs:int"
style="query" name="limit"/>
+                </request>
+                <response>
+                    <representation mediaType="application/json"/>
+                </response>
+            </method>
+            <method name="POST" id="create">
+                <request>
+                    <representation mediaType="application/json"/>
+                </request>
+                <response>
+                    <representation mediaType="application/json"/>
+                </response>
+            </method>
+            <resource path="{key}">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="id"/>
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="key"/>
+                <method name="GET" id="findByKey">
+                    <request>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string"
style="query" name="expand"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+                <method name="PUT" id="update">
+                    <request>
+                        <representation mediaType="application/json"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+                <method name="DELETE" id="delete">
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+                <method name="POST" id="create">
+                    <request>
+                        <representation mediaType="application/json"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+        </resource>
+        <resource path="/content/{id}/restriction">
+            <resource path="byOperation/{operationKey}">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="operationKey"/>
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="id"/>
+                <method name="GET" id="forOperation">
+                    <request>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="restrictions.user,restrictions.group"
type="xs:string" style="query" name="expand"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int"
style="query" name="start"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="100"
type="xs:int" style="query" name="limit"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+            <resource path="byOperation">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="id"/>
+                <method name="GET" id="byOperation">
+                    <request>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="update.restrictions.user,read.restrictions.group,read.restrictions.user,update.restrictions.group"
type="xs:string" style="query" name="expand"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+        </resource>
+        <resource path="/contentbody/convert/{to}">
+            <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="to"/>
+            <method name="POST" id="convert">
+                <request>
+                    <representation mediaType="application/json"/>
+                </request>
+                <response>
+                    <representation mediaType="application/json"/>
+                </response>
+            </method>
+        </resource>
+        <resource path="/content/{id}/child">
+            <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="id"/>
+            <method name="GET" id="children">
+                <request>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="" type="xs:string"
style="query" name="expand"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="0" type="xs:int"
style="query" name="parentVersion"/>
+                </request>
+                <response>
+                    <representation mediaType="application/json"/>
+                </response>
+            </method>
+            <resource path="/{type}">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="id"/>
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="type"/>
+                <method name="GET" id="childrenOfType">
+                    <request>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default=""
type="xs:string" style="query" name="expand"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="0"
type="xs:int" style="query" name="parentVersion"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int"
style="query" name="start"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="25"
type="xs:int" style="query" name="limit"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+            <resource path="/comment">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="id"/>
+                <method name="GET" id="commentsOfContent">
+                    <request>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default=""
type="xs:string" style="query" name="expand"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="0"
type="xs:int" style="query" name="parentVersion"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int"
style="query" name="start"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="25"
type="xs:int" style="query" name="limit"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string"
style="query" name="location"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default=""
type="xs:string" style="query" name="depth"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+        </resource>
+        <resource path="/content/{id}/child/attachment">
+            <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="id"/>
+            <method name="POST" id="createAttachments">
+                <response>
+                    <representation mediaType="application/json"/>
+                </response>
+            </method>
+            <method name="GET" id="getAttachments">
+                <request>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="" type="xs:string"
style="query" name="expand"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int" style="query"
name="start"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="50" type="xs:int"
style="query" name="limit"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string"
style="query" name="filename"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string"
style="query" name="mediaType"/>
+                </request>
+                <response>
+                    <representation mediaType="application/json"/>
+                </response>
+            </method>
+            <resource path="/{attachmentId}/data">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="attachmentId"/>
+                <method name="POST" id="updateData">
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+            <resource path="/{attachmentId}">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="attachmentId"/>
+                <method name="PUT" id="update">
+                    <request>
+                        <representation mediaType="application/json"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+        </resource>
+        <resource path="/longtask">
+            <method name="GET" id="getTasks">
+                <request>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="" type="xs:string"
style="query" name="expand"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int" style="query"
name="start"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="100" type="xs:int"
style="query" name="limit"/>
+                </request>
+                <response>
+                    <representation mediaType="application/json"/>
+                </response>
+            </method>
+            <resource path="/{id}">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="id"/>
+                <method name="GET" id="getTask">
+                    <request>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default=""
type="xs:string" style="query" name="expand"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+        </resource>
+        <resource path="/content/{id}/label">
+            <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="id"/>
+            <method name="DELETE" id="deleteLabelWithQueryParam">
+                <request>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string"
style="query" name="name"/>
+                </request>
+                <response>
+                    <representation mediaType="application/json"/>
+                </response>
+            </method>
+            <method name="POST" id="addLabels">
+                <request>
+                    <representation mediaType="application/json"/>
+                </request>
+                <response>
+                    <representation mediaType="application/json"/>
+                </response>
+            </method>
+            <method name="GET" id="labels">
+                <request>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string"
style="query" name="prefix"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int" style="query"
name="start"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="200" type="xs:int"
style="query" name="limit"/>
+                </request>
+                <response>
+                    <representation mediaType="application/json"/>
+                </response>
+            </method>
+            <resource path="/{label}">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="id"/>
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="label"/>
+                <method name="DELETE" id="deleteLabel">
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+        </resource>
+        <resource path="/content/{id}/descendant">
+            <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="id"/>
+            <method name="GET" id="descendants">
+                <request>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="" type="xs:string"
style="query" name="expand"/>
+                </request>
+                <response>
+                    <representation mediaType="application/json"/>
+                </response>
+            </method>
+            <resource path="/{type}">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="id"/>
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="type"/>
+                <method name="GET" id="descendantsOfType">
+                    <request>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default=""
type="xs:string" style="query" name="expand"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int"
style="query" name="start"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="25"
type="xs:int" style="query" name="limit"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+        </resource>
+        <resource path="/space">
+            <method name="GET" id="spaces">
+                <request>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string"
style="query" name="spaceKey"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="" type="xs:string"
style="query" name="expand"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int" style="query"
name="start"/>
+                    <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="25" type="xs:int"
style="query" name="limit"/>
+                </request>
+                <response>
+                    <representation mediaType="application/json"/>
+                </response>
+            </method>
+            <method name="POST" id="createSpace">
+                <request>
+                    <representation mediaType="application/json"/>
+                </request>
+                <response>
+                    <representation mediaType="application/json"/>
+                </response>
+            </method>
+            <resource path="{spaceKey}/content/{type}">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="spaceKey"/>
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="type"/>
+                <method name="GET" id="contentsWithType">
+                    <request>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="all"
type="xs:string" style="query" name="depth"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default=""
type="xs:string" style="query" name="expand"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int"
style="query" name="start"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="25"
type="xs:int" style="query" name="limit"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+            <resource path="_private">
+                <method name="POST" id="createPrivateSpace">
+                    <request>
+                        <representation mediaType="application/json"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+            <resource path="/{spaceKey}">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="spaceKey"/>
+                <method name="PUT" id="update">
+                    <request>
+                        <representation mediaType="application/json"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+                <method name="DELETE" id="delete">
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+            <resource path="{spaceKey}/content">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="spaceKey"/>
+                <method name="GET" id="contents">
+                    <request>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="all"
type="xs:string" style="query" name="depth"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default=""
type="xs:string" style="query" name="expand"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:int"
style="query" name="start"/>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default="25"
type="xs:int" style="query" name="limit"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+            <resource path="{spaceKey}">
+                <param xmlns:xs="http://www.w3.org/2001/XMLSchema" type="xs:string" style="template"
name="spaceKey"/>
+                <method name="GET" id="space">
+                    <request>
+                        <param xmlns:xs="http://www.w3.org/2001/XMLSchema" default=""
type="xs:string" style="query" name="expand"/>
+                    </request>
+                    <response>
+                        <representation mediaType="application/json"/>
+                    </response>
+                </method>
+            </resource>
+        </resource>
+    </resources>
+</application>



Mime
View raw message