3 Apr 2023
outsystems integration
If you are using outsystems and interested in integrating APS in it, then the following might be useful.
Our getting started tutorial shows you how to get your files to our servers, translate them and display their 3d visuals in your webpage. I followed the same in the SharePoint sample and will do the same here.
I started off with creating a new Traditional Web app:
Then added an empty Web Screen where we'll list the files stored in our APS bucket and display the selected model in the Viewer:
Added another Web Screen that already had the Upload widget in it to enable upload of new models and just deleted everything from it that was not needed:
Also created a Web Block to make it easier to include the Viewer in any parts of the web app, set its Style Sheet and added JavaScript code to expose some functions that can be used later on: initializeViewer() and loadModel()
Then defined all the API endpoints this app will use from Autodesk Platform Services. Just had to set the headers and add a sample response so that outsystems can generate the data types for the response:
Also added an endpoint that will be used on the client side from the Web Block's JavaScript code:
In the main web screen added a flow that will use all the REST endpoints we added. Request an access token, get the list of objects in the bucket, include both the css and js file of the Viewer and then call the "initializeViewer()" function that is part of the ViewerBlock's code. Also added local parameters: one to store the cursor as we iterate through the contents of the bucket called StartAtUrlParam, and one to store information about the list of files we retrieved called ObjectsInBucket. The latter will be referenced by the Record List I added next.
So I added the Record List that will be using the ObjectInBuckets local variable as a source, plus a Separator and an instance o the ViewerBlock
Added some JavaScript code to the main Web Screen that can load a new model and will be used for the onclick event of the rows of the Record List
Also had to create a flow for the second Web Screen that will be called when the user clicks the Upload button. It requests an access token, then a signed URL for the file that we want to upload, then uploads the content using that URL, triggers the SVF translation job for the file, and finally pops up a notification about the successful upload
Last but not least you have to add the APS credentials and bucket name (needs to be unique globally) you want to use. You can add them as Default Value on the Data tab under Site Properties:
The value for Base64ClientIdClientSecret should be the base64 encoded version of <ClientId>:<ClientSecret> - you can use a utility like https://www.base64encode.org/ to get it:
Also, you need to create the bucket whose name you provided before using this app - you can use a utility like this to do that:
https://oss-manager.autodesk.io/
Here is the finished website in action: https://youtu.be/wQho4a4JguE
And here is the saved application that you should be able to test in your environment. Please check out the readme for info on what needs to be modified in the app in order to run it with your credentials: https://github.com/adamenagy/outsystems-integration
There is actually a component for our Viewer that you can use provided by OutSystems: https://www.outsystems.com/forge/component-overview/1337/autodesk-forge-connector