28.01.2013 Views

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SAP HANA Developer Guide - Get a Free Blog

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The functions provided by the JavaScript APIs enable server-side JavaScript applications to perform the following<br />

actions:<br />

● Interact with the <strong>SAP</strong> <strong>HANA</strong> XS runtime environment<br />

● Directly access <strong>SAP</strong> <strong>HANA</strong> database capabilities<br />

Note: Unlike OData and XMLA, the JavaScript API enables you not only to expose data but to update,<br />

insert, and delete data, too.<br />

JavaScript programs are stored in the repository along with all the other development resources. When the<br />

programs are activated, the code is stored in the repository as a runtime object.<br />

9.2.2 JavaScript Editor<br />

You can write server-side JavaScript using the <strong>SAP</strong> <strong>HANA</strong> studio JavaScript editor, which provides syntax<br />

validation, code highlighting and code completion.<br />

When you edit a JavaScript file within an XS JavaScript project, the editor automatically has a reference to the XS<br />

JavaScript API. You can access the API’s objects by entering $, following by a period (.), and the objects are<br />

available, as in the following example.<br />

JSLint Validations<br />

The JavaScript editor includes the JSLint open-source library, which helps to validate JavaScript code. The editor<br />

highlights any code that does not conform to the JSLint standards.<br />

To configure the JSLint library and determine which validations are performed, go to:<br />

Windows Preferences JSLint<br />

In the preferences window, each JSLint setting is followed by the corresponding JSLint command name, which<br />

you can use to lookup more information on the JSLint Web site.<br />

Related Links<br />

JSLint Web Site<br />

<strong>SAP</strong> <strong>HANA</strong> <strong>Developer</strong> <strong>Guide</strong><br />

Writing Server-Side JavaScript Applications<br />

P U B L I C<br />

© 2012 <strong>SAP</strong> AG. All rights reserved. 213

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!