diff --git a/core_api/ScriptingServices/platform/lifecycle.js b/core_api/ScriptingServices/platform/lifecycle.js new file mode 100644 index 0000000..37d2518 --- /dev/null +++ b/core_api/ScriptingServices/platform/lifecycle.js @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2016 SAP and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * Contributors: + * SAP - initial API and implementation + *******************************************************************************/ + +/* globals $ java */ +/* eslint-env node, dirigible */ + +exports.activateProject = function(projectName) { + $.getLifecycleService().activateProject(projectName, $.getRequest()); +}; + +exports.publishProject = function(projectName) { + $.getLifecycleService().publishProject(projectName, $.getRequest()); +}; + +exports.publishTemplate = function(projectName) { + $.getLifecycleService().publishTemplate(projectName, $.getRequest()); +}; + +exports.activateAll = function() { + $.getLifecycleService().activateAll($.getRequest()); +}; + + +exports.publishAll = function() { + $.getLifecycleService().publishAll($.getRequest()); +}; diff --git a/core_api/TestCases/platform/lifecycle_test.js b/core_api/TestCases/platform/lifecycle_test.js new file mode 100644 index 0000000..0036319 --- /dev/null +++ b/core_api/TestCases/platform/lifecycle_test.js @@ -0,0 +1,13 @@ +/* globals $ */ +/* eslint-env node, dirigible */ + +var lifecycle = require('platform/lifecycle'); +var response = require('net/http/response'); + +// Publish All Projects +lifecycle.publishAll(); + +response.println("All projects have been published."); + +response.flush(); +response.close();