acdcserver 2.3.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- WMCore/ACDC/Collection.py +57 -0
- WMCore/ACDC/CollectionTypes.py +12 -0
- WMCore/ACDC/CouchCollection.py +67 -0
- WMCore/ACDC/CouchFileset.py +238 -0
- WMCore/ACDC/CouchService.py +73 -0
- WMCore/ACDC/DataCollectionService.py +485 -0
- WMCore/ACDC/Fileset.py +94 -0
- WMCore/ACDC/__init__.py +11 -0
- WMCore/Algorithms/ParseXMLFile.py +115 -0
- WMCore/Algorithms/Permissions.py +27 -0
- WMCore/Algorithms/__init__.py +7 -0
- WMCore/Configuration.py +651 -0
- WMCore/DataStructs/File.py +177 -0
- WMCore/DataStructs/Fileset.py +140 -0
- WMCore/DataStructs/Job.py +182 -0
- WMCore/DataStructs/JobGroup.py +142 -0
- WMCore/DataStructs/JobPackage.py +49 -0
- WMCore/DataStructs/LumiList.py +734 -0
- WMCore/DataStructs/Mask.py +219 -0
- WMCore/DataStructs/Pickleable.py +24 -0
- WMCore/DataStructs/Run.py +256 -0
- WMCore/DataStructs/Subscription.py +175 -0
- WMCore/DataStructs/WMObject.py +47 -0
- WMCore/DataStructs/WorkUnit.py +112 -0
- WMCore/DataStructs/Workflow.py +60 -0
- WMCore/DataStructs/__init__.py +8 -0
- WMCore/Database/CMSCouch.py +1349 -0
- WMCore/Database/ConfigDBMap.py +29 -0
- WMCore/Database/CouchUtils.py +118 -0
- WMCore/Database/DBCore.py +198 -0
- WMCore/Database/DBCreator.py +113 -0
- WMCore/Database/DBExceptionHandler.py +57 -0
- WMCore/Database/DBFactory.py +110 -0
- WMCore/Database/DBFormatter.py +177 -0
- WMCore/Database/Dialects.py +13 -0
- WMCore/Database/ExecuteDAO.py +327 -0
- WMCore/Database/MongoDB.py +241 -0
- WMCore/Database/MySQLCore.py +132 -0
- WMCore/Database/ResultSet.py +44 -0
- WMCore/Database/Transaction.py +91 -0
- WMCore/Database/__init__.py +9 -0
- WMCore/Database/ipy_profile_couch.py +438 -0
- WMCore/GroupUser/CouchObject.py +127 -0
- WMCore/GroupUser/Decorators.py +51 -0
- WMCore/GroupUser/Group.py +33 -0
- WMCore/GroupUser/Interface.py +73 -0
- WMCore/GroupUser/User.py +96 -0
- WMCore/GroupUser/__init__.py +11 -0
- WMCore/Lexicon.py +836 -0
- WMCore/Services/Requests.py +624 -0
- WMCore/Services/__init__.py +8 -0
- WMCore/Services/pycurl_manager.py +574 -0
- WMCore/WMException.py +183 -0
- WMCore/Wrappers/JsonWrapper/JSONThunker.py +342 -0
- WMCore/Wrappers/JsonWrapper/__init__.py +7 -0
- WMCore/Wrappers/__init__.py +6 -0
- WMCore/__init__.py +10 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/_attachments/CouchDBLogo.png +0 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/_attachments/DMWMLogo.png +0 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/_attachments/collections.html +60 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/_attachments/displaycollection.html +61 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/_attachments/index.html +36 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/_attachments/style/main.css +1 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/_id +1 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/couchapp.json +4 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/filters/filterDeletedDocs.js +3 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/rewrites.json +81 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/validate_doc_update.js +9 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/vendor/acdc/_attachments/acdc.js +302 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/views/byCollectionName/map.js +9 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/views/byCollectionName/reduce.js +3 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/views/byTimestamp/map.js +10 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/views/coll_fileset_count/map.js +9 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/views/coll_fileset_count/reduce.js +1 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/views/coll_fileset_docs/map.js +3 -0
- acdcserver-2.3.10.data/data/data/couchapps/ACDC/views/coll_fileset_docs/reduce.js +3 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/.couchappignore +1 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/.couchapprc +1 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/_attachments/index.html +85 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/_attachments/style/main.css +1 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/_id +1 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/couchapp.json +4 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/updates/newgroup.js +18 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/updates/newuser.js +15 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/updates/ownthis.js +8 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/vendor/couchapp/README.md +3 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/vendor/couchapp/_attachments/jquery.couchapp.js +200 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/vendor/couchapp/couchapp.js +1 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/vendor/couchapp/date.js +23 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/vendor/couchapp/metadata.json +4 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/vendor/couchapp/path.js +77 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/vendor/couchapp/template.js +33 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/vendor/groupuser/_attachments/groupuser.js +234 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/views/group_members/map.js +5 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/views/groups/map.js +5 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/views/name_map/map.js +5 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/views/owner_group_user/map.js +5 -0
- acdcserver-2.3.10.data/data/data/couchapps/GroupUser/views/users/map.js +5 -0
- acdcserver-2.3.10.dist-info/LICENSE +202 -0
- acdcserver-2.3.10.dist-info/METADATA +17 -0
- acdcserver-2.3.10.dist-info/NOTICE +16 -0
- acdcserver-2.3.10.dist-info/RECORD +104 -0
- acdcserver-2.3.10.dist-info/WHEEL +5 -0
- acdcserver-2.3.10.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>ACDC Couch Service</title>
|
|
5
|
+
<link rel="stylesheet" href="style/main.css" type="text/css">
|
|
6
|
+
<script src="/_utils/script/json2.js"></script>
|
|
7
|
+
<script src="/_utils/script/jquery.js?1.3.1"></script>
|
|
8
|
+
<script src="/_utils/script/jquery.couch.js?0.9.0"></script>
|
|
9
|
+
<script src="vendor/acdc/acdc.js"></script>
|
|
10
|
+
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
|
|
14
|
+
<table>
|
|
15
|
+
<tr>
|
|
16
|
+
<td>
|
|
17
|
+
<img height="100px" width="100px" src="DMWMLogo.png">
|
|
18
|
+
</td>
|
|
19
|
+
<td>
|
|
20
|
+
<h4>ACDC Service CouchDB </h4>
|
|
21
|
+
</td>
|
|
22
|
+
<td>
|
|
23
|
+
<img height="100px" width="100px" src="CouchDBLogo.png">
|
|
24
|
+
</td>
|
|
25
|
+
</tr>
|
|
26
|
+
</table>
|
|
27
|
+
<ul>
|
|
28
|
+
<li><a href="collections.html">Browse Collections</a></li>
|
|
29
|
+
<li><a href="filesets.html">Browse Filesets</a></li>
|
|
30
|
+
</ul>
|
|
31
|
+
</body>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* add styles here */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
_design/ACDC
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"from": "_design/:dname/*",
|
|
4
|
+
"to": "*"
|
|
5
|
+
},
|
|
6
|
+
|
|
7
|
+
{
|
|
8
|
+
"from": "_all_docs",
|
|
9
|
+
"to": "../../_all_docs"
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
{
|
|
13
|
+
"from": "vendor/*",
|
|
14
|
+
"to": "vendor/*"
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
{
|
|
18
|
+
"from": "index.html",
|
|
19
|
+
"to": "index.html"
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
{
|
|
23
|
+
"from": "",
|
|
24
|
+
"to": "_show/redirect"
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
{
|
|
28
|
+
"from": "css/*",
|
|
29
|
+
"to": "css/*"
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
{
|
|
33
|
+
"from": "style/*",
|
|
34
|
+
"to": "style/*"
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
{
|
|
38
|
+
"from": "images/*",
|
|
39
|
+
"to": "images/*"
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
{
|
|
43
|
+
"from": "img/*",
|
|
44
|
+
"to": "img/*"
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
{
|
|
48
|
+
"from": "js/*",
|
|
49
|
+
"to": "js/*"
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
{
|
|
53
|
+
"from": "lib/*",
|
|
54
|
+
"to": "lib/*"
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
{
|
|
58
|
+
"from": "_view/*",
|
|
59
|
+
"to": "_view/*"
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
{
|
|
63
|
+
"from": "_list/*",
|
|
64
|
+
"to": "_list/*"
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
{
|
|
68
|
+
"from": "_show/*",
|
|
69
|
+
"to": "_show/*"
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
{
|
|
73
|
+
"from": "_update/*",
|
|
74
|
+
"to": "_update/*"
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
{
|
|
78
|
+
"from": ":id",
|
|
79
|
+
"to": "../../:id"
|
|
80
|
+
}
|
|
81
|
+
]
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
// namespace variable for all acdc display libraries
|
|
2
|
+
var acdc = {
|
|
3
|
+
// reference for the couch db instance
|
|
4
|
+
couchdb : null,
|
|
5
|
+
|
|
6
|
+
// reference to dataTable;
|
|
7
|
+
dataTable : null,
|
|
8
|
+
|
|
9
|
+
//cache for a collection summary
|
|
10
|
+
currentCollection: null,
|
|
11
|
+
|
|
12
|
+
//tree reference
|
|
13
|
+
treeView : null,
|
|
14
|
+
filesetNode: null,
|
|
15
|
+
//
|
|
16
|
+
// Use this to provide the couch db API instance that these tools will use
|
|
17
|
+
//
|
|
18
|
+
setCouchDB: function(couchRef){
|
|
19
|
+
console.log("couchdb ref set...")
|
|
20
|
+
this.couchdb = couchRef;
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// QND URL parsing to get a query argument
|
|
24
|
+
getQueryVariable: function(variable) {
|
|
25
|
+
var query = window.location.search.substring(1);
|
|
26
|
+
var vars = query.split("&");
|
|
27
|
+
for (var i=0;i<vars.length;i++) {
|
|
28
|
+
var pair = vars[i].split("=");
|
|
29
|
+
if (pair[0] == variable) {
|
|
30
|
+
return pair[1];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
// draw data table for collection view
|
|
37
|
+
buildCollectionDataTable: function(tableElem){
|
|
38
|
+
var myColumnDefs = [
|
|
39
|
+
{key:"username" , resizeable:true,sortable:true},
|
|
40
|
+
{key:"group",resizeable:true, sortable:true},
|
|
41
|
+
{key:"collection",resizeable:true, sortable:true},
|
|
42
|
+
{key:"document", resizable:true, sortable:false}
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
// backend data source for the table is a JavaScript array that starts empty
|
|
46
|
+
var myDataSource = new YAHOO.util.DataSource([]);
|
|
47
|
+
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
|
|
48
|
+
myDataSource.responseSchema = {
|
|
49
|
+
fields: ["username","group","collection", "document"]
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// the actual table
|
|
53
|
+
var myDataTable = new YAHOO.widget.DataTable(tableElem,
|
|
54
|
+
myColumnDefs, myDataSource, {"width" : 950});
|
|
55
|
+
// set the groupuser.dataTable reference so that the onClick response can manipulate it
|
|
56
|
+
acdc.dataTable = myDataTable;
|
|
57
|
+
console.log("dataTable created...");
|
|
58
|
+
|
|
59
|
+
},
|
|
60
|
+
// populate collection table from couch view
|
|
61
|
+
fillCollectionTable: function(){
|
|
62
|
+
acdc.couchdb.view("ACDC/collection_name",{
|
|
63
|
+
success : function(data){
|
|
64
|
+
// clean out existing rows in the display table
|
|
65
|
+
if(acdc.dataTable.getRecordSet().getLength() > 0) {
|
|
66
|
+
acdc.dataTable.deleteRows(0, acdc.dataTable.getRecordSet().getLength());
|
|
67
|
+
}
|
|
68
|
+
for (i in data.rows){
|
|
69
|
+
// add new data rows to the table
|
|
70
|
+
//configcache.dataTable.addRow({"group": data.rows[i].key[0], "username": data.rows[i].key[1], "document" : data.rows[i]['value']['config_doc'], "label" : data.rows[i]['value']['config_label']})
|
|
71
|
+
console.log(data.rows[i]);
|
|
72
|
+
var group = data.rows[i]['key'][1];
|
|
73
|
+
var user = data.rows[i]['key'][2];
|
|
74
|
+
var name = data.rows[i]['key'][0];
|
|
75
|
+
var doc = data.rows[i]['value']['_id'];
|
|
76
|
+
var collLink = "<a href=\"" + acdc.couchdb.uri + "_design/ACDC/displaycollection.html" + "?group=" + group + "&user=" + user + "&collection=" + name + "\">" + doc + "</a>";
|
|
77
|
+
acdc.dataTable.addRow(
|
|
78
|
+
{ "group" : group, "username" : user, "collection" : name, "document" : collLink}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
// display the details of a single collection, getting the collection document ID from the URL parameters
|
|
86
|
+
displayCollection: function() {
|
|
87
|
+
console.log("displayCollection called");
|
|
88
|
+
var collName = acdc.getQueryVariable("collection");
|
|
89
|
+
var groupName = acdc.getQueryVariable("group");
|
|
90
|
+
var userName = acdc.getQueryVariable("user");
|
|
91
|
+
acdc.currentCollection = {};
|
|
92
|
+
acdc.currentCollection["collection"] = collName;
|
|
93
|
+
acdc.currentCollection["group"] = groupName;
|
|
94
|
+
acdc.currentCollection["user"] = userName;
|
|
95
|
+
acdc.currentCollection["filesets"] = [];
|
|
96
|
+
|
|
97
|
+
if (collName == null){
|
|
98
|
+
alert("No collection argument provided in the URL");
|
|
99
|
+
}
|
|
100
|
+
if (groupName == null){
|
|
101
|
+
alert("No group argument provided in the URL");
|
|
102
|
+
}
|
|
103
|
+
if (userName == null){
|
|
104
|
+
alert("No user argument provided in the URL");
|
|
105
|
+
}
|
|
106
|
+
console.log(collName + " " + groupName + " " + userName);
|
|
107
|
+
acdc.couchdb.view("ACDC/collection_name",{
|
|
108
|
+
startkey : [collName, groupName, userName], endkey:[collName, groupName, userName],
|
|
109
|
+
success : function(data){
|
|
110
|
+
acdc.currentCollection['id'] = data.rows[0]["id"];
|
|
111
|
+
acdc.collectionFilesetSummary();
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
// using information in acdc.currentCollection, call the view collection_fileset_summary and
|
|
118
|
+
// add the filesets to currentCollection['filesets']
|
|
119
|
+
collectionFilesetSummary: function(){
|
|
120
|
+
acdc.couchdb.view("ACDC/collection_fileset_summary",{
|
|
121
|
+
startkey : [acdc.currentCollection["id"]], endkey:[acdc.currentCollection["id"]],
|
|
122
|
+
success : function(data){
|
|
123
|
+
console.log("loading coll fileset summary...");
|
|
124
|
+
for (i in data.rows){
|
|
125
|
+
acdc.currentCollection['filesets'].push(data.rows[i]['value']);
|
|
126
|
+
acdc.dataTable.addRow(
|
|
127
|
+
{ "dataset" : data.rows[i]['value']['dataset'],
|
|
128
|
+
"files" : data.rows[i]['value']['files'],
|
|
129
|
+
"document" : data.rows[i]['value']['id'] }
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
// draw data table for collection view
|
|
138
|
+
buildFilesetSummaryDataTable: function(tableElem){
|
|
139
|
+
var myColumnDefs = [
|
|
140
|
+
{key:"dataset",resizeable:true, sortable:true},
|
|
141
|
+
{key:"files",resizeable:true, sortable:true},
|
|
142
|
+
{key:"document", resizable:true, sortable:false}
|
|
143
|
+
];
|
|
144
|
+
|
|
145
|
+
// backend data source for the table is a JavaScript array that starts empty
|
|
146
|
+
var myDataSource = new YAHOO.util.DataSource([]);
|
|
147
|
+
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
|
|
148
|
+
myDataSource.responseSchema = {
|
|
149
|
+
fields: ["dataset", "files", "id"]
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// the actual table
|
|
153
|
+
var myDataTable = new YAHOO.widget.DataTable(tableElem,
|
|
154
|
+
myColumnDefs, myDataSource, {"width" : 950});
|
|
155
|
+
// set the groupuser.dataTable reference so that the onClick response can manipulate it
|
|
156
|
+
acdc.dataTable = myDataTable;
|
|
157
|
+
console.log("dataTable created...");
|
|
158
|
+
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
buildFilesetDataTable: function(tableElem){
|
|
162
|
+
console.log("buildFilesetDataTable");
|
|
163
|
+
var myColumnDefs = [
|
|
164
|
+
{key:"username" , resizeable:true,sortable:true},
|
|
165
|
+
{key:"group",resizeable:true, sortable:true},
|
|
166
|
+
{key:"collection",resizeable:true, sortable:true},
|
|
167
|
+
{key:"dataset",resizeable:true, sortable:false},
|
|
168
|
+
{key:"document", resizable:true, sortable:false}
|
|
169
|
+
];
|
|
170
|
+
|
|
171
|
+
// backend data source for the table is a JavaScript array that starts empty
|
|
172
|
+
var myDataSource = new YAHOO.util.DataSource([]);
|
|
173
|
+
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
|
|
174
|
+
myDataSource.responseSchema = {
|
|
175
|
+
fields: ["username","group","collection", "dataset", "document"]
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
// the actual table
|
|
179
|
+
var myDataTable = new YAHOO.widget.DataTable(tableElem,
|
|
180
|
+
myColumnDefs, myDataSource, {"width" : 950});
|
|
181
|
+
// set the groupuser.dataTable reference so that the onClick response can manipulate it
|
|
182
|
+
acdc.dataTable = myDataTable;
|
|
183
|
+
console.log("dataTable created...");
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
fillFilesetTable: function(){
|
|
187
|
+
console.log("fillFilesetTable");
|
|
188
|
+
acdc.couchdb.view("ACDC/fileset_owner_coll_dataset",{
|
|
189
|
+
success : function(data){
|
|
190
|
+
// clean out existing rows in the display table
|
|
191
|
+
if(acdc.dataTable.getRecordSet().getLength() > 0) {
|
|
192
|
+
acdc.dataTable.deleteRows(0, acdc.dataTable.getRecordSet().getLength());
|
|
193
|
+
}
|
|
194
|
+
for (i in data.rows){
|
|
195
|
+
console.log(data.rows[i]);
|
|
196
|
+
var docLink = "<a href=\"" + acdc.couchdb.uri + "_design/ACDC/displayfileset.html?document=" + data.rows[i]['value'] + "\">" + data.rows[i]['value'] + "</a>";
|
|
197
|
+
acdc.dataTable.addRow( { "group" : data.rows[i].key[0],
|
|
198
|
+
"username" : data.rows[i].key[1],
|
|
199
|
+
"collection" : data.rows[i].key[2],
|
|
200
|
+
"dataset" : data.rows[i].key[3],
|
|
201
|
+
"document" : docLink} ) ;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
},
|
|
206
|
+
|
|
207
|
+
//
|
|
208
|
+
// lazy answer to displaying a chunk of JSON: turn it into a tree
|
|
209
|
+
//
|
|
210
|
+
buildFilesTreeView: function(treeElem){
|
|
211
|
+
acdc.treeView = new YAHOO.widget.TreeView(treeElem);
|
|
212
|
+
acdc.filesetNode = new YAHOO.widget.TextNode("Fileset", acdc.treeView.getRoot(), false);
|
|
213
|
+
acdc.treeView.draw();
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
},
|
|
218
|
+
|
|
219
|
+
//
|
|
220
|
+
// function to turn a dictionary like JSON object into a TextNode in the tree
|
|
221
|
+
// added to the node instance provided, will be recursively invoked for children in the object
|
|
222
|
+
buildTreeBranch: function(node, objectRef){
|
|
223
|
+
for ( o in objectRef) {
|
|
224
|
+
if (typeof(objectRef[o]) == "object"){
|
|
225
|
+
newNode = new YAHOO.widget.TextNode(o, node, false);
|
|
226
|
+
acdc.buildTreeBranch(newNode, objectRef[o]);
|
|
227
|
+
} else {
|
|
228
|
+
newNode = new YAHOO.widget.TextNode(o, node, false);
|
|
229
|
+
valueNode = new YAHOO.widget.TextNode(objectRef[o], newNode, true);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
// display the contents of a fileset as a table
|
|
237
|
+
buildFilesDataTable: function(tableElem){
|
|
238
|
+
console.log("buildFilesDataTable");
|
|
239
|
+
var myColumnDefs = [
|
|
240
|
+
{key:"lfn" , resizeable:true,sortable:true},
|
|
241
|
+
{key: "events", resizeable: true, sortable:true},
|
|
242
|
+
{key: "locations", resizeable: true, sortable:true},
|
|
243
|
+
{key: "size", resizeable: true, sortable:true},
|
|
244
|
+
];
|
|
245
|
+
var myDataSource = new YAHOO.util.DataSource([]);
|
|
246
|
+
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
|
|
247
|
+
myDataSource.responseSchema = {
|
|
248
|
+
fields: ["lfn", "events", "size", "locations"]
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
// the actual table
|
|
252
|
+
var myDataTable = new YAHOO.widget.DataTable(tableElem,
|
|
253
|
+
myColumnDefs, myDataSource, {"width" : 950});
|
|
254
|
+
// set the groupuser.dataTable reference so that the onClick response can manipulate it
|
|
255
|
+
acdc.dataTable = myDataTable;
|
|
256
|
+
},
|
|
257
|
+
|
|
258
|
+
displayFileset: function(){
|
|
259
|
+
console.log("displayFileset");
|
|
260
|
+
var docId = acdc.getQueryVariable("document");
|
|
261
|
+
if (docId == null){
|
|
262
|
+
alert('document argument not provided in URL');
|
|
263
|
+
return
|
|
264
|
+
}
|
|
265
|
+
acdc.couchdb.openDoc(docId, {
|
|
266
|
+
"success" : function(data) {
|
|
267
|
+
for (i in data.fileset){
|
|
268
|
+
if ( i != "files"){
|
|
269
|
+
// If it isnt the files node, send it to the tree
|
|
270
|
+
if (typeof(data.fileset[i]) == "object"){
|
|
271
|
+
// push object to tree
|
|
272
|
+
acdc.buildTreeBranch(acdc.filesetNode, data.fileset[i]);
|
|
273
|
+
} else {
|
|
274
|
+
// wrap value in object & push to tree
|
|
275
|
+
var dataObj = {};
|
|
276
|
+
dataObj[i] = data.fileset[i];
|
|
277
|
+
acdc.buildTreeBranch(acdc.filesetNode, dataObj);
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
for (f in data.fileset.files){
|
|
282
|
+
// files go into the dataTable, not the tree
|
|
283
|
+
var fileData = data.fileset.files[f];
|
|
284
|
+
var locations = "<ul>"
|
|
285
|
+
for (l in fileData.locations){
|
|
286
|
+
var locString = "<li>" + fileData.locations[l] + "</li>";
|
|
287
|
+
locations += locString;
|
|
288
|
+
}
|
|
289
|
+
locations += "</ul>";
|
|
290
|
+
acdc.dataTable.addRow(
|
|
291
|
+
{ "lfn" : fileData["lfn"],
|
|
292
|
+
"events" : fileData["events"],
|
|
293
|
+
"size" : fileData["size"],
|
|
294
|
+
"locations" : locations}
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
})
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return documents id and version indexed by timestamp,
|
|
3
|
+
* this assume that user records have no timestamps.
|
|
4
|
+
* @author Diego Ballesteros
|
|
5
|
+
*/
|
|
6
|
+
function(doc) {
|
|
7
|
+
if (doc.timestamp) {
|
|
8
|
+
emit(doc.timestamp, {"_rev" : doc._rev, "_id" : doc._id});
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
_sum
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
["^CVS"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Group User</title>
|
|
5
|
+
<link rel="stylesheet" href="style/main.css" type="text/css">
|
|
6
|
+
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.8.1/build/datatable/assets/skins/sam/datatable.css&2.8.1/build/logger/assets/skins/sam/logger.css">
|
|
7
|
+
<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.8.1/build/yahoo/yahoo-debug.js&2.8.1/build/dom/dom-debug.js&2.8.1/build/event/event-debug.js&2.8.1/build/element/element-debug.js&2.8.1/build/datasource/datasource-debug.js&2.8.1/build/datatable/datatable-debug.js&2.8.1/build/logger/logger-debug.js"></script>
|
|
8
|
+
|
|
9
|
+
<!-- Combo-handled YUI CSS files: -->
|
|
10
|
+
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.8.1/build/treeview/assets/skins/sam/treeview.css">
|
|
11
|
+
<!-- Combo-handled YUI JS files: -->
|
|
12
|
+
<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.8.1/build/yahoo-dom-event/yahoo-dom-event.js&2.8.1/build/treeview/treeview-min.js"></script>
|
|
13
|
+
<style type="text/css">
|
|
14
|
+
#header {
|
|
15
|
+
background: #fff;
|
|
16
|
+
position: absolute;
|
|
17
|
+
top: 0px;
|
|
18
|
+
left: 0px;
|
|
19
|
+
width: 950px;
|
|
20
|
+
height: 100px;
|
|
21
|
+
}
|
|
22
|
+
#leftcol {
|
|
23
|
+
background: #fff;
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: 100px;
|
|
26
|
+
left: 0px;
|
|
27
|
+
width: 300px;
|
|
28
|
+
height: 500px;
|
|
29
|
+
}
|
|
30
|
+
#content {
|
|
31
|
+
background: #fff;
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: 100px;
|
|
34
|
+
left: 300px;
|
|
35
|
+
width: 650px;
|
|
36
|
+
height: 500px;
|
|
37
|
+
}
|
|
38
|
+
#footer {
|
|
39
|
+
background: #fff;
|
|
40
|
+
position: absolute;
|
|
41
|
+
top: 600px;
|
|
42
|
+
left: 0px;
|
|
43
|
+
width: 950px;
|
|
44
|
+
height: 200px;
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
</style>
|
|
48
|
+
</head>
|
|
49
|
+
<body class="yui-skin-sam">
|
|
50
|
+
<div id="header"><h1>GroupUser TreeView</h1>
|
|
51
|
+
</div>
|
|
52
|
+
<div id="leftcol">
|
|
53
|
+
<div id="owners-tree"></div>
|
|
54
|
+
</div>
|
|
55
|
+
<div id="content"></div>
|
|
56
|
+
<div id="footer">
|
|
57
|
+
<ul><li><a href="create.html">New User</a></li></ul>
|
|
58
|
+
|
|
59
|
+
</div>
|
|
60
|
+
</body>
|
|
61
|
+
|
|
62
|
+
<script src="/_utils/script/json2.js"></script>
|
|
63
|
+
<script src="/_utils/script/jquery.js?1.3.1"></script>
|
|
64
|
+
<script src="/_utils/script/jquery.couch.js?0.9.0"></script>
|
|
65
|
+
<script src="vendor/groupuser/groupuser.js"></script>
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
<script>
|
|
70
|
+
// get the dbname from the document location & create the couch interface
|
|
71
|
+
var dbname = document.location.href.split('/')[3];
|
|
72
|
+
$db = $.couch.db(dbname);
|
|
73
|
+
|
|
74
|
+
// set up the groupuser instance
|
|
75
|
+
groupuser.setCouchDB($db);
|
|
76
|
+
// build the tree
|
|
77
|
+
groupuser.buildTree("owners-tree");
|
|
78
|
+
// build the table for the default output from the tree click response
|
|
79
|
+
groupuser.buildTable("content")
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* add styles here */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
_design/GroupUser
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function(doc, req){
|
|
2
|
+
if (doc){
|
|
3
|
+
log("have a doc for newgroup...");
|
|
4
|
+
return [ doc, "Exists"];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
doc = {};
|
|
10
|
+
var groupName = "group-";
|
|
11
|
+
groupName += req.query['group']
|
|
12
|
+
doc['_id'] = groupName
|
|
13
|
+
doc['group'] = {};
|
|
14
|
+
doc.group['name'] = req.query['group'];
|
|
15
|
+
doc.group['administrators'] = {};
|
|
16
|
+
doc.group['associated_sites'] = {};
|
|
17
|
+
return [doc, "OK"];
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function(doc, req){
|
|
2
|
+
if (doc){
|
|
3
|
+
log("have a doc for newuser...");
|
|
4
|
+
return [ doc, "Exists"];
|
|
5
|
+
}
|
|
6
|
+
doc = {};
|
|
7
|
+
var userName = "user-";
|
|
8
|
+
userName += req.query['user']
|
|
9
|
+
doc['_id'] = userName
|
|
10
|
+
doc['user'] = {};
|
|
11
|
+
doc.user['name'] = req.query['user'];
|
|
12
|
+
doc.user['name'] = req.query['group'];
|
|
13
|
+
doc.user['proxy'] = {};
|
|
14
|
+
return [doc, "OK"];
|
|
15
|
+
}
|