Commit 280de168 authored by fabio martelli's avatar fabio martelli
Browse files

upgrade to 2.0.1 enduser sources

parent 3d74e261
......@@ -16,6 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.client.enduser;
import java.io.File;
......
......@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.client.enduser;
import java.io.File;
......@@ -32,8 +33,9 @@ import org.apache.syncope.client.enduser.resources.SchemaResource;
import org.apache.syncope.client.enduser.resources.SecurityQuestionResource;
import org.apache.syncope.client.enduser.resources.AnyTypeClassResource;
import org.apache.syncope.client.enduser.resources.AnyTypeResource;
import org.apache.syncope.client.enduser.resources.SyncopeGroupResource;
import org.apache.syncope.client.enduser.resources.GroupResource;
import org.apache.syncope.client.enduser.resources.ExternalResourceResource;
import org.apache.syncope.client.enduser.resources.RealmResource;
import org.apache.syncope.client.enduser.resources.UserSelfChangePassword;
import org.apache.syncope.client.enduser.resources.UserSelfConfirmPasswordReset;
import org.apache.syncope.client.enduser.resources.UserSelfCreateResource;
......@@ -292,13 +294,23 @@ public class SyncopeEnduserApplication extends WebApplication implements Seriali
}
});
mountResource("/api/realms", new ResourceReference("realms") {
private static final long serialVersionUID = -128426276529456602L;
@Override
public IResource getResource() {
return new RealmResource();
}
});
mountResource("/api/groups", new ResourceReference("groups") {
private static final long serialVersionUID = -128426276529456602L;
@Override
public IResource getResource() {
return new SyncopeGroupResource();
return new GroupResource();
}
});
......
......@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.client.enduser.adapters;
import org.apache.syncope.client.enduser.SyncopeEnduserApplication;
......
......@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.client.enduser.model;
import java.io.Serializable;
......
......@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.client.enduser.resources;
import java.io.IOException;
......@@ -34,13 +35,13 @@ import org.apache.syncope.common.rest.api.beans.AnyQuery;
import org.apache.syncope.common.rest.api.service.GroupService;
import org.apache.wicket.request.resource.AbstractResource;
public class SyncopeGroupResource extends AbstractBaseResource {
public class GroupResource extends AbstractBaseResource {
private static final long serialVersionUID = 7475706378304995200L;
private final GroupService groupService;
public SyncopeGroupResource() {
public GroupResource() {
groupService = SyncopeEnduserSession.get().getService(GroupService.class);
}
......
#
# Copyright 2015 The CHOReVOLUTION project
# Copyright 2016 The CHOReVOLUTION project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -19,6 +19,8 @@ version=${syncope.version}
site=${project.parent.url}
license=${licenseUrl}
domain=Master
anonymousUser=${anonymousUser}
anonymousKey=${anonymousKey}
adminUser=${adminUser}
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015 The CHOReVOLUTION project
Copyright 2016 The CHOReVOLUTION project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015 The CHOReVOLUTION project
Copyright 2016 The CHOReVOLUTION project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015 The CHOReVOLUTION project
Copyright 2016 The CHOReVOLUTION project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015 The CHOReVOLUTION project
Copyright 2016 The CHOReVOLUTION project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file 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.
*/
* Copyright 2016 The CHOReVOLUTION project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file 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.
*/
/* app general css stylesheet */
.growl-container > .growl-item.ng-enter,
.growl-container > .growl-item.ng-leave {
-webkit-transition:1s linear all;
......
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file 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.
*/
* Copyright 2016 The CHOReVOLUTION project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file 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.
*/
#form-container {
position: relative;
width: 100%;
......
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* Copyright 2016 The CHOReVOLUTION project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file 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 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.
*/
body, html {
/*margin: 45px 0;*/
/*height: 100%;*/
......
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Copyright 2016 The CHOReVOLUTION project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file 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 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.
-->
<!--[if lt IE 7]> <html lang="en" ng-app="myApp" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html lang="en" ng-app="myApp" class="no-js lt-ie9 lt-ie8"> <![endif]-->
......@@ -80,6 +77,8 @@ under the License.
<script src="../webjars/angular-translate/${angular-translate.version}/angular-translate.js"></script>
<script src="../webjars/angular-translate-loader-partial/${angular-translate.version}/angular-translate-loader-partial.js"></script>
<script src="../webjars/angular-translate-storage-cookie/${angular-translate.version}/angular-translate-storage-cookie.js"></script>
<script src="../webjars/bootstrap-fileinput/${bootstrap-fileinput.version}/js/fileinput.js"></script>
<!--main angular application-->
<script src="js/app.js"></script>
<!--services-->
......@@ -91,13 +90,12 @@ under the License.
<script src="js/services/infoService.js"></script>
<script src="js/services/resourceService.js"></script>
<script src="js/services/groupService.js"></script>
<script src="js/services/choreographyService.js"></script>
<script src="js/services/anyService.js"></script>
<!--controllers-->
<script src="js/controllers/HomeController.js"></script>
<script src="js/controllers/LoginController.js"></script>
<script src="js/controllers/LanguageController.js"></script>
<script src="js/controllers/UserController.js"></script>
<script src="js/controllers/TailController.js"></script>
<!--directives-->
<script src="js/directives/dynamicPlainAttribute.js"></script>
<script src="js/directives/dynamicDerivedAttribute.js"></script>
......@@ -115,6 +113,7 @@ under the License.
<script src="js/directives/auxClasses.js"></script>
<script src="js/directives/validate.js"></script>
<script src="js/directives/validationMessage.js"></script>
<script src="js/directives/fileInput.js"></script>
<!--validator-->
<script src="js/validator/validationRules.js"></script>
<script src="js/validator/validationExecutor.js"></script>
......
/* global $templateCache */
/**
Copyright 2015 The CHOReVOLUTION project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file 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.
**/
/*
* Copyright 2016 The CHOReVOLUTION project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file 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.
*/
'use strict';
angular.module('home', []);
angular.module('login', []);
angular.module('language', []);
......@@ -248,7 +248,7 @@ app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', '$translate
templateUrl: 'views/mustchangepassword.html'
});
// catch all other routes
// send users to the home page
// send users to the home page
$urlRouterProvider.otherwise('/');
// HTTP service configuration
$httpProvider.defaults.withCredentials = true;
......@@ -297,6 +297,8 @@ app.run(['$rootScope', '$location', '$state', 'AuthService',
// main program
// keep user logged in after page refresh
//If the route change failed due to authentication error, redirect them out
$rootScope.endReached = false;
$rootScope.$on('$routeChangeError', function (event, current, previous, rejection) {
if (rejection === 'Not Authenticated') {
$location.path('/self');
......@@ -319,6 +321,7 @@ app.run(['$rootScope', '$location', '$state', 'AuthService',
$state.go('self');
}
);
} else if (toState.name === 'home' || toState.name === 'self') {
AuthService.islogged().then(function (response) {
if (response === "true") {
......@@ -331,6 +334,9 @@ app.run(['$rootScope', '$location', '$state', 'AuthService',
$state.go('self');
}
);
//enable "finish" button on every page in create mode
} else if (toState.name === 'create.finish') {
$rootScope.endReached = true;
} else {
$state.go(toState);
}
......
/**
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file 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.
**/
/*
* Copyright 2016 The CHOReVOLUTION project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file 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.
*/
'use strict';
angular.module("home").controller("HomeController", ['$scope', '$http', '$location', function ($scope, $http, $location) {
......
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file 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.
*/
'use strict';
angular.module('language')
.controller('LanguageController', function ($scope) {
$scope.init = function () {
// MainService.settings().then(function (response) {
// $scope.mainSettings = response;
// });
console.debug("Init language controller");
};
$scope.changeLanguage = function (language) {
console.info("Language changed to: ", language);
$scope.languages.selectedLanguage = language;
// $translate.use(langKey);
// LanguageService.switchLocale.query({language: langKey}, {}, function (response) {
// $scope.selectedLanguage.locale = langKey;
// });
};
this.retrieveLanguages = function () {
// LanguageService.language.query({}, function (response) {
// $scope.languages = response;
// });
console.debug("Retrieving available languages");
};
this.retrieveLanguages();
});
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
/*
* Copyright 2016 The CHOReVOLUTION project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file 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 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.
*/
'use strict';
angular.module("login").controller("LoginController", ['$scope', '$http', '$location',
'AuthService', '$translate', '$translatePartialLoader', function ($scope, $http,
......@@ -38,11 +34,13 @@ angular.module("login").controller("LoginController", ['$scope', '$http', '$loca
$scope.login = function (credentials) {
AuthService.login($scope.credentials).then(function (user) {
console.info("Login success for: ", user);
// reset error message
$scope.credentials.errorMessage = '';
// got to update page
$location.path("/self/update");
}, function (response) {
console.info("Login failed for: ", response);
var errorMessage;
// parse error response
if (response !== undefined) {
......@@ -57,7 +55,7 @@ angular.module("login").controller("LoginController", ['$scope', '$http', '$loca
AuthService.logout().then(function (response) {
console.info("Logout successfully");
}, function (response) {
console.info("Logout failed");
console.info("Logout failed: ", response);
});
};
$scope.islogged = function () {
......@@ -90,7 +88,6 @@ angular.module("login").controller("LoginController", ['$scope', '$http', '$loca
});
};
$scope.switchLanguage = function () {
console.log('$scope.languages.selectedLanguage', $scope.languages.selectedLanguage.code);
$translate.use($scope.languages.selectedLanguage.code);
};
}]);
/*
* Copyright 2016 The CHOReVOLUTION project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file 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.
*/
'use strict';
angular.module("self")
.controller("TailController", ['$scope', '$rootScope', '$location',
function ($scope, $rootScope, $location) {
$scope.redirect = function () {
$location.path('/self');
$rootScope.endReached = false;
};
}]);
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
/*
* Copyright 2016 The CHOReVOLUTION project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0