Skip to content

Commit

Permalink
Merge pull request #5 from CoreMedia/use-maven-plugin
Browse files Browse the repository at this point in the history
Use maven plugin
  • Loading branch information
rreich authored Feb 7, 2022
2 parents 4248371 + 56386e4 commit b69aab3
Show file tree
Hide file tree
Showing 13 changed files with 584 additions and 607 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
Changelog
================================================================================

2.0.1
--------------------------------------------------------------------------------

### Update to latest CMS versions

### Update thirdparty dependencies

### Replace assembly-plugin with coremedia-plugins-maven-plugin

2.0.0
--------------------------------------------------------------------------------

### Switch from Extensions to Plugin architecture

Suitable for CMCC 2101 and newer.

1.0.0
--------------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/** @type { import('@jangaroo/core').IJangarooConfig } */
module.exports = {
const { jangarooConfig } = require("@jangaroo/core");

module.exports = jangarooConfig({
type: "code",
extName: "com.coremedia.labs.plugins__studio-client.content-hub-adapter-youtube",
extNamespace: "com.coremedia.labs.plugins.adapters.youtube",
sencha: {
name: "com.coremedia.labs.plugins__studio-client.content-hub-adapter-youtube",
namespace: "com.coremedia.labs.plugins.adapters.youtube",
studioPlugins: [
{
mainClass: "com.coremedia.labs.plugins.adapters.youtube.ContentHubStudioYoutubePlugin",
name: "Content Hub",
name: "Content Hub YouTube",
},
],
},
};
});
16 changes: 8 additions & 8 deletions studio-client/apps/main/content-hub-adapter-youtube/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
"license": "CoreMedia Open Source License",
"private": true,
"dependencies": {
"@coremedia/studio-client.core-icons": "2110.1.0-pr3",
"@coremedia/studio-client.main.content-hub-editor-components": "2110.1.0-pr3",
"@coremedia/studio-client.main.editor-components": "2110.1.0-pr3",
"@jangaroo/runtime": "^1.0.0-alpha"
"@coremedia/studio-client.core-icons": "^2110.1.0",
"@coremedia/studio-client.main.content-hub-editor-components": "^2110.1.0",
"@coremedia/studio-client.main.editor-components": "^2110.1.0",
"@jangaroo/runtime": "^1.0.0"
},
"devDependencies": {
"@jangaroo/build": "^1.0.0-alpha",
"@jangaroo/core": "^1.0.0-alpha",
"@jangaroo/publish": "^1.0.0-alpha",
"@jangaroo/run": "^1.0.0-alpha",
"@jangaroo/build": "^1.0.0",
"@jangaroo/core": "^1.0.0",
"@jangaroo/publish": "^1.0.0",
"@jangaroo/run": "^1.0.0",
"eslint": "7.27.0",
"rimraf": "^3.0.2"
},
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion studio-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "studio-client",
"version": "2.0.0-SNAPSHOT",
"version": "2.0.1-SNAPSHOT",
"private": true,
"engines": {
"node": ">=16",
Expand Down
941 changes: 473 additions & 468 deletions studio-client/pnpm-lock.yaml

Large diffs are not rendered by default.

38 changes: 16 additions & 22 deletions studio-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
<groupId>com.coremedia.labs.plugins</groupId>
<artifactId>studio-server.content-hub-adapter-youtube</artifactId>
<version>2.0.1-SNAPSHOT</version>
<packaging>coremedia-plugin</packaging>

<properties>
<maven.compiler.release>11</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<cm.studio-server.core.version>2110.1-pr3</cm.studio-server.core.version>
<cm.common.core.version>2110.1-pr3</cm.common.core.version>
<cm.studio-server.core.version>2110.1</cm.studio-server.core.version>
<cm.common.core.version>2110.1</cm.common.core.version>
</properties>

<repositories>
Expand Down Expand Up @@ -64,7 +65,7 @@
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-youtube</artifactId>
<version>v3-rev152-1.19.0</version>
<version>v3-rev20210915-1.32.1</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
Expand All @@ -75,7 +76,7 @@
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.30.6</version>
<version>1.33.1</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
Expand All @@ -86,17 +87,17 @@
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client</artifactId>
<version>1.36.0</version>
<version>1.41.2</version>
</dependency>
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client-jackson2</artifactId>
<version>1.36.0</version>
<version>1.41.2</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>30.1.1-jre</version>
<version>31.0.1-jre</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down Expand Up @@ -178,23 +179,16 @@
</plugin>

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<groupId>com.coremedia.maven</groupId>
<artifactId>coremedia-plugins-maven-plugin</artifactId>
<version>1.0.0</version>
<extensions>true</extensions>
<configuration>
<descriptors>
<descriptor>src/assembly/descriptor.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
<pluginId>${project.artifactId}</pluginId>
<pluginVersion>${project.version}</pluginVersion>
<pluginConfigurationClass>com.coremedia.labs.plugins.adapters.youtube.YouTubeConfiguration</pluginConfigurationClass>
<pluginProvider>CoreMedia</pluginProvider>
</configuration>
<executions>
<execution>
<id>make-plugin</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
Expand Down
39 changes: 0 additions & 39 deletions studio-server/src/assembly/descriptor.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.Collections;

class PlayListById {
private static final Logger LOG = LoggerFactory.getLogger(PlayListById.class);
Expand All @@ -27,8 +28,8 @@ Playlist playlist() throws IOException {
private Playlist fetchPlayListById() throws IOException {
LOG.debug("YouTube.Playlist id: {}", id);
PlaylistListResponse playlistListResponse = youTube.playlists()
.list(SNIPPET)
.setId(id)
.list(Collections.singletonList(SNIPPET))
.setId(Collections.singletonList(id))
.execute();

return playlistListResponse.getItems().stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Collections;
import java.util.List;
import java.util.Optional;

Expand All @@ -33,7 +34,7 @@ public GetPlaylistItemsResponse fetchPlayListItems(@NonNull String playlistId, @
try {
LOG.debug("YouTube.PlaylistItems id: {}{}", playlistId, (pageCursor == null ? "" : " (paging)"));
YouTube.PlaylistItems.List list = youTube.playlistItems()
.list(REQUEST_TYPE_SNIPPET)
.list(Collections.singletonList(REQUEST_TYPE_SNIPPET))
.setMaxResults(YouTubeConstants.LOW_COST_REQUEST_PAGE_SIZE)
.setPlaylistId(playlistId);

Expand All @@ -58,8 +59,8 @@ public Optional<Playlist> fetchPlayListById(@NonNull String playlistId) {
try {
LOG.debug("YouTube.Playlist id: {}", playlistId);
PlaylistListResponse playlistListResponse = youTube.playlists()
.list(REQUEST_TYPE_SNIPPET)
.setId(playlistId)
.list(Collections.singletonList(REQUEST_TYPE_SNIPPET))
.setId(Collections.singletonList(playlistId))
.execute();

return playlistListResponse.getItems().stream().findAny();
Expand All @@ -77,7 +78,7 @@ public GetPlaylistsResponse fetchPlaylistsForChannel(@NonNull String channelId,
try {
LOG.debug("YouTube.Playlists channel: {}{}", channelId, (pageCursor == null ? "" : " (paging)"));
YouTube.Playlists.List list = youTube.playlists()
.list(REQUEST_TYPE_SNIPPET)
.list(Collections.singletonList(REQUEST_TYPE_SNIPPET))
.setMaxResults(YouTubeConstants.LOW_COST_REQUEST_PAGE_SIZE)
.setChannelId(channelId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

class YouTubeSearchServiceImpl implements YouTubeSearchService {
Expand Down Expand Up @@ -75,10 +76,10 @@ private void fetchSearchListRecursively(@NonNull String channelId,
List<SearchResult> searchResults, String token) throws IOException {
LOG.debug("YouTube.search channel: {}, term: {}, order: {}, limit: {}{}", channelId, term, order, limit, (token==null ? "" : " (paging)"));
YouTube.Search.List list = youTube.search()
.list(YOUTUBE_LIST_PART_SNIPPET)
.list(Collections.singletonList(YOUTUBE_LIST_PART_SNIPPET))
.setMaxResults(YouTubeConstants.HIGH_COST_REQUEST_PAGE_SIZE)
.setChannelId(channelId)
.setType(YOUTUBE_TYPE_VIDEO);
.setType(Collections.singletonList(YOUTUBE_TYPE_VIDEO));
if (term != null) {
list.setQ(term);
}
Expand Down Expand Up @@ -108,10 +109,10 @@ private SearchInChannelResponse fetchSearchList(@NonNull String channelId,
String token) throws IOException {
LOG.debug("YouTube.search channel: {}, term: {},{}", channelId, term, (token==null ? "" : " (paging)"));
YouTube.Search.List list = youTube.search()
.list(YOUTUBE_LIST_PART_SNIPPET)
.list(Collections.singletonList(YOUTUBE_LIST_PART_SNIPPET))
.setMaxResults(YouTubeConstants.HIGH_COST_REQUEST_PAGE_SIZE)
.setChannelId(channelId)
.setType(YOUTUBE_TYPE_VIDEO);
.setType(Collections.singletonList(YOUTUBE_TYPE_VIDEO));
if (term != null) {
list.setQ(term);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Optional;

Expand All @@ -32,9 +33,9 @@ public Optional<Video> findVideoById(@NonNull String videoId) {
VideoListResponse videoListResponse;
try {
videoListResponse = youTube.videos()
.list(REQUEST_TYPE_SNIPPET)
.list(Collections.singletonList(REQUEST_TYPE_SNIPPET))
.setMaxResults(1L)
.setId(videoId)
.setId(Collections.singletonList(videoId))
.execute();
} catch (GoogleJsonResponseException ge) {
throw processGoogleJsonResponseException("Cannot fetch video by id " + videoId, ge);
Expand Down
4 changes: 0 additions & 4 deletions studio-server/src/main/resources/plugin.properties

This file was deleted.

0 comments on commit b69aab3

Please sign in to comment.