Compare commits
137 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
43a9e73d33 | |
|
|
ee4618c67b | |
|
|
aefa2ae0d7 | |
|
|
0cff7d753a | |
|
|
02cb4ab656 | |
|
|
46ea2de206 | |
|
|
dfe36e2614 | |
|
|
6041e355a5 | |
|
|
1a81dccadd | |
|
|
8cd8f05054 | |
|
|
3a6da7c807 | |
|
|
035bfa3731 | |
|
|
6fec8bbd1a | |
|
|
c4d0ec6be0 | |
|
|
4452cb071d | |
|
|
734ca7623d | |
|
|
aa7ae6520f | |
|
|
554391e7fd | |
|
|
7e9242c005 | |
|
|
6ecf9993c7 | |
|
|
1149a20b89 | |
|
|
fcd50df49d | |
|
|
93cb4ba102 | |
|
|
2f53cb4b67 | |
|
|
259aacca67 | |
|
|
62faaf6384 | |
|
|
910b61cd81 | |
|
|
cdf82f4d06 | |
|
|
2e6c97b775 | |
|
|
34303af9fc | |
|
|
3a72c79cd8 | |
|
|
99a189534b | |
|
|
600a010ee9 | |
|
|
de29bb6a3a | |
|
|
30cd9bae25 | |
|
|
429ceeea82 | |
|
|
e5d05e998d | |
|
|
35b86a224a | |
|
|
8b0e00dca8 | |
|
|
ac27d5ac61 | |
|
|
d30cbc5ec7 | |
|
|
93e9063959 | |
|
|
2ec5507c1a | |
|
|
78b5eb4721 | |
|
|
37cbfa0cf2 | |
|
|
52ca67b4e3 | |
|
|
cd34cdc597 | |
|
|
fd5b69feed | |
|
|
5ff6a49819 | |
|
|
958f556307 | |
|
|
dc928d32c9 | |
|
|
c4cf6e8741 | |
|
|
b2b8c62389 | |
|
|
ea1750ecd8 | |
|
|
5867b26997 | |
|
|
eb1948d817 | |
|
|
cb0d700a24 | |
|
|
1c5961a75c | |
|
|
d91b01fee7 | |
|
|
705210a5cc | |
|
|
bc6ddd90a2 | |
|
|
d8c02b8917 | |
|
|
42fb2eab80 | |
|
|
026576eeed | |
|
|
c8f1e568d8 | |
|
|
cc02865318 | |
|
|
9424f35c2d | |
|
|
53839265b6 | |
|
|
558d075931 | |
|
|
ea04e3ba19 | |
|
|
816c0649b9 | |
|
|
7ec1355a3b | |
|
|
8865a4ef8a | |
|
|
1f81207902 | |
|
|
52663e5b14 | |
|
|
aae365f4f3 | |
|
|
78d9f512f6 | |
|
|
77f7a76cd6 | |
|
|
529d7d0bde | |
|
|
8633bf3e53 | |
|
|
703e05e33d | |
|
|
3add883c25 | |
|
|
2542eb4968 | |
|
|
1b916fa7e9 | |
|
|
901375c4cc | |
|
|
f1adb7f0ae | |
|
|
2e298bf267 | |
|
|
3cb28232a6 | |
|
|
4e046647c7 | |
|
|
5e4d73b44d | |
|
|
82a982ebf9 | |
|
|
1fdb60b045 | |
|
|
6366cd60f3 | |
|
|
5423933d3e | |
|
|
61362d9448 | |
|
|
ebf9d0d520 | |
|
|
d6758f478f | |
|
|
5978b40989 | |
|
|
8dd3a112f7 | |
|
|
40d1c34e86 | |
|
|
ecd4192aed | |
|
|
af609f5c10 | |
|
|
4cc48686d5 | |
|
|
f7721dd41b | |
|
|
5d891c2c6d | |
|
|
4a64d03056 | |
|
|
5f31e4ff45 | |
|
|
43b547e044 | |
|
|
264736422f | |
|
|
813ff58daa | |
|
|
8c6f68eb2b | |
|
|
a549db6035 | |
|
|
acfa6b7b5b | |
|
|
ae8e504eaa | |
|
|
407384a75a | |
|
|
4a4e4beb78 | |
|
|
2d15639124 | |
|
|
08cebebd02 | |
|
|
9ceb480c23 | |
|
|
94704d9e4a | |
|
|
ac6d3b3d65 | |
|
|
568cfe243e | |
|
|
a467bcebb7 | |
|
|
b164d6e00b | |
|
|
97c2ed46bf | |
|
|
ba001cc04b | |
|
|
d2b702cb11 | |
|
|
f4fd2bab9a | |
|
|
76f510e84d | |
|
|
73c0a45ce7 | |
|
|
a954ced804 | |
|
|
1a2c3087e3 | |
|
|
38d541c18d | |
|
|
422f37747d | |
|
|
141ce9f5a8 | |
|
|
ec09fd98e4 | |
|
|
c2c50e5899 |
|
|
@ -1,17 +1,12 @@
|
|||
it-pgsql-datasources.properties
|
||||
nb-configuration.xml
|
||||
nbproject
|
||||
node
|
||||
node_modules
|
||||
runtime
|
||||
target
|
||||
.cache
|
||||
.classpath
|
||||
.factorypath
|
||||
.parcel-cache
|
||||
.project
|
||||
.settings
|
||||
.tscache
|
||||
*.vscode
|
||||
/ccm-core/nbproject/
|
||||
/ccm-cms/nbproject/
|
||||
|
|
|
|||
|
|
@ -1,33 +1,28 @@
|
|||
pipeline {
|
||||
agent any
|
||||
tools {
|
||||
maven 'apache-maven-3.8.4'
|
||||
maven 'apache-maven-3.6.0'
|
||||
}
|
||||
stages {
|
||||
stage('Build and Test') {
|
||||
steps {
|
||||
dir('') {
|
||||
//sh 'mvn clean package verify -Prun-its-with-wildfly-h2mem -Dwildfly.propertiesFile=/srv/libreccm-wildfly.properties'
|
||||
sh 'mvn clean package'
|
||||
sh 'mvn clean verify -Prun-its-with-wildfly-h2mem -Dwildfly.propertiesFile=/srv/libreccm-wildfly.properties'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Analyse") {
|
||||
steps {
|
||||
dir('') {
|
||||
sh 'mvn package pmd:pmd pmd:cpd spotbugs:spotbugs'
|
||||
sh 'mvn pmd:pmd pmd:cpd spotbugs:spotbugs'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Deploy") {
|
||||
environment {
|
||||
DEPLOY_TOKEN = credentials('gitea_libreccm_ci_packages')
|
||||
NPM_TOKEN = credentials('gitea_libreccm_ci_packages')
|
||||
}
|
||||
steps {
|
||||
dir('') {
|
||||
configFileProvider([configFile(fileId: 'libreccm-packages-deploy', variable: 'MAVEN_SETTINGS')]) {
|
||||
sh 'mvn -U -s "$MAVEN_SETTINGS" -e package deploy'
|
||||
sh 'mvn -U -s "$MAVEN_SETTINGS" -e deploy'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
module.exports = {
|
||||
root: true,
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: [
|
||||
'@typescript-eslint',
|
||||
],
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
],
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
dist
|
||||
node_modules
|
||||
target
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
LibreCCM API Client Commons
|
||||
===========================
|
||||
|
||||
This module provides several usaable parts of building clients for
|
||||
specific endpoints of the LibreCCM RESTful API.
|
||||
|
||||
The `entities` module provides several entities used by various endpoints
|
||||
of the RESTful API of LibreCCM.
|
||||
|
||||
The module also provides an HTTP client specially tailored for
|
||||
the RESTful API of LibreCCM. The client is provided in several implementations:
|
||||
For browsers, for node.js and an isomorphic implementation. In most cases
|
||||
you will want to use the isomorphic implementation.
|
||||
|
||||
For most use cases it is recommanded to use the specific client APIs provided
|
||||
by the LibreCCM modules which provided a more high-level interface to the RESTful
|
||||
API of LibreCCM.
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"name": "@libreccm/ccm-apiclient-commons",
|
||||
"version": "7.0.0",
|
||||
"main": "target/dist/ccm-apiclient-commons.js",
|
||||
"types": "dist/ccm-apiclient-commons.d.ts",
|
||||
"description": "Client for the RESTful API provided by ccm-core.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/libreccm/libreccm/ccm-apiclient-commons"
|
||||
},
|
||||
"author": "Jens Pelzetter",
|
||||
"license": "GPL-3.0",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"check": "eslint",
|
||||
"doc": "typedoc --out target/docs src/main/typescript"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.12.50",
|
||||
"@typescript-eslint/eslint-plugin": "^3.6.0",
|
||||
"@typescript-eslint/parser": "^3.6.0",
|
||||
"eslint": "^7.4.0",
|
||||
"typedoc": "^0.17.8",
|
||||
"typescript": "^3.9.6"
|
||||
},
|
||||
"prettier": {
|
||||
"trailingComma": "es5",
|
||||
"tabWidth": 4,
|
||||
"semi": true,
|
||||
"singleQuote": false
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
<?xml version="1.0"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>libreccm-parent</artifactId>
|
||||
<version>7.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-apiclient-commons</artifactId>
|
||||
<version>7.0.0-SNAPSHOT</version>
|
||||
|
||||
<name>LibreCCM API Client Commons</name>
|
||||
<description>Provides basic classes and common datatypes for RESTful API clients</description>
|
||||
<url>https://www.libreccm.org/ccm-apiclient-commons</url>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>Lesser GPL 2.1</name>
|
||||
<url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1</url>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<finalName>ccm-apiclient-commons</finalName>
|
||||
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/typescript</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${project.build.directory}/generated-resources</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.github.eirslett</groupId>
|
||||
<artifactId>frontend-maven-plugin</artifactId>
|
||||
|
||||
<configuration>
|
||||
<installDirectory>../node</installDirectory>
|
||||
</configuration>
|
||||
|
||||
<executions>
|
||||
<execution>
|
||||
<id>Install node.js and NPM</id>
|
||||
<goals>
|
||||
<goal>install-node-and-npm</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<nodeVersion>${nodeVersion}</nodeVersion>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm install</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<arguments>install</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>build</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<arguments>run build</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
<execution>
|
||||
<id>npm publish</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
</goals>
|
||||
|
||||
<phase>deploy</phase>
|
||||
|
||||
<configuration>
|
||||
<arguments>publish --userconfig ../libreccm.npmrc</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,895 @@
|
|||
import * as http from "http";
|
||||
|
||||
/**
|
||||
* The interface of a client for the LibreCcm RESTful API.
|
||||
*/
|
||||
export interface LibreCcmApiClient {
|
||||
/**
|
||||
* Performs a `GET` request for the provided endpoint.
|
||||
* Implementations should throw an {@link ApiError} if an error
|
||||
* occurs.
|
||||
*
|
||||
* @param endpoint The API endpoint to use.
|
||||
* @param searchParams Optional search parameters.
|
||||
*/
|
||||
get(
|
||||
endpoint: string,
|
||||
searchParams?: Record<string, string>
|
||||
): Promise<ApiResponse>;
|
||||
/**
|
||||
* Performs a `POST` request for the provided endpoint.
|
||||
* Implementations should throw an {@link ApiError} if an error
|
||||
* occurs.
|
||||
*
|
||||
* @param endpoint The API endpoint to use.
|
||||
* @param body The request body.
|
||||
* @param searchParams Optional search parameters.
|
||||
*/
|
||||
post(
|
||||
endpoint: string,
|
||||
body?: RequestBody,
|
||||
searchParams?: Record<string, string>
|
||||
): Promise<ApiResponse>;
|
||||
/**
|
||||
* Performs a `PUT` request for the provided endpoint.
|
||||
* Implementations should throw an {@link ApiError} if an error
|
||||
* occurs.
|
||||
*
|
||||
* @param endpoint The API endpoint to use.
|
||||
* @param body The request body.
|
||||
* @param searchParams Optional search parameters.
|
||||
*/
|
||||
put(
|
||||
endpoint: string,
|
||||
body?: RequestBody,
|
||||
searchParams?: Record<string, string>
|
||||
): Promise<ApiResponse>;
|
||||
/**
|
||||
* Performs a `DELETE` request for the provided endpoint.
|
||||
* Implementations should throw an {@link ApiError} if an error
|
||||
* occurs.
|
||||
*
|
||||
* @param endpoint The API endpoint to use.
|
||||
* @param searchParams Optional search parameters.
|
||||
*/
|
||||
delete(
|
||||
endpoint: string,
|
||||
searchParams?: Record<string, string>
|
||||
): Promise<ApiResponse>;
|
||||
/**
|
||||
* Performs a `HEAD` request for the provided endpoint.
|
||||
* Implementations should throw an {@link ApiError} if an error
|
||||
* occurs.
|
||||
*
|
||||
* @param endpoint The API endpoint to use.
|
||||
*/
|
||||
head(endpoint: string): Promise<ApiResponse>;
|
||||
/**
|
||||
* Performs a `OPTIONS` request for the provided endpoint.
|
||||
* Implementations should throw an {@link ApiError} if an error
|
||||
* occurs.
|
||||
*
|
||||
* @param endpoint The API endpoint to use.
|
||||
*/
|
||||
options(endpoint: string): Promise<ApiResponse>;
|
||||
}
|
||||
|
||||
export type RequestBody =
|
||||
| Record<string, unknown>
|
||||
| ArrayBuffer
|
||||
| string
|
||||
| undefined;
|
||||
|
||||
/**
|
||||
* The response from the API.
|
||||
*/
|
||||
export interface ApiResponse {
|
||||
/**
|
||||
* Indicates that the request was processed successfully.
|
||||
*/
|
||||
ok: boolean;
|
||||
/**
|
||||
* The HTTP status code returned by the RESTful API.
|
||||
*/
|
||||
status: number;
|
||||
/**
|
||||
* The status text returned by the RESTful API.
|
||||
*/
|
||||
statusText: string;
|
||||
/**
|
||||
* Gets the Response Body as JSON.
|
||||
*/
|
||||
json(): Promise<unknown>;
|
||||
/**
|
||||
* Gets the Response Body as ArrayBuffer.
|
||||
*/
|
||||
arrayBuffer(): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Gets the Response Body as `string`.
|
||||
*/
|
||||
text(): Promise<string>;
|
||||
}
|
||||
|
||||
export class ApiError extends Error {
|
||||
/**
|
||||
* The HTTP status code reported by the API. `-1` if no status is available.
|
||||
*/
|
||||
status: number;
|
||||
/**
|
||||
* The status text reported by the API.
|
||||
*/
|
||||
statusText: string;
|
||||
/**
|
||||
* The HTTP method used for the failed request.
|
||||
*/
|
||||
method: "get" | "post" | "put" | "delete" | "head" | "options";
|
||||
/**
|
||||
* The URL used in the failed request.
|
||||
*/
|
||||
url: string;
|
||||
|
||||
constructor(
|
||||
status: number,
|
||||
statusText: string,
|
||||
method: "get" | "post" | "put" | "delete" | "head" | "options",
|
||||
message: string,
|
||||
url: string
|
||||
) {
|
||||
super(message);
|
||||
this.status = status;
|
||||
this.statusText = statusText;
|
||||
this.method = method;
|
||||
this.url = url;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A helper function for building an URL. Because it might be useful for implementing
|
||||
* clients for specific APIs in the exported from this module.
|
||||
*
|
||||
* @param base The base URL pointing the an LibreCCM installation.
|
||||
* @param endpoint The endpoint to address.
|
||||
* @param searchParams Optional search parameter to append to the URL.
|
||||
*/
|
||||
export function buildUrl(
|
||||
base: string,
|
||||
endpoint: string,
|
||||
searchParams?: Record<string, string>
|
||||
): string {
|
||||
const url = new URL(base);
|
||||
url.pathname = endpoint;
|
||||
if (searchParams) {
|
||||
const urlSearchParams: URLSearchParams = new URLSearchParams();
|
||||
for (const key in searchParams) {
|
||||
urlSearchParams.append(key, searchParams[key]);
|
||||
}
|
||||
url.search = urlSearchParams.toString();
|
||||
}
|
||||
|
||||
return url.href;
|
||||
}
|
||||
|
||||
export function isFetchAvailable(): boolean {
|
||||
if (!fetch) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An implementation of the {@link ApiResponse} for the Fetch-API supported
|
||||
* by browsers.
|
||||
*/
|
||||
class FetchResponse implements ApiResponse {
|
||||
readonly ok: boolean;
|
||||
readonly status: number;
|
||||
readonly statusText: string;
|
||||
#response: Response;
|
||||
|
||||
constructor(response: Response) {
|
||||
this.status = response.status;
|
||||
this.statusText = response.statusText;
|
||||
this.ok = response.ok;
|
||||
this.#response = response;
|
||||
}
|
||||
|
||||
json(): Promise<unknown> {
|
||||
return this.#response.json();
|
||||
}
|
||||
|
||||
arrayBuffer(): Promise<ArrayBuffer> {
|
||||
return this.#response.arrayBuffer();
|
||||
}
|
||||
|
||||
text(): Promise<string> {
|
||||
return this.#response.text();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An implementation of the {@link LibreCcmApiClient} interface
|
||||
* using the Fetch-API supported by browsers.
|
||||
*/
|
||||
export class ApiClientFetchImpl implements LibreCcmApiClient {
|
||||
readonly #baseUrl: string;
|
||||
readonly #fetchOptions: RequestInit;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param baseUrl The URL of the LibreCCM installation to use.
|
||||
* @param fetchOptions Basic fetch options for requests.
|
||||
*/
|
||||
constructor(baseUrl: string, fetchOptions: RequestInit) {
|
||||
this.#baseUrl = baseUrl;
|
||||
this.#fetchOptions = fetchOptions;
|
||||
}
|
||||
|
||||
private buildFetchOptions(
|
||||
method: "get" | "post" | "put" | "delete" | "head" | "options",
|
||||
body?: RequestBody
|
||||
): RequestInit {
|
||||
const fetchOptions: RequestInit = {
|
||||
...this.#fetchOptions,
|
||||
};
|
||||
fetchOptions.method = method;
|
||||
if (body) {
|
||||
if (body instanceof ArrayBuffer) {
|
||||
fetchOptions.body = body;
|
||||
} else if (typeof body === "string") {
|
||||
fetchOptions.body = body;
|
||||
} else {
|
||||
fetchOptions.body = JSON.stringify(body);
|
||||
}
|
||||
}
|
||||
|
||||
return fetchOptions;
|
||||
}
|
||||
|
||||
async get(
|
||||
endpoint: string,
|
||||
searchParams?: Record<string, string>
|
||||
): Promise<ApiResponse> {
|
||||
const url = buildUrl(this.#baseUrl, endpoint, searchParams);
|
||||
try {
|
||||
const response = await fetch(url, this.buildFetchOptions("get"));
|
||||
if (response.ok) {
|
||||
return new FetchResponse(response);
|
||||
} else {
|
||||
throw new ApiError(
|
||||
response.status,
|
||||
response.statusText,
|
||||
"get",
|
||||
"API responded with an error",
|
||||
url
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
throw new ApiError(
|
||||
-1,
|
||||
"n/a",
|
||||
"get",
|
||||
"`Failed to execute get: ${err}`",
|
||||
url
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async post(
|
||||
endpoint: string,
|
||||
body?: RequestBody,
|
||||
searchParams?: Record<string, string>
|
||||
): Promise<ApiResponse> {
|
||||
const url = buildUrl(this.#baseUrl, endpoint, searchParams);
|
||||
try {
|
||||
const response = await fetch(
|
||||
url,
|
||||
this.buildFetchOptions("post", body)
|
||||
);
|
||||
if (response.ok) {
|
||||
return new FetchResponse(response);
|
||||
} else {
|
||||
throw new ApiError(
|
||||
response.status,
|
||||
response.statusText,
|
||||
"get",
|
||||
"API responded with an error",
|
||||
url
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
throw new ApiError(
|
||||
-1,
|
||||
"n/a",
|
||||
"get",
|
||||
`Failed to execute get: ${err}`,
|
||||
url
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async put(
|
||||
endpoint: string,
|
||||
body?: RequestBody,
|
||||
searchParams?: Record<string, string>
|
||||
): Promise<ApiResponse> {
|
||||
const url = buildUrl(this.#baseUrl, endpoint, searchParams);
|
||||
try {
|
||||
const response = await fetch(
|
||||
url,
|
||||
this.buildFetchOptions("put", body)
|
||||
);
|
||||
if (response.ok) {
|
||||
return new FetchResponse(response);
|
||||
} else {
|
||||
throw new ApiError(
|
||||
response.status,
|
||||
response.statusText,
|
||||
"get",
|
||||
"API responded with an error.",
|
||||
url
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
throw new ApiError(
|
||||
-1,
|
||||
"n/a",
|
||||
"get",
|
||||
`Failed to execute get: ${err}`,
|
||||
url
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async delete(
|
||||
endpoint: string,
|
||||
searchParams?: Record<string, string>
|
||||
): Promise<ApiResponse> {
|
||||
const url = buildUrl(this.#baseUrl, endpoint, searchParams);
|
||||
try {
|
||||
const response = await fetch(url, this.buildFetchOptions("delete"));
|
||||
if (response.ok) {
|
||||
return new FetchResponse(response);
|
||||
} else {
|
||||
throw new ApiError(
|
||||
response.status,
|
||||
response.statusText,
|
||||
"get",
|
||||
"API responded with an error.",
|
||||
url
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
throw new ApiError(
|
||||
-1,
|
||||
"n/a",
|
||||
"get",
|
||||
`Failed to execute get: ${err}`,
|
||||
url
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async head(endpoint: string): Promise<ApiResponse> {
|
||||
const url = buildUrl(this.#baseUrl, endpoint);
|
||||
try {
|
||||
const response = await fetch(url, this.buildFetchOptions("head"));
|
||||
if (response.ok) {
|
||||
return new FetchResponse(response);
|
||||
} else {
|
||||
throw new ApiError(
|
||||
response.status,
|
||||
response.statusText,
|
||||
"get",
|
||||
"API responded with an error.",
|
||||
url
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
throw new ApiError(
|
||||
-1,
|
||||
"n/a",
|
||||
"get",
|
||||
`Failed to execute get: ${err}`,
|
||||
url
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async options(endpoint: string): Promise<ApiResponse> {
|
||||
const url = buildUrl(this.#baseUrl, endpoint);
|
||||
try {
|
||||
const response = await fetch(
|
||||
url,
|
||||
this.buildFetchOptions("options")
|
||||
);
|
||||
if (response.ok) {
|
||||
return new FetchResponse(response);
|
||||
} else {
|
||||
throw new ApiError(
|
||||
response.status,
|
||||
response.statusText,
|
||||
"get",
|
||||
"API responded with an error.",
|
||||
url
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
throw new ApiError(
|
||||
-1,
|
||||
"n/a",
|
||||
"get",
|
||||
`Failed to execute get: ${err}`,
|
||||
url
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An implementation of the {@link ApiResponse} for the Node.js HTTP API supported
|
||||
* by browsers.
|
||||
*/
|
||||
class NodeResponse implements ApiResponse {
|
||||
readonly ok: boolean;
|
||||
readonly status: number;
|
||||
readonly statusText: string;
|
||||
|
||||
#data: Buffer | null;
|
||||
|
||||
constructor(
|
||||
ok: boolean,
|
||||
status: number,
|
||||
statusText: string,
|
||||
data: Buffer | null
|
||||
) {
|
||||
this.ok = ok;
|
||||
this.status = status;
|
||||
this.statusText = statusText;
|
||||
this.#data = data;
|
||||
}
|
||||
|
||||
json(): Promise<unknown> {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
if (this.#data) {
|
||||
resolve(this.#data.toJSON());
|
||||
} else {
|
||||
resolve({});
|
||||
}
|
||||
} catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
arrayBuffer(): Promise<ArrayBuffer> {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
if (this.#data) {
|
||||
const arrayBuf: ArrayBuffer = this.#data.buffer.slice(
|
||||
this.#data.byteOffset,
|
||||
this.#data.byteLength + this.#data.byteLength
|
||||
);
|
||||
resolve(arrayBuf);
|
||||
} else {
|
||||
resolve(new ArrayBuffer(0));
|
||||
}
|
||||
} catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
text(): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
if (this.#data) {
|
||||
resolve(this.#data.toString());
|
||||
} else {
|
||||
resolve("");
|
||||
}
|
||||
} catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An implementation of the {@link LibreCcmApiClient} interface using the HTTP API
|
||||
* provided by node.js.
|
||||
*/
|
||||
export class ApiClientNodeImpl implements LibreCcmApiClient {
|
||||
readonly #baseUrl: string;
|
||||
readonly #jwt: string;
|
||||
|
||||
constructor(baseUrl: string, jwt: string) {
|
||||
this.#baseUrl = baseUrl;
|
||||
this.#jwt = jwt;
|
||||
}
|
||||
|
||||
get(
|
||||
endpoint: string,
|
||||
searchParams?: Record<string, string>
|
||||
): Promise<ApiResponse> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const url = buildUrl(this.#baseUrl, endpoint, searchParams);
|
||||
const request: http.ClientRequest = http.request(url, {
|
||||
headers: {
|
||||
Authorization: this.#jwt,
|
||||
},
|
||||
method: "GET",
|
||||
});
|
||||
|
||||
request.on("response", (response) => {
|
||||
const status: number = response.statusCode
|
||||
? response.statusCode
|
||||
: -1;
|
||||
const statusText: string = response.statusMessage
|
||||
? response.statusMessage
|
||||
: "";
|
||||
|
||||
const data: Array<Buffer> = [];
|
||||
|
||||
response.on("data", (chunk: Buffer) => {
|
||||
data.push(chunk);
|
||||
});
|
||||
response.on("end", () => {
|
||||
const buffer: Buffer = Buffer.concat(data);
|
||||
const apiResponse: ApiResponse = new NodeResponse(
|
||||
status === 200,
|
||||
status,
|
||||
statusText,
|
||||
buffer
|
||||
);
|
||||
resolve(apiResponse);
|
||||
});
|
||||
});
|
||||
request.on("error", (error) =>
|
||||
reject(
|
||||
new ApiError(
|
||||
-1,
|
||||
"n/a",
|
||||
"get",
|
||||
`Failed to do GET: ${error}`,
|
||||
url
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
request.end();
|
||||
});
|
||||
}
|
||||
|
||||
post(
|
||||
endpoint: string,
|
||||
body?: ArrayBuffer,
|
||||
searchParams?: Record<string, string>
|
||||
): Promise<ApiResponse> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const url = buildUrl(this.#baseUrl, endpoint, searchParams);
|
||||
const request: http.ClientRequest = http.request(url, {
|
||||
headers: {
|
||||
Authorization: this.#jwt,
|
||||
},
|
||||
method: "POST",
|
||||
});
|
||||
|
||||
request.on("response", (response) => {
|
||||
const status: number = response.statusCode
|
||||
? response.statusCode
|
||||
: -1;
|
||||
const statusText: string = response.statusMessage
|
||||
? response.statusMessage
|
||||
: "";
|
||||
|
||||
response.on("end", () => {
|
||||
const apiResponse: ApiResponse = new NodeResponse(
|
||||
status === 200 || status === 201,
|
||||
status,
|
||||
statusText,
|
||||
null
|
||||
);
|
||||
resolve(apiResponse);
|
||||
});
|
||||
});
|
||||
|
||||
request.on("error", (error) =>
|
||||
reject(
|
||||
new ApiError(
|
||||
-1,
|
||||
"n/a",
|
||||
"post",
|
||||
`Failed to do POST: ${error}`,
|
||||
url
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if (body) {
|
||||
request.write(body);
|
||||
}
|
||||
|
||||
request.end();
|
||||
});
|
||||
}
|
||||
|
||||
put(
|
||||
endpoint: string,
|
||||
body?: ArrayBuffer,
|
||||
searchParams?: Record<string, string>
|
||||
): Promise<ApiResponse> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const url = buildUrl(this.#baseUrl, endpoint, searchParams);
|
||||
const request: http.ClientRequest = http.request(url, {
|
||||
headers: {
|
||||
Authorization: this.#jwt,
|
||||
},
|
||||
method: "PUT",
|
||||
});
|
||||
|
||||
request.on("response", (response) => {
|
||||
const status: number = response.statusCode
|
||||
? response.statusCode
|
||||
: -1;
|
||||
const statusText: string = response.statusMessage
|
||||
? response.statusMessage
|
||||
: "";
|
||||
|
||||
response.on("end", () => {
|
||||
const apiResponse: ApiResponse = new NodeResponse(
|
||||
status === 200 || status === 201,
|
||||
status,
|
||||
statusText,
|
||||
null
|
||||
);
|
||||
resolve(apiResponse);
|
||||
});
|
||||
});
|
||||
|
||||
request.on("error", (error) =>
|
||||
reject(
|
||||
new ApiError(
|
||||
-1,
|
||||
"n/a",
|
||||
"put",
|
||||
`Failed to do PUT: ${error}`,
|
||||
url
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if (body) {
|
||||
request.write(body);
|
||||
}
|
||||
|
||||
request.end();
|
||||
});
|
||||
}
|
||||
|
||||
delete(
|
||||
endpoint: string,
|
||||
searchParams?: Record<string, string>
|
||||
): Promise<ApiResponse> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const url = buildUrl(this.#baseUrl, endpoint, searchParams);
|
||||
const request: http.ClientRequest = http.request(url, {
|
||||
headers: {
|
||||
Authorization: this.#jwt,
|
||||
},
|
||||
method: "DELETE",
|
||||
});
|
||||
|
||||
request.on("response", (response) => {
|
||||
const status: number = response.statusCode
|
||||
? response.statusCode
|
||||
: -1;
|
||||
const statusText: string = response.statusMessage
|
||||
? response.statusMessage
|
||||
: "";
|
||||
|
||||
response.on("end", () => {
|
||||
const apiResponse: ApiResponse = new NodeResponse(
|
||||
status === 200 || status === 204,
|
||||
status,
|
||||
statusText,
|
||||
null
|
||||
);
|
||||
resolve(apiResponse);
|
||||
});
|
||||
});
|
||||
|
||||
request.on("error", (error) =>
|
||||
reject(
|
||||
new ApiError(
|
||||
-1,
|
||||
"n/a",
|
||||
"delete",
|
||||
`Failed to do DELETE: ${error}`,
|
||||
url
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
request.end();
|
||||
});
|
||||
}
|
||||
|
||||
head(endpoint: string): Promise<ApiResponse> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const url = buildUrl(this.#baseUrl, endpoint);
|
||||
const request: http.ClientRequest = http.request(url, {
|
||||
headers: {
|
||||
Authorization: this.#jwt,
|
||||
},
|
||||
method: "HEAD",
|
||||
});
|
||||
|
||||
request.on("response", (response) => {
|
||||
const status: number = response.statusCode
|
||||
? response.statusCode
|
||||
: -1;
|
||||
const statusText: string = response.statusMessage
|
||||
? response.statusMessage
|
||||
: "";
|
||||
|
||||
const data: Array<Buffer> = [];
|
||||
|
||||
response.on("data", (chunk: Buffer) => {
|
||||
data.push(chunk);
|
||||
});
|
||||
response.on("end", () => {
|
||||
const buffer: Buffer = Buffer.concat(data);
|
||||
const apiResponse: ApiResponse = new NodeResponse(
|
||||
status === 200,
|
||||
status,
|
||||
statusText,
|
||||
buffer
|
||||
);
|
||||
resolve(apiResponse);
|
||||
});
|
||||
});
|
||||
request.on("error", (error) =>
|
||||
reject(
|
||||
new ApiError(
|
||||
-1,
|
||||
"n/a",
|
||||
"head",
|
||||
`Failed to do HEAD: ${error}`,
|
||||
url
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
request.end();
|
||||
});
|
||||
}
|
||||
|
||||
options(endpoint: string): Promise<ApiResponse> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const url = buildUrl(this.#baseUrl, endpoint);
|
||||
const request: http.ClientRequest = http.request(url, {
|
||||
headers: {
|
||||
Authorization: this.#jwt,
|
||||
},
|
||||
method: "OPTIONS",
|
||||
});
|
||||
|
||||
request.on("response", (response) => {
|
||||
const status: number = response.statusCode
|
||||
? response.statusCode
|
||||
: -1;
|
||||
const statusText: string = response.statusMessage
|
||||
? response.statusMessage
|
||||
: "";
|
||||
|
||||
const data: Array<Buffer> = [];
|
||||
|
||||
response.on("data", (chunk: Buffer) => {
|
||||
data.push(chunk);
|
||||
});
|
||||
response.on("end", () => {
|
||||
const buffer: Buffer = Buffer.concat(data);
|
||||
const apiResponse: ApiResponse = new NodeResponse(
|
||||
status === 200,
|
||||
status,
|
||||
statusText,
|
||||
buffer
|
||||
);
|
||||
resolve(apiResponse);
|
||||
});
|
||||
});
|
||||
request.on("error", (error) =>
|
||||
reject(
|
||||
new ApiError(
|
||||
-1,
|
||||
"n/a",
|
||||
"options",
|
||||
`Failed to do OPTIONS: ${error}`,
|
||||
url
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
request.end();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An isomorphic implementation of the {@link LibreCcmApiClient} interface.
|
||||
* Under the hood the implementation checks if the the Fetch-API is avaiable
|
||||
* and used either the {@link ApiClientFetchImpl} or the {@link ApiClientNodeImpl}.
|
||||
*/
|
||||
export class IsomorphicClientImpl implements LibreCcmApiClient {
|
||||
readonly #fetchClient: LibreCcmApiClient;
|
||||
readonly #nodeClient: LibreCcmApiClient;
|
||||
|
||||
constructor(fetchClient: LibreCcmApiClient, nodeClient: LibreCcmApiClient) {
|
||||
this.#fetchClient = fetchClient;
|
||||
this.#nodeClient = nodeClient;
|
||||
}
|
||||
|
||||
get(
|
||||
endpoint: string,
|
||||
searchParams?: Record<string, string>
|
||||
): Promise<ApiResponse> {
|
||||
if (isFetchAvailable()) {
|
||||
return this.#fetchClient.get(endpoint, searchParams);
|
||||
} else {
|
||||
return this.#nodeClient.get(endpoint, searchParams);
|
||||
}
|
||||
}
|
||||
|
||||
post(
|
||||
endpoint: string,
|
||||
body: ArrayBuffer,
|
||||
searchParams?: Record<string, string>
|
||||
): Promise<ApiResponse> {
|
||||
if (isFetchAvailable()) {
|
||||
return this.#fetchClient.post(endpoint, body, searchParams);
|
||||
} else {
|
||||
return this.#nodeClient.post(endpoint, body, searchParams);
|
||||
}
|
||||
}
|
||||
|
||||
put(
|
||||
endpoint: string,
|
||||
body?: ArrayBuffer,
|
||||
searchParams?: Record<string, string>
|
||||
): Promise<ApiResponse> {
|
||||
if (isFetchAvailable()) {
|
||||
return this.#fetchClient.put(endpoint, body, searchParams);
|
||||
} else {
|
||||
return this.#nodeClient.put(endpoint, body, searchParams);
|
||||
}
|
||||
}
|
||||
|
||||
delete(
|
||||
endpoint: string,
|
||||
searchParams?: Record<string, string>
|
||||
): Promise<ApiResponse> {
|
||||
if (isFetchAvailable()) {
|
||||
return this.#fetchClient.delete(endpoint, searchParams);
|
||||
} else {
|
||||
return this.#nodeClient.delete(endpoint, searchParams);
|
||||
}
|
||||
}
|
||||
|
||||
head(endpoint: string): Promise<ApiResponse> {
|
||||
if (isFetchAvailable()) {
|
||||
return this.#fetchClient.head(endpoint);
|
||||
} else {
|
||||
return this.#nodeClient.head(endpoint);
|
||||
}
|
||||
}
|
||||
|
||||
options(endpoint: string): Promise<ApiResponse> {
|
||||
if (isFetchAvailable()) {
|
||||
return this.#fetchClient.options(endpoint);
|
||||
} else {
|
||||
return this.#nodeClient.options(endpoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
import {
|
||||
LibreCcmApiClient,
|
||||
ApiResponse,
|
||||
ApiError,
|
||||
buildUrl,
|
||||
ApiClientFetchImpl,
|
||||
ApiClientNodeImpl,
|
||||
isFetchAvailable,
|
||||
IsomorphicClientImpl,
|
||||
} from "./ApiClient";
|
||||
|
||||
export * from "./entities";
|
||||
export { LibreCcmApiClient, ApiResponse, ApiError, buildUrl };
|
||||
|
||||
/**
|
||||
* Build an client for the LibreCCM RESTful API suitable for use in
|
||||
* clientside code served by the Application Server.
|
||||
*
|
||||
* The base URL for accessing the LibreCCM RESTful API is automatically
|
||||
* determined from the URL of the current document. The API client will
|
||||
* use the credentials stored in the browser (cookies) to authenticate itself.
|
||||
*/
|
||||
export function buildEmbeddedApiClient(): LibreCcmApiClient {
|
||||
if (!isFetchAvailable()) {
|
||||
throw new Error(
|
||||
"Fetch API is not available. Please use buildIsomorpicApiClient."
|
||||
);
|
||||
}
|
||||
const baseUrl = new URL(document.documentURI);
|
||||
baseUrl.hash = "";
|
||||
baseUrl.password = "";
|
||||
baseUrl.pathname = "";
|
||||
baseUrl.search = "";
|
||||
baseUrl.username = "";
|
||||
|
||||
return new ApiClientFetchImpl(baseUrl.href, {
|
||||
credentials: "include",
|
||||
mode: "same-origin",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a client for the LibreCCM RESTful API suitable for running in a browser.
|
||||
*
|
||||
* @param baseUrl The URL of the LibreCCM installation to access, including the port.
|
||||
* @param jwt The JSON Web Token to use by the client to authenticate itself.
|
||||
*/
|
||||
export function buildRemoteApiClient(
|
||||
baseUrl: string,
|
||||
jwt: string
|
||||
): LibreCcmApiClient {
|
||||
if (!isFetchAvailable()) {
|
||||
throw new Error(
|
||||
"Fetch API is not available. Please use buildIsomorpicApiClient."
|
||||
);
|
||||
}
|
||||
|
||||
return new ApiClientFetchImpl(baseUrl, {
|
||||
headers: {
|
||||
Authorization: jwt,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a client for the LibreCCM RESTful API suitable for running inside a node.js
|
||||
* environment.
|
||||
*
|
||||
* @param baseUrl The URL of the LibreCCM installation to access, including the port.
|
||||
* @param jwt The JSON Web Token to use by the client to authenticate itself.
|
||||
*/
|
||||
export function buildNodeApiClient(
|
||||
baseUrl: string,
|
||||
jwt: string
|
||||
): LibreCcmApiClient {
|
||||
return new ApiClientNodeImpl(baseUrl, jwt);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds an isomorphic client for the LibreCCM RESTful API which will work in the
|
||||
* browser and in a node.js environment. Use this function to create an API client
|
||||
* for JavaScript applications which use Server-Side-Rendering.
|
||||
*
|
||||
* @param baseUrl The URL of the LibreCCM installation to access, including the port.
|
||||
* @param jwt The JSON Web Token to use by the client to authenticate itself.
|
||||
*/
|
||||
export function buildIsomorpicApiClient(
|
||||
baseUrl: string,
|
||||
jwt: string
|
||||
): LibreCcmApiClient {
|
||||
const fetchClient: LibreCcmApiClient = buildRemoteApiClient(baseUrl, jwt);
|
||||
const nodeClient: LibreCcmApiClient = buildNodeApiClient(baseUrl, jwt);
|
||||
return new IsomorphicClientImpl(fetchClient, nodeClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* An utility function for checking if an record has specific properties.
|
||||
*
|
||||
* @param record The record to check.
|
||||
* @param properties The required properties.
|
||||
*
|
||||
* @return `true` if all properties are found in the record, `false` otherwise.
|
||||
*/
|
||||
export function hasProperties(
|
||||
record: Record<string, unknown>,
|
||||
properties: string[]
|
||||
): boolean {
|
||||
const keys = Object.keys(record);
|
||||
return properties.every((property) => keys.includes(property));
|
||||
}
|
||||
|
||||
/**
|
||||
* An utility function for checking if an record has specific properties. If
|
||||
* one of the properties is not found, the function will throw an error.
|
||||
*
|
||||
* @param record The record to check.
|
||||
* @param properties The required properties.
|
||||
*/
|
||||
export function assertProperties(
|
||||
record: Record<string, unknown>,
|
||||
properties: string[]
|
||||
): void {
|
||||
const missing = findMissingProperties(record, properties);
|
||||
if (missing.length > 0) {
|
||||
throw new MissingPropertiesError(missing);
|
||||
}
|
||||
}
|
||||
|
||||
export class MissingPropertiesError extends Error {
|
||||
constructor(missingProperties: string[]) {
|
||||
super(`record is missing the following required properties:
|
||||
${missingProperties.join(",")}`);
|
||||
|
||||
this.name = "MissingPropertiesError";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An utility function which checks which of the given properties the provided
|
||||
* record is missing.
|
||||
*
|
||||
* @param record The record to check.
|
||||
* @param properties The requird properties.
|
||||
*
|
||||
* @return An array with all missing properties.
|
||||
*/
|
||||
export function findMissingProperties(
|
||||
record: Record<string, unknown>,
|
||||
properties: string[]
|
||||
): string[] {
|
||||
const keys = Object.keys(record);
|
||||
return properties.filter((property) => !keys.includes(property));
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds an identifier parameter from the the provided parameter. If the
|
||||
* parameter is a number it is converted to a string and prefixed with `ID-`.
|
||||
* If the parameter matches the regex for a UUID, the identifier is prefixed
|
||||
* with `UUID-`. Otherwise the identifier is returned as it is.
|
||||
*
|
||||
* @param identifier The identifier to process.
|
||||
*/
|
||||
export function buildIdentifierParam(identifier: string | number): string {
|
||||
if (typeof identifier === "number") {
|
||||
return `ID-${identifier}`;
|
||||
} else {
|
||||
const strIdentifier: string = identifier as string;
|
||||
if (
|
||||
strIdentifier.match(
|
||||
/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/g
|
||||
)
|
||||
) {
|
||||
return `UUID-${identifier}`;
|
||||
} else {
|
||||
return identifier;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Error which should be thrown by clients for errors of the client side.
|
||||
*/
|
||||
export class ApiClientError extends Error {
|
||||
constructor(message: string) {
|
||||
super(message);
|
||||
|
||||
this.name = "ApiClientError";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
/**
|
||||
* A list view contains an array of objects and some data about the list.
|
||||
*/
|
||||
export interface ListView<T> {
|
||||
/**
|
||||
* The list of objects
|
||||
*/
|
||||
list: T[],
|
||||
/**
|
||||
* The number of elements for the query.
|
||||
*/
|
||||
count: number,
|
||||
/**
|
||||
* Items per page
|
||||
*/
|
||||
limit: number,
|
||||
/**
|
||||
* The first item shown
|
||||
*/
|
||||
offset: number,
|
||||
}
|
||||
|
||||
/**
|
||||
* Properties of the type `LocalizedString` are used in several entities
|
||||
* returned by various of the endpoints the RESTful API of LibreCCM.
|
||||
* Each `LocalizedString` consists of various values with the language
|
||||
* as key.
|
||||
*/
|
||||
export interface LocalizedString {
|
||||
values: Record<string, string>
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"module": "es6",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "dist",
|
||||
"declaration": true,
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"target": "es6"
|
||||
},
|
||||
"include": [
|
||||
"src/main/typescript/**/*"
|
||||
]
|
||||
}
|
||||
|
|
@ -183,8 +183,13 @@
|
|||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.10.3</version>
|
||||
<configuration>
|
||||
<detectLinks>false</detectLinks>
|
||||
<detectJavaApiLinks>false</detectJavaApiLinks>
|
||||
<detectLinks>true</detectLinks>
|
||||
<detectJavaApiLinks>true</detectJavaApiLinks>
|
||||
<links>
|
||||
<link>http://docs.oracle.com/javase/7/docs/api/</link>
|
||||
<link>http://docs.oracle.com/javaee/7/api/</link>
|
||||
<link>http://docs.jboss.org/hibernate/orm/4.3/javadocs/</link>
|
||||
</links>
|
||||
<show>private</show>
|
||||
<docfilessubdirs>true</docfilessubdirs>
|
||||
<charset>UTF-8</charset>
|
||||
|
|
@ -195,6 +200,16 @@
|
|||
<author>true</author>
|
||||
<keywords>true</keywords>
|
||||
<failOnError>false</failOnError>
|
||||
<doclet>org.jboss.apiviz.APIviz</doclet>
|
||||
<docletArtifact>
|
||||
<groupId>org.jboss.apiviz</groupId>
|
||||
<artifactId>apiviz</artifactId>
|
||||
<version>1.3.2.GA</version>
|
||||
</docletArtifact>
|
||||
<useStandardDocletOptions>true</useStandardDocletOptions>
|
||||
<additionalparam>
|
||||
-sourceclasspath ${project.build.outputDirectory}
|
||||
</additionalparam>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
|
@ -221,7 +236,7 @@
|
|||
<configuration>
|
||||
<linkXref>true</linkXref>
|
||||
<sourceEncoding>utf-8</sourceEncoding>
|
||||
<targetJdk>11</targetJdk>
|
||||
<targetJdk>1.8</targetJdk>
|
||||
<rulesets>
|
||||
<ruleset>/rulesets/java/basic.xml</ruleset>
|
||||
<ruleset>/rulesets/java/braces.xml</ruleset>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,204 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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.libreccm</groupId>
|
||||
<artifactId>ccm-bundle-devel</artifactId>
|
||||
<relativePath>../ccm-bundle-devel</relativePath>
|
||||
<version>7.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-bundle-devel-thorntail</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<name>LibreCCM Devel Bundle for Thorntail</name>
|
||||
<url>http://www.libreccm.org</url>
|
||||
<distributionManagement>
|
||||
<site>
|
||||
<id>libreccm-site</id>
|
||||
<name>LibreCCM</name>
|
||||
<url>http://www.libreccm.org/project-sites/</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
|
||||
<organization>
|
||||
<name>LibreCCM Foundation</name>
|
||||
</organization>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>LGPLv2 or newer</name>
|
||||
<url>http://www.gnu.org/licenses/lgpl-2.0.html</url>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<properties>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
</properties>
|
||||
|
||||
<!-- <dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.thorntail</groupId>
|
||||
<artifactId>bom</artifactId>
|
||||
<version>2.4.0.Final</version>
|
||||
<scope>import</scope>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>-->
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.thorntail</groupId>
|
||||
<artifactId>cdi</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.thorntail</groupId>
|
||||
<artifactId>datasources</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.thorntail</groupId>
|
||||
<artifactId>ejb</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.thorntail</groupId>
|
||||
<artifactId>hibernate-search</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.thorntail</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.thorntail</groupId>
|
||||
<artifactId>jaxrs</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>
|
||||
<groupId>io.thorntail</groupId>
|
||||
<artifactId>jaxrs-cdi</artifactId>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>io.thorntail</groupId>
|
||||
<artifactId>jaxrs-jsonp</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.thorntail</groupId>
|
||||
<artifactId>jpa</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.thorntail</groupId>
|
||||
<artifactId>jsf</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.thorntail</groupId>
|
||||
<artifactId>jsonp</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.thorntail</groupId>
|
||||
<artifactId>logging</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.thorntail</groupId>
|
||||
<artifactId>mail</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.thorntail</groupId>
|
||||
<artifactId>undertow</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.2.5.jre7</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>font-awesome</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>requirejs</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>requirejs-domready</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>ccm-bundle-devel-wildfly</finalName>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>io.thorntail</groupId>
|
||||
<artifactId>thorntail-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>package</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<configuration>
|
||||
<overlays>
|
||||
<overlay>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-editor</artifactId>
|
||||
<type>jar</type>
|
||||
</overlay>
|
||||
<overlay>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-theme-foundry</artifactId>
|
||||
<type>jar</type>
|
||||
</overlay>
|
||||
<overlay>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-core</artifactId>
|
||||
<type>jar</type>
|
||||
<includes>
|
||||
<include>assets/</include>
|
||||
</includes>
|
||||
</overlay>
|
||||
<overlay>
|
||||
<groupId>org.librecms</groupId>
|
||||
<artifactId>ccm-cms</artifactId>
|
||||
<type>jar</type>
|
||||
<includes>
|
||||
<include>templates/</include>
|
||||
</includes>
|
||||
</overlay>
|
||||
</overlays>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,215 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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.libreccm</groupId>
|
||||
<artifactId>libreccm-parent</artifactId>
|
||||
<version>7.0.0-SNAPSHOT</version>
|
||||
</parent>-->
|
||||
|
||||
<parent>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-bundle-devel</artifactId>
|
||||
<relativePath>../ccm-bundle-devel</relativePath>
|
||||
<version>7.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-bundle-devel-wildfly-swarm</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<name>LibreCCM Devel Bundle for Wildfly Swarm</name>
|
||||
<url>http://www.libreccm.org</url>
|
||||
<distributionManagement>
|
||||
<site>
|
||||
<id>libreccm-site</id>
|
||||
<name>LibreCCM</name>
|
||||
<url>http://www.libreccm.org/project-sites/</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
|
||||
<organization>
|
||||
<name>LibreCCM Foundation</name>
|
||||
</organization>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>LGPLv2 or newer</name>
|
||||
<url>http://www.gnu.org/licenses/lgpl-2.0.html</url>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<properties>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.wildfly.swarm</groupId>
|
||||
<artifactId>bom-all</artifactId>
|
||||
<version>2017.11.0</version>
|
||||
<scope>import</scope>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.wildfly.swarm</groupId>
|
||||
<artifactId>cdi</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.wildfly.swarm</groupId>
|
||||
<artifactId>container</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.wildfly.swarm</groupId>
|
||||
<artifactId>datasources</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.wildfly.swarm</groupId>
|
||||
<artifactId>ejb</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.wildfly.swarm</groupId>
|
||||
<artifactId>hibernate-search</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.wildfly.swarm</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.wildfly.swarm</groupId>
|
||||
<artifactId>jaxrs</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.wildfly.swarm</groupId>
|
||||
<artifactId>jaxrs-cdi</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.wildfly.swarm</groupId>
|
||||
<artifactId>jpa</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.wildfly.swarm</groupId>
|
||||
<artifactId>jsf</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.wildfly.swarm</groupId>
|
||||
<artifactId>logging</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.wildfly.swarm</groupId>
|
||||
<artifactId>mail</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.wildfly.swarm</groupId>
|
||||
<artifactId>undertow</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.1.4.jre7</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>font-awesome</artifactId>
|
||||
<version>4.7.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>requirejs</artifactId>
|
||||
<version>2.3.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>requirejs-domready</artifactId>
|
||||
<version>2.0.1-2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>ccm-bundle-devel-wildfly</finalName>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.wildfly.swarm</groupId>
|
||||
<artifactId>wildfly-swarm-plugin</artifactId>
|
||||
<!--<configuration>
|
||||
<mainClass>org.libreccm.CcmBundleDevel</mainClass>
|
||||
</configuration>-->
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>package</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<configuration>
|
||||
<overlays>
|
||||
<overlay>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-editor</artifactId>
|
||||
<type>jar</type>
|
||||
</overlay>
|
||||
<overlay>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-theme-foundry</artifactId>
|
||||
<type>jar</type>
|
||||
</overlay>
|
||||
<overlay>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-core</artifactId>
|
||||
<type>jar</type>
|
||||
<includes>
|
||||
<include>assets/</include>
|
||||
<include>VAADIN/</include>
|
||||
</includes>
|
||||
</overlay>
|
||||
<overlay>
|
||||
<groupId>org.librecms</groupId>
|
||||
<artifactId>ccm-cms</artifactId>
|
||||
<type>jar</type>
|
||||
<includes>
|
||||
<include>templates/</include>
|
||||
</includes>
|
||||
</overlay>
|
||||
</overlays>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package org.libreccm;
|
||||
|
||||
import org.wildfly.swarm.Swarm;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public class CcmBundleDevel {
|
||||
|
||||
public static void main(final String[] args) throws Exception {
|
||||
|
||||
final Swarm swarm = new Swarm();
|
||||
|
||||
swarm.start();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package org.libreccm;
|
||||
|
||||
import org.wildfly.swarm.Swarm;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public class CcmBundleDevel {
|
||||
|
||||
public static void main(final String[] args) throws Exception {
|
||||
|
||||
final Swarm swarm = new Swarm();
|
||||
|
||||
swarm.start();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="WARN">
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
|
||||
</Console>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="warn">
|
||||
<AppenderRef ref="Console"/>
|
||||
</Root>
|
||||
|
||||
<!--<Logger name="org.hibernate"
|
||||
level="info">
|
||||
</Logger>
|
||||
<Logger name="org.hibernate.SQL"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="org.hibernate.type"
|
||||
level="trace">
|
||||
</Logger>
|
||||
<Logger name="org.hibernate.type.descriptor.sql"
|
||||
level="trace">
|
||||
</Logger>-->
|
||||
|
||||
<!--<Logger name="com.arsdigita.bebop.util.Traversal"
|
||||
level="debug">
|
||||
</Logger>-->
|
||||
|
||||
<Logger name="com.arsdigita.cms.ui.assets.AssetFolderBrowserController"
|
||||
level="debug">
|
||||
|
||||
</Logger>
|
||||
<Logger name="com.arsdigita.cms.ui.folder.FolderBrowserTableModelBuilder"
|
||||
level="debug">
|
||||
</Logger>
|
||||
|
||||
<Logger name="com.arsdigita.ui.admin.AdminServlet"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="com.arsdigita.ui.admin.configuration.ConfigurationTable"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="com.arsdigita.ui.admin.usersgroupsroles.UsersTable"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="com.arsdigita.cms.ui.assets.AssetPane"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="com.arsdigita.ui.login.UserLoginForm"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="com.arsdigita.packaging.Config"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="com.arsdigita.templating.PatternStylesheetResolver"
|
||||
level="info">
|
||||
</Logger>
|
||||
<Logger name="com.arsdigita.templating.SimpleURIResolver"
|
||||
level="warn">
|
||||
</Logger>
|
||||
<Logger name="com.arsdigita.web.CCMDispatcherServlet"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="org.libreccm.core.AbstractEntityRepository"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="org.libreccm.modules.CcmIntegrator"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="org.libreccm.pagemodel.PageModelManager"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="org.libreccm.security.OneTimeAuthTokenCleaner"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="org.libreccm.security.PermissionManager"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="org.libreccm.security.Shiro"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="org.libreccm.ui.admin.usersgroupsroles.RolesController"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="org.librecms.contentsection.AssetRepository"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="org.librecms.contentsection.ContentSectionSetup"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="org.librecms.contentsection.ContentSectionServlet"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="org.librecms.contentsection.rs.Images"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="com.arsdigita.web.DefaultApplicationFileResolver"
|
||||
level="debug">
|
||||
</Logger>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
swarm:
|
||||
deployment:
|
||||
ccm-bundle-devel-wildfly.war:
|
||||
jaxrs:
|
||||
application-path: /jaxrs
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
[main]
|
||||
|
||||
filterChainResolver = org.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver
|
||||
|
||||
passwordMatcher = org.apache.shiro.authc.credential.PasswordMatcher
|
||||
passwordService = org.apache.shiro.authc.credential.DefaultPasswordService
|
||||
passwordMatcher.passwordService = $passwordService
|
||||
|
||||
ccmRealm = org.libreccm.security.CcmShiroRealm
|
||||
ccmRealm.credentialsMatcher = $passwordMatcher
|
||||
|
||||
securityManager.realms = $ccmRealm
|
||||
securityManager.rememberMeManager.cipherKey = p5h/Aphy0gfV+XThbEPqSG4iQNh2fTNH9ZEkSBAt/Ok=
|
||||
|
||||
cacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
|
||||
securityManager.cacheManager = $cacheManager
|
||||
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
# -*- text -*-
|
||||
# This file locates stylesheets, if you are using the
|
||||
# "PatternStylesheetResolver". Please read the Javadoc for that file for
|
||||
# the full story.
|
||||
|
||||
# Currently the "resource" part is actually "short-circuited", see
|
||||
# Templating#transformURL(url). As long as we store and synchronize all theme
|
||||
# files in each server's local file system, we use the direct file apprach to
|
||||
# avoid unnecessary http request and traffic between client (user) and server!
|
||||
# Additionally all modules are installed into one webapp context, so the
|
||||
# webapp tag is redundant, but sort of required by some part of the code.
|
||||
|
||||
|
||||
# Theme with single entry point (e.g Mandalay) managed by themedirector
|
||||
#http://::host::/resource/::webapp::/themes/::themedir::/::theme::/start.xsl
|
||||
http://::host::/::webapp::/themes/::themedir::/::theme::/start.xsl
|
||||
|
||||
# Theme with single entry point (e.g Mandalay) unmanaged default
|
||||
#http://::host::/resource/::webapp::/themes/mandalay/start.xsl
|
||||
#http://::host::/::webapp::/themes/mandalay/start.xsl
|
||||
|
||||
# Theme with single entry point (e.g Mandalay) unmanaged default
|
||||
#http://::host::/resource/::webapp::/themes/mandalay/start.xsl
|
||||
http://::host::/::webapp::/themes/libreccm-default/start.xsl
|
||||
|
||||
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# The following is for multi-entry themes, not used in ScientificCMS
|
||||
# ==============================================================================
|
||||
|
||||
# Output type is for things such as text/javascript
|
||||
# NOT used by ScientificCMS, uses Mandalay only!
|
||||
#http://::host::/resource/::webapp::/themes/heirloom/apps/::application::/xsl/::url::-::outputtype::-::locale::.xsl
|
||||
#http://::host::/resource/::webapp::/themes/heirloom/apps/::application::/xsl/::url::-::outputtype::.xsl
|
||||
|
||||
# Grabs custom item xsl for CMS
|
||||
# NOT used by ScientificCMS, uses Mandalay only!
|
||||
#http://::host::/themes/servlet/content-item/index.xsl?oid=::item_template_oid::&delegated=::item_delegated_url::
|
||||
|
||||
# Theme, with optional locale & prefix
|
||||
# NOT used by ScientificCMS, uses Mandalay only!
|
||||
#http://::host::/resource/::webapp::/themes/::themedir::/::theme::/::application::-::url::-::prefix::-::locale::.xsl
|
||||
#http://::host::/resource/::webapp::/themes/::themedir::/::theme::/::application::-::url::-::prefix::.xsl
|
||||
|
||||
# Theme, with optional locale
|
||||
# NOT used by ScientificCMS, uses Mandalay only!
|
||||
#http://::host::/resource/::webapp::/themes/::themedir::/::theme::/::application::-::url::-::locale::.xsl
|
||||
#http://::host::/resource/::webapp::/themes/::themedir::/::theme::/::application::-::url::.xsl
|
||||
|
||||
# APLAWS generic default, with locale and prefix
|
||||
# XXX change ROOT -> ccm-ldn-aplaws
|
||||
# http://::host::/resource/ROOT/themes/static/aplaws-generic/::application::-::url::-::prefix::-::locale::.xsl
|
||||
# http://::host::/resource/ROOT/themes/static/aplaws-generic/::application::-::url::-::prefix::.xsl
|
||||
|
||||
# APLAWS generic default, with locale
|
||||
# XXX change ROOT -> ccm-ldn-aplaws
|
||||
# http://::host::/resource/ROOT/themes/static/aplaws-generic/::application::-::url::-::locale::.xsl
|
||||
# http://::host::/resource/ROOT/themes/static/aplaws-generic/::application::-::url::.xsl
|
||||
|
||||
# Global default, from application's own web app
|
||||
# NOT used by ScientificCMS
|
||||
#http://::host::/resource/::webapp::/themes/heirloom/apps/::application::/xsl/::url::-::locale::.xsl
|
||||
#http://::host::/resource/::webapp::/themes/heirloom/apps/::application::/xsl/::url::.xsl
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version = 7.0.0-SNAPSHOT
|
||||
appname = LibreCCM
|
||||
apphomepage = http://www.libreccm.org
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
|
||||
http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
|
||||
bean-discovery-mode="all">
|
||||
</beans>
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
author: Jens Pelzetter
|
||||
-->
|
||||
|
||||
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
|
||||
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
|
||||
version="2.1">
|
||||
|
||||
<persistence-unit name="LibreCCM" transaction-type="JTA">
|
||||
|
||||
<!--
|
||||
Enforce JPA provider
|
||||
Not really necessary here because we don't use any Hibernate
|
||||
specific features, but makes it easier to manage to database
|
||||
creation scripts.
|
||||
-->
|
||||
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
||||
|
||||
<jta-data-source>java:jboss/datasources/LibreCCM</jta-data-source>
|
||||
|
||||
<!--<jta-data-source>java:/comp/env/jdbc/libreccm/db</jta-data-source>-->
|
||||
|
||||
<jar-file>lib/ccm-core-7.0.0-SNAPSHOT.jar</jar-file>
|
||||
<jar-file>lib/ccm-cms-7.0.0-SNAPSHOT.jar</jar-file>
|
||||
<jar-file>lib/ccm-shortcuts-7.0.0-SNAPSHOT.jar</jar-file>
|
||||
|
||||
|
||||
<properties>
|
||||
<!-- Properties for Hibernate -->
|
||||
<property name="hibernate.hbm2ddl.auto" value="validate" />
|
||||
<property name="hibernate.connection.autocommit" value="false" />
|
||||
<property name="hibernate.id.new_generator_mappings" value="true" />
|
||||
<property name="wildfly.jpa.hibernate.search.module"
|
||||
value="org.hibernate.search.orm:main" />
|
||||
|
||||
<!--<property name="hibernate.show_sql" value="true" />
|
||||
<property name="format_sql" value="true" />
|
||||
<property name="use_sql_comments" value="true" />-->
|
||||
|
||||
<!--
|
||||
Properties for Hibernate Envers
|
||||
We are using the ValidityAuditStrategy here because it is faster
|
||||
when querying data than the DefaultStrategy
|
||||
-->
|
||||
<property name="org.hibernate.envers.audit_strategy"
|
||||
value="org.hibernate.envers.strategy.ValidityAuditStrategy"/>
|
||||
</properties>
|
||||
|
||||
</persistence-unit>
|
||||
|
||||
</persistence>
|
||||
|
|
@ -0,0 +1 @@
|
|||
waf.config.packages=ccm-core
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
|
||||
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
|
||||
version="3.0">
|
||||
|
||||
<display-name>LibreCCM Devel Bundle for Wildfly</display-name>
|
||||
|
||||
<context-param>
|
||||
<param-name>ccm.develmode</param-name>
|
||||
<param-value>true</param-value>
|
||||
</context-param>
|
||||
<context-param>
|
||||
<param-name>ccm.distribution</param-name>
|
||||
<param-value>libreccm</param-value>
|
||||
</context-param>
|
||||
|
||||
<!-- No JSESSIONID!!! -->
|
||||
<session-config>
|
||||
<tracking-mode>COOKIE</tracking-mode>
|
||||
<!--<tracking-mode>URL</tracking-mode>-->
|
||||
</session-config>
|
||||
|
||||
<filter>
|
||||
<filter-name>ShiroFilter</filter-name>
|
||||
<filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>ShiroFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<listener>
|
||||
<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
|
||||
</listener>
|
||||
|
||||
<!-- JAX-RS -->
|
||||
<!--<servlet>
|
||||
<servlet-name>javax.ws.rs.core.Application</servlet-name>
|
||||
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>javax.ws.rs.core.Application</servlet-name>
|
||||
<url-pattern>/content-sections/*</url-pattern>
|
||||
</servlet-mapping>-->
|
||||
|
||||
<servlet>
|
||||
<servlet-name>Faces Servlet</servlet-name>
|
||||
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>Faces Servlet</servlet-name>
|
||||
<url-pattern>*.xhtml</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<context-param>
|
||||
<param-name>javax.faces.PROJECT_STAGE</param-name>
|
||||
<param-value>Development</param-value>
|
||||
</context-param>
|
||||
<context-param>
|
||||
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
|
||||
<param-value>true</param-value>
|
||||
</context-param>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>vaadin-servlet</servlet-name>
|
||||
<servlet-class>com.vaadin.cdi.server.VaadinCDIServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>vaadin-servlet</servlet-name>
|
||||
<url-pattern>/vaadin/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet-mapping>
|
||||
<servlet-name>vaadin-servlet</servlet-name>
|
||||
<url-pattern>/VAADIN/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
</web-app>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
requirejs(["./ccm-editor",
|
||||
"./ccm-cms-editor",
|
||||
"../webjars/requirejs-domready/2.0.1/domReady!"],
|
||||
function(editor, cmseditor, doc) {
|
||||
|
||||
editor.addEditor(".editor-textarea", {
|
||||
"commandGroups": [
|
||||
{
|
||||
"name": "blocks",
|
||||
"title": "Format blocks",
|
||||
"commands": [
|
||||
editor.FormatBlockCommand
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "format-text",
|
||||
"title": "Format text",
|
||||
"commands": [
|
||||
editor.MakeBoldCommand,
|
||||
editor.MakeItalicCommand,
|
||||
editor.MakeUnderlineCommand,
|
||||
editor.StrikeThroughCommand,
|
||||
editor.SubscriptCommand,
|
||||
editor.SuperscriptCommand,
|
||||
editor.RemoveFormatCommand,
|
||||
editor.InsertExternalLinkCommand,
|
||||
cmseditor.InsertInternalLinkCommand,
|
||||
cmseditor.InsertMediaAssetCommand
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "insert-list",
|
||||
"title": "Insert list",
|
||||
"commands": [
|
||||
editor.InsertUnorderedListCommand,
|
||||
editor.InsertOrderedListCommand
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "html",
|
||||
"title": "HTML",
|
||||
"commands": [editor.ToggleHtmlCommand]
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"ccm-editor-css.path": "/libreccm/ccm-editor/ccm-editor.css",
|
||||
"font-awesome.path": "/libreccm/webjars/font-awesome/4.7.0/css/font-awesome.min.css",
|
||||
"formatBlock.blocks": [
|
||||
{
|
||||
"element": "h3",
|
||||
"title": "Heading 3"
|
||||
},
|
||||
{
|
||||
"element": "h4",
|
||||
"title": "Heading 4"
|
||||
},
|
||||
{
|
||||
"element": "h5",
|
||||
"title": "Heading 5"
|
||||
},
|
||||
{
|
||||
"element": "h6",
|
||||
"title": "Heading 6"
|
||||
},
|
||||
{
|
||||
"element": "p",
|
||||
"title": "Paragraph"
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -1,3 +1,2 @@
|
|||
datasource.properties
|
||||
runtime.properties
|
||||
wildfly.properties
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
libreccm.datasource.connectionUrl=jdbc:postgresql://localhost:5432/ccm-devel
|
||||
libreccm.datasource.username=ccm
|
||||
libreccm.datasource.password=ccm47web
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scene Scope="Project" version="2">
|
||||
<Scope Scope="Faces Configuration Only"/>
|
||||
<Scope Scope="Project"/>
|
||||
<Scope Scope="All Faces Configurations"/>
|
||||
</Scene>
|
||||
|
|
@ -5,8 +5,11 @@
|
|||
"build": "webpack"
|
||||
},
|
||||
"dependencies": {
|
||||
"@librecms/ccm-cms-pagemodelseditor": "file:../ccm-cms-pagemodelseditor",
|
||||
"tinymce": "^4.8.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/tinymce": "^4.5.16",
|
||||
"@types/webpack-env": "^1.13.6",
|
||||
"file-loader": "^1.1.11",
|
||||
"ts-loader": "^4.4.2",
|
||||
|
|
|
|||
|
|
@ -24,12 +24,6 @@
|
|||
<url>http://www.libreccm.org/modules/web/wildfly</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-wildfly</artifactId>
|
||||
<version>7.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>font-awesome</artifactId>
|
||||
|
|
@ -55,7 +49,7 @@
|
|||
<artifactId>ccm-cms-js</artifactId>
|
||||
<version>7.0.0-SNAPSHOT</version>
|
||||
</dependency> -->
|
||||
<!-- <dependency>
|
||||
<dependency>
|
||||
<groupId>org.librecms</groupId>
|
||||
<artifactId>ccm-cms-pagemodelseditor</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
|
|
@ -64,7 +58,7 @@
|
|||
<groupId>org.librecms</groupId>
|
||||
<artifactId>ccm-cms-tinymce</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>-->
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
|
|
@ -80,9 +74,9 @@
|
|||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
<!--<resource>
|
||||
<resource>
|
||||
<directory>${project.build.directory}/generated-resources</directory>
|
||||
</resource>-->
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
|
|
@ -90,15 +84,15 @@
|
|||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<optimize>true</optimize>
|
||||
<debug>true</debug>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- <plugin>
|
||||
<plugin>
|
||||
<groupId>com.github.eirslett</groupId>
|
||||
<artifactId>frontend-maven-plugin</artifactId>
|
||||
|
||||
|
|
@ -113,10 +107,10 @@
|
|||
<goal>install-node-and-npm</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<nodeVersion>v16.14.2</nodeVersion>
|
||||
<nodeVersion>${nodeVersion}</nodeVersion>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<!-- <execution>
|
||||
<id>npm link @libreccm/ccm-pagemodelseditor</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
|
|
@ -124,7 +118,7 @@
|
|||
<configuration>
|
||||
<arguments>link @libreccm/ccm-pagemodelseditor</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</execution> -->
|
||||
<execution>
|
||||
<id>npm link @librecms/ccm-cms-pagemodelseditor</id>
|
||||
<goals>
|
||||
|
|
@ -134,7 +128,7 @@
|
|||
<arguments>link @librecms/ccm-cms-pagemodelseditor</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<!-- <execution>
|
||||
<id>npm link @librecms/ccm-cms-tinymce</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
|
|
@ -142,8 +136,8 @@
|
|||
<configuration>
|
||||
<arguments>link @librecms/ccm-cms-tinymce</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
</execution>-->
|
||||
<!--<execution>
|
||||
<id>npm link @librecms/ccm-cms-js</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
|
|
@ -151,7 +145,7 @@
|
|||
<configuration>
|
||||
<arguments>link @librecms/ccm-cms-js</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</execution>-->
|
||||
<execution>
|
||||
<id>npm install</id>
|
||||
<goals>
|
||||
|
|
@ -168,7 +162,7 @@
|
|||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>-->
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
|
@ -179,9 +173,9 @@
|
|||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
<!--<resource>
|
||||
<resource>
|
||||
<directory>${project.build.directory}/generated-resources</directory>
|
||||
</resource>-->
|
||||
</resource>
|
||||
</webResources>
|
||||
|
||||
<overlays>
|
||||
|
|
@ -190,11 +184,11 @@
|
|||
<artifactId>ccm-editor</artifactId>
|
||||
<type>jar</type>
|
||||
</overlay>
|
||||
<!-- <overlay>
|
||||
<overlay>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-pagemodelseditor</artifactId>
|
||||
<type>jar</type>
|
||||
</overlay>-->
|
||||
</overlay>
|
||||
<overlay>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-theme-foundry</artifactId>
|
||||
|
|
@ -206,62 +200,7 @@
|
|||
<type>jar</type>
|
||||
<includes>
|
||||
<include>assets/</include>
|
||||
</includes>
|
||||
</overlay>
|
||||
<overlay>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-core</artifactId>
|
||||
<type>jar</type>
|
||||
<includes>
|
||||
<include>themes/</include>
|
||||
</includes>
|
||||
</overlay>
|
||||
<overlay>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-core</artifactId>
|
||||
<type>jar</type>
|
||||
<includes>
|
||||
<include>WEB-INF/</include>
|
||||
</includes>
|
||||
</overlay>
|
||||
<!-- <overlay>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-shortcuts</artifactId>
|
||||
<type>jar</type>
|
||||
<includes>
|
||||
<include>WEB-INF/</include>
|
||||
</includes>
|
||||
</overlay>-->
|
||||
<overlay>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-core</artifactId>
|
||||
<type>jar</type>
|
||||
<includes>
|
||||
<include>resources/</include>
|
||||
</includes>
|
||||
</overlay>
|
||||
<overlay>
|
||||
<groupId>org.librecms</groupId>
|
||||
<artifactId>ccm-cms</artifactId>
|
||||
<type>jar</type>
|
||||
<includes>
|
||||
<include>WEB-INF/</include>
|
||||
</includes>
|
||||
</overlay>
|
||||
<overlay>
|
||||
<groupId>org.librecms</groupId>
|
||||
<artifactId>ccm-cms</artifactId>
|
||||
<type>jar</type>
|
||||
<includes>
|
||||
<include>assets/</include>
|
||||
</includes>
|
||||
</overlay>
|
||||
<overlay>
|
||||
<groupId>org.librecms</groupId>
|
||||
<artifactId>ccm-cms</artifactId>
|
||||
<type>jar</type>
|
||||
<includes>
|
||||
<include>icons/</include>
|
||||
<include>_admin/</include>
|
||||
</includes>
|
||||
</overlay>
|
||||
<overlay>
|
||||
|
|
@ -272,22 +211,14 @@
|
|||
<include>templates/</include>
|
||||
</includes>
|
||||
</overlay>
|
||||
<!-- <overlay>
|
||||
<overlay>
|
||||
<groupId>org.librecms</groupId>
|
||||
<artifactId>ccm-cms-tinymce</artifactId>
|
||||
<type>jar</type>
|
||||
<includes>
|
||||
<include>scripts/</include>
|
||||
</includes>
|
||||
</overlay>-->
|
||||
<!-- <overlay>
|
||||
<groupId>org.librecms</groupId>
|
||||
<artifactId>ccm-cms-default-theme</artifactId>
|
||||
<type>jar</type>
|
||||
<includes>
|
||||
<include>themes/librecms/scripts/</include>
|
||||
</includes>
|
||||
</overlay> -->
|
||||
</overlay>
|
||||
</overlays>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
|
@ -308,27 +239,6 @@
|
|||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>properties-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>read-runtime-properties</id>
|
||||
<phase>initialize</phase>
|
||||
<goals>
|
||||
<goal>read-project-properties</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<files>
|
||||
<file>${project.basedir}/runtime.example.properties</file>
|
||||
<file>${project.basedir}/runtime.properties</file>
|
||||
</files>
|
||||
<quiet>true</quiet>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.wildfly.plugins</groupId>
|
||||
<artifactId>wildfly-maven-plugin</artifactId>
|
||||
|
|
@ -341,58 +251,6 @@
|
|||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.wildfly.plugins</groupId>
|
||||
<artifactId>wildfly-jar-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<jvmArguments>
|
||||
<arg>-agentlib:jdwp=transport=dt_socket,server=y,suspend=${libreccm.debug.suspend},address=${libreccm.debug.port}</arg>
|
||||
</jvmArguments>
|
||||
<arguments>
|
||||
-Dorg.wildfly.datasources.postgresql.database=${libreccm.database.name}
|
||||
-Dorg.wildfly.datasources.postgresql.host=${libreccm.database.host}
|
||||
-Dorg.wildfly.datasources.postgresql.jndi-name=java:/comp/env/jdbc/libreccm/db
|
||||
-Dorg.wildfly.datasources.postgresql.password=${libreccm.database.password}
|
||||
-Dorg.wildfly.datasources.postgresql.port=${libreccm.database.port}
|
||||
-Dorg.wildfly.datasources.postgresql.user-name=${libreccm.database.user}
|
||||
</arguments>
|
||||
<feature-packs>
|
||||
<feature-pack>
|
||||
<location>wildfly@maven(org.jboss.universe:community-universe)#24.0.1.Final</location>
|
||||
</feature-pack>
|
||||
<feature-pack>
|
||||
<groupId>org.wildfly</groupId>
|
||||
<artifactId>wildfly-datasources-galleon-pack</artifactId>
|
||||
<version>2.0.2.Final</version>
|
||||
</feature-pack>
|
||||
</feature-packs>
|
||||
<layers>
|
||||
<layer>cdi</layer>
|
||||
<layer>datasources</layer>
|
||||
<layer>ejb</layer>
|
||||
<layer>jaxrs</layer>
|
||||
<layer>jpa</layer>
|
||||
<layer>jsf</layer>
|
||||
<layer>jsonp</layer>
|
||||
<layer>logging</layer>
|
||||
<layer>mail</layer>
|
||||
<layer>management</layer>
|
||||
<layer>postgresql-datasource</layer>
|
||||
</layers>
|
||||
<!-- <excluded-layers>
|
||||
<layer>deployment-scanner</layer>
|
||||
</excluded-layers>-->
|
||||
<skip>false</skip>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>package</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
libreccm.debug.suspend=n
|
||||
|
||||
libreccm.database.host=localhost
|
||||
libreccm.database.port=5432
|
||||
libreccm.database.name=ccm-devel
|
||||
libreccm.database.user=ccm
|
||||
libreccm.database.password=ccm47web
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
libreccm.http.port=8080
|
||||
libreccm.https.port=8180
|
||||
libreccm.debug.port=8787
|
||||
libreccm.debug.suspend=n
|
||||
|
||||
libreccm.database.host=localhost
|
||||
libreccm.database.port=5432
|
||||
libreccm.database.name=libreccm-devel
|
||||
libreccm.database.user=libreccm
|
||||
libreccm.database.password=libreccm
|
||||
|
|
@ -80,6 +80,9 @@
|
|||
<Logger name="org.libreccm.security.Shiro"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="org.libreccm.theming.xslt.CcmUriResolver"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="org.libreccm.ui.admin.usersgroupsroles.RolesController"
|
||||
level="debug">
|
||||
</Logger>
|
||||
|
|
@ -98,16 +101,9 @@
|
|||
<Logger name="com.arsdigita.web.DefaultApplicationFileResolver"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name = "org.libreccm.ui.admin.AdminApplication"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="org.libreccm.ui.admin.applications.ApplicationsPage"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="org.librecms.ui.ContentSectionController"
|
||||
level="debug">
|
||||
</Logger>
|
||||
<Logger name="org.libreccm.categorization.CategoryManager"
|
||||
|
||||
|
||||
<Logger name="org.libreccm.ui.admin.AdminUi"
|
||||
level="debug">
|
||||
</Logger>
|
||||
</Loggers>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 57 KiB |
|
|
@ -1,2 +0,0 @@
|
|||
example.setting=Properties from the Freemarker theme.
|
||||
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
* {
|
||||
box-sizing: border-box;
|
||||
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
header {
|
||||
padding: 1em 2em;
|
||||
}
|
||||
|
||||
header img {
|
||||
display: block;
|
||||
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
|
||||
width: 20vw;
|
||||
max-width: 1020px;
|
||||
max-height: 566px;
|
||||
}
|
||||
|
||||
main {
|
||||
max-width: 55em;
|
||||
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
|
||||
padding: 2em 1em;
|
||||
}
|
||||
|
||||
main h1 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
main form.login {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
main form.login .form-row {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
main form.login button[type=submit] {
|
||||
display: block;
|
||||
|
||||
margin-top: 0.75em;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
|
||||
padding: 0.25em;
|
||||
}
|
||||
|
||||
footer {
|
||||
background-color: #71ac52;
|
||||
color: #fff;
|
||||
|
||||
padding: 3em 1em;
|
||||
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
footer p {
|
||||
text-align: center;
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>LibreCCM Devel Theme</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>LibreCCM Devel</h1>
|
||||
<h2>Site Info</h2>
|
||||
<dl>
|
||||
<dt>host</dt>
|
||||
<dd>${CmsPagesSiteInfoModel.host}</dd>
|
||||
<dt>domain</dt>
|
||||
<dd>${CmsPagesSiteInfoModel.domain}</dd>
|
||||
<dt>name</dt>
|
||||
<dd>${CmsPagesSiteInfoModel.name}</dd>
|
||||
<dt>Current category</dt>
|
||||
<dd>${CmsPagesCategoryModel.category.name}</dd>
|
||||
</dl>
|
||||
<h2>Category Tree</h2>
|
||||
<ul>
|
||||
<!--<#list CmsPagesCategoryModel.categoryTree.subCategories as category>
|
||||
<@categoryTreeNode category />
|
||||
</#list>-->
|
||||
<@categoryTreeNode CmsPagesCategoryModel.categoryTree />
|
||||
</ul>
|
||||
<h2>(Index) Item</h2>
|
||||
<#if (CmsPagesCategoryModel.category.hasIndexItem)>
|
||||
<dl>
|
||||
<dt>Name</dt>
|
||||
<dd>${CmsPagesCategorizedItemModel.name}</dd>
|
||||
<dt>Title</dt>
|
||||
<dd>${CmsPagesCategorizedItemModel.title}</dd>
|
||||
<dt>Description</dt>
|
||||
<dd>${CmsPagesCategorizedItemModel.description}</dd>
|
||||
</dl>
|
||||
<#else>
|
||||
<p>No (Index) Item</p>
|
||||
</#if>
|
||||
<h2>Item List</h2>
|
||||
<ul>
|
||||
<#list CmsPagesItemListModel.items as item>
|
||||
<li>
|
||||
<b>${item.title} (${item.name})</b>
|
||||
${item.description}
|
||||
</li>
|
||||
</#list>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<#macro categoryTreeNode category>
|
||||
<li>
|
||||
${category.name}
|
||||
<#if (category.subCategories?size > 0)>
|
||||
<ul>
|
||||
<#list category.subCategories as subCategory>
|
||||
<@categoryTreeNode subCategory />
|
||||
</#list>
|
||||
</ul>
|
||||
</#if>
|
||||
</li>
|
||||
</#macro>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<footer>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/impressum">
|
||||
<!--Impressum-->
|
||||
${localize("footer.impressum")}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/privacy">
|
||||
<!--Privacy-->
|
||||
${localize("footer.privacy")}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<code>imported</code>
|
||||
</li>
|
||||
</ul>
|
||||
</footer>
|
||||
|
|
@ -1 +0,0 @@
|
|||
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
<#import "../main.html.ftl" as main>
|
||||
|
||||
<@main.ccm_main>
|
||||
<h1>${LoginMessages['login.title']}</h1>
|
||||
<#if (loginFailed)>
|
||||
<div class="alert-error">
|
||||
${LoginMessages['login.errors.failed']}
|
||||
</div>
|
||||
</#if>
|
||||
<form action="${mvc.uri('LoginController#processLogin')}"
|
||||
class="login"
|
||||
method="post">
|
||||
<div class="form-row">
|
||||
<label for="login">${LoginMessages['login.screenname.label']}</label>
|
||||
<input id="login" name="login" required="true" type="text" />
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="password">
|
||||
${LoginMessages['login.password.label']}
|
||||
</label>
|
||||
<input id="password"
|
||||
name="password"
|
||||
required="true"
|
||||
type="password" />
|
||||
</div>
|
||||
<input type="hidden"
|
||||
name="returnUrl"
|
||||
value="${returnUrl}" />
|
||||
|
||||
<button type="submit">
|
||||
${LoginMessages['login.submit']}
|
||||
</button>
|
||||
</form>
|
||||
</@main.ccm_main>
|
||||
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Category page</title>
|
||||
<link rel="stylesheet" href="${getContextPath()}/theming/ccm/style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>${LoginMessages['login.password_recovered.title']}</h1>
|
||||
<p>${LoginMessages['login.password_recovered.message']}</p>
|
||||
</main>
|
||||
<#include "footer.html.ftl">
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Category page</title>
|
||||
<link rel="stylesheet" href="${getContextPath()}/theming/ccm/style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>${LoginMessages['login.recover_password.title']}</h1>
|
||||
<# if (failedToSendRecoverMessage)>
|
||||
<div class="alert-error">
|
||||
${LoginMessages['login.errors.failedToSendRecoverMessage']}
|
||||
</div>
|
||||
</#if>
|
||||
<form action="${mvc.url('LoginController#recoverPassword')}"
|
||||
method="post">
|
||||
<label for="email">${LoginMessages['login.email.label']}</label>
|
||||
<input id="email" name="email" required="true" type="text" />
|
||||
|
||||
<button type="submit">
|
||||
${LoginMessages['login.recover_password.submit']}
|
||||
</button>
|
||||
</form>
|
||||
</main>
|
||||
<#include "footer.html.ftl">
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Category page</title>
|
||||
<link rel="stylesheet" href="${themeUrl}/style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>Logout successful</h1>
|
||||
<p>Logout successful</p>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
<#macro ccm_main scripts=[]>
|
||||
<html>
|
||||
<head>
|
||||
<title>Category page</title>
|
||||
<link rel="stylesheet" href="${themeUrl}/styles/style.css" />
|
||||
<#list scripts as script>
|
||||
<script src="${themeUrl}/${script}" />
|
||||
</#list>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href="https://www.libreccm.org">
|
||||
<img alt="LibreCCM Logo"
|
||||
src="${themeUrl}/images/libreccm.png" />
|
||||
</a>
|
||||
</header>
|
||||
<main>
|
||||
<#nested>
|
||||
</main>
|
||||
<footer>
|
||||
<p>LibreCCM basic theme. The customize create your own theme.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
</#macro>
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
label.critical=Critical
|
||||
label.error=Error
|
||||
label.ok=OK
|
||||
label.warning=Warning
|
||||
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
footer.impressum=Impressum
|
||||
footer.privacy=Privacy
|
||||
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
{
|
||||
"files": [
|
||||
{
|
||||
"name": "images",
|
||||
"isDirectory": true,
|
||||
"files": [
|
||||
{
|
||||
"name": "libreccm.png",
|
||||
"isDirectory": false,
|
||||
"mimeType": "image/png"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "settings.properties",
|
||||
"isDirectory": false,
|
||||
"mimeType": "text/plain"
|
||||
},
|
||||
{
|
||||
"name": "styles",
|
||||
"isDirectory": true,
|
||||
"files": [
|
||||
{
|
||||
"name": "style.css",
|
||||
"isDirectory": false,
|
||||
"mimeType": "text/css"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "templates",
|
||||
"isDirectory": true,
|
||||
"files": [
|
||||
{
|
||||
"name": "login",
|
||||
"isDirectory": true,
|
||||
"files": [
|
||||
{
|
||||
"name": "login-form.html.ftl",
|
||||
"isDirectory": false,
|
||||
"mimeType": "text/plain"
|
||||
},
|
||||
{
|
||||
"name": "login-password-recovered.html.ftl",
|
||||
"isDirectory": false,
|
||||
"mimeType": "text/plain"
|
||||
}, {
|
||||
"name": "login-recover-password.html.ftl",
|
||||
"isDirectory": false,
|
||||
"mimeType": "text/plain"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "logout",
|
||||
"isDirectory": true,
|
||||
"files": [
|
||||
{
|
||||
"name": "loggedout.html.ftl",
|
||||
"isDirectory": false,
|
||||
"mimeText": "text/plain"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "texts",
|
||||
"isDirectory": true,
|
||||
"files": [
|
||||
{
|
||||
"name": "labels.properties",
|
||||
"isDirectory": false,
|
||||
"mimeType": "text/plain"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "theme-bundle.properties",
|
||||
"isDirectory": false,
|
||||
"mimeType": "text/plain"
|
||||
},
|
||||
{
|
||||
"name": "theme-index.json",
|
||||
"isDirectory": false,
|
||||
"mimeType": "application/json"
|
||||
},
|
||||
{
|
||||
"name": "theme.json",
|
||||
"isDirectory": false,
|
||||
"mimeType": "application/json"
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
|
|
@ -1,144 +0,0 @@
|
|||
{
|
||||
"name": "librecms-devel",
|
||||
"type": "freemarker",
|
||||
|
||||
"default-template": "templates/default.html.ftl",
|
||||
|
||||
"mvc-templates": {
|
||||
"default": {
|
||||
"description": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "Default Template"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "Default Template",
|
||||
"path": "templates/default.html.ftl",
|
||||
"title": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "Default Template"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"login-form": {
|
||||
"description": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "Login Form"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "Login Form",
|
||||
"path": "templates/login/login-form.html.ftl",
|
||||
"title": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "Login Form"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"login-recover-password": {
|
||||
"description": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "Recover lost passwords"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "login-recover-password",
|
||||
"path": "templates/login/login-recover-password.html.ftl",
|
||||
"title": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "Recover password"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"login-password-recovered": {
|
||||
"description": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "Password recovered"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "login-password-recovered",
|
||||
"path": "templates/login/login-password-recovered.html.ftl",
|
||||
"title": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "Password recovered"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"loggedout": {
|
||||
"description": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "Logout successful"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "loggedout",
|
||||
"path": "templates/logout/loggedout.html.ftl",
|
||||
"title": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "Logout succesful"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"views": {
|
||||
"default": {
|
||||
"default": "default",
|
||||
"@default": "default"
|
||||
},
|
||||
"login": {
|
||||
"loginForm": "login-form",
|
||||
"passwordRecovered": "login-password-recovered",
|
||||
"recoverPassword": "login-recover-password"
|
||||
},
|
||||
"logout": {
|
||||
"loggedout": "loggedout"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -25,6 +25,7 @@
|
|||
<jar-file>lib/ccm-cms-7.0.0-SNAPSHOT.jar</jar-file>
|
||||
<jar-file>lib/ccm-shortcuts-7.0.0-SNAPSHOT.jar</jar-file>
|
||||
|
||||
|
||||
<properties>
|
||||
<!-- Properties for Hibernate -->
|
||||
<property name="hibernate.hbm2ddl.auto" value="validate" />
|
||||
|
|
|
|||
|
|
@ -4,7 +4,4 @@
|
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
|
||||
http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
|
||||
<application>
|
||||
<resource-handler>org.libreccm.mvc.facelets.CcmViewResourceHandler</resource-handler>
|
||||
</application>
|
||||
</faces-config>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version="1.0" ?>
|
||||
<jboss-web>
|
||||
<context-root>/libreccm</context-root>
|
||||
<default-encoding>UTF-8</default-encoding>
|
||||
</jboss-web>
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@
|
|||
<param-name>ccm.distribution</param-name>
|
||||
<param-value>libreccm</param-value>
|
||||
</context-param>
|
||||
<context-param>
|
||||
<param-name>resteasy.resources</param-name>
|
||||
<param-value>org.jboss.resteasy.plugins.stats.RegistryStatsResource</param-value>
|
||||
</context-param>
|
||||
|
||||
<!-- No JSESSIONID!!! -->
|
||||
<session-config>
|
||||
|
|
@ -69,10 +65,6 @@
|
|||
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
|
||||
<param-value>true</param-value>
|
||||
</context-param>
|
||||
<context-param>
|
||||
<param-name>PARAMETER_ENCODING</param-name>
|
||||
<param-value>UTF-8</param-value>
|
||||
</context-param>
|
||||
|
||||
<!-- <servlet>
|
||||
<servlet-name>vaadin-servlet</servlet-name>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ module.exports = {
|
|||
devtool: "source-map",
|
||||
|
||||
entry: {
|
||||
// "ccm-cms-pagemodelseditor": "./src/main/typescript/ccm-cms-pagemodelseditor.ts",
|
||||
"ccm-cms-pagemodelseditor": "./src/main/typescript/ccm-cms-pagemodelseditor.ts",
|
||||
// "ccm-cms-tinymce-loader": "./src/main/typescript/tinymce/ccm-cms-tinymce-loader.ts",
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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">
|
||||
<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>
|
||||
|
||||
|
|
@ -44,18 +43,18 @@
|
|||
<artifactId>ccm-theme-ftllibs-devel</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.librecms</groupId>
|
||||
<artifactId>ccm-cms-default-theme</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<groupId>net.sf.saxon</groupId>
|
||||
<artifactId>Saxon-HE</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- CCM modules -->
|
||||
<!-- <dependency>
|
||||
<dependency>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-shortcuts</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>-->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.librecms</groupId>
|
||||
<artifactId>ccm-cms</artifactId>
|
||||
|
|
@ -64,10 +63,13 @@
|
|||
<!-- CCM Modules end -->
|
||||
|
||||
<!-- Dependencies for log4j 2 including adapter for the log4j 1.2 API -->
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
|
|
|||
|
|
@ -113,8 +113,8 @@
|
|||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.3</version>
|
||||
<configuration>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
<optimize>true</optimize>
|
||||
<debug>true</debug>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
|
|
@ -191,8 +191,13 @@
|
|||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.10.3</version>
|
||||
<configuration>
|
||||
<detectLinks>false</detectLinks>
|
||||
<detectJavaApiLinks>false</detectJavaApiLinks>
|
||||
<detectLinks>true</detectLinks>
|
||||
<detectJavaApiLinks>true</detectJavaApiLinks>
|
||||
<links>
|
||||
<link>http://docs.oracle.com/javase/7/docs/api/</link>
|
||||
<link>http://docs.oracle.com/javaee/7/api/</link>
|
||||
<link>http://docs.jboss.org/hibernate/orm/4.3/javadocs/</link>
|
||||
</links>
|
||||
<show>private</show>
|
||||
<docfilessubdirs>true</docfilessubdirs>
|
||||
<charset>UTF-8</charset>
|
||||
|
|
@ -203,6 +208,16 @@
|
|||
<author>true</author>
|
||||
<keywords>true</keywords>
|
||||
<failOnError>false</failOnError>
|
||||
<doclet>org.jboss.apiviz.APIviz</doclet>
|
||||
<docletArtifact>
|
||||
<groupId>org.jboss.apiviz</groupId>
|
||||
<artifactId>apiviz</artifactId>
|
||||
<version>1.3.2.GA</version>
|
||||
</docletArtifact>
|
||||
<useStandardDocletOptions>true</useStandardDocletOptions>
|
||||
<additionalparam>
|
||||
-sourceclasspath ${project.build.outputDirectory}
|
||||
</additionalparam>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
|
@ -229,7 +244,7 @@
|
|||
<configuration>
|
||||
<linkXref>true</linkXref>
|
||||
<sourceEncoding>utf-8</sourceEncoding>
|
||||
<targetJdk>11</targetJdk>
|
||||
<targetJdk>1.8</targetJdk>
|
||||
<rulesets>
|
||||
<ruleset>/rulesets/java/basic.xml</ruleset>
|
||||
<ruleset>/rulesets/java/braces.xml</ruleset>
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
{
|
||||
"name": "@librecms/default-theme",
|
||||
"version": "7.0.0",
|
||||
"scripts": {
|
||||
"build": "npm-run-all build:*",
|
||||
"build:mkdir": "shx mkdir -p target/generated-resources/themes/librecms",
|
||||
"build:theme": "shx cp -r src/main/resources/themes/librecms/* target/generated-resources/themes/librecms",
|
||||
"build:icons": "shx cp node_modules/bootstrap-icons/bootstrap-icons.svg target/generated-resources/themes/librecms/images/",
|
||||
"build:js": "webpack",
|
||||
"build:css": "npm-run-all build:css:*",
|
||||
"build:css:librecms": "sass src/main/scss/librecms.scss target/generated-resources/themes/librecms/styles/librecms.css",
|
||||
"build:index": "theme-index-builder target/generated-resources/themes/librecms"
|
||||
},
|
||||
"author": "Jens Pelzetter",
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"devDependencies": {
|
||||
"@types/bootstrap": "^5.1.8",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"sass": "^1.48.0",
|
||||
"shx": "^0.3.4",
|
||||
"ts-loader": "^9.2.6",
|
||||
"typescript": "^4.5.4",
|
||||
"webpack": "^5.66.0",
|
||||
"webpack-cli": "^4.9.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"bootstrap": "^5.1.3",
|
||||
"bootstrap-icons": "^1.7.2"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<timestamp>${maven.build.timestamp}</timestamp>
|
||||
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'Z</maven.build.timestamp.format>
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>libreccm-parent</artifactId>
|
||||
<version>7.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.librecms</groupId>
|
||||
<artifactId>ccm-cms-default-theme</artifactId>
|
||||
<version>7.0.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>LibreCMS Default Theme</name>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>Lesser GPL 2.1</name>
|
||||
<url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1</url>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.libreccm</groupId>
|
||||
<artifactId>ccm-static-theme-index-builder</artifactId>
|
||||
<version>7.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<finalName>ccm-cms-default-theme</finalName>
|
||||
|
||||
<resources>
|
||||
<!-- <resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/typescript</directory>
|
||||
</resource> -->
|
||||
<resource>
|
||||
<directory>${project.build.directory}/generated-resources</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.github.eirslett</groupId>
|
||||
<artifactId>frontend-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<installDirectory>../node</installDirectory>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>Install node.js and NPM</id>
|
||||
<goals>
|
||||
<goal>install-node-and-npm</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<nodeVersion>v16.14.2</nodeVersion>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm install</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm link @libreccm/ccm-static-theme-index-builder</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<arguments>link @libreccm/ccm-static-theme-index-builder</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>build</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<arguments>run build</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm link</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<arguments>link</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -1 +0,0 @@
|
|||
import "bootstrap";
|
||||
|
Before Width: | Height: | Size: 175 KiB |
|
Before Width: | Height: | Size: 174 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 180 KiB |
|
|
@ -1,63 +0,0 @@
|
|||
<#macro "org.librecms.assets.AudioAsset" asset>
|
||||
<figure>
|
||||
<audio controls
|
||||
src="/content-sections/${asset.contentSection}/audiomedia${asset.assetPath}"
|
||||
width="240"></audio>
|
||||
<figcaption>${asset.description}</figcaption>
|
||||
</figure>
|
||||
</#macro>
|
||||
|
||||
<#macro "org.librecms.assets.ExternalAudioAsset" asset>
|
||||
<figure>
|
||||
<audio controls src="${asset.url}" width="240"></audio>
|
||||
<figcaption>${asset.description}</figcaption>
|
||||
</figure>
|
||||
</#macro>
|
||||
|
||||
<#macro "org.librecms.assets.ExternalVideoAsset" asset>
|
||||
<figure>
|
||||
<video controls src="${asset.url}" width="240"></video>
|
||||
<figcaption>${asset.description}</figcaption>
|
||||
</figure>
|
||||
</#macro>
|
||||
|
||||
<#macro "org.librecms.assets.FileAsset" asset>
|
||||
<h3><a href="/content-sections/${asset.contentSection}/files${asset.assetPath}">${asset.title}</a></h3>
|
||||
<p>${asset.description}</p>
|
||||
<small>${asset.mimeType} ${asset.size} Bytes</small>
|
||||
</#macro>
|
||||
|
||||
<#macro "org.librecms.assets.Image" asset>
|
||||
<figure>
|
||||
<img src="/content-sections/${asset.contentSection}/images${asset.assetPath}"
|
||||
width="240" />
|
||||
<figcaption>${asset.description}</figcaption>
|
||||
</figure>
|
||||
</#macro>
|
||||
|
||||
|
||||
<#macro "org.librecms.assets.RelatedLink" asset>
|
||||
<#if asset.externalLink>
|
||||
<div>
|
||||
<a href="${asset.targetUrl}">${asset.title}</a>
|
||||
<svg class="bi"
|
||||
fill="current-color"
|
||||
height="1em"
|
||||
width="1em">
|
||||
<use xlink:href="${themeUrl}/images/bootstrap-icons.svg#globe" />
|
||||
</svg>
|
||||
<span class="visually-hidden">External link</span>
|
||||
</div>
|
||||
<#else>
|
||||
<a href="${asset.targetItemPath}">${asset.title}</a>
|
||||
</#if>
|
||||
</#macro>
|
||||
|
||||
<#macro "org.librecms.assets.VideoAsset" asset>
|
||||
<figure>
|
||||
<video controls
|
||||
src="/content-sections/${asset.contentSection}/videos${asset.assetPath}"
|
||||
width="240"></video>
|
||||
<figcaption>${asset.description}</figcaption>
|
||||
</figure>
|
||||
</#macro>
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
<#import "./main.html.ftl" as main>
|
||||
<#import "./assets.html.ftl" as assets>
|
||||
|
||||
<@main.librecms>
|
||||
<div class="container">
|
||||
<div class="row align-items-start justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<#if CmsPagesContentItemTypeModel.itemClass != "">
|
||||
<#assign itemTemplate = .getOptionalTemplate("./contentitems/${CmsPagesContentItemTypeModel.itemClass}.html.ftl")>
|
||||
<#if itemTemplate.exists>
|
||||
<#import "./contentitems/${CmsPagesContentItemTypeModel.itemClass}.html.ftl" as contentitem>
|
||||
<#else>
|
||||
<#import "./contentitems/default.html.ftl" as contentitem>
|
||||
</#if>
|
||||
<@contentitem.details />
|
||||
</#if>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<#list CmsPagesCategorizedItemModel.attachmentLists as attachmentList>
|
||||
<h2>${attachmentList.title}</h2>
|
||||
<p class="item-description">${attachmentList.description}</p>
|
||||
<#list attachmentList.attachments>
|
||||
<ul class="list-group">
|
||||
<#items as attachment>
|
||||
<li class="list-group-item">
|
||||
<@.vars["assets"][attachment.asset.type] attachment.asset />
|
||||
</li>
|
||||
</#items>
|
||||
</ul>
|
||||
</#list>
|
||||
</#list>
|
||||
</div>
|
||||
</div>
|
||||
<#list CmsPagesItemListModel.getItems()>
|
||||
<div class="row align-items-start">
|
||||
<div class="col-12">
|
||||
<ul class="list-group">
|
||||
<#items as item>
|
||||
<li class="list-group-item">
|
||||
<h2>
|
||||
<a href="/pages/${CmsPagesCategoryModel.category.path}${item.name}.${negotiatedLocale}.html${CmsPagesPageUrlModel.queryString}">${item.title}</a>
|
||||
</h2>
|
||||
<p class="item-description">${item.description}</p>
|
||||
</li>
|
||||
</#items>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</#list>
|
||||
</@main.librecms>
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
<#macro details>
|
||||
<h1>${CmsPagesCategorizedItemModel.title}</h1>
|
||||
<p class="item-description">${CmsPagesCategorizedItemModel.description}</p>
|
||||
<div class="alert alert-warning">
|
||||
No template for ${CmsPagesContentItemTypeModel.itemClass} available
|
||||
</div>
|
||||
</#macro>
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<#import "../assets.html.ftl" as assets>
|
||||
|
||||
<#macro details>
|
||||
<h1>${CmsPagesCategorizedItemModel.title}</h1>
|
||||
<p class="item-description">${CmsPagesCategorizedItemModel.description}</p>
|
||||
|
||||
<div class="float-end">
|
||||
<#list CmsPagesCategorizedItemModel.mediaLists as mediaList>
|
||||
<#list mediaList.attachments as media>
|
||||
<@.vars["assets"][media.asset.type] media.asset />
|
||||
</#list>
|
||||
</#list>
|
||||
</div>
|
||||
<div>
|
||||
${CmsPagesArticleModel.text}
|
||||
</div>
|
||||
</#macro>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
<#macro details>
|
||||
<div class="d-flex">
|
||||
<h1>
|
||||
${CmsPagesCategorizedItemModel.title}
|
||||
<span class="badge bg-secondary rounded-pill">
|
||||
${CmsPagesEventModel.getStartDateTime('yyyy-MM-dd')}
|
||||
<#if CmsPagesEventModel.getEndDateTime()??>
|
||||
- ${CmsPagesEventModel.getEndDateTime('yyyy-MM-dd')}
|
||||
</#if>
|
||||
</span>
|
||||
</h1>
|
||||
</div>
|
||||
<p class="item-description">${CmsPagesCategorizedItemModel.description}</p>
|
||||
|
||||
<div>
|
||||
${CmsPagesEventModel.text}
|
||||
</div>
|
||||
|
||||
<#if CmsPagesEventModel.location??>
|
||||
<h2>Location</h2>
|
||||
<div>
|
||||
${CmsPagesEventModel.location}
|
||||
</div>
|
||||
</#if>
|
||||
</#macro>
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
<#macro details>
|
||||
<h1>${CmsPagesCategorizedItemModel.title}</h1>
|
||||
<p class="item-description">${CmsPagesCategorizedItemModel.description}</p>
|
||||
|
||||
<h2>${CmsPagesMultiPartArticleModel.currentSectionTitle}</h2>
|
||||
<div>
|
||||
<nav>
|
||||
<ul class="flex-column float-end nav">
|
||||
<#list CmsPagesMultiPartArticleModel.sectionTitles as section>
|
||||
<li class="nav-item">
|
||||
<#if section?index == CmsPagesMultiPartArticleModel.currentSection>
|
||||
<a aria-current="page"
|
||||
class="active nav-link"
|
||||
href="${CmsPagesMultiPartArticleModel.sectionLinks[section?index]}">
|
||||
${section}
|
||||
</a>
|
||||
<#else>
|
||||
<a class="nav-link"
|
||||
href="${CmsPagesMultiPartArticleModel.sectionLinks[section?index]}">
|
||||
${section}
|
||||
</a>
|
||||
</#if>
|
||||
</li>
|
||||
</#list>
|
||||
</ul>
|
||||
</nav>
|
||||
${CmsPagesMultiPartArticleModel.currentSectionText}
|
||||
<nav>
|
||||
<ul class="pagination">
|
||||
<#if CmsPagesMultiPartArticleModel.prevSectionLink != "">
|
||||
<li class="list-item">
|
||||
<a class="page-link"
|
||||
href="${CmsPagesMultiPartArticleModel.prevSectionLink}">
|
||||
<svg class="bi"
|
||||
fill="current-color"
|
||||
height="1em"
|
||||
width="1em">
|
||||
<use xlink:href="${themeUrl}/images/bootstrap-icons.svg#caret-left-fill" />
|
||||
</svg>
|
||||
<span class="visually-hidden">Previous</span>
|
||||
</a>
|
||||
</li>
|
||||
</#if>
|
||||
<#if CmsPagesMultiPartArticleModel.nextSectionLink != "">
|
||||
<li class="list-item">
|
||||
<a class="page-link"
|
||||
href="${CmsPagesMultiPartArticleModel.nextSectionLink}">
|
||||
<svg class="bi"
|
||||
fill="current-color"
|
||||
height="1em"
|
||||
width="1em">
|
||||
<use xlink:href="${themeUrl}/images/bootstrap-icons.svg#caret-right-fill" />
|
||||
</svg>
|
||||
<span class="visually-hidden">Next</span>
|
||||
</a>
|
||||
</li>
|
||||
</#if>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</#macro>
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<#macro details>
|
||||
<div class="d-flex">
|
||||
<h1>
|
||||
${CmsPagesCategorizedItemModel.title}
|
||||
<span class="badge bg-secondary rounded-pill">
|
||||
${CmsPagesNewsModel.getReleaseDate('yyyy-MM-dd')}
|
||||
</span>
|
||||
</h1>
|
||||
</div>
|
||||
<p class="item-description">${CmsPagesCategorizedItemModel.description}</p>
|
||||
|
||||
<div>
|
||||
${CmsPagesNewsModel.text}
|
||||
</div>
|
||||
</#macro>
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link href="${themeUrl}/styles/librecms.css" rel="stylesheet" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Default Template</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<p>This theme works.</p>
|
||||
<dl>
|
||||
<dt>application</dt>
|
||||
<dd>${application}</dd>
|
||||
<dt>themeUrl</dt>
|
||||
<dd>${themeUrl}</dd>
|
||||
<dt>view</dt>
|
||||
<dd>${view!""}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
<#import "./main.html.ftl" as main>
|
||||
<#-- <#import "./contentitems/${CmsPagesContentItemTypeModel.itemClass}.html.ftl" as contentitem> -->
|
||||
|
||||
<@main.librecms>
|
||||
<div class="container">
|
||||
<div class="row align-items-start justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<#if CmsPagesContentItemTypeModel.itemClass != "">
|
||||
<#assign itemTemplate = .getOptionalTemplate("./contentitems/${CmsPagesContentItemTypeModel.itemClass}.html.ftl")>
|
||||
<#if itemTemplate.exists>
|
||||
<#import "./contentitems/${CmsPagesContentItemTypeModel.itemClass}.html.ftl" as contentitem>
|
||||
<#else>
|
||||
<#import "./contentitems/default.html.ftl" as contentitem>
|
||||
</#if>
|
||||
<@contentitem.details />
|
||||
</#if>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<!-- Attachments -->
|
||||
<h2>Notes</h2>
|
||||
<ul class="list-group mb-4">
|
||||
<li class="list-group-item">
|
||||
<p>
|
||||
A side note with some text
|
||||
</p>
|
||||
<p>
|
||||
Occaecat sit eu ipsum irure. Enim consectetur aute anim proident sint dolor sint ea ex eu adipisicing et. Veniam laborum mollit velit incididunt aliquip do esse officia eu ea nostrud nulla.
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>More information</h2>
|
||||
<p>
|
||||
Consequat occaecat eu ullamco amet id tempor.
|
||||
</p>
|
||||
<ul class="list-group mb-4">
|
||||
<li class="list-group-item">
|
||||
<p>Anim ex ut reprehenderit in enim id proident duis pariatur est anim do.</p>
|
||||
<a href="https://example.com">A related link</a>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<p>Quis minim deserunt incididunt ea voluptate laboris fugiat elit nulla.</p>
|
||||
<a href="https://example.com">Some download link</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</@main.librecms>
|
||||
|
|
@ -1,173 +0,0 @@
|
|||
<#import "./main.html.ftl" as main>
|
||||
|
||||
<@main.librecms>
|
||||
<div class="container">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<div class="bg-light mb-4 rounded-3">
|
||||
<div class="container-fluid py-5">
|
||||
<#if CmsPagesCategorizedItemModel.itemAvailable>
|
||||
<h1 class="display-5 fw-bold">
|
||||
${CmsPagesCategorizedItemModel.title}
|
||||
</h1>
|
||||
<p>
|
||||
${CmsPagesCategorizedItemModel.description}
|
||||
</p>
|
||||
<a class="btn btn-primary btn-lg"
|
||||
href="#">
|
||||
Find out more
|
||||
</a>
|
||||
<#else>
|
||||
<h1 class="display-5 fw-bold">
|
||||
LibreCMS
|
||||
</h1>
|
||||
<p>
|
||||
No index item has been defined.
|
||||
</p>
|
||||
<a class="btn btn-primary btn-lg"
|
||||
href="https://www.libreccm.org">
|
||||
Find out more
|
||||
</a>
|
||||
</#if>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<#-- <#if CmsPagesCategorizedItemModel.itemAvailable>
|
||||
Category has an index item
|
||||
<#else>
|
||||
Category has no index item
|
||||
</#if>
|
||||
|
||||
<h2>Index page</h2>
|
||||
<p>This theme works.</p>
|
||||
<dl>
|
||||
<dt>application</dt>
|
||||
<dd>${application}</dd>
|
||||
<dt>themeUrl</dt>
|
||||
<dd>${themeUrl}</dd>
|
||||
<dt>view</dt>
|
||||
<dd>${view!""}</dd>
|
||||
</dl>
|
||||
|
||||
<h2>From <code>ArticleModel</code></h2>
|
||||
<dl>
|
||||
<dt>Title</dt>
|
||||
<dd>${CmsPagesArticleModel.title}</dd>
|
||||
<dt>Description</dt>
|
||||
<dd>${CmsPagesArticleModel.description}</dd>
|
||||
<dt>Text</dt>
|
||||
<dd>${CmsPagesArticleModel.text}</dd>
|
||||
</dl>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="row align-items-start justify-content-center">
|
||||
<#list CmsPagesItemListModel.getItems("newslist")>
|
||||
<div class="col">
|
||||
<h2>News</h2>
|
||||
<ul class="list-group">
|
||||
<#items as news>
|
||||
<li class="list-group-item">
|
||||
<h3 class="d-flex w-100 justify-content-between">
|
||||
<div>
|
||||
<a href="/pages${CmsPagesCategoryModel.category.path}${news.name}.${negotiatedLocale}.html${CmsPagesPageUrlModel.queryString}">${news.title}</a>
|
||||
</div>
|
||||
<#-- <div>${news.getReleaseDate('yyyy-MM-dd')}</div> -->
|
||||
<div>${news.getReleaseDate('dd. MMM yyyy')}</div>
|
||||
</h3>
|
||||
<p class="item-description">${news.description}</p>
|
||||
</li>
|
||||
</#items>
|
||||
</ul>
|
||||
</div>
|
||||
</#list>
|
||||
<#list CmsPagesItemListModel.getItems("eventlist")>
|
||||
<div class="col">
|
||||
<h2>Upcoming events</h2>
|
||||
<ul class="list-group">
|
||||
<#items as event>
|
||||
<li class="list-group-item">
|
||||
<h3 class="d-flex w-100 justify-content-between">
|
||||
<div>
|
||||
<a href="/pages${CmsPagesCategoryModel.category.path}${event.name}.${negotiatedLocale}.html${CmsPagesPageUrlModel.queryString}">${event.title}</a>
|
||||
</div>
|
||||
<div>${event.getStartDate('dd. MMM yyyy HH:mm')}</div>
|
||||
</h3>
|
||||
<p class="item-description">${event.description}</p>
|
||||
</li>
|
||||
</#items>
|
||||
</ul>
|
||||
</div>
|
||||
</#list>
|
||||
</div>
|
||||
|
||||
|
||||
<#-- <h2>Item List</h2>
|
||||
<p>Item List size: ${CmsPagesItemListModel.listSize}</p>
|
||||
<dl>
|
||||
<dt>Item List size:</dt>
|
||||
<dd>${CmsPagesItemListModel.listSize}</dd>
|
||||
<dt>Page size</dt>
|
||||
<dd>${CmsPagesItemListModel.pageSize}</dd>
|
||||
<dt>Page</dt>
|
||||
<dd>${CmsPagesItemListModel.page}</dd>
|
||||
<dt>Offset</dt>
|
||||
<dd>${CmsPagesItemListModel.offset}</dd>
|
||||
</dl>
|
||||
<ul>
|
||||
<#list CmsPagesItemListModel.items as item>
|
||||
<li>
|
||||
<dl>
|
||||
<dt>UUID</dt>
|
||||
<dd>${item.uuid}</dd>
|
||||
<dt>displayName</dt>
|
||||
<dd>${item.displayName}</dd>
|
||||
<dt>Name</dt>
|
||||
<dd>${item.name}</dd>
|
||||
<dt>Title</dt>
|
||||
<dd>${item.title}</dd>
|
||||
<dt>description</dt>
|
||||
<dd>${item.description}</dd>
|
||||
<dt>Type</dt>
|
||||
<dd>${item.type}</dd>
|
||||
</dl>
|
||||
</li>
|
||||
</#list>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h2>News List</h2>
|
||||
<p>News List size: ${CmsPagesItemListModel.getListSize("newslist")}</p>
|
||||
<dl>
|
||||
<dt>Item List size:</dt>
|
||||
<dd>${CmsPagesItemListModel.getListSize("newslist")}</dd>
|
||||
<dt>Page size</dt>
|
||||
<dd>${CmsPagesItemListModel.getPageSize("newslist")}</dd>
|
||||
<dt>Page</dt>
|
||||
<dd>${CmsPagesItemListModel.getPage("newslist")}</dd>
|
||||
<dt>Offset</dt>
|
||||
<dd>${CmsPagesItemListModel.getOffset("newslist")}</dd>
|
||||
</dl>
|
||||
<ul>
|
||||
<#list CmsPagesItemListModel.getItems("newslist") as item>
|
||||
<li>
|
||||
<dl>
|
||||
<dt>UUID</dt>
|
||||
<dd>${item.uuid}</dd>
|
||||
<dt>displayName</dt>
|
||||
<dd>${item.displayName}</dd>
|
||||
<dt>Name</dt>
|
||||
<dd>${item.name}</dd>
|
||||
<dt>Title</dt>
|
||||
<dd>${item.title}</dd>
|
||||
<dt>description</dt>
|
||||
<dd>${item.description}</dd>
|
||||
<dt>Type</dt>
|
||||
<dd>${item.type}</dd>
|
||||
</dl>
|
||||
</li>
|
||||
</#list>
|
||||
</ul>
|
||||
</div> -->
|
||||
|
||||
</@main.librecms>
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
<#macro librecms scripts=[]>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link href="${themeUrl}/styles/librecms.css" rel="stylesheet" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Default Template</title>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-lg navbar-expand navbar-light bg-light">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand"
|
||||
href="/pages">
|
||||
<img class="theme-logo img-fluid"
|
||||
src="${themeUrl}/images/librecms.svg" />
|
||||
</a>
|
||||
<button aria-controls="navbarSupportedContent"
|
||||
aria-expanded="false"
|
||||
aria-label="Toggle navigation"
|
||||
class="navbar-toggler"
|
||||
data-bs-toggle="collapse"
|
||||
data-bs-target="#navbar-items"
|
||||
type="button">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse"
|
||||
id="navbar-items">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<#list CmsPagesCategoryModel.categoryTree.subCategories as category>
|
||||
<li ${category.selected?then("aria-selected=\"page\"","")}
|
||||
class="nav-item ${category.selected?then( "active","")}">
|
||||
<a class="nav-link"
|
||||
href="/pages${category.categoryPath}/index.${negotiatedLocale}.html${CmsPagesPageUrlModel.queryString}">
|
||||
${category.title}
|
||||
</a>
|
||||
</li>
|
||||
</#list>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<#nested>
|
||||
</main>
|
||||
<script src="${themeUrl}/scripts/librecms.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
</#macro>
|
||||
|
|
@ -1,121 +0,0 @@
|
|||
{
|
||||
"name": "librecms",
|
||||
"type": "freemarker",
|
||||
"master-theme": null,
|
||||
"title": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "LibreCMS Default Theme"
|
||||
},
|
||||
{
|
||||
"lang": "de",
|
||||
"value": "LibreCMS Standard Theme"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"description": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "The LibreCMS default theme"
|
||||
},
|
||||
{
|
||||
"lang": "de",
|
||||
"value": "Das LibreCMS Standard Theme"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
"mvc-templates": {
|
||||
"category-page": {
|
||||
"description": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "Template for category pages."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "Category Page Template",
|
||||
"path": "templates/category-page.html.ftl",
|
||||
"title": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "Category Page Template"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "Default Template used if no other template fits."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "Default Template",
|
||||
"path": "templates/default.html.ftl",
|
||||
"title": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "Default Template"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"index-page": {
|
||||
"description": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "Template for the index page of a site."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"name": "index-page",
|
||||
"path": "templates/index-page.html.ftl",
|
||||
"title": {
|
||||
"values": {
|
||||
"value": [
|
||||
{
|
||||
"lang": "en",
|
||||
"value": "Index Page"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"views": {
|
||||
"default": {
|
||||
"default": "default",
|
||||
"@default": "default"
|
||||
},
|
||||
"pages": {
|
||||
"category-page": "category-page",
|
||||
"index": "index-page",
|
||||
"default": "default",
|
||||
"@default": "default"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
$primary: #0A9793;
|
||||
|
||||
a.navbar-brand {
|
||||
max-width: 15%;
|
||||
}
|
||||
|
||||
.imgbox-button {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.item-description {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
@import "custom";
|
||||
@import "../../../node_modules/bootstrap/scss/bootstrap"
|
||||
|
|
@ -1 +0,0 @@
|
|||
import "bootstrap";
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"declaration": true,
|
||||
"lib": ["DOM", "ES2016"],
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "scripts",
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"target": "ES6"
|
||||
},
|
||||
"include": ["src/main/typescript/**/*"]
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
|
||||
module.exports = {
|
||||
mode: "development",
|
||||
devtool: "source-map",
|
||||
optimization: {
|
||||
chunkIds: false
|
||||
},
|
||||
entry: {
|
||||
librecms: "./src/main/typescript/librecms.ts"
|
||||
},
|
||||
output: {
|
||||
filename: "[name].js",
|
||||
path: __dirname + "/target/generated-resources/themes/librecms/scripts"
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".tsx", ".ts", ".js", ".jsx"],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
// all files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'
|
||||
{ test: /\.tsx?$/, use: ["ts-loader"], exclude: /node_modules/ },
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -75,16 +75,16 @@
|
|||
<goal>install-node-and-npm</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<nodeVersion>v16.14.2</nodeVersion>
|
||||
<nodeVersion>${nodeVersion}</nodeVersion>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm link @libreccm/ccm-pagemodelseditor</id>
|
||||
<id>install ccm-pagemodelseditor</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<arguments>link @libreccm/ccm-pagemodelseditor</arguments>
|
||||
<arguments>install ../ccm-pagemodelseditor</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
|
@ -93,16 +93,6 @@
|
|||
<goal>npm</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<!-- Sync Maven module version and NPM module version -->
|
||||
<execution>
|
||||
<id>npm version</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<arguments>version --allow-same-version=true ${project.version}</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>build</id>
|
||||
<goals>
|
||||
|
|
@ -112,15 +102,6 @@
|
|||
<arguments>run build</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm link</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<arguments>link</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"requires": true,
|
||||
"dependencies": {
|
||||
"@libreccm/ccm-pagemodelseditor": {
|
||||
"version": "7.0.0",
|
||||
"version": "file:../ccm-pagemodelseditor",
|
||||
"requires": {
|
||||
"react": "^16.4.2",
|
||||
"react-dom": "^16.4.2",
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
"tslint": "tslint --project ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@libreccm/ccm-pagemodelseditor": "7.0.0",
|
||||
"@libreccm/ccm-pagemodelseditor": "file:../ccm-pagemodelseditor",
|
||||
"react": "^16.4.2",
|
||||
"react-dom": "^16.4.2"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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">
|
||||
<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>
|
||||
|
||||
|
|
@ -8,7 +7,6 @@
|
|||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<timestamp>${maven.build.timestamp}</timestamp>
|
||||
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'Z</maven.build.timestamp.format>
|
||||
<buildNumber></buildNumber>
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
|
|
@ -59,71 +57,6 @@
|
|||
|
||||
<plugins>
|
||||
|
||||
<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-remote-resources-plugin</artifactId> <version>1.5</version> <configuration> <resourceBundles>
|
||||
<resourceBundle>org.libreccm:ccm-pagemodelseditor:${project.version}</resourceBundle> </resourceBundles> </configuration> <executions> <execution> <goals> <goal>process</goal> </goals> </execution> </executions> </plugin> -->
|
||||
|
||||
<!--<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
|
||||
<executions>
|
||||
<execution>
|
||||
<id>npm install</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>npm</executable>
|
||||
<arguments>
|
||||
<argument>install</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm link @libreccm/ccm-pagemodelseditor</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>npm</executable>
|
||||
<arguments>
|
||||
<argument>link</argument>
|
||||
<argument>@libreccm/ccm-pagemodelseditor</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm run build</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>npm</executable>
|
||||
<arguments>
|
||||
<argument>run</argument>
|
||||
<argument>build</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm link</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>npm</executable>
|
||||
<arguments>
|
||||
<argument>link</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>-->
|
||||
|
||||
<plugin>
|
||||
<groupId>com.github.eirslett</groupId>
|
||||
<artifactId>frontend-maven-plugin</artifactId>
|
||||
|
|
@ -139,16 +72,16 @@
|
|||
<goal>install-node-and-npm</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<nodeVersion>v16.14.2</nodeVersion>
|
||||
<nodeVersion>${nodeVersion}</nodeVersion>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm link @libreccm/ccm-pagemodelseditor</id>
|
||||
<id>install ccm-pagemodelseditor</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<arguments>link @libreccm/ccm-pagemodelseditor</arguments>
|
||||
<arguments>install ../ccm-pagemodelseditor</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
|
@ -157,16 +90,6 @@
|
|||
<goal>npm</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<!-- Sync Maven module version and NPM module version -->
|
||||
<execution>
|
||||
<id>npm version</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<arguments>version --allow-same-version=true ${project.version}${buildNumber}</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>build</id>
|
||||
<goals>
|
||||
|
|
@ -176,15 +99,6 @@
|
|||
<arguments>run build</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm link</id>
|
||||
<goals>
|
||||
<goal>npm</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<arguments>link</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
<execution>
|
||||
<id>npm publish</id>
|
||||
|
|
@ -195,7 +109,7 @@
|
|||
<phase>deploy</phase>
|
||||
|
||||
<configuration>
|
||||
<arguments>publish -userconfig ../libreccm.npmrc</arguments>
|
||||
<arguments>publish --userconfig ../libreccm.npmrc</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
|
@ -203,18 +117,4 @@
|
|||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>with-buildnumber</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env.BUILD_NUMBER</name>
|
||||
</property>
|
||||
</activation>
|
||||
<properties>
|
||||
<buildNumber>.${env.BUILD_NUMBER}</buildNumber>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -74,12 +74,6 @@
|
|||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Dependencies for log4j 2 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
|
|
@ -144,8 +138,8 @@
|
|||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<optimize>true</optimize>
|
||||
<debug>true</debug>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
|
|
@ -221,8 +215,13 @@
|
|||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<configuration>
|
||||
<detectLinks>false</detectLinks>
|
||||
<detectJavaApiLinks>false</detectJavaApiLinks>
|
||||
<detectLinks>true</detectLinks>
|
||||
<detectJavaApiLinks>true</detectJavaApiLinks>
|
||||
<links>
|
||||
<link>http://docs.oracle.com/javase/7/docs/api/</link>
|
||||
<link>http://docs.oracle.com/javaee/7/api/</link>
|
||||
<link>http://docs.jboss.org/hibernate/orm/4.3/javadocs/</link>
|
||||
</links>
|
||||
<show>private</show>
|
||||
<docfilessubdirs>true</docfilessubdirs>
|
||||
<charset>UTF-8</charset>
|
||||
|
|
@ -233,6 +232,14 @@
|
|||
<author>true</author>
|
||||
<keywords>true</keywords>
|
||||
<failOnError>false</failOnError>
|
||||
<doclet>org.jboss.apiviz.APIviz</doclet>
|
||||
<docletArtifact>
|
||||
<groupId>org.jboss.apiviz</groupId>
|
||||
<artifactId>apiviz</artifactId>
|
||||
<version>1.3.2.GA</version>
|
||||
</docletArtifact>
|
||||
<useStandardDocletOptions>true</useStandardDocletOptions>
|
||||
<additionalparam>-sourceclasspath ${project.build.outputDirectory}</additionalparam>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
|
@ -255,7 +262,7 @@
|
|||
<configuration>
|
||||
<linkXref>true</linkXref>
|
||||
<sourceEncoding>utf-8</sourceEncoding>
|
||||
<targetJdk>11</targetJdk>
|
||||
<targetJdk>1.8</targetJdk>
|
||||
<!-- <rulesets>
|
||||
<ruleset>/rulesets/java/basic.xml</ruleset>
|
||||
<ruleset>/rulesets/java/braces.xml</ruleset>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,117 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import org.librecms.assets.Person;
|
||||
import org.librecms.contentsection.AssetRepository;
|
||||
import org.librecms.contentsection.ContentItemRepository;
|
||||
import org.librecms.profilesite.ProfileSiteItem;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@RequestScoped
|
||||
class ProfileSiteItemController {
|
||||
|
||||
public static final String OWNER = "owner";
|
||||
|
||||
public static final String POSITION = "position";
|
||||
|
||||
public static final String INTERSETS = "interests";
|
||||
|
||||
public static final String MISC = "misc";
|
||||
|
||||
@Inject
|
||||
private AssetRepository assetRepository;
|
||||
|
||||
@Inject
|
||||
private ContentItemRepository itemRepository;
|
||||
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
public void setOwner(final long profileSiteItemId, final long ownerId) {
|
||||
final ProfileSiteItem profileSiteItem = itemRepository
|
||||
.findById(profileSiteItemId, ProfileSiteItem.class)
|
||||
.orElseThrow(
|
||||
() -> new IllegalArgumentException(
|
||||
String.format(
|
||||
"No ProfileSiteItem with ID %d found.",
|
||||
profileSiteItemId
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
final Person owner = assetRepository
|
||||
.findById(ownerId, Person.class)
|
||||
.orElseThrow(
|
||||
() -> new IllegalArgumentException(
|
||||
String.format(
|
||||
"No Person with ID %d found.", ownerId
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
profileSiteItem.setOwner(owner);
|
||||
itemRepository.save(profileSiteItem);
|
||||
}
|
||||
|
||||
public void setPosition(
|
||||
final long profileSiteItemId, final String position, final Locale locale
|
||||
) {
|
||||
final ProfileSiteItem profileSiteItem = itemRepository
|
||||
.findById(profileSiteItemId, ProfileSiteItem.class)
|
||||
.orElseThrow(
|
||||
() -> new IllegalArgumentException(
|
||||
String.format(
|
||||
"No ProfileSiteItem with ID %d found.",
|
||||
profileSiteItemId
|
||||
)
|
||||
)
|
||||
);
|
||||
profileSiteItem.getPosition().addValue(locale, position);
|
||||
}
|
||||
|
||||
public void setInterests(
|
||||
final long profileSiteItemId,
|
||||
final String interests,
|
||||
final Locale locale
|
||||
) {
|
||||
final ProfileSiteItem profileSiteItem = itemRepository
|
||||
.findById(profileSiteItemId, ProfileSiteItem.class)
|
||||
.orElseThrow(
|
||||
() -> new IllegalArgumentException(
|
||||
String.format(
|
||||
"No ProfileSiteItem with ID %d found.",
|
||||
profileSiteItemId
|
||||
)
|
||||
)
|
||||
);
|
||||
profileSiteItem.getInterests().addValue(locale, interests);
|
||||
}
|
||||
|
||||
public void setMisc(
|
||||
final long profileSiteItemId, final String misc, final Locale locale
|
||||
) {
|
||||
final ProfileSiteItem profileSiteItem = itemRepository
|
||||
.findById(profileSiteItemId, ProfileSiteItem.class)
|
||||
.orElseThrow(
|
||||
() -> new IllegalArgumentException(
|
||||
String.format(
|
||||
"No ProfileSiteItem with ID %d found.",
|
||||
profileSiteItemId
|
||||
)
|
||||
)
|
||||
);
|
||||
profileSiteItem.getMisc().addValue(locale, misc);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.FormData;
|
||||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.assets.AssetSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||
import com.arsdigita.cms.ui.authoring.PageCreateForm;
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
|
||||
import org.librecms.assets.Person;
|
||||
import org.librecms.contentsection.ContentItemInitializer;
|
||||
import org.librecms.profilesite.ProfileSiteConstants;
|
||||
import org.librecms.profilesite.ProfileSiteItem;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public class ProfileSiteItemCreate extends PageCreateForm {
|
||||
|
||||
private final static String OWNER_SEARCH = "owner";
|
||||
|
||||
private AssetSearchWidget ownerSearch;
|
||||
|
||||
public ProfileSiteItemCreate(
|
||||
final ItemSelectionModel itemModel,
|
||||
final CreationSelector creationSelector,
|
||||
final StringParameter selectedLanguageParam
|
||||
) {
|
||||
super(itemModel, creationSelector, selectedLanguageParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
ownerSearch = new AssetSearchWidget(OWNER_SEARCH, Person.class);
|
||||
ownerSearch.setLabel(
|
||||
new GlobalizedMessage(
|
||||
"profile_site.owner.label", ProfileSiteConstants.BUNDLE
|
||||
)
|
||||
);
|
||||
add(ownerSearch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(final FormSectionEvent event)
|
||||
throws FormProcessException {
|
||||
super.validate(event);
|
||||
final FormData formData = event.getFormData();
|
||||
|
||||
if (!formData.containsKey(OWNER_SEARCH)
|
||||
|| formData.get(OWNER_SEARCH) == null) {
|
||||
formData.addError(
|
||||
new GlobalizedMessage(
|
||||
"profile_site.owner.not_selected",
|
||||
ProfileSiteConstants.BUNDLE
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ContentItemInitializer<ProfileSiteItem> getItemInitializer(
|
||||
final FormData formData, final PageState state
|
||||
) {
|
||||
return (item) -> item.setOwner((Person) formData.get(OWNER_SEARCH));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.FormData;
|
||||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.form.TextArea;
|
||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SelectedLanguageUtil;
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
|
||||
import org.libreccm.cdi.utils.CdiUtil;
|
||||
import org.librecms.profilesite.ProfileSiteConstants;
|
||||
import org.librecms.profilesite.ProfileSiteItem;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public class ProfileSiteItemInterestsForm
|
||||
extends BasicItemForm
|
||||
implements FormProcessListener, FormInitListener {
|
||||
|
||||
private final StringParameter selectedLangParam;
|
||||
|
||||
public ProfileSiteItemInterestsForm(
|
||||
final ItemSelectionModel itemModel,
|
||||
final StringParameter selectedLangParam
|
||||
) {
|
||||
super("ProfileSiteItemEditInterests", itemModel, selectedLangParam);
|
||||
this.selectedLangParam = selectedLangParam;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(
|
||||
new Label(
|
||||
new GlobalizedMessage(
|
||||
"profile_site_item.ui.interests",
|
||||
ProfileSiteConstants.BUNDLE
|
||||
)
|
||||
)
|
||||
);
|
||||
final ParameterModel interestsParam = new StringParameter(
|
||||
ProfileSiteItemController.POSITION);
|
||||
final TextArea interests = new TextArea(interestsParam);
|
||||
interests.setCols(80);
|
||||
interests.setRows(8);
|
||||
add(interests);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(final FormSectionEvent event) throws FormProcessException {
|
||||
final PageState state = event.getPageState();
|
||||
final FormData data = event.getFormData();
|
||||
final ProfileSiteItem profile
|
||||
= (ProfileSiteItem) getItemSelectionModel()
|
||||
.getSelectedItem(state);
|
||||
|
||||
data.put(ProfileSiteItemController.POSITION, profile.getInterests());
|
||||
|
||||
setVisible(state, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(final FormSectionEvent event)
|
||||
throws FormProcessException {
|
||||
final PageState state = event.getPageState();
|
||||
final FormData data = event.getFormData();
|
||||
final ProfileSiteItem profile
|
||||
= (ProfileSiteItem) getItemSelectionModel()
|
||||
.getSelectedItem(state);
|
||||
|
||||
if ((profile != null)
|
||||
&& getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
|
||||
final ProfileSiteItemController controller = CdiUtil
|
||||
.createCdiUtil()
|
||||
.findBean(ProfileSiteItemController.class);
|
||||
|
||||
final Locale selectedLocale = SelectedLanguageUtil.selectedLocale(
|
||||
state, selectedLangParam
|
||||
);
|
||||
|
||||
controller.setInterests(
|
||||
profile.getObjectId(),
|
||||
(String) data.get(ProfileSiteItemController.POSITION),
|
||||
selectedLocale
|
||||
);
|
||||
}
|
||||
|
||||
init(event);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
|
||||
import org.librecms.profilesite.ProfileSiteConstants;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public class ProfileSiteItemInterestsStep extends SimpleEditStep {
|
||||
|
||||
private String EDIT_POSITION_SHEET_NAME = "editInterests";
|
||||
|
||||
public ProfileSiteItemInterestsStep(
|
||||
final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent,
|
||||
final StringParameter selectedLangParam
|
||||
) {
|
||||
this(itemModel, parent, selectedLangParam, null);
|
||||
}
|
||||
|
||||
public ProfileSiteItemInterestsStep(
|
||||
final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent,
|
||||
final StringParameter selectedLangParam,
|
||||
final String prefix
|
||||
) {
|
||||
super(itemModel, parent, selectedLangParam, prefix);
|
||||
|
||||
final BasicItemForm editInterestsForm = new ProfileSiteItemInterestsForm(
|
||||
itemModel, selectedLangParam
|
||||
);
|
||||
add(
|
||||
EDIT_POSITION_SHEET_NAME,
|
||||
new GlobalizedMessage(
|
||||
"profile_site_site.ui.interests.edit",
|
||||
ProfileSiteConstants.BUNDLE
|
||||
),
|
||||
new WorkflowLockedComponentAccess(parent, itemModel),
|
||||
editInterestsForm.getSaveCancelSection().getCancelButton()
|
||||
);
|
||||
|
||||
setDisplayComponent(getProfileSiteItemInterestsSheet(
|
||||
itemModel, selectedLangParam)
|
||||
);
|
||||
}
|
||||
|
||||
public static final Component getProfileSiteItemInterestsSheet(
|
||||
final ItemSelectionModel itemModel,
|
||||
final StringParameter selectedLangParam
|
||||
) {
|
||||
final DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(
|
||||
itemModel, false, selectedLangParam
|
||||
);
|
||||
|
||||
sheet.add(
|
||||
new GlobalizedMessage(
|
||||
"profile_site_item.ui.interests",
|
||||
ProfileSiteConstants.BUNDLE
|
||||
),
|
||||
ProfileSiteItemController.POSITION
|
||||
);
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.FormData;
|
||||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.form.TextArea;
|
||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SelectedLanguageUtil;
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
|
||||
import org.libreccm.cdi.utils.CdiUtil;
|
||||
import org.librecms.profilesite.ProfileSiteConstants;
|
||||
import org.librecms.profilesite.ProfileSiteItem;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public class ProfileSiteItemMiscForm
|
||||
extends BasicItemForm
|
||||
implements FormProcessListener, FormInitListener {
|
||||
|
||||
private final StringParameter selectedLangParam;
|
||||
|
||||
public ProfileSiteItemMiscForm(
|
||||
final ItemSelectionModel itemModel,
|
||||
final StringParameter selectedLangParam
|
||||
) {
|
||||
super("ProfileSiteItemEditMisc", itemModel, selectedLangParam);
|
||||
this.selectedLangParam = selectedLangParam;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(
|
||||
new Label(
|
||||
new GlobalizedMessage(
|
||||
"profile_site_item.ui.misc",
|
||||
ProfileSiteConstants.BUNDLE
|
||||
)
|
||||
)
|
||||
);
|
||||
final ParameterModel miscParam = new StringParameter(
|
||||
ProfileSiteItemController.POSITION);
|
||||
final TextArea misc = new TextArea(miscParam);
|
||||
misc.setCols(80);
|
||||
misc.setRows(8);
|
||||
add(misc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(final FormSectionEvent event) throws FormProcessException {
|
||||
final PageState state = event.getPageState();
|
||||
final FormData data = event.getFormData();
|
||||
final ProfileSiteItem profile
|
||||
= (ProfileSiteItem) getItemSelectionModel()
|
||||
.getSelectedItem(state);
|
||||
|
||||
data.put(ProfileSiteItemController.POSITION, profile.getMisc());
|
||||
|
||||
setVisible(state, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(final FormSectionEvent event)
|
||||
throws FormProcessException {
|
||||
final PageState state = event.getPageState();
|
||||
final FormData data = event.getFormData();
|
||||
final ProfileSiteItem profile
|
||||
= (ProfileSiteItem) getItemSelectionModel()
|
||||
.getSelectedItem(state);
|
||||
|
||||
if ((profile != null)
|
||||
&& getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
|
||||
final ProfileSiteItemController controller = CdiUtil
|
||||
.createCdiUtil()
|
||||
.findBean(ProfileSiteItemController.class);
|
||||
|
||||
final Locale selectedLocale = SelectedLanguageUtil.selectedLocale(
|
||||
state, selectedLangParam
|
||||
);
|
||||
|
||||
controller.setMisc(
|
||||
profile.getObjectId(),
|
||||
(String) data.get(ProfileSiteItemController.POSITION),
|
||||
selectedLocale
|
||||
);
|
||||
}
|
||||
|
||||
init(event);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
|
||||
import org.librecms.profilesite.ProfileSiteConstants;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public class ProfileSiteItemMiscStep extends SimpleEditStep {
|
||||
|
||||
private String EDIT_POSITION_SHEET_NAME = "editMisc";
|
||||
|
||||
public ProfileSiteItemMiscStep(
|
||||
final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent,
|
||||
final StringParameter selectedLangParam
|
||||
) {
|
||||
this(itemModel, parent, selectedLangParam, null);
|
||||
}
|
||||
|
||||
public ProfileSiteItemMiscStep(
|
||||
final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent,
|
||||
final StringParameter selectedLangParam,
|
||||
final String prefix
|
||||
) {
|
||||
super(itemModel, parent, selectedLangParam, prefix);
|
||||
|
||||
final BasicItemForm editMiscForm = new ProfileSiteItemMiscForm(
|
||||
itemModel, selectedLangParam
|
||||
);
|
||||
add(
|
||||
EDIT_POSITION_SHEET_NAME,
|
||||
new GlobalizedMessage(
|
||||
"profile_site_site.ui.misc.edit",
|
||||
ProfileSiteConstants.BUNDLE
|
||||
),
|
||||
new WorkflowLockedComponentAccess(parent, itemModel),
|
||||
editMiscForm.getSaveCancelSection().getCancelButton()
|
||||
);
|
||||
|
||||
setDisplayComponent(getProfileSiteItemMiscSheet(
|
||||
itemModel, selectedLangParam)
|
||||
);
|
||||
}
|
||||
|
||||
public static final Component getProfileSiteItemMiscSheet(
|
||||
final ItemSelectionModel itemModel,
|
||||
final StringParameter selectedLangParam
|
||||
) {
|
||||
final DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(
|
||||
itemModel, false, selectedLangParam
|
||||
);
|
||||
|
||||
sheet.add(
|
||||
new GlobalizedMessage(
|
||||
"profile_site_item.ui.misc",
|
||||
ProfileSiteConstants.BUNDLE
|
||||
),
|
||||
ProfileSiteItemController.POSITION
|
||||
);
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.FormData;
|
||||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.form.TextArea;
|
||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SelectedLanguageUtil;
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
|
||||
import org.libreccm.cdi.utils.CdiUtil;
|
||||
import org.librecms.profilesite.ProfileSiteConstants;
|
||||
import org.librecms.profilesite.ProfileSiteItem;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public class ProfileSiteItemPositionForm
|
||||
extends BasicItemForm
|
||||
implements FormProcessListener, FormInitListener {
|
||||
|
||||
private final StringParameter selectedLangParam;
|
||||
|
||||
public ProfileSiteItemPositionForm(
|
||||
final ItemSelectionModel itemModel,
|
||||
final StringParameter selectedLangParam
|
||||
) {
|
||||
super("ProfileSiteItemEditPosition", itemModel, selectedLangParam);
|
||||
this.selectedLangParam = selectedLangParam;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(
|
||||
new Label(
|
||||
new GlobalizedMessage(
|
||||
"profile_site_item.ui.position",
|
||||
ProfileSiteConstants.BUNDLE
|
||||
)
|
||||
)
|
||||
);
|
||||
final ParameterModel positionParam = new StringParameter(
|
||||
ProfileSiteItemController.POSITION);
|
||||
final TextArea position = new TextArea(positionParam);
|
||||
position.setCols(80);
|
||||
position.setRows(8);
|
||||
add(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(final FormSectionEvent event) throws FormProcessException {
|
||||
final PageState state = event.getPageState();
|
||||
final FormData data = event.getFormData();
|
||||
final ProfileSiteItem profile
|
||||
= (ProfileSiteItem) getItemSelectionModel()
|
||||
.getSelectedItem(state);
|
||||
|
||||
data.put(ProfileSiteItemController.POSITION, profile.getPosition());
|
||||
|
||||
setVisible(state, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(final FormSectionEvent event)
|
||||
throws FormProcessException {
|
||||
final PageState state = event.getPageState();
|
||||
final FormData data = event.getFormData();
|
||||
final ProfileSiteItem profile
|
||||
= (ProfileSiteItem) getItemSelectionModel()
|
||||
.getSelectedItem(state);
|
||||
|
||||
if ((profile != null)
|
||||
&& getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
|
||||
final ProfileSiteItemController controller = CdiUtil
|
||||
.createCdiUtil()
|
||||
.findBean(ProfileSiteItemController.class);
|
||||
|
||||
final Locale selectedLocale = SelectedLanguageUtil.selectedLocale(
|
||||
state, selectedLangParam
|
||||
);
|
||||
|
||||
controller.setPosition(
|
||||
profile.getObjectId(),
|
||||
(String) data.get(ProfileSiteItemController.POSITION),
|
||||
selectedLocale
|
||||
);
|
||||
}
|
||||
|
||||
init(event);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
|
||||
import org.librecms.profilesite.ProfileSiteConstants;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public class ProfileSiteItemPositionStep extends SimpleEditStep {
|
||||
|
||||
private String EDIT_POSITION_SHEET_NAME = "editPosition";
|
||||
|
||||
public ProfileSiteItemPositionStep(
|
||||
final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent,
|
||||
final StringParameter selectedLangParam
|
||||
) {
|
||||
this(itemModel, parent, selectedLangParam, null);
|
||||
}
|
||||
|
||||
public ProfileSiteItemPositionStep(
|
||||
final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent,
|
||||
final StringParameter selectedLangParam,
|
||||
final String prefix
|
||||
) {
|
||||
super(itemModel, parent, selectedLangParam, prefix);
|
||||
|
||||
final BasicItemForm editPositionForm = new ProfileSiteItemPositionForm(
|
||||
itemModel, selectedLangParam
|
||||
);
|
||||
add(
|
||||
EDIT_POSITION_SHEET_NAME,
|
||||
new GlobalizedMessage(
|
||||
"profile_site_site.ui.position.edit",
|
||||
ProfileSiteConstants.BUNDLE
|
||||
),
|
||||
new WorkflowLockedComponentAccess(parent, itemModel),
|
||||
editPositionForm.getSaveCancelSection().getCancelButton()
|
||||
);
|
||||
|
||||
setDisplayComponent(getProfileSiteItemPositionSheet(
|
||||
itemModel, selectedLangParam)
|
||||
);
|
||||
}
|
||||
|
||||
public static final Component getProfileSiteItemPositionSheet(
|
||||
final ItemSelectionModel itemModel,
|
||||
final StringParameter selectedLangParam
|
||||
) {
|
||||
final DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(
|
||||
itemModel, false, selectedLangParam
|
||||
);
|
||||
|
||||
sheet.add(
|
||||
new GlobalizedMessage(
|
||||
"profile_site_item.ui.position",
|
||||
ProfileSiteConstants.BUNDLE
|
||||
),
|
||||
ProfileSiteItemController.POSITION
|
||||
);
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.SegmentedPanel;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
|
||||
import org.librecms.assets.Person;
|
||||
import org.librecms.profilesite.ProfileSiteConstants;
|
||||
import org.librecms.profilesite.ProfileSiteItem;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public class ProfileSiteItemPropertiesStep extends SimpleEditStep {
|
||||
|
||||
public static final String EDIT_SHEET_NAME = "editProfileSiteItem";
|
||||
|
||||
public ProfileSiteItemPropertiesStep(
|
||||
final ItemSelectionModel itemModel,
|
||||
final AuthoringKitWizard parent,
|
||||
final StringParameter selectedLangParam
|
||||
) {
|
||||
super(itemModel, parent, selectedLangParam);
|
||||
|
||||
setDefaultEditKey(EDIT_SHEET_NAME);
|
||||
|
||||
final SimpleEditStep basicProperties = new SimpleEditStep(
|
||||
itemModel, parent, selectedLangParam, EDIT_SHEET_NAME
|
||||
);
|
||||
final BasicPageForm editBasicSheet = new ProfileSiteItemPropertyForm(
|
||||
itemModel, this, selectedLangParam
|
||||
);
|
||||
|
||||
basicProperties.add(
|
||||
EDIT_SHEET_NAME,
|
||||
new GlobalizedMessage(
|
||||
ProfileSiteConstants.BUNDLE,
|
||||
"profile_site.ui.edit_basic_properties"
|
||||
),
|
||||
new WorkflowLockedComponentAccess(editBasicSheet, itemModel),
|
||||
editBasicSheet.getSaveCancelSection().getCancelButton()
|
||||
);
|
||||
|
||||
basicProperties.setDisplayComponent(
|
||||
getProfileSiteItemPropertiesSheet(itemModel, selectedLangParam)
|
||||
);
|
||||
|
||||
final SegmentedPanel segmentedPanel = new SegmentedPanel();
|
||||
segmentedPanel.addSegment(
|
||||
new Label(
|
||||
new GlobalizedMessage(
|
||||
ProfileSiteConstants.BUNDLE,
|
||||
"profile_site.ui.basic_properties"
|
||||
)
|
||||
),
|
||||
basicProperties
|
||||
);
|
||||
|
||||
setDisplayComponent(segmentedPanel);
|
||||
}
|
||||
|
||||
public static Component getProfileSiteItemPropertiesSheet(
|
||||
final ItemSelectionModel itemModel,
|
||||
final StringParameter selectedLangParam
|
||||
) {
|
||||
final DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(
|
||||
itemModel, false, selectedLangParam
|
||||
);
|
||||
|
||||
sheet.add(
|
||||
new GlobalizedMessage(
|
||||
ProfileSiteConstants.BUNDLE, "profile_site.ui.OWNER"
|
||||
),
|
||||
ProfileSiteItemController.OWNER,
|
||||
new OwnerFormatter()
|
||||
);
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
||||
private static class OwnerFormatter
|
||||
implements DomainObjectPropertySheet.AttributeFormatter {
|
||||
|
||||
@Override
|
||||
public String format(
|
||||
final Object obj, final String attribute, final PageState state
|
||||
) {
|
||||
final ProfileSiteItem profileSiteItem = (ProfileSiteItem) obj;
|
||||
|
||||
final Person owner = profileSiteItem.getOwner();
|
||||
|
||||
if (owner == null) {
|
||||
return "";
|
||||
} else {
|
||||
return owner.getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||