You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2011/12/23 16:29:45 UTC

svn commit: r1222704 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp: index.html js/redback/roles.js

Author: olamy
Date: Fri Dec 23 15:29:45 2011
New Revision: 1222704

URL: http://svn.apache.org/viewvc?rev=1222704&view=rev
Log:
start work on role management in webapp-js

Added:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js   (with props)
Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html?rev=1222704&r1=1222703&r2=1222704&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html Fri Dec 23 15:29:45 2011
@@ -63,6 +63,7 @@
        .script("redback/users.js").wait()
        .script("redback/redback.js").wait()
        .script("redback/register.js").wait()
+       .script("redback/roles.js").wait()
        .script("archiva/main.js");
 
 </script>

Added: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js?rev=1222704&view=auto
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js (added)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js Fri Dec 23 15:29:45 2011
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+$(function() {
+
+  role = function(name,description){
+    this.name = name;
+    this.description = description;
+  }
+
+  displayRolesGrid = function(){
+    $.ajax("restServices/redbackServices/roleManagementService/allRoles",
+      {
+       type: "GET",
+       async: false,
+       dataType: 'json',
+       success: function(data) {
+         var roles = $.map(data.role, function(item) {
+             return mapRole(item);
+         });
+       }
+      }
+    );
+  }
+
+  /**
+   * @param data Role response from redback rest api
+   */
+  mapRole=function(data) {
+    return new role(data.name, data.description);
+  }
+
+});
\ No newline at end of file

Propchange: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision