-
-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XWIKI-18604: Expose the Icon Theme through the REST API
- Introduces the icon extension rest api and default implementation modules - Introduces the icon extension docker tests module
- Loading branch information
1 parent
2ea2ec2
commit 2b82f75
Showing
15 changed files
with
1,112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-rest/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.xwiki.platform</groupId> | ||
<artifactId>xwiki-platform-icon</artifactId> | ||
<version>13.4-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>xwiki-platform-icon-rest</artifactId> | ||
<name>XWiki Platform - Icon - REST - Parent POM</name> | ||
<packaging>pom</packaging> | ||
<description>Services to access XWiki Icons through a RESTful API.</description> | ||
<properties> | ||
<!-- Name to display by the Extension Manager --> | ||
<xwiki.extension.name>Icon REST Services</xwiki.extension.name> | ||
</properties> | ||
<modules> | ||
<module>xwiki-platform-icon-rest-api</module> | ||
<module>xwiki-platform-icon-rest-default</module> | ||
</modules> | ||
</project> |
80 changes: 80 additions & 0 deletions
80
...rm-core/xwiki-platform-icon/xwiki-platform-icon-rest/xwiki-platform-icon-rest-api/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.xwiki.platform</groupId> | ||
<artifactId>xwiki-platform-icon-rest</artifactId> | ||
<version>13.4-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>xwiki-platform-icon-rest-api</artifactId> | ||
<name>XWiki Platform - Icon - REST - API</name> | ||
<packaging>jar</packaging> | ||
<description>The API of the Icon REST services.</description> | ||
<properties> | ||
<xwiki.extension.name>Icon REST Services API</xwiki.extension.name> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>javax.ws.rs</groupId> | ||
<artifactId>jsr311-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.xwiki.commons</groupId> | ||
<artifactId>xwiki-commons-stability</artifactId> | ||
<version>${commons.version}</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.jvnet.jaxb2.maven2</groupId> | ||
<artifactId>maven-jaxb2-plugin</artifactId> | ||
<configuration> | ||
<generatePackage>org.xwiki.icon.rest.model.jaxb</generatePackage> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>generate</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<!-- Apply the Checkstyle configurations defined in the top level pom.xml file --> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-checkstyle-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<!-- Specify the "default" execution id so that the "blocker" one is always executed --> | ||
<id>default</id> | ||
<configuration> | ||
<excludes>org/xwiki/icon/rest/model/jaxb/*.java</excludes> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
65 changes: 65 additions & 0 deletions
65
...st/xwiki-platform-icon-rest-api/src/main/java/org/xwiki/icon/rest/IconThemesResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.xwiki.icon.rest; | ||
|
||
import java.util.List; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.PathParam; | ||
import javax.ws.rs.QueryParam; | ||
|
||
import org.xwiki.icon.rest.model.jaxb.Icons; | ||
import org.xwiki.stability.Unstable; | ||
|
||
/** | ||
* Exposes the wiki icon themes and their icons through REST. | ||
* | ||
* @version $Id$ | ||
* @since 13.4RC1 | ||
*/ | ||
@Path("/wikis/{wikiName}/iconThemes") | ||
@Unstable | ||
public interface IconThemesResource | ||
{ | ||
/** | ||
* Returns the icons metadata of the requested icons list, for a given icon theme. | ||
* | ||
* @param wikiName the name of the wiki holding the icons | ||
* @param iconTheme the name of the icon theme holding the icons | ||
* @param names a list of icon names to return | ||
* @return the list of resolved icons metadata | ||
*/ | ||
@GET | ||
@Path("/{iconTheme}/icons") | ||
Icons getIconsByTheme(@PathParam("wikiName") String wikiName, @PathParam("iconTheme") String iconTheme, | ||
@QueryParam("name") List<String> names); | ||
|
||
/** | ||
* Returns the icons metadata of the requested icons list, for the default icon theme. | ||
* | ||
* @param wikiName the name of the wiki holding the icons | ||
* @param names a list of icon names to return | ||
* @return the list of resolved icons metadata | ||
*/ | ||
@GET | ||
@Path("/icons") | ||
Icons getIcons(@PathParam("wikiName") String wikiName, @QueryParam("name") List<String> names); | ||
} |
33 changes: 33 additions & 0 deletions
33
...-icon/xwiki-platform-icon-rest/xwiki-platform-icon-rest-api/src/main/resources/simple.xjb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
* | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
* | ||
--> | ||
|
||
<!-- | ||
This enables the simple binding mode in JAXB. | ||
See https://javaee.github.io/jaxb-v2/doc/user-guide/ch05.html#simple | ||
--> | ||
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0" | ||
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jaxb:extensionBindingPrefixes="xjc"> | ||
<jaxb:globalBindings> | ||
<xjc:simple/> | ||
</jaxb:globalBindings> | ||
</jaxb:bindings> |
63 changes: 63 additions & 0 deletions
63
...tform-icon-rest/xwiki-platform-icon-rest-api/src/main/resources/xwiki.rest.icon.model.xsd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
* | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
* | ||
--> | ||
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.xwiki.org/icon" | ||
xmlns:icon="http://www.xwiki.org/icon" elementFormDefault="qualified"> | ||
|
||
<!-- | ||
* | ||
* Types | ||
* | ||
--> | ||
|
||
<complexType name="Icon"> | ||
<annotation> | ||
<documentation>Stores an icon metatada.</documentation> | ||
</annotation> | ||
<sequence> | ||
<element name="name" type="string"/> | ||
<element name="iconSetType" type="string"/> | ||
<element name="iconSetName" type="string"/> | ||
<element name="cssClass" type="string" minOccurs="0"/> | ||
<element name="url" type="string" minOccurs="0"/> | ||
</sequence> | ||
</complexType> | ||
|
||
<complexType name="Icons"> | ||
<annotation> | ||
<documentation>Stores a collection of icons metadatas.</documentation> | ||
</annotation> | ||
<sequence> | ||
<!-- A collection of resolved translations. --> | ||
<element name="icon" type="icon:Icon" minOccurs="0" maxOccurs="unbounded"/> | ||
<element name="missingIcons" type="string" minOccurs="0" maxOccurs="unbounded"/> | ||
</sequence> | ||
</complexType> | ||
|
||
<!-- | ||
* | ||
* Elements | ||
* | ||
--> | ||
|
||
<element name="icons" type="icon:Icons"/> | ||
</schema> |
73 changes: 73 additions & 0 deletions
73
...ore/xwiki-platform-icon/xwiki-platform-icon-rest/xwiki-platform-icon-rest-default/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.xwiki.platform</groupId> | ||
<artifactId>xwiki-platform-icon-rest</artifactId> | ||
<version>13.4-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>xwiki-platform-icon-rest-default</artifactId> | ||
<name>XWiki Platform - Icon - REST - Default</name> | ||
<packaging>jar</packaging> | ||
<description>Default implementation of the Icon REST API.</description> | ||
<properties> | ||
<xwiki.jacoco.instructionRatio>1.00</xwiki.jacoco.instructionRatio> | ||
<!-- Name to display by the Extension Manager --> | ||
<xwiki.extension.name>Icon REST Services - Default Implementation</xwiki.extension.name> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.xwiki.platform</groupId> | ||
<artifactId>xwiki-platform-icon-rest-api</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.xwiki.commons</groupId> | ||
<artifactId>xwiki-commons-component-api</artifactId> | ||
<version>${commons.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.xwiki.platform</groupId> | ||
<artifactId>xwiki-platform-rest-server</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.xwiki.platform</groupId> | ||
<artifactId>xwiki-platform-model-api</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.xwiki.platform</groupId> | ||
<artifactId>xwiki-platform-icon-api</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<!-- Test dependencies. --> | ||
<dependency> | ||
<groupId>org.xwiki.commons</groupId> | ||
<artifactId>xwiki-commons-tool-test-component</artifactId> | ||
<version>${commons.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
Oops, something went wrong.