Skip to content

About

Learn Forge Tutorial: View your models using 2-legged OAuth. Available in Nodejs, .NET, Go, PHP & Java

Topics

Resources

Stars

105 stars

Watchers

13 watching

Forks

 
 

Latest commit

 

History

31 Commits

Folders and files

Repository files navigation

learn.forge.viewmodels (Java)

JDK8 Apache Tomcat Eclipse Platforms License

oAuth2 Data-Management OSS Model-Derivative

Description

This sample is part of the Learn Forge tutorials.

Setup

For using this sample, you need an Autodesk developer credentials. Visit the Forge Developer Portal, sign up for an account, then create an app. For this new app, use http://localhost:3000/api/forge/callback/oauth as Callback URL, although is not used on 2-legged flow. Finally take note of the Client ID and Client Secret.

Run locally

Clone this project or download it. It's recommended to install GitHub desktop. To clone it via command line, use the following (Terminal on MacOSX/Linux, Git Shell on Windows):

git clone -b java https://github.com/Autodesk-Forge/learn.forge.viewmodels.git

To run it, install the required packages, set the enviroment variables with your client ID & secret (or input manually to config.java. In Eclipse, right click project, locate [Run As], then [Maven Install]. And follow the steps to configure the server and finally start it.

Open the browser: http://localhost:3000.

Packages used

The Forge JAVA SDK packages is included by default. Some other non-Autodesk packaged are used, including WebServlet and commons-fileupload for upload file.

Tips & tricks

Maven 3.0 and above deprecated LATEST and RELEASE metaversions (see this discussion], if you need latest version of Forge JAVA SDK, please check on Maven Center and update with the specific version number accordingly.

  <dependency>
          <groupId>com.autodesk</groupId>
          <artifactId>forge-java-sdk</artifactId> 
          <version> input the latest version if needed </version>
  </dependency>

Or, get the source repository of JAVA SDK and integrate with your project.

Troubleshooting

If Tomcat throws an error (org.apache.catalina.LifecycleException) when running the sample, it might be the mismatch of Tomcat version and project JSE version, you can follow the article to check Tomcat JSE version.

License

This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.

Written by

Xiaodong Liang @coldwood and Jaime Rosales Duque @AfroJme, Forge Partner Development

About

Learn Forge Tutorial: View your models using 2-legged OAuth. Available in Nodejs, .NET, Go, PHP & Java

Topics

Resources

Stars

105 stars

Watchers

13 watching

Forks

Releases

Packages

Used by

Contributors

Languages