Skip to content

Commit

Permalink
Merge pull request #58 from tallence/cm11-preparations
Browse files Browse the repository at this point in the history
2110 upgrade for core-redirects
  • Loading branch information
Timo Lemke authored Apr 8, 2022
2 parents e895ffa + 390dbc6 commit 11b9496
Show file tree
Hide file tree
Showing 132 changed files with 5,757 additions and 4,270 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ buildNumber.properties
Network Trash Folder
Temporary Items
.apdisk

/**/node_modules/

# Jangaroo Build
dist/
build/
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ Per default, requests can only be redirected to a CoreMedia content. Redirects t
Getting started
===============

The extension is always kept compatible with the newest CoreMedia version (currently cmcc-10-2107.1). The redirect
manager is also known to work with cms-9-1904, cms-9-1901 and cms-9-1810 (https://github.com/tallence/core-redirects/tree/cm9-1904).
The extension runs with CoreMedia 11 (v2110.1). And also runs with:
- v2107.1. See the release [cmcc-10-2107.1](https://github.com/tallence/core-redirects/releases/tag/cmcc-10-2107.1).
- v2007.2. See the release [cmcc-10-2007.2](https://github.com/tallence/core-redirects/releases/tag/cmcc-10-2007.2).
- CoreMedia 9 (v18.10). See the branch: [1904.2-compatible](https://github.com/tallence/core-redirects/tree/cm9-1904).

There is a [simple user guide](docs/userguide.md) available.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ["@jangaroo/eslint-config"],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const { jangarooConfig } = require("@jangaroo/core");

module.exports = jangarooConfig({
type: "code",
sencha: {
name: "com.coremedia.blueprint__core-redirects-studio-plugin",
namespace: "com.tallence.core.redirects.studio",
studioPlugins: [
{
mainClass: "com.tallence.core.redirects.studio.RedirectManagerStudioPlugin",
name: "Redirect Manager Extension",
},
],
},
appManifests: {
en: {
categories: [
"Content",
],
cmServiceShortcuts: [
{
cmKey: "redirect-manager",
cmCategory: "Content",
name: "Redirect manager",
url: "",
cmAdministrative: true,
cmService: {
name: "launchSubAppService",
method: "launchSubApp",
},
},
],
},
},
command: {
build: {
ignoreTypeErrors: false
},
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "@coremedia-blueprint/studio-client.main.core-redirects-studio-plugin",
"author": "Tallence AG",
"version": "1.0.0-SNAPSHOT",
"private": true,
"dependencies": {
"@coremedia-blueprint/studio-client.main.blueprint-forms": "1.0.0-SNAPSHOT",
"@coremedia/studio-client.app-context-models": "2110.1.0",
"@coremedia/studio-client.cap-base-models": "2110.1.0",
"@coremedia/studio-client.cap-rest-client": "2110.1.0",
"@coremedia/studio-client.client-core": "2110.1.0",
"@coremedia/studio-client.client-core-impl": "2110.1.0",
"@coremedia/studio-client.core-icons": "2110.1.0",
"@coremedia/studio-client.ext.base-components": "2110.1.0",
"@coremedia/studio-client.ext.ui-components": "2110.1.0",
"@coremedia/studio-client.main.bpbase-studio-components": "2110.1.0",
"@coremedia/studio-client.main.editor-components": "2110.1.0",
"@coremedia/studio-client.multi-site-models": "2110.1.0",
"@jangaroo/ext-ts": "^1.0.0",
"@jangaroo/jooflash-core": "^1.0.0",
"@jangaroo/runtime": "^1.0.0"
},
"devDependencies": {
"@jangaroo/build": "^1.0.0",
"@jangaroo/core": "^1.0.0",
"@jangaroo/eslint-config": "^1.0.0",
"@jangaroo/publish": "^1.0.0",
"eslint": "^7.27.0",
"rimraf": "^3.0.2"
},
"scripts": {
"clean": "rimraf ./dist && rimraf ./build",
"build": "jangaroo build",
"watch": "jangaroo watch",
"publish": "jangaroo publish",
"lint": "eslint --fix \"src/**/*.ts\""
},
"exports": {
"./*": {
"types": "./src/*.ts",
"default": "./dist/src/*.js"
}
},
"coremedia": {
"projectExtensionFor": "studio-client.main-static"
},
"publishConfig": {
"directory": "dist",
"exports": {
"./*": {
"types": "./src/*.d.ts",
"default": "./src/*.js"
}
}
}
}
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/*
* Copyright 2019 Tallence AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import ContentTypes_properties from "@coremedia/studio-client.cap-base-models/content/ContentTypes_properties";
import StudioAppsImpl from "@coremedia/studio-client.app-context-models/apps/StudioAppsImpl";
import studioApps from "@coremedia/studio-client.app-context-models/apps/studioApps";
import CopyResourceBundleProperties
from "@coremedia/studio-client.main.editor-components/configuration/CopyResourceBundleProperties";
import RegisterRestResource from "@coremedia/studio-client.main.editor-components/configuration/RegisterRestResource";
import AddTabbedDocumentFormsPlugin
from "@coremedia/studio-client.main.editor-components/sdk/plugins/AddTabbedDocumentFormsPlugin";
import TabbedDocumentFormDispatcher
from "@coremedia/studio-client.main.editor-components/sdk/premular/TabbedDocumentFormDispatcher";
import Config from "@jangaroo/runtime/Config";
import ConfigUtils from "@jangaroo/runtime/ConfigUtils";
import resourceManager from "@jangaroo/runtime/l10n/resourceManager";
import RedirectManagerStudioPluginBase from "./RedirectManagerStudioPluginBase";
import RedirectContentTypes_properties from "./bundles/RedirectContentTypes_properties";
import RedirectImpl from "./data/RedirectImpl";
import RedirectsImpl from "./data/RedirectsImpl";
import RedirectForm from "./studioform/RedirectForm";
import IEditorContext from "@coremedia/studio-client.main.editor-components/sdk/IEditorContext";
import {cast} from "@jangaroo/runtime";
import OpenRedirectManagerEditorAction from "./action/OpenRedirectManagerEditorAction";
import WorkArea from "@coremedia/studio-client.main.editor-components/sdk/desktop/WorkArea";
import WorkAreaTabTypesPlugin
from "@coremedia/studio-client.main.editor-components/sdk/desktop/WorkAreaTabTypesPlugin";
import ComponentBasedWorkAreaTabType
from "@coremedia/studio-client.main.editor-components/sdk/desktop/ComponentBasedWorkAreaTabType";
import RedirectManagerEditor from "./editor/RedirectManagerEditor";

interface RedirectManagerStudioPluginConfig extends Config<RedirectManagerStudioPluginBase> {
}

class RedirectManagerStudioPlugin extends RedirectManagerStudioPluginBase {
declare Config: RedirectManagerStudioPluginConfig;

override init(editorContext: IEditorContext): void {
super.init(editorContext);

cast(StudioAppsImpl, studioApps._).getSubAppLauncherRegistry().registerSubAppLauncher("redirect-manager", (): void => {
const openTagsAction = new OpenRedirectManagerEditorAction();
openTagsAction.execute();
});
}

constructor(config: Config<RedirectManagerStudioPlugin> = null) {
super(ConfigUtils.apply(Config(RedirectManagerStudioPlugin, {

rules: [

Config(TabbedDocumentFormDispatcher, {
plugins: [
Config(AddTabbedDocumentFormsPlugin, {
documentTabPanels: [
Config(RedirectForm, { itemId: "Redirect" }),
],
}),
],
}),

Config(WorkArea, {
plugins: [
Config(WorkAreaTabTypesPlugin, {
tabTypes: [
new ComponentBasedWorkAreaTabType({ tabComponent: Config(RedirectManagerEditor, { closable: true }) }),
],
}),
],
}),

],

configuration: [

new RegisterRestResource({ beanClass: RedirectsImpl }),
new RegisterRestResource({ beanClass: RedirectImpl }),

new CopyResourceBundleProperties({
destination: resourceManager.getResourceBundle(null, ContentTypes_properties),
source: resourceManager.getResourceBundle(null, RedirectContentTypes_properties),
}),

],

}), config));
}
}

export default RedirectManagerStudioPlugin;
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright 2019 Tallence AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import BeanClassRegistry from "@coremedia/studio-client.client-core-impl/data/impl/BeanClassRegistry";
import StudioPlugin from "@coremedia/studio-client.main.editor-components/configuration/StudioPlugin";
import IEditorContext from "@coremedia/studio-client.main.editor-components/sdk/IEditorContext";
import Config from "@jangaroo/runtime/Config";
import RedirectManagerStudioPlugin from "./RedirectManagerStudioPlugin";
import RedirectSourceParameter from "./data/RedirectSourceParameter";
import RedirectTargetParameter from "./data/RedirectTargetParameter";

interface RedirectManagerStudioPluginBaseConfig extends Config<StudioPlugin> {
}

class RedirectManagerStudioPluginBase extends StudioPlugin {
declare Config: RedirectManagerStudioPluginBaseConfig;

constructor(config: Config<RedirectManagerStudioPlugin> = null) {
super(config);
}

override init(editorContext: IEditorContext): void {
super.init(editorContext);

BeanClassRegistry.registerTypeImplementation("com.tallence.core.redirects.studio.data.RedirectSourceParameter", RedirectSourceParameter);
BeanClassRegistry.registerTypeImplementation("com.tallence.core.redirects.studio.data.RedirectTargetParameter", RedirectTargetParameter);
}
}

export default RedirectManagerStudioPluginBase;
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2019 Tallence AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Config from "@jangaroo/runtime/Config";
import ConfigUtils from "@jangaroo/runtime/ConfigUtils";
import OpenRedirectManagerEditorActionBase from "./OpenRedirectManagerEditorActionBase";

interface OpenRedirectManagerEditorActionConfig extends Config<OpenRedirectManagerEditorActionBase> {
}

class OpenRedirectManagerEditorAction extends OpenRedirectManagerEditorActionBase {
declare Config: OpenRedirectManagerEditorActionConfig;

constructor(config: Config<OpenRedirectManagerEditorAction> = null) {
super(ConfigUtils.apply(Config(OpenRedirectManagerEditorAction), config));
}
}

export default OpenRedirectManagerEditorAction;
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright 2019 Tallence AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import WorkArea from "@coremedia/studio-client.main.editor-components/sdk/desktop/WorkArea";
import editorContext from "@coremedia/studio-client.main.editor-components/sdk/editorContext";
import Action from "@jangaroo/ext-ts/Action";
import Panel from "@jangaroo/ext-ts/panel/Panel";
import { as } from "@jangaroo/runtime";
import Config from "@jangaroo/runtime/Config";
import RedirectManagerEditor from "../editor/RedirectManagerEditor";
import RedirectManagerEditorBase from "../editor/RedirectManagerEditorBase";
import OpenRedirectManagerEditorAction from "./OpenRedirectManagerEditorAction";

interface OpenRedirectManagerEditorActionBaseConfig extends Config<Action> {
}

class OpenRedirectManagerEditorActionBase extends Action {
declare Config: OpenRedirectManagerEditorActionBaseConfig;

constructor(config: Config<OpenRedirectManagerEditorAction> = null) {
config.handler = OpenRedirectManagerEditorActionBase.openRedirectAdmin;
super(config);
}

static openRedirectAdmin(): void {
const workArea = as(editorContext._.getWorkArea(), WorkArea);
let redirectManagerTab = RedirectManagerEditorBase.getInstance();

if (!redirectManagerTab) {
const workAreaTabType = workArea.getTabTypeById(RedirectManagerEditor.xtype);
workAreaTabType.createTab(null, (tab: Panel): void => {
redirectManagerTab = as(tab, RedirectManagerEditor);
workArea.addTab(workAreaTabType, redirectManagerTab);
});
}

workArea.setActiveTab(redirectManagerTab);
}
}

export default OpenRedirectManagerEditorActionBase;
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2019 Tallence AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import ResourceBundleUtil from "@jangaroo/runtime/l10n/ResourceBundleUtil";
import RedirectContentTypes_properties from "./RedirectContentTypes_properties";

/**
* Overrides of ResourceBundle "RedirectContentTypes" for Locale "de".
* @see RedirectContentTypes_properties#INSTANCE
*/
ResourceBundleUtil.override(RedirectContentTypes_properties, {
Redirect_redirectType_text: "Typ",
Redirect_edit_hint_text: "Die Umleitung kann in diesem Formular nicht editiert werden. Bitte nutzen Sie dafür den Redirect-Manager:",
Redirect_sourceUrlType_text: "Url Typ",
Redirect_source_text: "Quelle",
Redirect_targetLink_text: "Ziel",
Redirect_description_text: "Beschreibung",
});
Loading

0 comments on commit 11b9496

Please sign in to comment.