Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ludovic Dubost
application-gitlab
Commits
2d8af691
Commit
2d8af691
authored
Jun 10, 2018
by
Ludovic Dubost
Browse files
Initial Commit
parent
17fe8201
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
pom.xml
0 → 100644
View file @
2d8af691
<?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/maven-v4_0_0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
org.xwiki.contrib
</groupId>
<artifactId>
parent-platform
</artifactId>
<version>
8.4
</version>
</parent>
<groupId>
org.xwiki.contrib.gitlab-application
</groupId>
<artifactId>
application-gitlab-application
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<packaging>
xar
</packaging>
<name>
gitlab-application Application
</name>
<description>
XWiki GitLab Application allowing to commit XWiki code to a GitLab repository
</description>
<properties>
<platform.version>
${commons.version}
</platform.version>
<!-- Enable auto release on jira -->
<xwiki.release.jira.skip>
false
</xwiki.release.jira.skip>
<xwiki.issueManagement.jira.id></xwiki.issueManagement.jira.id>
</properties>
<developers>
<developer>
<id></id>
<name></name>
<organization>
XWiki SAS
</organization>
</developer>
</developers>
<build>
<!-- Needed to add support for the XAR packaging -->
<extensions>
<extension>
<groupId>
org.xwiki.commons
</groupId>
<artifactId>
xwiki-commons-tool-xar-handlers
</artifactId>
<version>
${commons.version}
</version>
</extension>
</extensions>
</build>
<scm>
<connection>
scm:git:git://git.xwikisas.com/ludovic/application-gitlab.git
</connection>
<developerConnection>
scm:git:git@git.xwikisas.com:ludovic/application-gitlab.git
</developerConnection>
<url>
https://git.xwikisas.com/ludovic/application-gitlab
</url>
<tag>
HEAD
</tag>
</scm>
<distributionManagement>
<repository>
<id>
xwiki-staging
</id>
<name>
XWiki Staging Repository
</name>
<url>
http://nexus.xwiki.org/nexus/service/local/staging/deploy/maven2/
</url>
</repository>
</distributionManagement>
</project>
\ No newline at end of file
src/main/resources/GitLab/Code/GitLabAuthClass.xml
0 → 100644
View file @
2d8af691
<?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.
-->
<xwikidoc
version=
"1.3"
reference=
"GitLab.Code.GitLabAuthClass"
locale=
""
>
<web>
GitLab.Code
</web>
<name>
GitLabAuthClass
</name>
<language/>
<defaultLanguage/>
<translation>
0
</translation>
<creator>
xwiki:XWiki.Admin
</creator>
<creationDate>
1514761200000
</creationDate>
<parent>
xwiki:GitLab.Code.WebHome
</parent>
<author>
xwiki:XWiki.Admin
</author>
<contentAuthor>
xwiki:XWiki.Admin
</contentAuthor>
<date>
1514761200000
</date>
<contentUpdateDate>
1514761200000
</contentUpdateDate>
<version>
1.1
</version>
<title/>
<comment/>
<minorEdit>
false
</minorEdit>
<syntaxId>
xwiki/2.0
</syntaxId>
<hidden>
false
</hidden>
<content>
{{velocity}}
## Replace Main with the Space where you want your documents to be created.
## Replace the default parent with the one of your choice and save the document.
##
#set($defaultParent = $doc.fullName)
#set($defaultSpace = 'Main')
{{/velocity}}
</content>
<class>
<name>
GitLab.Code.GitLabAuthClass
</name>
<customClass/>
<customMapping/>
<defaultViewSheet/>
<defaultEditSheet/>
<defaultWeb/>
<nameField/>
<validationScript/>
<contextuser>
<customDisplay/>
<disabled>
0
</disabled>
<hint/>
<name>
contextuser
</name>
<number>
3
</number>
<picker>
0
</picker>
<prettyName>
contextuser
</prettyName>
<size>
30
</size>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.StringClass
</classType>
</contextuser>
<token>
<algorithm/>
<customDisplay/>
<disabled>
0
</disabled>
<hint/>
<name>
token
</name>
<number>
2
</number>
<picker>
0
</picker>
<prettyName>
Private Token
</prettyName>
<size>
30
</size>
<storageType>
Clear
</storageType>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.PasswordClass
</classType>
</token>
</class>
<object>
<name>
GitLab.Code.GitLabAuthClass
</name>
<number>
0
</number>
<className>
XWiki.DocumentSheetBinding
</className>
<guid>
9b178628-aca1-441d-92bc-3ca53d608eac
</guid>
<class>
<name>
XWiki.DocumentSheetBinding
</name>
<customClass/>
<customMapping/>
<defaultViewSheet/>
<defaultEditSheet/>
<defaultWeb/>
<nameField/>
<validationScript/>
<sheet>
<customDisplay/>
<disabled>
0
</disabled>
<name>
sheet
</name>
<number>
1
</number>
<picker>
0
</picker>
<prettyName>
Sheet
</prettyName>
<size>
30
</size>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.StringClass
</classType>
</sheet>
</class>
<property>
<sheet>
XWiki.ClassSheet
</sheet>
</property>
</object>
</xwikidoc>
src/main/resources/GitLab/Code/GitLabConfigClass.xml
0 → 100644
View file @
2d8af691
<?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.
-->
<xwikidoc
version=
"1.3"
reference=
"GitLab.Code.GitLabConfigClass"
locale=
""
>
<web>
GitLab.Code
</web>
<name>
GitLabConfigClass
</name>
<language/>
<defaultLanguage/>
<translation>
0
</translation>
<creator>
xwiki:XWiki.Admin
</creator>
<creationDate>
1514761200000
</creationDate>
<parent>
xwiki:GitLab.Code.WebHome
</parent>
<author>
xwiki:XWiki.Admin
</author>
<contentAuthor>
xwiki:XWiki.Admin
</contentAuthor>
<date>
1514761200000
</date>
<contentUpdateDate>
1514761200000
</contentUpdateDate>
<version>
1.1
</version>
<title/>
<comment/>
<minorEdit>
false
</minorEdit>
<syntaxId>
xwiki/2.0
</syntaxId>
<hidden>
false
</hidden>
<content/>
<class>
<name>
GitLab.Code.GitLabConfigClass
</name>
<customClass/>
<customMapping/>
<defaultViewSheet/>
<defaultEditSheet/>
<defaultWeb/>
<nameField/>
<validationScript/>
<contribVersion>
<customDisplay/>
<disabled>
0
</disabled>
<hint/>
<name>
contribVersion
</name>
<number>
3
</number>
<picker>
0
</picker>
<prettyName>
Contrib Version
</prettyName>
<size>
30
</size>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.StringClass
</classType>
</contribVersion>
<defaultdate>
<customDisplay/>
<dateFormat>
dd/MM/yyyy
</dateFormat>
<disabled>
0
</disabled>
<emptyIsToday>
0
</emptyIsToday>
<hint/>
<name>
defaultdate
</name>
<number>
11
</number>
<picker>
1
</picker>
<prettyName>
Default Date
</prettyName>
<size>
20
</size>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.DateClass
</classType>
</defaultdate>
<defaultspace>
<customDisplay/>
<disabled>
0
</disabled>
<hint/>
<name>
defaultspace
</name>
<number>
10
</number>
<picker>
0
</picker>
<prettyName>
Default Spaces
</prettyName>
<size>
30
</size>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.StringClass
</classType>
</defaultspace>
<defaultuser>
<customDisplay/>
<disabled>
0
</disabled>
<hint/>
<name>
defaultuser
</name>
<number>
12
</number>
<picker>
0
</picker>
<prettyName>
Default User
</prettyName>
<size>
30
</size>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.StringClass
</classType>
</defaultuser>
<description>
<contenttype>
---
</contenttype>
<customDisplay/>
<disabled>
0
</disabled>
<editor>
Text
</editor>
<hint/>
<name>
description
</name>
<number>
5
</number>
<picker>
0
</picker>
<prettyName>
Description
</prettyName>
<rows>
5
</rows>
<size>
40
</size>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.TextAreaClass
</classType>
</description>
<gitlab_url>
<customDisplay/>
<disabled>
0
</disabled>
<hint/>
<name>
gitlab_url
</name>
<number>
6
</number>
<picker>
0
</picker>
<prettyName>
GitLab URL
</prettyName>
<size>
80
</size>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.StringClass
</classType>
</gitlab_url>
<name>
<customDisplay/>
<disabled>
0
</disabled>
<hint/>
<name>
name
</name>
<number>
1
</number>
<picker>
0
</picker>
<prettyName>
Name
</prettyName>
<size>
30
</size>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.StringClass
</classType>
</name>
<repository_name>
<customDisplay/>
<disabled>
0
</disabled>
<hint/>
<name>
repository_name
</name>
<number>
8
</number>
<picker>
0
</picker>
<prettyName>
Repository Name
</prettyName>
<size>
80
</size>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.StringClass
</classType>
</repository_name>
<repository_path>
<customDisplay/>
<disabled>
0
</disabled>
<hint/>
<name>
repository_path
</name>
<number>
9
</number>
<picker>
0
</picker>
<prettyName>
Repository Path
</prettyName>
<size>
80
</size>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.StringClass
</classType>
</repository_path>
<repository_user>
<customDisplay/>
<disabled>
0
</disabled>
<hint/>
<name>
repository_user
</name>
<number>
7
</number>
<picker>
0
</picker>
<prettyName>
Repository User
</prettyName>
<size>
30
</size>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.StringClass
</classType>
</repository_user>
<status>
<contenttype>
---
</contenttype>
<customDisplay/>
<disabled>
0
</disabled>
<editor>
Text
</editor>
<hint/>
<name>
status
</name>
<number>
13
</number>
<picker>
0
</picker>
<prettyName>
Status
</prettyName>
<rows>
5
</rows>
<size>
40
</size>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.TextAreaClass
</classType>
</status>
<version>
<customDisplay/>
<disabled>
0
</disabled>
<hint/>
<name>
version
</name>
<number>
2
</number>
<picker>
0
</picker>
<prettyName>
Version
</prettyName>
<size>
30
</size>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.StringClass
</classType>
</version>
<xarXmlVersion>
<customDisplay/>
<disabled>
0
</disabled>
<hint/>
<name>
xarXmlVersion
</name>
<number>
4
</number>
<picker>
0
</picker>
<prettyName>
XML File Version (1.1 or 1.0)
</prettyName>
<size>
30
</size>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.StringClass
</classType>
</xarXmlVersion>
</class>
<object>
<name>
GitLab.Code.GitLabConfigClass
</name>
<number>
0
</number>
<className>
XWiki.ClassSheetBinding
</className>
<guid>
74119b6f-3335-4021-81d4-20bee29ad7e8
</guid>
<class>
<name>
XWiki.ClassSheetBinding
</name>
<customClass/>
<customMapping/>
<defaultViewSheet/>
<defaultEditSheet/>
<defaultWeb/>
<nameField/>
<validationScript/>
<sheet>
<customDisplay/>
<disabled>
0
</disabled>
<name>
sheet
</name>
<number>
1
</number>
<picker>
0
</picker>
<prettyName>
Sheet
</prettyName>
<size>
30
</size>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.StringClass
</classType>
</sheet>
</class>
<property>
<sheet>
GitLab.Code.GitLabConfigSheet
</sheet>
</property>
</object>
<object>
<name>
GitLab.Code.GitLabConfigClass
</name>
<number>
0
</number>
<className>
XWiki.DocumentSheetBinding
</className>
<guid>
a5b831dc-78e2-4288-82f1-d25efd790247
</guid>
<class>
<name>
XWiki.DocumentSheetBinding
</name>
<customClass/>
<customMapping/>
<defaultViewSheet/>
<defaultEditSheet/>
<defaultWeb/>
<nameField/>
<validationScript/>
<sheet>
<customDisplay/>
<disabled>
0
</disabled>
<name>
sheet
</name>
<number>
1
</number>
<picker>
0
</picker>
<prettyName>
Sheet
</prettyName>
<size>
30
</size>
<unmodifiable>
0
</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>
com.xpn.xwiki.objects.classes.StringClass
</classType>
</sheet>
</class>
<property>
<sheet>
XWiki.ClassSheet
</sheet>
</property>
</object>
</xwikidoc>
src/main/resources/GitLab/Code/GitLabConfigSheet.xml
0 → 100644
View file @
2d8af691
<?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.
-->
<xwikidoc
version=
"1.3"
reference=
"GitLab.Code.GitLabConfigSheet"
locale=
""
>
<web>
GitLab.Code
</web>
<name>
GitLabConfigSheet
</name>
<language/>
<defaultLanguage/>
<translation>
0
</translation>
<creator>
xwiki:XWiki.Admin
</creator>
<creationDate>
1514761200000
</creationDate>
<parent>
xwiki:GitLab.Code.WebHome
</parent>
<author>
xwiki:XWiki.Admin
</author>
<contentAuthor>
xwiki:XWiki.Admin
</contentAuthor>
<date>
1514761200000
</date>
<contentUpdateDate>
1514761200000
</contentUpdateDate>
<version>
1.1
</version>
<title/>
<comment/>
<minorEdit>
false
</minorEdit>
<syntaxId>
xwiki/2.0
</syntaxId>
<hidden>
false
</hidden>
<content>
{{velocity}}
#if ("$!request.action" == "compare")
= $msg.get('gitlab.configsheet.compare.title'): $request.page =
#else
= $msg.get("gitlab.configsheet.title"): $doc.name =
#end
#if(!$xwiki.hasProgrammingRights())
#warning("This application cannot work without programming rights on the current page. Resave this page as an admin and retry.")
#else
#if(!$request.action)
#set($class = $doc.getObject('GitLab.Code.GitLabConfigClass').xWikiClass)
#set($authobj = $doc.getObject("GitLab.Code.GitLabAuthClass", "contextuser", $context.user))
#if(!$authobj)
#set($authobj = $doc.newObject("GitLab.Code.GitLabAuthClass"))
#if($context.action=="edit")
#set($ok = $doc.use($authobj))
#set($ok = $doc.set("contextuser", $context.user))
#set($ok = $doc.use("GitLab.Code.GitLabConfigClass"))
#set($ok = $doc.save())
#end
#end
{{html clean="false" wiki="true"}}
#foreach($prop in $class.properties)
#set($tooltip = $prop.propertyClass.getTooltip($context.context))
;
<
label#if ($xcontext.action == 'edit') for="GitLab.Code.GitLabClass_0_${prop.name}"#end
>
$escapetool.xml($doc.displayPrettyName($prop.name, false, false))
<
/label
>
: $doc.display($prop.name)
#if($prop.name=="gitlab_url"
&&
$context.action=="edit")
#set($ok = $doc.use($authobj))
;
<
label#if ($xcontext.action == 'edit') for="GitLab.Code.GitAuthClass_${authobj.number}_${prop.name}"#end
>
$escapetool.xml($doc.displayPrettyName("token", false, false))
<
/label
>
: $doc.display("token")
#set($ok = $doc.set("contextuser", $context.user))
$doc.display("contextuser", "hidden")
#set($ok = $doc.use("GitLab.Code.GitLabConfigClass"))
#end
#end ## end for
{{/html}}
#end ## end request.action
#set($configLoaded = "")
#if($request.action)
#set($gitlabgroovy = $xwiki.parseGroovyFromPage("GitLab.Code.GitLabGroovy","GitLab.Code.GitLabGroovy"))
#set($ok = $gitlabgroovy.setXWiki($xwiki, $context))
#if(!$gitlabgroovy.hasProgrammingRights())
#warning("This application cannot work without programming rights on [[GitLab.Code.GitLabGroovy]]. Resave this page as an admin and retry.")
#end
#set($configLoaded = $gitlabgroovy.setGitLabConfig($doc.fullName))
#if($request.spaces)
#set($spaces = $request.spaces)
#set($savedlist = "")
#else
#set($savedlist = $gitlabgroovy.getSavedList())
#set($spaces = $gitlabgroovy.getDefaultSpace())
#end
#end
#if($configLoaded!="")
## it was not possible to connect to gitlab
$configLoaded
#else
## CUSTOM action
#if($request.action=="custom")
{{html wiki=true clean=false}}
<
form action="" method="get"
>
<
input type="hidden" name="action" value="list" /
>
$msg.get("gitlab.configsheet.custom.spacelist"):
<
input type="text" name="spaces" value="" /
><
input type="submit" value="$msg.get("gitlab.configsheet.listpages")" /
>
<
/form
>
<
form action="" method="get"
>
<
input type="hidden" name="action" value="list" /
>
$msg.get("gitlab.configsheet.custom.space"):
<
select name="spaces"
>
#foreach($space in $xwiki.spaces)
<
option value="$space"
>
$space
<
/option
>
#end
<
/select
>
<
input type="submit" value="$msg.get("gitlab.configsheet.listpages")" /
>
<
/form
>