Giter Club home page Giter Club logo

hello-java-spring-force_dot_com's Introduction

Spring MVC and Force.com template application

This is a template for a web application that uses Spring MVC and Force.com. The sample code is a simple CRUD page that manipulates records for a single model object.

Running the application locally

Setup OAuth Remote Access in Salesforce.com

1. Go to Salesforce.com's Setup page
2. Go to Develop -> Remote Access
3. Add a new Remote Access config with a URL of: `http://localhost:8080/_auth`

Add environment variables for authenticating to Salesforce.com (replace the values with the ones from the Remote Access definition on Salesforce.com):

  • On Linux/Mac:

      $ export OAUTH_CLIENT_KEY=3MVM3_GuVCQ3gmEE5al72RmBfiAWhBX5O2wYc9zTZ8ytj1E3NF7grV_G99OxTyEcY71Tc46TOvzK_rzoyYYPk
      $ export OAUTH_CLIENT_SECRET=1319558946720906100
    
  • On Windows:

      $ set OAUTH_CLIENT_KEY=3MVM3_GuVCQ3gmEE5al72RmBfiAWhBX5O2wYc9zTZ8ytj1E3NF7grV_G99OxTyEcY71Tc46TOvzK_rzoyYYPk
      $ set OAUTH_CLIENT_SECRET=1319558946720906100
    

Build with:

$ mvn clean install

Then run it with:

$ java -jar target/dependency/webapp-runner.jar target/*.war

Running on Heroku

Clone this project locally:

$ git clone git://github.com/jamesward/hello-java-spring-force_dot_com.git

Create a new app on Heroku (make sure you have the Heroku Toolbelt installed):

$ heroku login
$ heroku create -s cedar

Setup OAuth Remote Access in Salesforce.com

1. Go to Salesforce.com's Setup page
2. Go to Develop -> Remote Access
3. Add a new Remote Access config with a URL of: `https://your-app-1234.herokuapp.com/_auth`

Add config params for authenticating to Salesforce.com (replace the values with the ones from the Remote Access definition on Salesforce.com):

$ heroku config:add OAUTH_CLIENT_KEY=3MVM3_GuVCQ3gmEE5al72RmBfiAWhBX5O2wYc9zTZ8ytj1E3NF7grV_G99OxTyEcY71Tc46TOvzK_rzoyYYPk OAUTH_CLIENT_SECRET=1319558946720906100

Upload the app to Heroku:

$ git push heroku master

Open the app in your browser:

$ heroku open

hello-java-spring-force_dot_com's People

Contributors

jamesward avatar jsimone avatar ryanbrainard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hello-java-spring-force_dot_com's Issues

Push to Heroku Failed

Failed to execute goal on project hello-java-spring-force_dot_com: Could not resolve dependencies for project com.example:hello-java-spring-force_dot_com:war:0.0.1-SNAPSHOT: Failed to collect dependencies for [com.github.twitter:bootstrap:jar:2.0.3 (compile), javax.servlet:javax.servlet-api:jar:3.0.1 (provided), org.springframework:spring-webmvc:jar:3.1.1.RELEASE (compile), taglibs:standard:jar:1.1.2 (compile), javax.servlet:jstl:jar:1.2 (compile), com.force.api:force-rest-api:jar:0.0.18 (compile), com.force.sdk:force-oauth:jar:22.0.8-BETA (compile), com.force.sdk:force-springsecurity:jar:22.0.8-BETA (compile), com.github.jsimone:webapp-runner:jar:7.0.22.3 (provided)]: No versions available for org.codehaus.jackson:jackson-mapper-asl:jar:[1.9.1,1.9.7] within specified range -> [Help 1]

Make endpoint="http://login.salesforce.com" configurable

Hi James,

Need some help on configuring the aouthInfo endpoint:

<fss:oauth logout-url="/logout" default-logout-success="/" store-data-in-session="true">
        <fss:oauthInfo endpoint="http://login.salesforce.com"
                       oauth-key="#{systemEnvironment['OAUTH_CLIENT_KEY']}"
                       oauth-secret="#{systemEnvironment['OAUTH_CLIENT_SECRET']}"/>
    </fss:oauth>"

I want to make the endpoint to be configurable during login where I can popup a option to select environment. So the endpoint needs to switch between:
endpoint="http://login.salesforce.com"
endpoint="http://sandbox.salesforce.com"

Any suggestions on how I can do this?

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.