summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-widget-ms
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-portal-widget-ms')
-rw-r--r--ecomp-portal-widget-ms/common-widgets/.gitignore3
-rw-r--r--ecomp-portal-widget-ms/common-widgets/pom.xml5
-rw-r--r--ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/js/controller.js604
-rw-r--r--ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/markup/markup.html178
-rw-r--r--ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/styles/styles.css47
-rw-r--r--ecomp-portal-widget-ms/pom.xml40
-rw-r--r--ecomp-portal-widget-ms/widget-ms/pom.xml4
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/MicroserviceApplication.java19
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/constant/WidgetConstant.java11
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/DatabaseFileUploadController.java (renamed from ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/DatabaseFileUploadController.java)41
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/HealthController.java35
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/WidgetsCatalogController.java (renamed from ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/WidgetsCatalogController.java)49
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/dao/WidgetDataSource.java34
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/App.java47
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceData.java (renamed from ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/MicroserviceData.java)39
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceParameter.java70
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/RoleApp.java (renamed from ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/RoleApp.java)39
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/ValidationRespond.java34
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetCatalog.java (renamed from ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/WidgetCatalog.java)39
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetFile.java96
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/excetpion/StorageException.java15
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/excetpion/StorageFileNotFoundException.java14
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/filters/CorsConfiguration.java15
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/hibernate/HibernateConfiguration.java44
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/listener/WidgetEventListener.java36
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/InitializationService.java7
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/MicroserviceService.java17
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/StorageService.java34
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/WidgetCatalogService.java28
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/InitializationServiceImpl.java (renamed from ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/InitializationServiceImpl.java)59
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/MicroserviceServiceImpl.java (renamed from ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/MicroserviceServiceImpl.java)45
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/StorageServiceImpl.java (renamed from ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/StorageServiceImpl.java)55
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/WidgetCatalogServiceImpl.java (renamed from ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/WidgetCatalogServiceImpl.java)47
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/utils/AuthorizationUtil.java19
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/utils/UnzipUtil.java (renamed from ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/utils/UnzipUtil.java)41
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/MicroserviceApplication.java57
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/constant/WidgetConstant.java48
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/HealthController.java72
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/dao/WidgetDataSource.java71
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/App.java84
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/MicroserviceParameter.java107
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/ValidationRespond.java71
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/WidgetFile.java133
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/excetpion/StorageException.java52
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/excetpion/StorageFileNotFoundException.java51
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/filters/CorsConfiguration.java52
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/hibernate/HibernateConfiguration.java81
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/listener/WidgetEventListener.java73
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/InitializationService.java44
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/MicroserviceService.java54
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/StorageService.java71
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/WidgetCatalogService.java65
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/utils/AuthorizationUtil.java56
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/resources/logback.xml2
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetFileControllerTest.java (renamed from ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/controller/WidgetFileControllerTest.java)43
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java (renamed from ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java)49
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/service/WidgetCatalogServiceTest.java (renamed from ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/service/WidgetCatalogServiceTest.java)45
57 files changed, 1490 insertions, 1801 deletions
diff --git a/ecomp-portal-widget-ms/common-widgets/.gitignore b/ecomp-portal-widget-ms/common-widgets/.gitignore
index f151f08a..92ae7aa8 100644
--- a/ecomp-portal-widget-ms/common-widgets/.gitignore
+++ b/ecomp-portal-widget-ms/common-widgets/.gitignore
@@ -3,3 +3,6 @@
/.settings/
/bin/
target/
+/common-widgets/events-widget.zip
+/common-widgets/news-widget.zip
+/common-widgets/resources-widget.zip \ No newline at end of file
diff --git a/ecomp-portal-widget-ms/common-widgets/pom.xml b/ecomp-portal-widget-ms/common-widgets/pom.xml
index 232f9331..7b1167d4 100644
--- a/ecomp-portal-widget-ms/common-widgets/pom.xml
+++ b/ecomp-portal-widget-ms/common-widgets/pom.xml
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onap.portal</groupId>
<artifactId>widget-ms-parent</artifactId>
- <version>1.3.0</version>
+ <version>2.2</version>
</parent>
<artifactId>common-widgets</artifactId>
@@ -78,5 +78,4 @@
</plugin>
</plugins>
</build>
-
</project>
diff --git a/ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/js/controller.js b/ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/js/controller.js
new file mode 100644
index 00000000..934095c3
--- /dev/null
+++ b/ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/js/controller.js
@@ -0,0 +1,604 @@
+function SchedulerCtrl($rootScope , $scope,$state,widgetsCatalogService,$log,schedulerService,$filter,confirmBoxService,userProfileService,conf,$interval,$compile) {
+ /****define fields****/
+ var pollpromise;
+ /*Assign the data that's passed to scheduler UI*/
+ $scope.hasParentData = true;
+ $rootScope.schedulerID = '';
+ $scope.orgUserId="";
+ $scope.policys = [];
+ $scope.selectedPolicy={policyName:"",policyConfig:""};
+ $scope.scheduler = {};
+ $scope.schedulingInfo = {};
+ $scope.timeSlots = [];
+ $scope.changeManagement = {};
+ $rootScope.schedulerForm = {
+ checkboxSelection : 'false',
+ fromDate:'',
+ toDate:'',
+ duration:'',
+ fallbackDuration:'',
+ concurrencyLimit:''
+ };
+
+ $scope.vnfNames = [];
+ $scope.vnfTypes = [];
+ $scope.schedulerObj = {};
+
+ var tomorrow = new Date();
+ tomorrow.setDate(tomorrow.getDate() + 1);
+ $scope.minDate = tomorrow.toISOString().substring(0, 10);
+
+
+ /*form validation*/
+ $scope.durationEmpty=false;
+ $scope.concurrencyLimitEmpty = false;
+ $scope.fallBackDurationEmpty=false;
+ $scope.fromDateEmpty = false;
+ $scope.toDateEmpty=false;
+
+ /*interval values for getting time slots*/
+ var hasvaluereturnd = true;
+ var hasthresholdreached = false;
+ var thresholdvalue =10; // interval threshold value
+
+ $scope.timeUnit= [
+ {text: 'HOURS'},
+ {text: 'MINUTES'},
+ {text: 'SECONDS'}
+ ];
+
+
+ /***** Functions for modal popup ******/
+ $scope.radioSelections=function (){
+ if( $rootScope.schedulerForm.checkboxSelection=="true"){
+ $rootScope.schedulerForm.fromDate='';
+ $rootScope.schedulerForm.toDate=''
+ }
+ }
+
+ /*Dropdown update: everytime values in dropdown chagnes, update the selected value*/
+ $scope.$watch('selectedPolicy.policyName', (newVal, oldVal) => {
+ for (var i = 0; i < $scope.policys.length; i++)
+ if ($scope.policys[i].policyName == newVal)
+ $scope.selectedPolicy = angular.copy($scope.policys[i]);;
+ });
+
+ $scope.$watch('selectedTimeUint.text', (newVal, oldVal) => {
+ for (var i = 0; i < $scope.timeUnit.length; i++)
+ if ($scope.timeUnit[i].text == newVal)
+ $scope.selectedTimeUint = angular.copy($scope.timeUnit[i]);;
+ });
+
+ /**
+ * This function is to validate and check if the input is a valid date.
+ * There are two checkers in this function:
+ * Check 1: the input is a valid date object,return true, return false otherwise.
+ * Check 2: check if the input has the format of MM/DD/YYYY or M/D/YYYY and is a valid date value.
+ * @param dateInput
+ * @return true/false
+ */
+ $scope.isDateValid = function(dateInput) {
+ /*Check 1: see if the input is able to convert into date object*/
+ if ( Object.prototype.toString.call(dateInput) === "[object Date]" )
+ return true;
+ /*Check 2: see if the input is the date format MM/DD/YYYY */
+ var isDateStrFormat = false;
+ try{
+ /*check the format of MM/DD/YYYY or M/D/YYYY */
+ var startDateformat = dateInput.split('/');
+ if (startDateformat.length != 3)
+ return false;
+ var day = startDateformat[1];
+ var month = parseInt(startDateformat[0])-1;
+ var year = startDateformat[2];
+ if (year.length != 4)
+ return false;
+ /*check the input value and see if it's a valid date*/
+ var composedDate = new Date(year, month, day);
+ if(composedDate.getDate() == day && composedDate.getMonth() == month && composedDate.getFullYear() == year)
+ isDateStrFormat = true
+ else
+ isDateStrFormat =false;
+ }catch(err){
+ return false;
+ }
+ return isDateStrFormat;
+ };
+
+ /**
+ * This function is to check whether the input date is greater than current date or not.
+ * @param date
+ * @return true/false
+ */
+ $scope.isStartDateValidFromToday = function (date) {
+ if(!$scope.isDateValid(date))
+ return false;
+ var startDate = new Date(date);
+ var currentDate = new Date();
+ if(startDate<=currentDate)
+ return false;
+ return true;
+ };
+
+ /**
+ * This function is to check whether the input to date is greater than input from date.
+ * @param fromDate , toDate
+ * @return true/false
+ */
+ $scope.isToDateGreaterFromDate = function (fromDate,toDate) {
+ if(!$scope.isDateValid(fromDate) || !$scope.isDateValid(toDate))
+ return false;
+ var fromDateObj = new Date(fromDate);
+ var toDateObj = new Date(toDate);
+ if(toDateObj<=fromDateObj)
+ return false;
+ return true;
+ };
+
+ /**
+ * This function is to get error message from the input json response object.
+ * @param response , method
+ * @return errorMsg
+ */
+ $scope.parseErrorMsg = function(response, method){
+ var errorMsg = '';
+ if(response.entity){
+ try{
+ var entityJson = JSON.parse(response.entity);
+ if(entityJson){
+ errorMsg = entityJson.requestError.text;
+ }
+ }catch(err){
+ $log.error('SchedulerCtrl::' + method +' error: ' + err);
+ }
+ }
+ return errorMsg;
+ }
+ /***** Scheduler UI functions *****/
+
+ /* This function is to send scheduler task approval to scheduler microservice. */
+ $scope.submit = function () {
+ $rootScope.showSpinner =true;
+
+ var approvalDateTime = new Date($scope.timeSlots[0].startTime);
+ $scope.schedulingInfo={
+ scheduleId: $rootScope.schedulerID,
+ approvalDateTime:approvalDateTime.toISOString(),
+ approvalUserId:$scope.orgUserId,
+ approvalStatus:$scope.schedulerObjConst.approvalSubmitStatus,
+ approvalType: $scope.schedulerObjConst.approvalType
+ }
+ var approvalObj= JSON.stringify($scope.schedulingInfo)
+ schedulerService.postSubmitForApprovedTimeslots(approvalObj).then(response => {
+ if(response.status>=200 && response.status<=204){
+ confirmBoxService.showInformation("Successfully Sent for Approval").then(isConfirmed => {});
+ }else{
+ var errorMsg = $scope.parseErrorMsg(response, 'postSubmitForApprovedTimeslots');
+ confirmBoxService.showInformation("Failed to Send for Approval "+ errorMsg).then(isConfirmed => {
+ $scope.closeModal();
+ });
+ }
+ }).catch(err => {
+ $log.error('SchedulerCtrl::postSubmitForApprovedTimeslots error: ' + err);
+ var errorMsg = '';
+ if(err.data)
+ errorMsg = $scope.parseErrorMsg(err.data, 'postSubmitForApprovedTimeslots');
+ else
+ errorMsg = err;
+ confirmBoxService.showInformation("There was a problem sending Schedule request. " + errorMsg).then(isConfirmed => {
+ $scope.closeModal();
+ });
+ }).finally(() => {
+ $rootScope.showSpinner = false;
+ });
+ };
+
+ /* This function is to send scheduler task rejection to scheduler microservice. */
+ $scope.reject = function () {
+ $rootScope.showSpinner =true;
+ var approvalDateTime = new Date($scope.timeSlots[0].startTime);
+ $scope.schedulingInfo={
+ scheduleId: $rootScope.schedulerID,
+ approvalDateTime:approvalDateTime.toISOString(),
+ approvalUserId:$scope.orgUserId,
+ approvalStatus: $scope.schedulerObjConst.approvalRejectStatus,
+ approvalType: $scope.schedulerObjConst.approvalType
+ }
+ var approvalObj= JSON.stringify($scope.schedulingInfo)
+ schedulerService.postSubmitForApprovedTimeslots(approvalObj).then(response => {
+ if(response.status>=200 && response.status<=299){
+ confirmBoxService.showInformation("Successfully Sent for Reject").then(isConfirmed => {});
+ }else{
+ var errorMsg = $scope.parseErrorMsg(response, 'postSubmitForApprovedTimeslots');
+ confirmBoxService.showInformation("Failed to Send for Reject "+ errorMsg).then(isConfirmed => {});
+ }
+ }).catch(err => {
+ $log.error('SchedulerCtrl::postSubmitForApprovedTimeslots error: ' + err);
+ var errorMsg = '';
+ if(err.data)
+ errorMsg = $scope.parseErrorMsg(err.data, 'postSubmitForApprovedTimeslots');
+ else
+ errorMsg = err;
+ confirmBoxService.showInformation("There was a problem rejecting Schedule request. " + errorMsg).then(isConfirmed => {
+ $scope.closeModal();
+ });
+ }).finally(() => {
+ $rootScope.showSpinner = false;
+ });
+ };
+
+ /* This function is to send policy config and receive scheduler Id. */
+ function sendSchedulerReq(){
+ $scope.timeSlots=[];
+ $scope.timeSlots.length=0;
+ $scope.schedulerObj.userId=$scope.orgUserId;
+ $scope.schedulerObj.domainData[0].WorkflowName=$scope.vnfObject.workflow;
+ $scope.schedulerObj.schedulingInfo.normalDurationInSeconds=convertToSecs($rootScope.schedulerForm.duration)
+ $scope.schedulerObj.schedulingInfo.additionalDurationInSeconds=convertToSecs($rootScope.schedulerForm.fallbackDuration)
+ $scope.schedulerObj.schedulingInfo.concurrencyLimit=parseInt($rootScope.schedulerForm.concurrencyLimit)
+
+ $scope.schedulerObj.schedulingInfo['vnfDetails'][0].groupId=$scope.schedulerObjConst.groupId;
+ $scope.schedulerObj.schedulingInfo['vnfDetails'][0].node=getVnfData($scope.vnfObject.vnfNames);
+ for(var i=0;i<$scope.policys.length;i++){
+ if($scope.policys[i].policyName == $scope.selectedPolicy.policyName){
+ try{
+ var config = $scope.policys[i].config;
+ var configJson = JSON.parse(config);
+ $scope.selectedPolicy.policyConfig = configJson.policyName;
+ }catch(err){
+ confirmBoxService.showInformation("There was a problem setting Policy config. Please try again later. " + err).then(isConfirmed => {
+ $scope.closeModal();
+ });
+ return;
+ }
+ }
+ }
+ $scope.schedulerObj.schedulingInfo.policyId=$scope.selectedPolicy.policyConfig;
+ var changeWindow=[{
+ startTime:$filter('date')(new Date($rootScope.schedulerForm.fromDate), "yyyy-MM-ddTHH:mmZ", "UTC"),
+ endTime:$filter('date')(new Date($rootScope.schedulerForm.toDate), "yyyy-MM-ddTHH:mmZ", "UTC")
+ }];
+ $scope.schedulerObj.schedulingInfo['vnfDetails'][0].changeWindow=changeWindow;
+
+ if($rootScope.schedulerForm.checkboxSelection=="true"){ //When Scheduled now we remove the changeWindow
+ delete $scope.schedulerObj.schedulingInfo['vnfDetails'][0].changeWindow;
+ }
+ var requestScheduler= JSON.stringify($scope.schedulerObj)
+ $rootScope.showSpinner = true;
+ schedulerService.getStatusSchedulerId(requestScheduler).then(response => {
+
+ var errorMsg = '';
+ if(response && response.entity!=null){
+ var errorMsg = $scope.parseErrorMsg(response, 'getStatusSchedulerId');
+ confirmBoxService.showInformation("There was a problem retrieving scheduler ID. Please try again later. " + errorMsg).then(isConfirmed => {
+ $scope.closeModal();
+ });
+
+ }else{
+ if(response && response.uuid){
+ $rootScope.schedulerID = response.uuid;
+ var scheduledID= JSON.stringify({scheduleId:$rootScope.schedulerID});
+ $scope.seviceCallToGetTimeSlots();
+ }else{
+ confirmBoxService.showInformation("There was a problem retrieving scheduler ID. Please try again later. " + response).then(isConfirmed => {
+
+ });
+ }
+
+
+ }
+ }).catch(err => {
+ $rootScope.showSpinner = false;
+ $log.error('SchedulerCtrl::getStatusSchedulerId error: ' + err);
+ var errorMsg = '';
+ if(err.data)
+ errorMsg = $scope.parseErrorMsg(err.data, 'getStatusSchedulerId');
+ else
+ errorMsg = err;
+ confirmBoxService.showInformation("There was a problem retrieving scheduler ID. Please try again later." + errorMsg).then(isConfirmed => {
+ $scope.closeModal();
+ });
+ }).finally(() => {
+ $rootScope.showSpinner = false;
+ });
+ }
+
+ /* This function is to get time slots from SNIRO */
+ $scope.seviceCallToGetTimeSlots = function(){
+ $rootScope.showTimeslotSpinner = true;
+ schedulerService.getTimeslotsForScheduler($rootScope.schedulerID).then(response => {
+ if($rootScope.schedulerForm.checkboxSelection=="false"){
+ if(response.entity && JSON.parse(response.entity).schedule){ //received the timeslots
+ var entityJson = JSON.parse(response.entity);
+ var scheduleColl=JSON.parse(entityJson.schedule);
+ if(scheduleColl.length>0){
+ $scope.timeSlots =scheduleColl;
+ hasvaluereturnd = false;
+ $rootScope.showTimeslotSpinner = false;
+ $scope.stopPoll();
+ confirmBoxService.showInformation(entityJson.scheduleId +" Successfully Returned TimeSlots.").then(isConfirmed => {});
+ }else
+ confirmBoxService.showInformation("No time slot available").then(isConfirmed => {
+ $scope.closeModal();
+ });
+ }else{ // do polling
+ if($scope.timeSlots.length==0 && hasthresholdreached==false){
+ var polltime=$scope.schedulerObjConst.getTimeslotRate*1000;
+ pollpromise= poll(polltime, function () {
+ if($scope.timeSlots.length==0){
+ hasvaluereturnd = true;
+ $scope.seviceCallToGetTimeSlots()
+ }else
+ hasvaluereturnd = false;
+ });
+ } else {
+ if($rootScope.showTimeslotSpinner === true){
+ $rootScope.showTimeslotSpinner = false;
+ hasthresholdreached = false;
+ confirmBoxService.showInformation("Failed to get time slot - Timeout error. Please try again later").then(isConfirmed => {
+ $scope.closeModal();
+ });
+ }
+ }
+ }
+ }else{
+ if(response.entity){
+ $rootScope.showTimeslotSpinner = false;
+ if($rootScope.schedulerForm.checkboxSelection=="false")
+ confirmBoxService.showInformation("Schedule ID :" + response.entity.scheduleId +" is ready to schedule.").then(isConfirmed => {});
+ else{
+ var entityObj = JSON.parse(response.entity);
+ confirmBoxService.showInformation("ID :" + entityObj.scheduleId +" is successfully sent for Approval").then(isConfirmed => {
+ $scope.closeModal();
+ });
+ }
+ }
+ }
+ }).catch(err => {
+ $log.error('SchedulerCtrl::seviceCallToGetTimeSlots error: ' + err);
+ $rootScope.showTimeslotSpinner = false;
+ confirmBoxService.showInformation("There was a problem retrieving time slows. Please try again later.").then(isConfirmed => {
+ $scope.closeModal();
+ });
+ })
+ }
+
+
+ $scope.closeModal = function(){
+ setTimeout(function(){ $rootScope.closeModal(); }, 500);
+ }
+
+ /* This function is to get policy list from policy microservice */
+ $scope.getPolicy = function(){
+ schedulerService.getPolicyInfo().then(res =>{
+ if(res==null || res=='' || res.status==null || !(res.status>=200 && res.status<=299)){
+ $log.error('SchedulerWidgetCtrl::getPolicyInfo caught error', res);
+ var errorMsg = $scope.parseErrorMsg(res, 'getPolicy');
+ confirmBoxService.showInformation('There was a problem retrieving ploicy. Please try again later. ' + errorMsg).then(isConfirmed => {
+ $scope.closeModal();
+ });
+ }else
+ $scope.policys = res.entity;
+ });
+ }
+
+ $scope.removeXMLExtension = function(str){
+ return str.replace(".xml","");
+ };
+ /* Find Button */
+ $scope.schedule = function () {
+ if($scope.formValidation())
+ sendSchedulerReq();
+ };
+
+ /*************utility functions**************/
+
+ function convertToSecs(number){
+ var totalSecs;
+ if($scope.selectedTimeUint.text === 'HOURS'){
+ totalSecs=number * 3600;
+ } else if($scope.selectedOption === 'MINUTES') {
+ totalSecs=number * 60;
+ } else {
+ totalSecs=number;
+ }
+ return totalSecs;
+ }
+
+ function poll(interval, callback) {
+ return $interval(function () {
+ if (hasvaluereturnd) //check flag before start new call
+ callback(hasvaluereturnd);
+ thresholdvalue = thresholdvalue - 1; //Decrease threshold value
+ if (thresholdvalue == 0)
+ $scope.stopPoll(); // Stop $interval if it reaches to threshold
+ }, interval)
+ }
+
+ // stop interval.
+ $scope.stopPoll = function () {
+ $interval.cancel(pollpromise);
+ thresholdvalue = 0; //reset all flags.
+ hasvaluereturnd = false;
+ hasthresholdreached=true;
+ $rootScope.showSpinner = false;
+ }
+
+ function getVnfData(arrColl){
+ var vnfcolletion=[];
+ for(var i=0;i<arrColl.length;i++)
+ vnfcolletion.push(arrColl[i].name);
+ return vnfcolletion
+ }
+
+ function extractChangeManagementCallbackDataStr(changeManagement) {
+ var result = {};
+ result.requestType = changeManagement.workflow;
+ result.requestDetails = [];
+ _.forEach(changeManagement.vnfNames, function (vnfName) {
+ if (vnfName && vnfName.version) {
+ if (vnfName.selectedFile) {
+ vnfName.version.requestParameters.userParams = vnfName.selectedFile;
+ }
+ result.requestDetails.push(vnfName.version)
+ }
+ });
+ return JSON.stringify(result);
+ }
+
+
+ $scope.constructScheduleInfo = function(){
+ var callbackData = extractChangeManagementCallbackDataStr($scope.vnfObject);
+ $scope.schedulerObj = {
+ domain: $scope.schedulerObjConst.domain,
+ scheduleId: '',
+ scheduleName: $scope.schedulerObjConst.scheduleName,
+ userId: '',
+ domainData: [{
+ 'WorkflowName': $scope.schedulerObjConst.WorkflowName,
+ 'CallbackUrl': $scope.schedulerObjConst.CallbackUrl,
+ 'CallbackData': callbackData
+ }],
+ schedulingInfo: {
+ normalDurationInSeconds: '',
+ additionalDurationInSeconds: '',
+ concurrencyLimit: '',
+ policyId: '',
+ vnfDetails: [
+ {
+ groupId: "",
+ node: [],
+ changeWindow: [{
+ startTime: '',
+ endTime: ''
+ }]
+ }
+ ]
+ },
+ }
+ }
+
+ $scope.formValidation = function(){
+ $scope.durationEmpty=false;
+ $scope.concurrencyLimitEmpty = false;
+ $scope.fallBackDurationEmpty=false;
+ $scope.fromDateGreater=false;
+ $scope.fromDateEmpty=false;
+ $scope.toDateEmpty=false;
+ if($rootScope.schedulerForm.duration=='')
+ $scope.durationEmpty=true;
+ if($rootScope.schedulerForm.fallbackDuration=='')
+ $scope.fallBackDurationEmpty=true;
+ if($rootScope.schedulerForm.concurrencyLimit=='')
+ $scope.concurrencyLimitEmpty = true;
+ if(!($rootScope.schedulerForm.fromDate instanceof Date))
+ $scope.fromDateEmpty=true;
+ if(!($rootScope.schedulerForm.toDate instanceof Date ))
+ $scope.toDateEmpty=true;
+ var fromDateObj = new Date($rootScope.schedulerForm.fromDate);
+ var toDateObj = new Date($rootScope.schedulerForm.toDate);
+ if(fromDateObj>toDateObj)
+ $scope.fromDateGreater = true;
+ if($scope.durationEmpty||$scope.fallBackDurationEmpty ||$scope.concurrencyLimitEmpty || (($scope.fromDateEmpty || $scope.toDateEmpty) && $rootScope.schedulerForm.checkboxSelection=='false' ) ||$scope.fromDateGreater)
+ return false;
+ if($rootScope.schedulerForm.checkboxSelection == false && (!isDateValid($rootScope.schedulerForm.toDate) || !isDateValid($rootScope.schedulerForm.fromDate)))
+ return false;
+ if($scope.selectedPolicy.policyName=='' || $scope.selectedPolicy.policyName=='Select Policy'){
+ confirmBoxService.showInformation("Policy is required").then(isConfirmed => {});
+ return false;
+ }
+ return true;
+ }
+
+ $scope.getScheduleConstant =function(){
+ schedulerService.getSchedulerConstants().then(res =>{
+ if(res==null || res=='' || res.status==null || res.status!="OK"){
+ $log.error('SchedulerWidgetCtrl::getSchedulerConstants caught error', res);
+ confirmBoxService.showInformation('There is a problem about the Scheduler UI. Please try again later.').then(isConfirmed => {
+ $scope.closeModal();
+ });
+ }else{
+ var response = res.response;
+ $scope.schedulerObjConst= {
+ domain: response.domainName,
+ scheduleName : response.scheduleName,
+ WorkflowName : response.workflowName,
+ CallbackUrl : response.callbackUrl,
+ approvalType : response.approvalType,
+ approvalSubmitStatus : response.approvalSubmitStatus,
+ approvalRejectStatus : response.approvalRejectStatus,
+ getTimeslotRate : response.intervalRate,
+ policyName : response.policyName,
+ groupId : response.groupId
+ }
+ $scope.constructScheduleInfo();
+ $scope.getPolicy() // get policy items for the dropdown in the scheduler UI
+ }
+ });
+ }
+
+ /*This function is to get the current logged in user id*/
+ $scope.getUserId = function(){
+ $rootScope.showSpinner = true;
+ userProfileService.getUserProfile()
+ .then(profile=> {
+ $scope.orgUserId = profile.orgUserId;
+ }).finally(() => {
+ $rootScope.showSpinner = false;
+ });
+ }
+
+ $scope.activateThis = function(ele){
+ $compile(ele.contents())($scope);
+ $scope.$apply();
+ };
+
+ /** listening calls from parents **/
+ $scope.$on("submit", function(events,data){
+ $scope.submit();
+ });
+
+ $scope.$on("reject", function(events,data){
+ $scope.reject();
+ });
+
+ $scope.$on("schedule", function(events,data){
+ $scope.schedule();
+ });
+
+ /** init **/
+
+ var init = function () {
+ $rootScope.showSpinner = false;
+ $scope.selectedTimeUint=$scope.timeUnit[0];
+
+ if($scope.$parent.parentData){
+ $scope.hasParentData = true;
+ $scope.message = $scope.$parent.parentData;
+ $scope.vnfObject = $scope.message.data;
+ $scope.schedulerObj = $scope.message.data;
+ $scope.getUserId();
+ $scope.getScheduleConstant(); //get Scheduler constants from properties file
+ }else{
+ //second approach to get data
+ var isModal = $( "#scheduler-body" ).hasClass( "b2b-modal-body" );
+ if(isModal){
+ $scope.message = schedulerService.getWidgetData();
+ if($scope.message){
+ $scope.hasParentData = true;
+ $scope.vnfObject = $scope.message.data;
+ $scope.schedulerObj = $scope.message.data;
+ $scope.getUserId();
+ $scope.getScheduleConstant(); //get Scheduler constants from properties file
+ }
+ }else{
+ $scope.hasParentData = false;
+ }
+ }
+ };
+
+ init();
+
+
+}
+
diff --git a/ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/markup/markup.html b/ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/markup/markup.html
new file mode 100644
index 00000000..1a941907
--- /dev/null
+++ b/ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/markup/markup.html
@@ -0,0 +1,178 @@
+<div id="widget-scheduler" ng-controller="SchedulerCtrl" class="widget-scheduler-main" >
+ <div id="widget-scheduler" class="widget-scheduler-main">
+ <span class="ecomp-spinner" ng-show="showTimeslotSpinner"></span>
+ <span class="ecomp-spinner" ng-show="showSpinner"></span>
+ <div ng-if="!hasParentData">
+ <div class="activity-error-container" style="background: rgb(255, 255, 255); overflow: hidden !important; width: 100%;">
+ <div class="activity-error-block">
+ <i class="icon-information full-linear-icon-information" style="margin-left: 125px; font-size: 90px"></i> <br>
+ <div class="activity-error-msg1">No prerequisite data available</div>
+ </div>
+ </div>
+ </div>
+ <div ng-if="hasParentData" ng-hide="showSpinner || showTimeslotSpinner">
+ <div class="row-nowrap">
+ <br>
+ <div class="scheduler-radio" role="radio">
+ <label for="nowRadio" class="radio"> <input
+ type="radio" ng-model="schedulerForm.checkboxSelection" id="nowRadio"
+ name="nowRadio" value="true">
+ <i class="skin"></i> <span>Now</span>
+ </label>
+ </div>
+ </div>
+ <div class="scheduler-radio" role="radio">
+ <label for="rangeRadio" class="radio"> <input
+ type="radio" ng-model="schedulerForm.checkboxSelection" id="rangeRadio"
+ name="rangeRadio" value="false">
+ <i class="skin"></i> <span>Range</span>
+ </label>
+ </div>
+
+ <br>
+ <div class="row-nowrap">
+ <div class="span12">
+ <div class="form-row">
+ <label for="textinputID-2a">From Date</label>
+ <div class="datepicker-container">
+ <input id="startDate" min="minDate"
+ ng-disabled="(schedulerForm.checkboxSelection=='true')? true:false"
+ name="startDate" type="text" class="span12"
+ ng-model="schedulerForm.fromDate" b2b-datepicker>
+ <span class="error"
+ ng-show="fromDateEmpty && schedulerForm.fromDate=='' && schedulerForm.checkboxSelection=='false'">A required date is missing</span>
+ <span class="error" ng-show="!isDateValid(schedulerForm.fromDate) && schedulerForm.fromDate!=''">Please enter valid date in MM/DD/YYYY format!</span>
+ <span class="error" ng-show="isDateValid(schedulerForm.fromDate) && !isStartDateValidFromToday(schedulerForm.fromDate) && schedulerForm.fromDate!=''">Input date must be greater than today!</span>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ <br>
+ <div class="row-nowrap">
+ <div class="span12">
+ <div class="form-row">
+ <label for="textinputID-2a">To Date</label>
+ <div class="datepicker-container">
+ <input id="startDate" min="minDate" ng-disabled="(schedulerForm.checkboxSelection=='true')? true:false" name="endDate" type="text" class="span12"
+ ng-model="schedulerForm.toDate" b2b-datepicker>
+ <span class="error" ng-show="(fromDateGreater || (!isToDateGreaterFromDate(schedulerForm.fromDate,schedulerForm.toDate) && schedulerForm.toDate!=''))">To date must be greater than From date.</span>
+ <span class="error" ng-show="toDateEmpty && schedulerForm.toDate=='' && schedulerForm.checkboxSelection=='false'">A required date is missing</span>
+ <span class="error" ng-show="!isDateValid(schedulerForm.toDate) && schedulerForm.toDate!=''">Please enter valid date in MM/DD/YYYY format!</span>
+ <span class="error" ng-show="isDateValid(schedulerForm.toDate) && !isStartDateValidFromToday(schedulerForm.toDate) && schedulerForm.toDate!=''">Input date must be greater than today!</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ <br>
+ <div class="row-nowrap">
+ <div class="span12">
+ <div class="form-row">
+ <label for="dropdown1">Please Select Option For Duration
+ and FallBack</label> <select id="dropdown1" name="dropdown1" b2b-dropdown
+ placeholder-text="" ng-model="selectedTimeUint.text">
+ <option b2b-dropdown-list option-repeat="d in timeUnit"
+ value="{{d.text}}">{{d.text}}</option>
+ </select>
+ </div>
+ </div>
+ </div>
+ <br>
+ <div class="row-nowrap">
+ <div class="span12">
+ <div class="form-row">
+ <label for="textinputID-2a">Duration</label>
+ <div class="field-group">
+ <input id="textinputID-2a" class="span12" type="number"
+ data-ng-model="schedulerForm.duration"> <span
+ class="error"
+ ng-show="durationEmpty && schedulerForm.duration==''">Required!</span>
+ </div>
+ </div>
+ </div>
+ <div class="span12">
+ <div class="form-row">
+ <label for="fallBackDuration">FallBack Duration</label>
+ <div class="field-group">
+ <input id="fallBackDuration" class="span12" type="number"
+ data-ng-model="schedulerForm.fallbackDuration"> <span
+ class="error"
+ ng-show="fallBackDurationEmpty && schedulerForm.fallbackDuration==''">Required!</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ <br>
+ <div class="row-nowrap">
+ <div class="span12">
+ <div class="form-row">
+ <label for="concurrency">Concurrency Limit</label>
+ <div class="field-group">
+ <input id="concurrency" class="span12" type="number"
+ data-ng-model="schedulerForm.concurrencyLimit" min="1" max="30">
+ <span class="error"
+ ng-show="concurrencyLimitEmpty && schedulerForm.concurrencyLimit==''">Required!</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ <br>
+ <div class="row-nowrap">
+ <div class="span12">
+ <div class="form-row">
+ <label for="policy">Policy</label> <select name="policy"
+ b2b-dropdown placeholder-text="Select Policy"
+ ng-model="selectedPolicy.policyName" id="policy">
+ <option b2b-dropdown-list option-repeat="p in policys"
+ value="{{p.policyName}}">{{p.policyName}}</option>
+ </select>
+ </div>
+ </div>
+ </div>
+ <br>
+ <div>
+ <button type="button" id="find" name="Find" ng-show="(schedulerForm.checkboxSelection=='true')? false:true"
+ class="btn btn-alt btn-small" ng-click="schedule()">Find</button>
+ <div b2b-table table-data="timeSlots" ng-hide="timeSlots.length==0" class="b2b-table-div">
+ <table>
+ <thead b2b-table-row type="header">
+ <tr>
+ <th b2b-table-header key="firstName" sortable="true" id="start-time" default-sort="a">Start Time</th>
+ <th b2b-table-header key="lastName" sortable="true" id="end-time">Finish Time</th>
+ </tr>
+ </thead>
+ <tbody b2b-table-row type="body" row-repeat="rowData in timeSlots" class="table-users-div">
+ <tr ng-click="users.openAddNewUserModal(rowData)">
+ <td b2b-table-body id="rowheader_t1_{{$index}}-startTime" headers="start-time" ng-bind="rowData.startTime"></td>
+ <td b2b-table-body id="rowheader_t1_{{$index}}-endTime" headers="end-time" ng-bind="rowData.finishTime"></td>
+
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+
+ <div class="b2b-modal-footer">
+ <div class="cta-button-group in">
+ <div ng-show="(schedulerForm.checkboxSelection=='true')? false:true">
+ <button class="btn btn-alt btn-small" id="div-confirm-ok-button"
+ type="button" ng-click="reject()" ng-disabled="schedulerID=='' || showSpinner || showTimeslotSpinner">Reject</button>
+ <button class="btn btn-alt btn-small" id="div-confirm-ok-button"
+ type="button" name="submit" ng-click="submit()" ng-disabled="schedulerID=='' || showSpinner || showTimeslotSpinner">Schedule</button>
+
+ </div>
+ <div ng-show="(schedulerForm.checkboxSelection=='true')? true:false">
+ <button class="btn btn-alt btn-small" id="div-confirm-ok-button"
+ type="button" name="submit" ng-click="schedule()" ng-disabled="showSpinner || showTimeslotSpinner">Schedule</button>
+ </div>
+ <div>
+ <button class="btn btn-alt btn-small"
+ type="button" ng-click="closeModal()">Cancel</button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+</div>
diff --git a/ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/styles/styles.css b/ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/styles/styles.css
new file mode 100644
index 00000000..67c8ab40
--- /dev/null
+++ b/ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/styles/styles.css
@@ -0,0 +1,47 @@
+
+.portal-widget-panel-container {
+ margin-left:150px;
+ width:1500px;
+}
+
+
+.portal-widget-panel-fixed-panel {
+ min-height: 300px;
+ max-height: 1300px;
+ overflow: auto;
+}
+
+.portal-widget-panel-double-middle {
+ min-height: 660px;
+ max-height: 660px;
+ overflow: auto;
+}
+
+.portal-widget-panel-row {
+ margin-right: 0px;
+ margin-left: 0px;
+ width: 2800px;
+}
+
+/*Increases the width of the card/panel */
+.portal-widget-panel-panel-default {
+ width:450px
+}
+
+/*Controls the spacing between the cards */
+.portal-widget-panel-col-sm-3 {
+ width:20.5%
+}
+
+.portal-widget-panel-top {
+ top: 15px;
+ left: 15px;
+}
+
+#-css-ready {
+color: #bada55 !important;
+}
+
+.scheduler-radio{
+ margin:5px;
+} \ No newline at end of file
diff --git a/ecomp-portal-widget-ms/pom.xml b/ecomp-portal-widget-ms/pom.xml
index a16fc64e..0fa5de70 100644
--- a/ecomp-portal-widget-ms/pom.xml
+++ b/ecomp-portal-widget-ms/pom.xml
@@ -6,30 +6,32 @@
<parent>
<groupId>org.onap.portal</groupId>
<artifactId>onap-portal-parent</artifactId>
- <version>1.3.0</version>
+ <version>2.2</version>
</parent>
<artifactId>widget-ms-parent</artifactId>
<packaging>pom</packaging>
- <modules>
- <module>common-widgets</module>
- <!-- The widget-ms module uses Spring; it cannot name this parent. -->
- <module>widget-ms</module>
- </modules>
+ <modules>
+ <!-- Child modules do NOT name this parent. -->
+ <!-- Defined for build convenience only! -->
+ <!-- This POM names only ONAP projects -->
+ <module>common-widgets</module>
+ <module>widget-ms</module>
+ </modules>
- <build>
- <plugins>
- <!-- No deployment step for this project -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.8</version>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <build>
+ <plugins>
+ <!-- No deployment step for this project -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.8</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/ecomp-portal-widget-ms/widget-ms/pom.xml b/ecomp-portal-widget-ms/widget-ms/pom.xml
index 67350d28..3e806793 100644
--- a/ecomp-portal-widget-ms/widget-ms/pom.xml
+++ b/ecomp-portal-widget-ms/widget-ms/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
<!-- This project must name Spring as parent; cannot name Portal -->
<parent>
@@ -13,7 +13,7 @@
<groupId>org.onap.portal</groupId>
<artifactId>widget-ms</artifactId>
- <version>1.3.0</version>
+ <version>2.2</version>
<packaging>jar</packaging>
<name>widget-microservice</name>
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/MicroserviceApplication.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/MicroserviceApplication.java
new file mode 100644
index 00000000..fbaf2eaf
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/MicroserviceApplication.java
@@ -0,0 +1,19 @@
+ package org.onap.portalapp.widget;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.web.client.RestTemplate;
+
+@SpringBootApplication
+@ComponentScan(basePackages = "org.onap.portalapp.widget")
+public class MicroserviceApplication {
+ @Bean
+ public RestTemplate getRestTemplate(){
+ return new RestTemplate();
+ }
+ public static void main(String[] args) {
+ SpringApplication.run(MicroserviceApplication.class, args);
+ }
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/constant/WidgetConstant.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/constant/WidgetConstant.java
new file mode 100644
index 00000000..e4c519f9
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/constant/WidgetConstant.java
@@ -0,0 +1,11 @@
+package org.onap.portalapp.widget.constant;
+
+public final class WidgetConstant {
+
+ public static final String WIDGET_MARKUP_LOCATION = "markup/markup.html";
+ public static final String WIDGET_CONTROLLER_LOCATION = "js/controller.js";
+ public static final String WIDGET_STYLE_LOCATION = "styles/styles.css";
+ public static final String VALIDATION_MESSAGE_ZIP = "Please upload a zip file";
+ public static final String VALIDATION_MESSAGE_FILES = "Please check your files (should contains js, styles and markup folder)";
+}
+
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/DatabaseFileUploadController.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/DatabaseFileUploadController.java
index 02cc9415..acdde23b 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/DatabaseFileUploadController.java
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/DatabaseFileUploadController.java
@@ -1,48 +1,11 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.controller;
+package org.onap.portalapp.widget.controller;
import java.io.UnsupportedEncodingException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.openecomp.portalapp.widget.service.StorageService;
+import org.onap.portalapp.widget.service.StorageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/HealthController.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/HealthController.java
new file mode 100644
index 00000000..6814f75a
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/HealthController.java
@@ -0,0 +1,35 @@
+package org.onap.portalapp.widget.controller;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+public class HealthController {
+
+ @RequestMapping(value = { "/health" }, method = RequestMethod.GET, produces = "application/json")
+ public HealthStatus getWidgetCatalog(HttpServletRequest request, HttpServletResponse response) {
+ return new HealthStatus("ok");
+ }
+
+ class HealthStatus {
+ private String status;
+
+ public HealthStatus(String status){
+ this.status = status;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+
+ }
+} \ No newline at end of file
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/WidgetsCatalogController.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/WidgetsCatalogController.java
index 60d92772..31f9b95f 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/WidgetsCatalogController.java
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/WidgetsCatalogController.java
@@ -1,41 +1,4 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.controller;
+package org.onap.portalapp.widget.controller;
import java.io.IOException;
import java.util.ArrayList;
@@ -44,11 +7,11 @@ import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.openecomp.portalapp.widget.domain.ValidationRespond;
-import org.openecomp.portalapp.widget.domain.WidgetCatalog;
-import org.openecomp.portalapp.widget.service.StorageService;
-import org.openecomp.portalapp.widget.service.WidgetCatalogService;
-import org.openecomp.portalapp.widget.utils.AuthorizationUtil;
+import org.onap.portalapp.widget.domain.ValidationRespond;
+import org.onap.portalapp.widget.domain.WidgetCatalog;
+import org.onap.portalapp.widget.service.StorageService;
+import org.onap.portalapp.widget.service.WidgetCatalogService;
+import org.onap.portalapp.widget.utils.AuthorizationUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/dao/WidgetDataSource.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/dao/WidgetDataSource.java
new file mode 100644
index 00000000..a60b8988
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/dao/WidgetDataSource.java
@@ -0,0 +1,34 @@
+package org.onap.portalapp.widget.dao;
+
+import javax.sql.DataSource;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+import org.springframework.stereotype.Component;
+
+@Component
+public class WidgetDataSource{
+
+ @Value("${spring.database.driver.classname}")
+ private String dbDriverClassName;
+
+ @Value("${spring.datasource.url}")
+ private String dbUrl;
+
+ @Value("${spring.datasource.username}")
+ private String dbUsername;
+
+ @Value("${spring.datasource.password}")
+ private String dbPassword;
+
+ @Bean
+ public DataSource dataSource() {
+ DriverManagerDataSource dataSource = new DriverManagerDataSource();
+ dataSource.setDriverClassName(dbDriverClassName);
+ dataSource.setUrl(dbUrl);
+ dataSource.setUsername(dbUsername);
+ dataSource.setPassword(dbPassword);
+ return dataSource;
+ }
+} \ No newline at end of file
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/App.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/App.java
new file mode 100644
index 00000000..d950d035
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/App.java
@@ -0,0 +1,47 @@
+package org.onap.portalapp.widget.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Entity
+@Table(name = "FN_APP")
+public class App implements Serializable{
+
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @Column(name = "APP_ID")
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ private Long appId;
+
+ @Column(name = "APP_Name")
+ private String appName;
+
+ public Long getAppId() {
+ return appId;
+ }
+
+ public void setAppId(Long appId) {
+ this.appId = appId;
+ }
+
+ public String getAppName() {
+ return appName;
+ }
+
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+
+ @Override
+ public String toString() {
+ return "App [appId=" + appId + ", appName=" + appName + "]";
+ }
+
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/MicroserviceData.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceData.java
index 02df499c..e0b0f722 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/MicroserviceData.java
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceData.java
@@ -1,41 +1,4 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.domain;
+package org.onap.portalapp.widget.domain;
import javax.persistence.Column;
import javax.persistence.Entity;
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceParameter.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceParameter.java
new file mode 100644
index 00000000..64e22967
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceParameter.java
@@ -0,0 +1,70 @@
+package org.onap.portalapp.widget.domain;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * TODO: moved all microservice-related code (domain, controller, service)
+ * from ecomp portal Backend to widget microservice
+ */
+@Entity
+@Table(name="EP_MICROSERVICE_PARAMETER")
+public class MicroserviceParameter {
+
+ @Id
+ @Column(name = "id")
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ private Long id;
+
+ @Column(name = "service_id")
+ private long serviceId;
+
+ @Column(name = "para_key")
+ private String para_key;
+
+ @Column(name = "para_value")
+ private String para_value;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public long getServiceId() {
+ return serviceId;
+ }
+
+ public void setServiceId(long serviceId) {
+ this.serviceId = serviceId;
+ }
+
+ public String getPara_key() {
+ return para_key;
+ }
+
+ public void setPara_key(String para_key) {
+ this.para_key = para_key;
+ }
+
+ public String getPara_value() {
+ return para_value;
+ }
+
+ public void setPara_value(String para_value) {
+ this.para_value = para_value;
+ }
+
+ @Override
+ public String toString() {
+ return "MicroserviceParameter [serviceId=" + serviceId + ", para_key=" + para_key + ", para_value=" + para_value
+ + "]";
+ }
+
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/RoleApp.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/RoleApp.java
index 8ff7cc31..807067b2 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/RoleApp.java
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/RoleApp.java
@@ -1,41 +1,4 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.domain;
+package org.onap.portalapp.widget.domain;
import java.io.Serializable;
import java.util.Set;
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/ValidationRespond.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/ValidationRespond.java
new file mode 100644
index 00000000..287e8c65
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/ValidationRespond.java
@@ -0,0 +1,34 @@
+package org.onap.portalapp.widget.domain;
+
+public class ValidationRespond {
+ private boolean valid;
+ private String error;
+
+ public ValidationRespond(boolean valid, String error){
+ this.valid = valid;
+ this.error = error;
+ }
+
+ public boolean isValid() {
+ return valid;
+ }
+
+ public void setValid(boolean valid) {
+ this.valid = valid;
+ }
+
+ public String getError() {
+ return error;
+ }
+
+ public void setError(String error) {
+ this.error = error;
+ }
+
+ @Override
+ public String toString() {
+ return "ValidationRespond [valid=" + valid + ", error=" + error + "]";
+ }
+
+
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/WidgetCatalog.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetCatalog.java
index d54748a5..9d153e2a 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/WidgetCatalog.java
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetCatalog.java
@@ -1,41 +1,4 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.domain;
+package org.onap.portalapp.widget.domain;
import java.util.Set;
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetFile.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetFile.java
new file mode 100644
index 00000000..e9c6ffc2
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetFile.java
@@ -0,0 +1,96 @@
+package org.onap.portalapp.widget.domain;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Entity
+@Table(name = "ep_widget_catalog_files")
+public class WidgetFile {
+ @Id
+ @Column (name = "file_id")
+ private int id;
+
+ @Column(name = "widget_name")
+ private String name;
+
+ @Column(name = "widget_id")
+ private long widgetId;
+
+ @Column(name = "markup_html")
+ private byte[] markup;
+
+ @Column(name = "controller_js")
+ private byte[] controller;
+
+ @Column(name = "framework_js")
+ private byte[] framework;
+
+ @Column(name = "widget_css")
+ private byte[] css;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public byte[] getMarkup() {
+ return markup;
+ }
+
+ public void setMarkup(byte[] markup) {
+ this.markup = markup;
+ }
+
+ public byte[] getController() {
+ return controller;
+ }
+
+ public void setController(byte[] controller) {
+ this.controller = controller;
+ }
+
+ public byte[] getFramework() {
+ return framework;
+ }
+
+ public void setFramework(byte[] framework) {
+ this.framework = framework;
+ }
+
+ public byte[] getCss() {
+ return css;
+ }
+
+ public void setCss(byte[] css) {
+ this.css = css;
+ }
+
+ public long getWidgetId() {
+ return widgetId;
+ }
+
+ public void setWidgetId(long widgetId) {
+ this.widgetId = widgetId;
+ }
+
+ @Override
+ public String toString() {
+ return "WidgetFile [name=" + name + ", widgetId=" + widgetId + "]";
+ }
+
+
+
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/excetpion/StorageException.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/excetpion/StorageException.java
new file mode 100644
index 00000000..41dd6b48
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/excetpion/StorageException.java
@@ -0,0 +1,15 @@
+package org.onap.portalapp.widget.excetpion;
+
+public class StorageException extends RuntimeException {
+
+
+ private static final long serialVersionUID = 4142203582273176386L;
+
+ public StorageException(String message) {
+ super(message);
+ }
+
+ public StorageException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/excetpion/StorageFileNotFoundException.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/excetpion/StorageFileNotFoundException.java
new file mode 100644
index 00000000..6ca46fae
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/excetpion/StorageFileNotFoundException.java
@@ -0,0 +1,14 @@
+package org.onap.portalapp.widget.excetpion;
+
+public class StorageFileNotFoundException extends StorageException {
+
+ private static final long serialVersionUID = -930114778119283188L;
+
+ public StorageFileNotFoundException(String message) {
+ super(message);
+ }
+
+ public StorageFileNotFoundException(String message, Throwable cause) {
+ super(message, cause);
+ }
+} \ No newline at end of file
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/filters/CorsConfiguration.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/filters/CorsConfiguration.java
new file mode 100644
index 00000000..5338359f
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/filters/CorsConfiguration.java
@@ -0,0 +1,15 @@
+package org.onap.portalapp.widget.filters;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.HttpMethod;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+
+@Configuration
+public class CorsConfiguration extends WebSecurityConfigurerAdapter {
+ @Override
+ protected void configure(HttpSecurity http) throws Exception {
+ http.authorizeRequests().antMatchers(HttpMethod.OPTIONS, "/microservices/widgetCatalog/").permitAll();
+ http.csrf().disable();
+ }
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/hibernate/HibernateConfiguration.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/hibernate/HibernateConfiguration.java
new file mode 100644
index 00000000..b52631f1
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/hibernate/HibernateConfiguration.java
@@ -0,0 +1,44 @@
+package org.onap.portalapp.widget.hibernate;
+
+import java.util.Properties;
+
+import javax.sql.DataSource;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.orm.hibernate4.LocalSessionFactoryBean;
+import org.springframework.orm.jpa.JpaTransactionManager;
+import org.springframework.transaction.PlatformTransactionManager;
+
+/**
+ * Provides a Hibernate session factory.
+ */
+@org.springframework.context.annotation.Configuration
+public class HibernateConfiguration {
+
+ @Autowired
+ private DataSource dataSource;
+
+ @Bean
+ public LocalSessionFactoryBean sessionFactory() {
+
+ LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
+ sessionFactory.setDataSource(dataSource);
+ sessionFactory.setHibernateProperties(hibernateProperties());
+ sessionFactory.setPackagesToScan(new String[] { "org.onap.portalapp.widget.domain" });
+ return sessionFactory;
+ }
+
+ private Properties hibernateProperties() {
+ Properties properties = new Properties();
+ properties.put("hibernate.dialect", "org.hibernate.dialect.MySQLDialect");
+ properties.put("hibernate.show_sql", "false");
+ return properties;
+ }
+
+ @Bean
+ public PlatformTransactionManager transactionManager() {
+ return new JpaTransactionManager();
+ }
+
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/listener/WidgetEventListener.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/listener/WidgetEventListener.java
new file mode 100644
index 00000000..de29875e
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/listener/WidgetEventListener.java
@@ -0,0 +1,36 @@
+package org.onap.portalapp.widget.listener;
+
+import org.onap.portalapp.widget.service.InitializationService;
+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.context.event.ApplicationReadyEvent;
+import org.springframework.context.ApplicationListener;
+import org.springframework.stereotype.Component;
+
+@Component
+public class WidgetEventListener implements ApplicationListener<ApplicationReadyEvent>{
+
+ private static final Logger logger = LoggerFactory.getLogger(WidgetEventListener.class);
+
+ @Autowired
+ InitializationService initializationService;
+
+ @Value("${initialization.default.widgets}")
+ String init_default_widget;
+
+ @Override
+ public void onApplicationEvent(ApplicationReadyEvent event) {
+
+ logger.debug("Listening event " + event.toString());
+ try {
+ if(Boolean.parseBoolean(init_default_widget))
+ initializationService.initialize();
+ } catch (Exception e) {
+ logger.error("onApplicationEvent: InitializationService#initialize failed", e);
+ }
+
+ }
+
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/InitializationService.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/InitializationService.java
new file mode 100644
index 00000000..54b6d4fd
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/InitializationService.java
@@ -0,0 +1,7 @@
+package org.onap.portalapp.widget.service;
+
+public interface InitializationService {
+
+ void initialize();
+
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/MicroserviceService.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/MicroserviceService.java
new file mode 100644
index 00000000..5cd342f4
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/MicroserviceService.java
@@ -0,0 +1,17 @@
+package org.onap.portalapp.widget.service;
+
+import org.onap.portalapp.widget.domain.MicroserviceData;
+import org.onap.portalapp.widget.domain.MicroserviceParameter;
+
+/**
+ * TODO: moved all microservice-related code (domain, controller, service)
+ * from ecomp portal Backend to widget microservice
+ */
+public interface MicroserviceService {
+
+ Long saveMicroserivce(MicroserviceData newService);
+
+ void saveMicroserviceParameter(MicroserviceParameter newParameter);
+
+ Long getMicroserviceIdByName(String newServiceName);
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/StorageService.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/StorageService.java
new file mode 100644
index 00000000..fbd0f963
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/StorageService.java
@@ -0,0 +1,34 @@
+package org.onap.portalapp.widget.service;
+
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+
+import org.onap.portalapp.widget.domain.ValidationRespond;
+import org.onap.portalapp.widget.domain.WidgetCatalog;
+import org.onap.portalapp.widget.domain.WidgetFile;
+import org.springframework.web.multipart.MultipartFile;
+
+public interface StorageService {
+
+ void deleteWidgetFile(long widgetId);
+
+ WidgetFile getWidgetFile(long widgetId);
+
+ String getWidgetMarkup(long widgetId) throws UnsupportedEncodingException;
+
+ String getWidgetController(long widgetId) throws UnsupportedEncodingException;
+
+ String getWidgetFramework(long widgetId) throws UnsupportedEncodingException;
+
+ String getWidgetCSS(long widgetId) throws UnsupportedEncodingException;
+
+ ValidationRespond checkZipFile(MultipartFile file);
+
+ void save(MultipartFile file, WidgetCatalog newWidget, long widgetId);
+
+ void initSave(File file, WidgetCatalog newWidget, long widgetId);
+
+ void update(MultipartFile file, WidgetCatalog newWidget, long widgetId);
+
+ byte[] getWidgetCatalogContent(long widgetId) throws Exception;
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/WidgetCatalogService.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/WidgetCatalogService.java
new file mode 100644
index 00000000..88857649
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/WidgetCatalogService.java
@@ -0,0 +1,28 @@
+package org.onap.portalapp.widget.service;
+
+import java.util.List;
+
+import org.onap.portalapp.widget.domain.WidgetCatalog;
+
+public interface WidgetCatalogService {
+
+ List<WidgetCatalog> getWidgetCatalog();
+
+ List<WidgetCatalog> getUserWidgetCatalog(String loginName);
+
+ WidgetCatalog getWidgetCatalog(Long widgetCatalogId);
+
+ void deleteWidgetCatalog(long WidgetCatalogId);
+
+ long saveWidgetCatalog(WidgetCatalog newWidgetCatalog);
+
+ void updateWidgetCatalog(Long widgetCatalogId, WidgetCatalog newWidgetCatalog);
+
+ Long getServiceIdByWidget(Long widgetCatalogId);
+
+ boolean getWidgetIdByName(String newWidgetName);
+
+ List<WidgetCatalog> getWidgetsByServiceId(Long serviceId);
+
+
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/InitializationServiceImpl.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/InitializationServiceImpl.java
index 4b0c04f4..cbc0c9d0 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/InitializationServiceImpl.java
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/InitializationServiceImpl.java
@@ -1,41 +1,4 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.service.impl;
+package org.onap.portalapp.widget.service.impl;
import java.io.File;
import java.io.FileOutputStream;
@@ -45,14 +8,14 @@ import java.util.HashSet;
import javax.transaction.Transactional;
-import org.openecomp.portalapp.widget.domain.MicroserviceData;
-import org.openecomp.portalapp.widget.domain.MicroserviceParameter;
-import org.openecomp.portalapp.widget.domain.RoleApp;
-import org.openecomp.portalapp.widget.domain.WidgetCatalog;
-import org.openecomp.portalapp.widget.service.InitializationService;
-import org.openecomp.portalapp.widget.service.MicroserviceService;
-import org.openecomp.portalapp.widget.service.StorageService;
-import org.openecomp.portalapp.widget.service.WidgetCatalogService;
+import org.onap.portalapp.widget.domain.MicroserviceData;
+import org.onap.portalapp.widget.domain.MicroserviceParameter;
+import org.onap.portalapp.widget.domain.RoleApp;
+import org.onap.portalapp.widget.domain.WidgetCatalog;
+import org.onap.portalapp.widget.service.InitializationService;
+import org.onap.portalapp.widget.service.MicroserviceService;
+import org.onap.portalapp.widget.service.StorageService;
+import org.onap.portalapp.widget.service.WidgetCatalogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -96,6 +59,7 @@ public class InitializationServiceImpl implements InitializationService {
initCommonWidget("News");
initCommonWidget("Events");
initCommonWidget("Resources");
+ initCommonWidget("Portal-Common-Scheduler");
}
private void initCommonWidget(String name) {
@@ -121,6 +85,9 @@ public class InitializationServiceImpl implements InitializationService {
parameter.setPara_key(PARAMETER_KEY);
String parameter_value = null;
switch (name.toLowerCase()) {
+ case "Portal-Common-Scheduler":
+ parameter_value = "NEWS";
+ break;
case "news":
parameter_value = "NEWS";
break;
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/MicroserviceServiceImpl.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/MicroserviceServiceImpl.java
index bb1e5f6f..da680b48 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/MicroserviceServiceImpl.java
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/MicroserviceServiceImpl.java
@@ -1,41 +1,4 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.service.impl;
+package org.onap.portalapp.widget.service.impl;
import java.util.List;
@@ -46,9 +9,9 @@ import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.criterion.Restrictions;
-import org.openecomp.portalapp.widget.domain.MicroserviceData;
-import org.openecomp.portalapp.widget.domain.MicroserviceParameter;
-import org.openecomp.portalapp.widget.service.MicroserviceService;
+import org.onap.portalapp.widget.domain.MicroserviceData;
+import org.onap.portalapp.widget.domain.MicroserviceParameter;
+import org.onap.portalapp.widget.service.MicroserviceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/StorageServiceImpl.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/StorageServiceImpl.java
index 2f7206ea..c2633948 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/StorageServiceImpl.java
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/StorageServiceImpl.java
@@ -1,41 +1,4 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.service.impl;
+package org.onap.portalapp.widget.service.impl;
import java.io.File;
import java.io.FileOutputStream;
@@ -57,14 +20,14 @@ import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.criterion.Restrictions;
-import org.openecomp.portalapp.widget.constant.WidgetConstant;
-import org.openecomp.portalapp.widget.domain.ValidationRespond;
-import org.openecomp.portalapp.widget.domain.WidgetCatalog;
-import org.openecomp.portalapp.widget.domain.WidgetFile;
-import org.openecomp.portalapp.widget.excetpion.StorageException;
-import org.openecomp.portalapp.widget.service.StorageService;
-import org.openecomp.portalapp.widget.service.WidgetCatalogService;
-import org.openecomp.portalapp.widget.utils.UnzipUtil;
+import org.onap.portalapp.widget.constant.WidgetConstant;
+import org.onap.portalapp.widget.domain.ValidationRespond;
+import org.onap.portalapp.widget.domain.WidgetCatalog;
+import org.onap.portalapp.widget.domain.WidgetFile;
+import org.onap.portalapp.widget.excetpion.StorageException;
+import org.onap.portalapp.widget.service.StorageService;
+import org.onap.portalapp.widget.service.WidgetCatalogService;
+import org.onap.portalapp.widget.utils.UnzipUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/WidgetCatalogServiceImpl.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/WidgetCatalogServiceImpl.java
index 3becc779..8dd86282 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/WidgetCatalogServiceImpl.java
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/WidgetCatalogServiceImpl.java
@@ -1,41 +1,4 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.service.impl;
+package org.onap.portalapp.widget.service.impl;
import java.util.List;
import java.util.Set;
@@ -48,10 +11,10 @@ import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.criterion.Restrictions;
-import org.openecomp.portalapp.widget.domain.MicroserviceData;
-import org.openecomp.portalapp.widget.domain.RoleApp;
-import org.openecomp.portalapp.widget.domain.WidgetCatalog;
-import org.openecomp.portalapp.widget.service.WidgetCatalogService;
+import org.onap.portalapp.widget.domain.MicroserviceData;
+import org.onap.portalapp.widget.domain.RoleApp;
+import org.onap.portalapp.widget.domain.WidgetCatalog;
+import org.onap.portalapp.widget.service.WidgetCatalogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/utils/AuthorizationUtil.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/utils/AuthorizationUtil.java
new file mode 100644
index 00000000..1c898909
--- /dev/null
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/utils/AuthorizationUtil.java
@@ -0,0 +1,19 @@
+package org.onap.portalapp.widget.utils;
+
+import java.nio.charset.Charset;
+import java.util.Base64;
+
+public class AuthorizationUtil {
+
+ public boolean authorization(String auth, String security_user, String security_pass){
+ if (auth != null && auth.startsWith("Basic")) {
+ String base64Credentials = auth.substring("Basic".length()).trim();
+ String credentials = new String(Base64.getDecoder().decode(base64Credentials),
+ Charset.forName("UTF-8"));
+ final String[] values = credentials.split(":",2);
+ if(security_user.equals(values[0]) && security_pass.equals(values[1]))
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/utils/UnzipUtil.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/utils/UnzipUtil.java
index edf35d53..d699e5da 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/utils/UnzipUtil.java
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/utils/UnzipUtil.java
@@ -1,41 +1,4 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.utils;
+package org.onap.portalapp.widget.utils;
import java.io.BufferedOutputStream;
import java.io.File;
@@ -50,7 +13,7 @@ import java.util.Stack;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
-import org.openecomp.portalapp.widget.constant.WidgetConstant;
+import org.onap.portalapp.widget.constant.WidgetConstant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/MicroserviceApplication.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/MicroserviceApplication.java
deleted file mode 100644
index 446f48f4..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/MicroserviceApplication.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.web.client.RestTemplate;
-
-@SpringBootApplication
-@ComponentScan(basePackages = "org.openecomp.portalapp.widget")
-public class MicroserviceApplication {
- @Bean
- public RestTemplate getRestTemplate() {
- return new RestTemplate();
- }
-
- public static void main(String[] args) {
- SpringApplication.run(MicroserviceApplication.class, args);
- }
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/constant/WidgetConstant.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/constant/WidgetConstant.java
deleted file mode 100644
index c54f100c..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/constant/WidgetConstant.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.constant;
-
-public final class WidgetConstant {
-
- public static final String WIDGET_MARKUP_LOCATION = "markup/markup.html";
- public static final String WIDGET_CONTROLLER_LOCATION = "js/controller.js";
- public static final String WIDGET_STYLE_LOCATION = "styles/styles.css";
- public static final String VALIDATION_MESSAGE_ZIP = "Please upload a zip file";
- public static final String VALIDATION_MESSAGE_FILES = "Please check your files (should contains js, styles and markup folder)";
-}
-
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/HealthController.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/HealthController.java
deleted file mode 100644
index dfe5c2d6..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/HealthController.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.controller;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-public class HealthController {
-
- @RequestMapping(value = { "/health" }, method = RequestMethod.GET, produces = "application/json")
- public HealthStatus getWidgetCatalog(HttpServletRequest request, HttpServletResponse response) {
- return new HealthStatus("ok");
- }
-
- class HealthStatus {
- private String status;
-
- public HealthStatus(String status){
- this.status = status;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
-
- }
-} \ No newline at end of file
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/dao/WidgetDataSource.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/dao/WidgetDataSource.java
deleted file mode 100644
index 8b5692b8..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/dao/WidgetDataSource.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.dao;
-
-import javax.sql.DataSource;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.jdbc.datasource.DriverManagerDataSource;
-import org.springframework.stereotype.Component;
-
-@Component
-public class WidgetDataSource{
-
- @Value("${spring.database.driver.classname}")
- private String dbDriverClassName;
-
- @Value("${spring.datasource.url}")
- private String dbUrl;
-
- @Value("${spring.datasource.username}")
- private String dbUsername;
-
- @Value("${spring.datasource.password}")
- private String dbPassword;
-
- @Bean
- public DataSource dataSource() {
- DriverManagerDataSource dataSource = new DriverManagerDataSource();
- dataSource.setDriverClassName(dbDriverClassName);
- dataSource.setUrl(dbUrl);
- dataSource.setUsername(dbUsername);
- dataSource.setPassword(dbPassword);
- return dataSource;
- }
-} \ No newline at end of file
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/App.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/App.java
deleted file mode 100644
index 40ef2529..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/App.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.domain;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "FN_APP")
-public class App implements Serializable{
-
- private static final long serialVersionUID = 1L;
-
- @Id
- @Column(name = "APP_ID")
- @GeneratedValue(strategy=GenerationType.AUTO)
- private Long appId;
-
- @Column(name = "APP_Name")
- private String appName;
-
- public Long getAppId() {
- return appId;
- }
-
- public void setAppId(Long appId) {
- this.appId = appId;
- }
-
- public String getAppName() {
- return appName;
- }
-
- public void setAppName(String appName) {
- this.appName = appName;
- }
-
- @Override
- public String toString() {
- return "App [appId=" + appId + ", appName=" + appName + "]";
- }
-
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/MicroserviceParameter.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/MicroserviceParameter.java
deleted file mode 100644
index 87cabb76..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/MicroserviceParameter.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- * TODO: moved all microservice-related code (domain, controller, service)
- * from ecomp portal Backend to widget microservice
- */
-@Entity
-@Table(name="EP_MICROSERVICE_PARAMETER")
-public class MicroserviceParameter {
-
- @Id
- @Column(name = "id")
- @GeneratedValue(strategy=GenerationType.AUTO)
- private Long id;
-
- @Column(name = "service_id")
- private long serviceId;
-
- @Column(name = "para_key")
- private String para_key;
-
- @Column(name = "para_value")
- private String para_value;
-
- public Long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public long getServiceId() {
- return serviceId;
- }
-
- public void setServiceId(long serviceId) {
- this.serviceId = serviceId;
- }
-
- public String getPara_key() {
- return para_key;
- }
-
- public void setPara_key(String para_key) {
- this.para_key = para_key;
- }
-
- public String getPara_value() {
- return para_value;
- }
-
- public void setPara_value(String para_value) {
- this.para_value = para_value;
- }
-
- @Override
- public String toString() {
- return "MicroserviceParameter [serviceId=" + serviceId + ", para_key=" + para_key + ", para_value=" + para_value
- + "]";
- }
-
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/ValidationRespond.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/ValidationRespond.java
deleted file mode 100644
index 94196f18..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/ValidationRespond.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.domain;
-
-public class ValidationRespond {
- private boolean valid;
- private String error;
-
- public ValidationRespond(boolean valid, String error){
- this.valid = valid;
- this.error = error;
- }
-
- public boolean isValid() {
- return valid;
- }
-
- public void setValid(boolean valid) {
- this.valid = valid;
- }
-
- public String getError() {
- return error;
- }
-
- public void setError(String error) {
- this.error = error;
- }
-
- @Override
- public String toString() {
- return "ValidationRespond [valid=" + valid + ", error=" + error + "]";
- }
-
-
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/WidgetFile.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/WidgetFile.java
deleted file mode 100644
index b405c82f..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/WidgetFile.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "ep_widget_catalog_files")
-public class WidgetFile {
- @Id
- @Column (name = "file_id")
- private int id;
-
- @Column(name = "widget_name")
- private String name;
-
- @Column(name = "widget_id")
- private long widgetId;
-
- @Column(name = "markup_html")
- private byte[] markup;
-
- @Column(name = "controller_js")
- private byte[] controller;
-
- @Column(name = "framework_js")
- private byte[] framework;
-
- @Column(name = "widget_css")
- private byte[] css;
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public byte[] getMarkup() {
- return markup;
- }
-
- public void setMarkup(byte[] markup) {
- this.markup = markup;
- }
-
- public byte[] getController() {
- return controller;
- }
-
- public void setController(byte[] controller) {
- this.controller = controller;
- }
-
- public byte[] getFramework() {
- return framework;
- }
-
- public void setFramework(byte[] framework) {
- this.framework = framework;
- }
-
- public byte[] getCss() {
- return css;
- }
-
- public void setCss(byte[] css) {
- this.css = css;
- }
-
- public long getWidgetId() {
- return widgetId;
- }
-
- public void setWidgetId(long widgetId) {
- this.widgetId = widgetId;
- }
-
- @Override
- public String toString() {
- return "WidgetFile [name=" + name + ", widgetId=" + widgetId + "]";
- }
-
-
-
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/excetpion/StorageException.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/excetpion/StorageException.java
deleted file mode 100644
index 80a4f21f..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/excetpion/StorageException.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.excetpion;
-
-public class StorageException extends RuntimeException {
-
-
- private static final long serialVersionUID = 4142203582273176386L;
-
- public StorageException(String message) {
- super(message);
- }
-
- public StorageException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/excetpion/StorageFileNotFoundException.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/excetpion/StorageFileNotFoundException.java
deleted file mode 100644
index fc3afe4a..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/excetpion/StorageFileNotFoundException.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.excetpion;
-
-public class StorageFileNotFoundException extends StorageException {
-
- private static final long serialVersionUID = -930114778119283188L;
-
- public StorageFileNotFoundException(String message) {
- super(message);
- }
-
- public StorageFileNotFoundException(String message, Throwable cause) {
- super(message, cause);
- }
-} \ No newline at end of file
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/filters/CorsConfiguration.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/filters/CorsConfiguration.java
deleted file mode 100644
index 9d1dd8f5..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/filters/CorsConfiguration.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.filters;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.http.HttpMethod;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
-
-@Configuration
-public class CorsConfiguration extends WebSecurityConfigurerAdapter {
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.authorizeRequests().antMatchers(HttpMethod.OPTIONS, "/microservices/widgetCatalog/").permitAll();
- http.csrf().disable();
- }
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/hibernate/HibernateConfiguration.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/hibernate/HibernateConfiguration.java
deleted file mode 100644
index c132a85b..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/hibernate/HibernateConfiguration.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.hibernate;
-
-import java.util.Properties;
-
-import javax.sql.DataSource;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.orm.hibernate4.LocalSessionFactoryBean;
-import org.springframework.orm.jpa.JpaTransactionManager;
-import org.springframework.transaction.PlatformTransactionManager;
-
-/**
- * Provides a Hibernate session factory.
- */
-@org.springframework.context.annotation.Configuration
-public class HibernateConfiguration {
-
- @Autowired
- private DataSource dataSource;
-
- @Bean
- public LocalSessionFactoryBean sessionFactory() {
-
- LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
- sessionFactory.setDataSource(dataSource);
- sessionFactory.setHibernateProperties(hibernateProperties());
- sessionFactory.setPackagesToScan(new String[] { "org.openecomp.portalapp.widget.domain" });
- return sessionFactory;
- }
-
- private Properties hibernateProperties() {
- Properties properties = new Properties();
- properties.put("hibernate.dialect", "org.hibernate.dialect.MySQLDialect");
- properties.put("hibernate.show_sql", "false");
- return properties;
- }
-
- @Bean
- public PlatformTransactionManager transactionManager() {
- return new JpaTransactionManager();
- }
-
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/listener/WidgetEventListener.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/listener/WidgetEventListener.java
deleted file mode 100644
index 04b1dbcf..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/listener/WidgetEventListener.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.listener;
-
-import org.openecomp.portalapp.widget.service.InitializationService;
-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.context.event.ApplicationReadyEvent;
-import org.springframework.context.ApplicationListener;
-import org.springframework.stereotype.Component;
-
-@Component
-public class WidgetEventListener implements ApplicationListener<ApplicationReadyEvent>{
-
- private static final Logger logger = LoggerFactory.getLogger(WidgetEventListener.class);
-
- @Autowired
- InitializationService initializationService;
-
- @Value("${initialization.default.widgets}")
- String init_default_widget;
-
- @Override
- public void onApplicationEvent(ApplicationReadyEvent event) {
-
- logger.debug("Listening event " + event.toString());
- try {
- if(Boolean.parseBoolean(init_default_widget))
- initializationService.initialize();
- } catch (Exception e) {
- logger.error("onApplicationEvent: InitializationService#initialize failed", e);
- }
-
- }
-
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/InitializationService.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/InitializationService.java
deleted file mode 100644
index a6e9fcbf..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/InitializationService.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.service;
-
-public interface InitializationService {
-
- void initialize();
-
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/MicroserviceService.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/MicroserviceService.java
deleted file mode 100644
index 377ed53c..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/MicroserviceService.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.service;
-
-import org.openecomp.portalapp.widget.domain.MicroserviceData;
-import org.openecomp.portalapp.widget.domain.MicroserviceParameter;
-
-/**
- * TODO: moved all microservice-related code (domain, controller, service)
- * from ecomp portal Backend to widget microservice
- */
-public interface MicroserviceService {
-
- Long saveMicroserivce(MicroserviceData newService);
-
- void saveMicroserviceParameter(MicroserviceParameter newParameter);
-
- Long getMicroserviceIdByName(String newServiceName);
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/StorageService.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/StorageService.java
deleted file mode 100644
index 7d1fab9b..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/StorageService.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.service;
-
-import java.io.File;
-import java.io.UnsupportedEncodingException;
-
-import org.openecomp.portalapp.widget.domain.ValidationRespond;
-import org.openecomp.portalapp.widget.domain.WidgetCatalog;
-import org.openecomp.portalapp.widget.domain.WidgetFile;
-import org.springframework.web.multipart.MultipartFile;
-
-public interface StorageService {
-
- void deleteWidgetFile(long widgetId);
-
- WidgetFile getWidgetFile(long widgetId);
-
- String getWidgetMarkup(long widgetId) throws UnsupportedEncodingException;
-
- String getWidgetController(long widgetId) throws UnsupportedEncodingException;
-
- String getWidgetFramework(long widgetId) throws UnsupportedEncodingException;
-
- String getWidgetCSS(long widgetId) throws UnsupportedEncodingException;
-
- ValidationRespond checkZipFile(MultipartFile file);
-
- void save(MultipartFile file, WidgetCatalog newWidget, long widgetId);
-
- void initSave(File file, WidgetCatalog newWidget, long widgetId);
-
- void update(MultipartFile file, WidgetCatalog newWidget, long widgetId);
-
- byte[] getWidgetCatalogContent(long widgetId) throws Exception;
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/WidgetCatalogService.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/WidgetCatalogService.java
deleted file mode 100644
index c8670baf..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/WidgetCatalogService.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.widget.domain.WidgetCatalog;
-
-public interface WidgetCatalogService {
-
- List<WidgetCatalog> getWidgetCatalog();
-
- List<WidgetCatalog> getUserWidgetCatalog(String loginName);
-
- WidgetCatalog getWidgetCatalog(Long widgetCatalogId);
-
- void deleteWidgetCatalog(long WidgetCatalogId);
-
- long saveWidgetCatalog(WidgetCatalog newWidgetCatalog);
-
- void updateWidgetCatalog(Long widgetCatalogId, WidgetCatalog newWidgetCatalog);
-
- Long getServiceIdByWidget(Long widgetCatalogId);
-
- boolean getWidgetIdByName(String newWidgetName);
-
- List<WidgetCatalog> getWidgetsByServiceId(Long serviceId);
-
-
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/utils/AuthorizationUtil.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/utils/AuthorizationUtil.java
deleted file mode 100644
index 2711c3da..00000000
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/utils/AuthorizationUtil.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.utils;
-
-import java.nio.charset.Charset;
-import java.util.Base64;
-
-public class AuthorizationUtil {
-
- public boolean authorization(String auth, String security_user, String security_pass){
- if (auth != null && auth.startsWith("Basic")) {
- String base64Credentials = auth.substring("Basic".length()).trim();
- String credentials = new String(Base64.getDecoder().decode(base64Credentials),
- Charset.forName("UTF-8"));
- final String[] values = credentials.split(":",2);
- if(security_user.equals(values[0]) && security_pass.equals(values[1]))
- return true;
- }
- return false;
- }
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/resources/logback.xml b/ecomp-portal-widget-ms/widget-ms/src/main/resources/logback.xml
index 204a6598..e19367fd 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/main/resources/logback.xml
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/resources/logback.xml
@@ -122,7 +122,7 @@
</rollingPolicy>
</appender>
- <logger name="org.openecomp.portalapp.widget" level="debug" additivity="false">
+ <logger name="org.onap.portalapp.widget" level="debug" additivity="false">
<appender-ref ref="ERROR" />
<appender-ref ref="DEBUG" />
<appender-ref ref="APPLICATION" />
diff --git a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/controller/WidgetFileControllerTest.java b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetFileControllerTest.java
index 0ff2c573..db6ddc36 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/controller/WidgetFileControllerTest.java
+++ b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetFileControllerTest.java
@@ -1,41 +1,4 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.test.controller;
+package org.onap.portalapp.widget.test.controller;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.times;
@@ -49,8 +12,8 @@ import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.runners.MockitoJUnitRunner;
-import org.openecomp.portalapp.widget.controller.DatabaseFileUploadController;
-import org.openecomp.portalapp.widget.service.impl.StorageServiceImpl;
+import org.onap.portalapp.widget.controller.DatabaseFileUploadController;
+import org.onap.portalapp.widget.service.impl.StorageServiceImpl;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
diff --git a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java
index 3d728c95..cf3d6ce5 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java
+++ b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java
@@ -1,41 +1,4 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.test.controller;
+package org.onap.portalapp.widget.test.controller;
import static org.hamcrest.CoreMatchers.is;
@@ -60,11 +23,11 @@ import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.runners.MockitoJUnitRunner;
-import org.openecomp.portalapp.widget.controller.WidgetsCatalogController;
-import org.openecomp.portalapp.widget.domain.ValidationRespond;
-import org.openecomp.portalapp.widget.domain.WidgetCatalog;
-import org.openecomp.portalapp.widget.service.StorageService;
-import org.openecomp.portalapp.widget.service.WidgetCatalogService;
+import org.onap.portalapp.widget.controller.WidgetsCatalogController;
+import org.onap.portalapp.widget.domain.ValidationRespond;
+import org.onap.portalapp.widget.domain.WidgetCatalog;
+import org.onap.portalapp.widget.service.StorageService;
+import org.onap.portalapp.widget.service.WidgetCatalogService;
import org.springframework.http.MediaType;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.test.web.servlet.MockMvc;
diff --git a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/service/WidgetCatalogServiceTest.java b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/service/WidgetCatalogServiceTest.java
index 92bcf805..9076884b 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/service/WidgetCatalogServiceTest.java
+++ b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/service/WidgetCatalogServiceTest.java
@@ -1,41 +1,4 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
- *
- * Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
- * you may not use this software except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * ============LICENSE_END============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.test.service;
+package org.onap.portalapp.widget.test.service;
import static org.junit.Assert.assertEquals;
@@ -61,9 +24,9 @@ import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.runners.MockitoJUnitRunner;
-import org.openecomp.portalapp.widget.domain.RoleApp;
-import org.openecomp.portalapp.widget.domain.WidgetCatalog;
-import org.openecomp.portalapp.widget.service.impl.WidgetCatalogServiceImpl;
+import org.onap.portalapp.widget.domain.RoleApp;
+import org.onap.portalapp.widget.domain.WidgetCatalog;
+import org.onap.portalapp.widget.service.impl.WidgetCatalogServiceImpl;
@RunWith(MockitoJUnitRunner.class)