Skip to content

Commit

Permalink
lifecycle API added
Browse files Browse the repository at this point in the history
  • Loading branch information
delchev committed Oct 19, 2016
1 parent fd6bafc commit d6e9099
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
33 changes: 33 additions & 0 deletions core_api/ScriptingServices/platform/lifecycle.js
Original file line number Diff line number Diff line change
@@ -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());
};
13 changes: 13 additions & 0 deletions core_api/TestCases/platform/lifecycle_test.js
Original file line number Diff line number Diff line change
@@ -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();

0 comments on commit d6e9099

Please sign in to comment.