-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
42,045 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package it.cnr.si.config; | ||
|
||
|
||
import feign.Feign; | ||
import feign.form.FormEncoder; | ||
import feign.gson.GsonDecoder; | ||
import feign.gson.GsonEncoder; | ||
import it.cnr.si.flows.ng.service.AceAuthService; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.bind.RelaxedPropertyResolver; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.core.env.Environment; | ||
import org.springframework.security.oauth2.client.OAuth2ClientContext; | ||
import org.springframework.security.oauth2.client.OAuth2RestTemplate; | ||
import org.springframework.security.oauth2.client.resource.OAuth2ProtectedResourceDetails; | ||
import org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordResourceDetails; | ||
import org.springframework.security.oauth2.common.AuthenticationScheme; | ||
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableOAuth2Client; | ||
import org.springframework.security.oauth2.config.annotation.web.configuration.OAuth2ClientConfiguration; | ||
|
||
import javax.inject.Inject; | ||
import java.util.List; | ||
|
||
//@Profile("cnr") | ||
//@Configuration | ||
//@EnableOAuth2Client | ||
public class ACERestConfiguration { | ||
|
||
@Inject | ||
private OAuth2ClientContext oauth2Context; | ||
|
||
@Value("${spring.ace.url}") | ||
private String aceUrl; | ||
@Value("${spring.ace.password}") | ||
private String acePassword; | ||
@Value("${spring.ace.username}") | ||
private String aceUsername; | ||
|
||
@Bean(name ="aceRestTemplate") | ||
public OAuth2RestTemplate aceRestTemplate() { | ||
|
||
final AceAuthService service = Feign.builder() | ||
.decoder(new GsonDecoder()) | ||
.encoder(new FormEncoder(new GsonEncoder())) | ||
.target(AceAuthService.class, aceUrl + "api"); | ||
|
||
service.getToken(aceUsername, acePassword); | ||
|
||
ResourceOwnerPasswordResourceDetails details = new ResourceOwnerPasswordResourceDetails(); | ||
details.setPassword(acePassword); | ||
details.setUsername(aceUsername); | ||
details.setAccessTokenUri(aceUrl); | ||
details.setTokenName("ace_token"); | ||
|
||
OAuth2RestTemplate rt = new OAuth2RestTemplate(details); | ||
return rt; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/main/webapp/app/components/attachments/addattachment.modal.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
(function() { | ||
'use strict'; | ||
|
||
angular.module('sprintApp') | ||
.controller('AddAttachmentModalController', AddAttachmentModalController); | ||
|
||
|
||
AddAttachmentModalController.$inject = ['$scope', '$uibModalInstance', 'dataService', 'processInstanceId', 'Upload', 'AlertService', '$log']; | ||
|
||
function AddAttachmentModalController ($scope, $uibModalInstance, dataService, processInstanceId, Upload, AlertService, $log) { | ||
|
||
var vm = this; | ||
vm.data = {processInstanceId: processInstanceId}; | ||
$scope.data = {}; | ||
|
||
$scope.submitDocumento = function(file) { | ||
|
||
Upload.upload({ | ||
url: 'api/attachments/'+ processInstanceId +'/'+ 'nuovoDocumento' +'/data', | ||
data: $scope.data, | ||
}).then(function (response) { | ||
$scope.loadAttachments(); | ||
$uibModalInstance.close(); | ||
AlertService.success("Richiesta completata con successo"); | ||
|
||
}, function (err) { | ||
$log.error(err); | ||
AlertService.error("Richiesta non riuscita<br>"+ err.data.message); | ||
}); | ||
} | ||
} | ||
})(); |
23 changes: 23 additions & 0 deletions
23
src/main/webapp/app/components/attachments/addattachment.modal.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<div class="modal-header"> | ||
<h4 class="modal-title">Carica un ulteriore documento</h4> | ||
</div> | ||
<div class="modal-body"> | ||
|
||
<div class="row"> | ||
<div class="col-md-12"> | ||
<h4>Carica Documento</h4> | ||
|
||
<form novalidate class="flows-form" name="aggiornaDocumentoForm" ng-submit="submitDocumento(picFile)"> | ||
|
||
<fileinput name="file" multiple=false cnr-required=true /> | ||
<button class="btn btn-primary" type="submit" ng-disabled="aggiornaDocumentoForm.$invalid"> | ||
Invia | ||
<span class="glyphicon glyphicon-arrow-right"></span> | ||
</button> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<button class="btn btn-primary" type="button" ng-click="$dismiss()">Chiudi</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.