Skip to content

Commit

Permalink
Merge pull request #14 from CoreMedia/develop
Browse files Browse the repository at this point in the history
Release: updates for 2.0.0
  • Loading branch information
oennen committed Jun 21, 2018
2 parents 8995d8c + a791794 commit 69137b4
Show file tree
Hide file tree
Showing 209 changed files with 4,553 additions and 1,812 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ overlays/

### Custom

/tmp/
tmp/
48 changes: 38 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
![Status: Active](https://documentation.coremedia.com/badges/badge_status_active.png "Status: Active")
![For CoreMedia CMS](https://documentation.coremedia.com/badges/badge_coremedia_cms.png "For CoreMedia CMS")
![Tested: 9.1707.4](https://documentation.coremedia.com/badges/badge_tested_coremedia_9-1707-4.png "Tested: 9.1707.4")
![Tested: 9.1710.1](https://documentation.coremedia.com/badges/badge_tested_coremedia_9-1710-1.png "Tested: 9.1710.1")
![Tested: 9.1801.1](https://documentation.coremedia.com/badges/badge_tested_coremedia_9-1801-1.png "Tested: 9.1801.1")

Expand All @@ -19,6 +18,12 @@ Integrate ready-to-go content fragments and new dynamic client-side modules into
This README contains an overview of the code and how to start the server. For more detailed documentation, see the [wiki](https://github.com/CoreMedia/coremedia-headless-server/wiki).


## Versions in this Repository

* **master**: This is the release branch.
* **develop**: This is the branch for all current, unreleased work.


## Workspace Structure

The workspace is comprised of the following modules:
Expand Down Expand Up @@ -66,6 +71,14 @@ or start the Tomcat Webapp

mvn cargo:run -pl headless-server-webapp -Dinstallation.server.host=<CMS-SERVER-HOSTNAME> -Dinstallation.server.port=<CMS-SERVER-PORT>

### Executable Jar

A fully executable jar, which can be executed as binary or registered with `init.d` or `systemd`, can be created by adding the profile

-P executable-jar`

at build time. For more information see ["Installing Spring Boot Applications"](https://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html).


## Testing the API

Expand All @@ -90,14 +103,29 @@ Run the headless server and try the following URLs:
The value will be used for the `{siteId}` placeholder in the REST URLs

3. Go to the system tab end expand the *Local Settings* property box.
Add a *String* property to it's root:

*Property:* tenantId
*Value:* your tenant identifier (only alphanumerical characters/lowercase)

This value will be used for the `{tenantId}` placeholder in the REST URLs

5. Try to fetch the JSON description of the enabled site:
1. Add a *String* property to it's root:

*Property:* tenantId
*Value:* your tenant identifier (only alphanumerical characters/lowercase)

This value will be used for the `{tenantId}` placeholder in the REST URLs

2. Add a *Struct* property to it's root:

*Property:* caasClients

Add a sub *Struct* property (empty UUID):

*Property*: 00000000-0000-0000-0000-000000000000

Add a *String* property to the sub struct:

*Property:* pd
*value:* default

This maps all 'unknown' clients to the processing definition named 'default'. See the [wiki](https://github.com/CoreMedia/coremedia-headless-server/wiki/Processing-Definitions) for more information.

4. Try to fetch the JSON description of the enabled site:

`http://localhost:8080/caas/v1/{tenantId}/sites/{siteId}`

Expand All @@ -115,7 +143,7 @@ Run the headless server and try the following URLs:
}
```

6. Test your site with the Swagger UI.
5. Test your site with the Swagger UI.

### Swagger

Expand Down
3 changes: 3 additions & 0 deletions headless-pd/headless-pd-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
<excludes>
<exclude>config/**</exclude>
</excludes>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: CMCollectionImpl
customFields:
- !Constant
name: teaserTarget
targetType: CMLinkable
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@ customFields:
sourceName: this
targetType: String
dataFetcher: Uri
- !CustomField
name: settings
dataFetcher: Settings
- !CustomField
name: viewtype
sourceName: (viewtype)[0].(layout)
targetType: String
dataFetcher: Builtin
dataFetcher: ContentProperty
- !CustomField
name: context
sourceName: context
targetType: CMNavigation
dataFetcher: Context
dataFetcher: Navigation
- !CustomField
name: navigationPath
sourceName: pathToRoot
targetType: List:CMNavigation
dataFetcher: NavigationPath
dataFetcher: Navigation
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ customFields:
name: languageId
sourceName: (locale)
targetType: String
dataFetcher: Property
dataFetcher: ContentProperty
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,23 @@ excludedProperties:
- placement
- theme
customFields:
- !CustomField
name: children
sourceName: children
targetType: List:CMLinkable
dataFetcher: Navigation
- !CustomField
name: grid
sourceName: (placement)
sourceName: placement
targetType: PageGrid
dataFetcher: PageGrid
- !CustomField
name: hidden
sourceName: (hidden)
targetType: Boolean
dataFetcher: Property
dataFetcher: ContentProperty
- !CustomField
name: hiddenInSitemap
sourceName: (hiddenInSitemap)
targetType: Boolean
dataFetcher: Property
dataFetcher: ContentProperty
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: CMProduct
customFields:
- !CustomField
name: price
sourceName: /price
targetType: Float
dataFetcher: Setting
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ customFields:
name: title
sourceName: (productName)
targetType: String
dataFetcher: Property
dataFetcher: ContentProperty
- !CustomField
name: teaserTitle
sourceName: (productName)
targetType: String
dataFetcher: Property
dataFetcher: ContentProperty
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@ excludedProperties:
- linkedSettings
- localSettings
- siteManagerGroup
customFields:
- !CustomField
name: settings
dataFetcher: Settings
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ customFields:
fallbackSourceNames:
- (title)
targetType: String
dataFetcher: Property
dataFetcher: ContentProperty
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ customFields:
name: segment
sourceName: (target)[0].(segment)
targetType: String
dataFetcher: Property
dataFetcher: ContentProperty
- !CustomField
name: teaserTarget
sourceName: (target)
Expand All @@ -30,4 +30,4 @@ customFields:
- (target)[0].(teaserTitle)
- (target)[0].(title)
targetType: String
dataFetcher: Property
dataFetcher: ContentProperty
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ customFields:
sourceName: (timeLine)
targetType: TimeLine
dataFetcher: Struct
directives:
- !Directive
name: if
arguments:
test: getLink('viewtype')?.getString('layout') == 'shoppable'
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ customFields:
name: this
targetType: Content_
nonNull: true
dataFetcher: Builtin
dataFetcher: Property
- !CustomField
name: _id
sourceName: id
targetType: String
nonNull: true
dataFetcher: Builtin
dataFetcher: Property
- !CustomField
name: _type
sourceName: type.name
sourceName: type
targetType: String
nonNull: true
dataFetcher: Builtin
dataFetcher: Property
- !CustomField
name: _name
sourceName: name
targetType: String
nonNull: true
dataFetcher: Builtin
dataFetcher: Property
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
!ObjectType
name: PageGrid
fields:
- !Builtin
- !Property
name: cssClassName
typeName: String
- !Builtin
- !Property
name: placements
typeName: List:PageGridPlacement
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
!ObjectType
name: PageGridPlacement
fields:
- !Builtin
- !Property
name: name
typeName: String
- !Builtin
- !Property
name: viewtype
sourceName: viewtype.(layout)
typeName: String
- !Builtin
- !Property
name: items
typeName: List:CMLinkable
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ fields:
name: sequences
sourceName: (sequences)
typeName: List:TimeLineEntry
directives:
- !Directive
name: filter
arguments:
test: ?[['link'] != null]
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,16 @@ query NavigationQuery {
root {
... NavigationEntry
... on CMNavigation {
hidden
hiddenInSitemap
children {
children @filter(test: "?[!navigation.hidden]") {
... NavigationEntry
... on CMNavigation {
hidden
hiddenInSitemap
children {
children @filter(test: "?[!navigation.hidden]") {
... NavigationEntry
... on CMNavigation {
hidden
hiddenInSitemap
children {
children @filter(test: "?[!navigation.hidden]") {
... NavigationEntry
... on CMNavigation {
hidden
hiddenInSitemap
children {
children @filter(test: "?[!navigation.hidden]") {
... NavigationEntry
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fragment Teasable on CMTeasable {
link
}
... on CMProduct {
price: floatSetting(key: "price")
price
}
}

Expand Down
2 changes: 1 addition & 1 deletion headless-schema-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<version>${spring-boot.version}</version>
<configuration>
<mainClass>com.coremedia.caas.generator.GeneratorRunner</mainClass>
<layout>JAR</layout>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.coremedia.caas.generator.config;

import com.coremedia.cap.content.ContentRepository;

import com.google.common.collect.ImmutableList;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
Expand Down Expand Up @@ -55,6 +56,7 @@ private List<TypeCustomization> readTypeCustomizations() throws IOException {
Constructor constructor = new Constructor();
constructor.addTypeDescription(new TypeDescription(ConstantDefinition.class, new Tag("!Constant")));
constructor.addTypeDescription(new TypeDescription(CustomFieldDefinition.class, new Tag("!CustomField")));
constructor.addTypeDescription(new TypeDescription(DirectiveDefinition.class, new Tag("!Directive")));
Yaml yaml = new Yaml(constructor);
ImmutableList.Builder<TypeCustomization> builder = ImmutableList.builder();
if (resources != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ public List<String> getFallbackSourceNames() {
throw new IllegalArgumentException("Constant value cannot have fallback sources");
}

@Override
public List<DirectiveDefinition> getDirectives() {
throw new IllegalArgumentException("Constant value cannot have directives");
}

@Override
public String getTypeName() {
return TYPE_NAME.toLowerCase();
Expand Down
Loading

0 comments on commit 69137b4

Please sign in to comment.