Professional Documents
Culture Documents
October, 2013
Local Development
How Do I Test My Application Locally?
Scenario: app developer wants to deploy & test persistence-enabled application locally application code should run both in the local dev environment & in the cloud
Public
Local Development
Application Scenarios
Default
Application uses only one schema Application works only with default datasource binding Application uses no database-vendor-specific SQL statements/features
Multiple applications share one schema Application uses database-vendorspecific SQL statements/features One application uses multiple schemas
Public
Local Development
Local Testing Default Support
Apache Derby
In-memory lightweight database Embedded in Java server runtime process
If only one schema is needed, no configuration changes are required Eclipse IDE
Choose Run As Run on Server Select Manually define a new server As the server type, select SAP SAP HANA Cloud local runtime
Public
Local Development
Local Testing Support for Multiple Applications Sharing One Schema
Same as default support All applications deployed together on the local server always share the same schema on Derby
Public
Local Development
Local Testing Support for Applications Using a Particular Database
*********
Public
Local Development
Local Testing Support for Applications Using Multiple Schemas
************
************
************
Public
Local Development
What Youve Learned in This Unit
How to test your persistence-enabled application on a local server What Apache Derby is, and how it is used on SAP HANA Cloud Platform How to test your application locally but still use the data from your database in the cloud How to configure the applications data sources in the database connection properties
Public
Scenario: app developer wants to use SAP HANA data-persistence and analytic model artifacts Specifics of SAP HANA Cloud Platform Schemas on trial landscape: shared SAP HANA database systems Application isolation based on schema and package namespace Applications database user has restricted permissions
Public
Public
Open a database tunnel Connect SAP HANA studio to opensap schema In SAP HANA Systems View: Application schema Personal schema not used Application package EPM application sample data
EPM sample data EPM sample data
Application schema
Application package
Public
Enterprise Procurement Model Reference Application Used for demo and testing purposes Pre-delivered data content for SAP HANA Cloud trial accounts Multiple tables available
Public
Create calculation view on top of EPM data Create calculation view artifact Activate view Grant permissions to applications db user CALL "HCP"."HCP_GRANT_SELECT_ON_ACTIVATED_OBJECTS"
Public
Visualize View content in a Web application Consume calculation view in JDBC sample Declare data source jdbc/opensapDS in web.xml Select content in servlet
SELECT TOP 10 * FROM "_SYS_BIC"."<MyPackage>" "SO_CV" ORDER BY ...
Bind opensap schema to JDBC sample Deploy and start JDBC sample
2013 SAP AG. All rights reserved. Public 7
How to create a calculation view How to activate objects in SAP HANA studio How to grant permissions for your user to select data from activated objects How to consume calculation view content in a Java servlet
Public
Stores files and folders in the cloud Open standards-based Easy to consume Usage-based pricing Scalable High availability setup Secure Multi-tenancy-enabled
Document Service Document Service API Internet SAP HANA Cloud Platform Apps
Public
Apache Chemistry
CMIS libraries for various languages Development tools: CMIS Workbench Technology Compatibility Kit (TCK) for CMIS SAP actively contributes and chairs this project
Public
CMIS features
Files & folders Metadata (types & properties) Queries via CMISQL Versioning Permission handling (ACL) Retention management
Additional features
AES encryption of content Virus scan on upload Multi-tenancy support Repository lifecycle Backups to multiple locations
Public
Simple Web application Connects to Document service Creates a folder and a file Reads & prints the folders entries
Public
How the Document service works The CMIS standard How to deploy the first demo application in combination with the Document service
Public
Documents in the cloud only accessible to apps deployed in the same account Proxy Bridge
Tunnels external CMIS requests to Document service Restricts access with roles or filters Access to repository via unique name + key
SAP HANA Cloud
Proxy Bridge
No direct access
Document Service
Public
Public
Public
Public
Setting properties
List<String> tags = Arrays.asList("Hello", "Tutorial"); Map<String, Object> properties = new HashMap<String, Object>(); properties.put("sap:tags", tags); doc.updateProperties(properties);
Getting properties
// all properties List<Property<?>> properties = document.getProperties(); // single property Property<String> property = document.getProperty(cmis:name); String docName = property.getValue();
Querying properties
String query = "SELECT cmis:name, cmis:objectId, cmis:createdBy, sap:tags, sap:owner FROM cmis:document WHERE ANY sap:tags IN ('Hello')"; ItemIterable<QueryResult> results = session.query(query, false);
Public
Public
Public
How to attach properties to documents How to query properties in Java How to query with the CMIS Workbench Advanced features for the Document Service
Public
Thank you
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. National product specifications may vary. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Please see http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices.
Public