-
Notifications
You must be signed in to change notification settings - Fork 87
/
addservice2.html
42 lines (37 loc) · 1.78 KB
/
addservice2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<div class="addservice2">
<p>You will be forwarded to the website hosted by the service provider. Depending on the service provider's policy, you might have to login (and possibly create an account).
The service provider will ask you whether you want to give this BIMserver certain rights (for example if it can use certain creditcard-backed functionalities).</p>
<p>In most cases you will also implicitly agree for certain information to be shared between this BIMserver and the Service Provider.</p>
<p>After continuing, the process of adding a service should continue here.</p>
<button class="btn btn-default btnCancel">Cancel</button>
<button class="btn btn-primary btnContinue">Continue</button>
</div>
<script>
function AddService2(cd, main, project, serviceDescriptor, isLocal, longCallBack) {
var o = this;
cd.find(".btnCancel").click(function(){
main.pageChanger.current.rightPanel.showAddService(project, null, function(){
main.pageChanger.current.rightPanel.loadServices();
});
});
cd.find(".btnContinue").click(function(){
Global.bimServerApi.call("OAuthInterface", "registerApplication", {registrationEndpoint: serviceDescriptor.registerUrl, apiUrl: serviceDescriptor.url}, function(applicationId){
var url = new Url(document.location);
url.tab = "services";
url.oauth = "true";
url.baseUrl = serviceDescriptor.url;
url.serviceIdentifier = serviceDescriptor.identifier;
url.applicationId = applicationId;
url.page = "Project";
var uri = url.toString();
Global.bimServerApi.call("OAuthInterface", "generateForwardUrl", {
registrationEndpoint: serviceDescriptor.registerUrl,
authorizeUrl: serviceDescriptor.authorizeUrl,
returnUrl: encodeURIComponent(uri)
}, function(forwardUrl){
document.location = forwardUrl;
});
});
});
}
</script>