GithubHelp home page GithubHelp logo

isabella232 / db-resource-provider-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adobe-marketing-cloud/db-resource-provider-example

0.0 0.0 0.0 156 KB

License: Apache License 2.0

Java 100.00%

db-resource-provider-example's Introduction

DB Example

This repository contains a DB based sample application to illustrate a possibility how to integrate a relational database in AEM 6.

To build run

mvn clean install

To install on a local AEM 6 instance running on port 4502

mvn clean install -P installPackage

For development it is also useful to only update the bundle

mvn clean install -P installBundle -pl resource-provider

Testing CRUD with curl

Create:

curl -X POST -u admin:admin -F"./userid=john" -F"./name=John Doe" -F"./[email protected]" -F":nameHint=john" "http://localhost:4502/examples/db/accounts/*"

Read (in the browser):

http://localhost:4502/examples/db/accounts.tidy.-1.json
or
http://localhost:4502/examples/db/accounts/john.tidy.-1.json

Update:

curl -X POST -u admin:admin -F"./balance=100" "http://localhost:4502/examples/db/accounts/john"

Delete:

curl -X POST -u admin:admin -F":operation=delete" "http://localhost:4502/examples/db/accounts/john"

Rendering the result in a browser:

http://localhost:4502/examples/db/accounts.tidy.-1.json

By default an in-memory H2 database is created due to the connection url configured in

content/src/main/content/jcr_root/apps/db-example/config/org.apache.sling.datasource.DataSourceFactory-db-example.config

To configure a persistent database, adjust the url property in this file, e.g.

url="jdbc:h2:~/db-example-h2"

db-resource-provider-example's People

Contributors

jsedding avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.