Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
dfebe7c8
Commit
dfebe7c8
authored
Aug 21, 2012
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug: storages can now use jobManager correctly
parent
8b66f91e
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
309 additions
and
240 deletions
+309
-240
OfficeJS/grunt/10_gruntJIO/grunt.js
OfficeJS/grunt/10_gruntJIO/grunt.js
+1
-2
OfficeJS/src/jio.storage/conflictmanagerstorage.js
OfficeJS/src/jio.storage/conflictmanagerstorage.js
+4
-3
OfficeJS/src/jio.storage/cryptstorage.js
OfficeJS/src/jio.storage/cryptstorage.js
+2
-1
OfficeJS/src/jio.storage/davstorage.js
OfficeJS/src/jio.storage/davstorage.js
+17
-11
OfficeJS/src/jio.storage/indexstorage.js
OfficeJS/src/jio.storage/indexstorage.js
+2
-1
OfficeJS/src/jio.storage/localstorage.js
OfficeJS/src/jio.storage/localstorage.js
+6
-5
OfficeJS/src/jio.storage/replicatestorage.js
OfficeJS/src/jio.storage/replicatestorage.js
+2
-1
OfficeJS/src/jio/intro.js
OfficeJS/src/jio/intro.js
+1
-0
OfficeJS/src/jio/jio.intro.js
OfficeJS/src/jio/jio.intro.js
+1
-1
OfficeJS/src/jio/jio.outro.js
OfficeJS/src/jio/jio.outro.js
+155
-97
OfficeJS/src/jio/jioNamespace.js
OfficeJS/src/jio/jioNamespace.js
+25
-38
OfficeJS/src/jio/jobs/job.js
OfficeJS/src/jio/jobs/job.js
+6
-7
OfficeJS/src/jio/jobs/jobIdHandler.js
OfficeJS/src/jio/jobs/jobIdHandler.js
+1
-2
OfficeJS/src/jio/jobs/jobManager.js
OfficeJS/src/jio/jobs/jobManager.js
+4
-8
OfficeJS/src/jio/jobs/jobRules.js
OfficeJS/src/jio/jobs/jobRules.js
+46
-21
OfficeJS/src/jio/storages/storage.js
OfficeJS/src/jio/storages/storage.js
+36
-9
OfficeJS/src/jio/storages/storageHandler.js
OfficeJS/src/jio/storages/storageHandler.js
+0
-33
No files found.
OfficeJS/grunt/10_gruntJIO/grunt.js
View file @
dfebe7c8
...
@@ -18,8 +18,8 @@ module.exports = function(grunt) {
...
@@ -18,8 +18,8 @@ module.exports = function(grunt) {
'
<file_strip_banner:../../src/<%= pkg.name %>/intro.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/intro.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/exceptions.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/exceptions.js>
'
,
// Jio wrapper top
// Jio wrapper top
'
<file_strip_banner:../../src/<%= pkg.name %>/jio.intro.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/storages/storage.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/storages/storage.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/storages/storageHandler.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/commands/command.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/commands/command.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/commands/allDocsCommand.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/commands/allDocsCommand.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/commands/getCommand.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/commands/getCommand.js>
'
,
...
@@ -34,7 +34,6 @@ module.exports = function(grunt) {
...
@@ -34,7 +34,6 @@ module.exports = function(grunt) {
'
<file_strip_banner:../../src/<%= pkg.name %>/jobs/status/waitStatus.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/jobs/status/waitStatus.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/jobs/job.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/jobs/job.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/announcements/announcement.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/announcements/announcement.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/jio.intro.js>
'
,
// Singletons
// Singletons
'
<file_strip_banner:../../src/<%= pkg.name %>/activityUpdater.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/activityUpdater.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/announcements/announcer.js>
'
,
'
<file_strip_banner:../../src/<%= pkg.name %>/announcements/announcer.js>
'
,
...
...
OfficeJS/src/jio.storage/conflictmanagerstorage.js
View file @
dfebe7c8
var
newConflictManagerStorage
=
function
(
spec
,
my
)
{
var
newConflictManagerStorage
=
function
(
spec
,
my
)
{
var
that
=
Jio
.
storage
(
spec
,
my
,
'
handler
'
),
priv
=
{};
spec
=
spec
||
{};
spec
=
spec
||
{};
my
=
my
||
{};
var
that
=
my
.
basicStorage
(
spec
,
my
),
priv
=
{};
var
storage_exists
=
(
spec
.
storage
?
true
:
false
);
var
storage_exists
=
(
spec
.
storage
?
true
:
false
);
priv
.
secondstorage_spec
=
spec
.
storage
||
{
type
:
'
base
'
};
priv
.
secondstorage_spec
=
spec
.
storage
||
{
type
:
'
base
'
};
...
@@ -42,7 +41,7 @@ var newConflictManagerStorage = function ( spec, my ) {
...
@@ -42,7 +41,7 @@ var newConflictManagerStorage = function ( spec, my ) {
};
};
priv
.
saveNewRevision
=
function
(
command
,
path
,
content
,
success
,
error
)
{
priv
.
saveNewRevision
=
function
(
command
,
path
,
content
,
success
,
error
)
{
that
.
addJob
(
'
p
u
t
'
,
priv
.
secondstorage_spec
,{
_id
:
path
,
content
:
content
},
that
.
addJob
(
'
p
os
t
'
,
priv
.
secondstorage_spec
,{
_id
:
path
,
content
:
content
},
command
.
cloneOption
(),
success
,
error
);
command
.
cloneOption
(),
success
,
error
);
};
};
...
@@ -72,6 +71,7 @@ var newConflictManagerStorage = function ( spec, my ) {
...
@@ -72,6 +71,7 @@ var newConflictManagerStorage = function ( spec, my ) {
};
};
priv
.
_revs
=
function
(
metadata
,
revision
)
{
priv
.
_revs
=
function
(
metadata
,
revision
)
{
if
(
!
(
metadata
&&
revision
))
{
return
null
;
}
if
(
metadata
[
revision
])
{
if
(
metadata
[
revision
])
{
return
{
start
:
metadata
[
revision
].
_revisions
.
length
,
return
{
start
:
metadata
[
revision
].
_revisions
.
length
,
ids
:
metadata
[
revision
].
_revisions
};
ids
:
metadata
[
revision
].
_revisions
};
...
@@ -81,6 +81,7 @@ var newConflictManagerStorage = function ( spec, my ) {
...
@@ -81,6 +81,7 @@ var newConflictManagerStorage = function ( spec, my ) {
};
};
priv
.
_revs_info
=
function
(
metadata
)
{
priv
.
_revs_info
=
function
(
metadata
)
{
if
(
!
metadata
)
{
return
null
;
}
var
k
,
l
=
[];
var
k
,
l
=
[];
for
(
k
in
metadata
)
{
for
(
k
in
metadata
)
{
l
.
push
({
l
.
push
({
...
...
OfficeJS/src/jio.storage/cryptstorage.js
View file @
dfebe7c8
var
newCryptedStorage
=
function
(
spec
,
my
)
{
var
newCryptedStorage
=
function
(
spec
,
my
)
{
var
that
=
Jio
.
storage
(
spec
,
my
,
'
handler
'
),
priv
=
{};
spec
=
spec
||
{};
var
that
=
my
.
basicStorage
(
spec
,
my
),
priv
=
{};
var
is_valid_storage
=
(
spec
.
storage
?
true
:
false
);
var
is_valid_storage
=
(
spec
.
storage
?
true
:
false
);
...
...
OfficeJS/src/jio.storage/davstorage.js
View file @
dfebe7c8
var
newDAVStorage
=
function
(
spec
,
my
)
{
var
newDAVStorage
=
function
(
spec
,
my
)
{
var
that
=
Jio
.
storage
(
spec
,
my
,
'
base
'
),
priv
=
{};
spec
=
spec
||
{};
var
that
=
my
.
basicStorage
(
spec
,
my
),
priv
=
{};
priv
.
secureDocId
=
function
(
string
)
{
priv
.
secureDocId
=
function
(
string
)
{
var
split
=
string
.
split
(
'
/
'
),
i
;
var
split
=
string
.
split
(
'
/
'
),
i
;
...
@@ -75,15 +76,7 @@ var newDAVStorage = function ( spec, my ) {
...
@@ -75,15 +76,7 @@ var newDAVStorage = function ( spec, my ) {
return
async
;
return
async
;
};
};
that
.
post
=
function
(
command
)
{
priv
.
putOrPost
=
function
(
command
,
type
)
{
that
.
put
(
command
);
};
/**
* Saves a document in the distant dav storage.
* @method put
*/
that
.
put
=
function
(
command
)
{
var
secured_docid
=
priv
.
secureDocId
(
command
.
getDocId
());
var
secured_docid
=
priv
.
secureDocId
(
command
.
getDocId
());
...
@@ -92,7 +85,7 @@ var newDAVStorage = function ( spec, my ) {
...
@@ -92,7 +85,7 @@ var newDAVStorage = function ( spec, my ) {
priv
.
secured_username
+
'
/
'
+
priv
.
secured_username
+
'
/
'
+
priv
.
secured_applicationname
+
'
/
'
+
priv
.
secured_applicationname
+
'
/
'
+
secured_docid
,
secured_docid
,
type
:
'
PUT
'
,
type
:
type
,
data
:
command
.
getDocContent
(),
data
:
command
.
getDocContent
(),
async
:
true
,
async
:
true
,
dataType
:
'
text
'
,
// TODO is it necessary ?
dataType
:
'
text
'
,
// TODO is it necessary ?
...
@@ -110,6 +103,18 @@ var newDAVStorage = function ( spec, my ) {
...
@@ -110,6 +103,18 @@ var newDAVStorage = function ( spec, my ) {
that
.
retry
(
type
);
that
.
retry
(
type
);
}
}
}
);
}
);
};
that
.
post
=
function
(
command
)
{
priv
.
putOrPost
(
command
,
'
POST
'
);
};
/**
* Saves a document in the distant dav storage.
* @method put
*/
that
.
put
=
function
(
command
)
{
priv
.
putOrPost
(
command
,
'
PUT
'
);
};
// end put
};
// end put
/**
/**
...
@@ -247,6 +252,7 @@ var newDAVStorage = function ( spec, my ) {
...
@@ -247,6 +252,7 @@ var newDAVStorage = function ( spec, my ) {
dataType
:
'
xml
'
,
dataType
:
'
xml
'
,
headers
:
{
'
Authorization
'
:
'
Basic
'
+
Base64
.
encode
(
headers
:
{
'
Authorization
'
:
'
Basic
'
+
Base64
.
encode
(
priv
.
username
+
'
:
'
+
priv
.
password
),
Depth
:
'
1
'
},
priv
.
username
+
'
:
'
+
priv
.
password
),
Depth
:
'
1
'
},
// xhrFields: {withCredentials: 'true'}, // cross domain
success
:
function
(
xmlData
)
{
success
:
function
(
xmlData
)
{
var
response
=
$
(
xmlData
).
find
(
var
response
=
$
(
xmlData
).
find
(
'
D
\\
:response, response
'
'
D
\\
:response, response
'
...
...
OfficeJS/src/jio.storage/indexstorage.js
View file @
dfebe7c8
var
newIndexStorage
=
function
(
spec
,
my
)
{
var
newIndexStorage
=
function
(
spec
,
my
)
{
var
that
=
Jio
.
storage
(
spec
,
my
,
'
handler
'
),
priv
=
{};
spec
=
spec
||
{};
var
that
=
my
.
basicStorage
(
spec
,
my
),
priv
=
{};
var
validatestate_secondstorage
=
spec
.
storage
||
false
;
var
validatestate_secondstorage
=
spec
.
storage
||
false
;
priv
.
secondstorage_spec
=
spec
.
storage
||
{
type
:
'
base
'
};
priv
.
secondstorage_spec
=
spec
.
storage
||
{
type
:
'
base
'
};
...
...
OfficeJS/src/jio.storage/localstorage.js
View file @
dfebe7c8
...
@@ -3,7 +3,8 @@
...
@@ -3,7 +3,8 @@
* It is a database located in the browser local storage.
* It is a database located in the browser local storage.
*/
*/
var
newLocalStorage
=
function
(
spec
,
my
)
{
var
newLocalStorage
=
function
(
spec
,
my
)
{
var
that
=
Jio
.
storage
(
spec
,
my
,
'
base
'
),
priv
=
{};
spec
=
spec
||
{};
var
that
=
my
.
basicStorage
(
spec
,
my
),
priv
=
{};
priv
.
secureDocId
=
function
(
string
)
{
priv
.
secureDocId
=
function
(
string
)
{
var
split
=
string
.
split
(
'
/
'
),
i
;
var
split
=
string
.
split
(
'
/
'
),
i
;
...
@@ -179,7 +180,7 @@ var newLocalStorage = function ( spec, my ) {
...
@@ -179,7 +180,7 @@ var newLocalStorage = function ( spec, my ) {
}
}
LocalOrCookieStorage
.
setItem
(
path
,
doc
);
LocalOrCookieStorage
.
setItem
(
path
,
doc
);
that
.
success
({
ok
:
true
,
id
:
command
.
getDocId
()});
that
.
success
({
ok
:
true
,
id
:
command
.
getDocId
()});
});
}
,
5000
);
};
// end put
};
// end put
/**
/**
...
@@ -213,7 +214,7 @@ var newLocalStorage = function ( spec, my ) {
...
@@ -213,7 +214,7 @@ var newLocalStorage = function ( spec, my ) {
}
}
that
.
success
(
doc
);
that
.
success
(
doc
);
}
}
});
}
,
5000
);
};
// end get
};
// end get
/**
/**
...
@@ -249,7 +250,7 @@ var newLocalStorage = function ( spec, my ) {
...
@@ -249,7 +250,7 @@ var newLocalStorage = function ( spec, my ) {
}
}
}
}
that
.
success
({
total_rows
:
new_array
.
length
,
rows
:
new_array
});
that
.
success
({
total_rows
:
new_array
.
length
,
rows
:
new_array
});
});
}
,
5000
);
};
// end allDocs
};
// end allDocs
/**
/**
...
@@ -270,7 +271,7 @@ var newLocalStorage = function ( spec, my ) {
...
@@ -270,7 +271,7 @@ var newLocalStorage = function ( spec, my ) {
LocalOrCookieStorage
.
deleteItem
(
path
);
LocalOrCookieStorage
.
deleteItem
(
path
);
priv
.
removeFileName
(
secured_docid
);
priv
.
removeFileName
(
secured_docid
);
that
.
success
({
ok
:
true
,
id
:
command
.
getDocId
()});
that
.
success
({
ok
:
true
,
id
:
command
.
getDocId
()});
});
}
,
5000
);
};
// end remove
};
// end remove
return
that
;
return
that
;
...
...
OfficeJS/src/jio.storage/replicatestorage.js
View file @
dfebe7c8
var
newReplicateStorage
=
function
(
spec
,
my
)
{
var
newReplicateStorage
=
function
(
spec
,
my
)
{
var
that
=
Jio
.
storage
(
spec
,
my
,
'
handler
'
),
priv
=
{};
spec
=
spec
||
{};
var
that
=
my
.
basicStorage
(
spec
,
my
),
priv
=
{};
priv
.
return_value_array
=
[];
priv
.
return_value_array
=
[];
priv
.
storagelist
=
spec
.
storagelist
||
[];
priv
.
storagelist
=
spec
.
storagelist
||
[];
...
...
OfficeJS/src/jio/intro.js
View file @
dfebe7c8
var
jio
=
(
function
()
{
var
jio
=
(
function
()
{
"
use strict
"
;
OfficeJS/src/jio/jio.intro.js
View file @
dfebe7c8
var
jio
=
function
(
spec
,
my
)
{
var
jio
=
function
(
spec
)
{
OfficeJS/src/jio/jio.outro.js
View file @
dfebe7c8
// Class jio
// Class jio
var
that
=
{};
var
that
=
{}
,
priv
=
{}
;
spec
=
spec
||
{};
spec
=
spec
||
{};
my
=
my
||
{};
// Attributes //
// Attributes //
var
priv
=
{};
var
jio_id_array_name
=
'
jio/id_array
'
;
var
jio_id_array_name
=
'
jio/id_array
'
;
priv
.
id
=
null
;
priv
.
id
=
null
;
my
.
jobManager
=
jobManager
;
my
.
jobIdHandler
=
jobIdHandler
;
priv
.
storage_spec
=
spec
;
priv
.
storage_spec
=
spec
;
// initialize //
// initialize //
...
@@ -31,38 +27,79 @@
...
@@ -31,38 +27,79 @@
};
};
// Methods //
// Methods //
that
.
start
=
function
()
{
/**
* Returns a storage from a storage description.
* @method storage
* @param {object} spec The specifications.
* @param {object} my The protected object.
* @param {string} forcetype Force storage type
* @return {object} The storage object.
*/
Object
.
defineProperty
(
that
,
"
storage
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
(
spec
,
my
,
forcetype
)
{
spec
=
spec
||
{};
my
=
my
||
{};
my
.
basicStorage
=
storage
;
my
.
storage
=
that
.
storage
;
// NOTE : or proxy storage
var
type
=
forcetype
||
spec
.
type
||
'
base
'
;
if
(
type
===
'
base
'
)
{
return
storage
(
spec
,
my
);
}
if
(
!
storage_type_object
[
type
])
{
throw
invalidStorageType
(
{
type
:
type
,
message
:
'
Storage does not exists.
'
});
}
return
storage_type_object
[
type
](
spec
,
my
);
}
});
Object
.
defineProperty
(
that
,
"
start
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
()
{
priv
.
init
();
priv
.
init
();
activityUpdater
.
start
();
activityUpdater
.
start
();
jobManager
.
start
();
jobManager
.
start
();
};
}
that
.
stop
=
function
()
{
});
Object
.
defineProperty
(
that
,
"
stop
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
()
{
jobManager
.
stop
();
jobManager
.
stop
();
};
}
that
.
close
=
function
()
{
});
Object
.
defineProperty
(
that
,
"
close
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
()
{
activityUpdater
.
stop
();
activityUpdater
.
stop
();
jobManager
.
stop
();
jobManager
.
stop
();
priv
.
id
=
null
;
priv
.
id
=
null
;
};
}
that
.
start
(
);
}
);
/**
/**
* Returns the jio id.
* Returns the jio id.
* @method getId
* @method getId
* @return {number} The jio id.
* @return {number} The jio id.
*/
*/
that
.
getId
=
function
()
{
Object
.
defineProperty
(
that
,
"
getId
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
()
{
return
priv
.
id
;
return
priv
.
id
;
};
}
});
/**
/**
* Returns the jio job rules object used by the job manager.
* Returns the jio job rules object used by the job manager.
* @method getJobRules
* @method getJobRules
* @return {object} The job rules object
* @return {object} The job rules object
*/
*/
that
.
getJobRules
=
function
()
{
Object
.
defineProperty
(
that
,
"
getJobRules
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
()
{
return
jobRules
;
return
jobRules
;
};
}
});
/**
/**
* Checks if the storage description is valid or not.
* Checks if the storage description is valid or not.
...
@@ -70,13 +107,19 @@
...
@@ -70,13 +107,19 @@
* @param {object} description The description object.
* @param {object} description The description object.
* @return {boolean} true if ok, else false.
* @return {boolean} true if ok, else false.
*/
*/
that
.
validateStorageDescription
=
function
(
description
)
{
Object
.
defineProperty
(
that
,
"
validateStorageDescription
"
,{
return
jioNamespace
.
storage
(
description
,
my
).
isValid
();
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
};
function
(
description
)
{
return
that
.
storage
(
description
).
isValid
();
}
});
that
.
getJobArray
=
function
()
{
Object
.
defineProperty
(
that
,
"
getJobArray
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
()
{
return
jobManager
.
serialized
();
return
jobManager
.
serialized
();
};
}
});
priv
.
getParam
=
function
(
list
,
nodoc
)
{
priv
.
getParam
=
function
(
list
,
nodoc
)
{
var
param
=
{},
i
=
0
;
var
param
=
{},
i
=
0
;
...
@@ -110,33 +153,36 @@
...
@@ -110,33 +153,36 @@
priv
.
addJob
=
function
(
commandCreator
,
spec
)
{
priv
.
addJob
=
function
(
commandCreator
,
spec
)
{
jobManager
.
addJob
(
jobManager
.
addJob
(
job
({
storage
:
jioNamespace
.
storage
(
priv
.
storage_spec
,
my
),
job
({
storage
:
that
.
storage
(
priv
.
storage_spec
),
command
:
commandCreator
(
spec
,
my
)},
my
));
command
:
commandCreator
(
spec
)}
));
};
};
// /**
/**
// * Post a document.
* Post a document.
// * @method post
* @method post
// * @param {object} doc The document {"content":}.
* @param {object} doc The document {"content":}.
// * @param {object} options (optional) Contains some options:
* @param {object} options (optional) Contains some options:
// * - {number} max_retry The number max of retries, 0 = infinity.
* - {number} max_retry The number max of retries, 0 = infinity.
// * - {boolean} revs Include revision history of the document.
* - {boolean} revs Include revision history of the document.
// * - {boolean} revs_info Retreive the revisions.
* - {boolean} revs_info Retreive the revisions.
// * - {boolean} conflicts Retreive the conflict list.
* - {boolean} conflicts Retreive the conflict list.
// * @param {function} callback (optional) The callback(err,response).
* @param {function} callback (optional) The callback(err,response).
// * @param {function} error (optional) The callback on error, if this
* @param {function} error (optional) The callback on error, if this
// * callback is given in parameter, "callback" is changed as "success",
* callback is given in parameter, "callback" is changed as "success",
// * called on success.
* called on success.
// */
*/
// that.post = function() {
Object
.
defineProperty
(
that
,
"
post
"
,{
// var param = priv.getParam(arguments);
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
// param.options.max_retry = param.options.max_retry || 0;
function
()
{
// priv.addJob(postCommand,{
var
param
=
priv
.
getParam
(
arguments
);
// doc:param.doc,
param
.
options
.
max_retry
=
param
.
options
.
max_retry
||
0
;
// options:param.options,
priv
.
addJob
(
postCommand
,{
// callbacks:{success:param.success,error:param.error}
doc
:
param
.
doc
,
// });
options
:
param
.
options
,
// };
callbacks
:{
success
:
param
.
success
,
error
:
param
.
error
}
});
}
});
/**
/**
* Put a document.
* Put a document.
...
@@ -152,7 +198,9 @@
...
@@ -152,7 +198,9 @@
* callback is given in parameter, "callback" is changed as "success",
* callback is given in parameter, "callback" is changed as "success",
* called on success.
* called on success.
*/
*/
that
.
put
=
function
()
{
Object
.
defineProperty
(
that
,
"
put
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
()
{
var
param
=
priv
.
getParam
(
arguments
);
var
param
=
priv
.
getParam
(
arguments
);
param
.
options
.
max_retry
=
param
.
options
.
max_retry
||
0
;
param
.
options
.
max_retry
=
param
.
options
.
max_retry
||
0
;
priv
.
addJob
(
putCommand
,{
priv
.
addJob
(
putCommand
,{
...
@@ -160,7 +208,8 @@
...
@@ -160,7 +208,8 @@
options
:
param
.
options
,
options
:
param
.
options
,
callbacks
:{
success
:
param
.
success
,
error
:
param
.
error
}
callbacks
:{
success
:
param
.
success
,
error
:
param
.
error
}
});
});
};
}
});
/**
/**
* Get a document.
* Get a document.
...
@@ -178,7 +227,9 @@
...
@@ -178,7 +227,9 @@
* callback is given in parameter, "callback" is changed as "success",
* callback is given in parameter, "callback" is changed as "success",
* called on success.
* called on success.
*/
*/
that
.
get
=
function
()
{
Object
.
defineProperty
(
that
,
"
get
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
()
{
var
param
=
priv
.
getParam
(
arguments
);
var
param
=
priv
.
getParam
(
arguments
);
param
.
options
.
max_retry
=
param
.
options
.
max_retry
||
3
;
param
.
options
.
max_retry
=
param
.
options
.
max_retry
||
3
;
param
.
options
.
metadata_only
=
(
param
.
options
.
metadata_only
=
(
...
@@ -189,7 +240,8 @@
...
@@ -189,7 +240,8 @@
options
:
param
.
options
,
options
:
param
.
options
,
callbacks
:{
success
:
param
.
success
,
error
:
param
.
error
}
callbacks
:{
success
:
param
.
success
,
error
:
param
.
error
}
});
});
};
}
});
/**
/**
* Remove a document.
* Remove a document.
...
@@ -205,7 +257,9 @@
...
@@ -205,7 +257,9 @@
* callback is given in parameter, "callback" is changed as "success",
* callback is given in parameter, "callback" is changed as "success",
* called on success.
* called on success.
*/
*/
that
.
remove
=
function
()
{
Object
.
defineProperty
(
that
,
"
remove
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
()
{
var
param
=
priv
.
getParam
(
arguments
);
var
param
=
priv
.
getParam
(
arguments
);
param
.
options
.
max_retry
=
param
.
options
.
max_retry
||
0
;
param
.
options
.
max_retry
=
param
.
options
.
max_retry
||
0
;
priv
.
addJob
(
removeCommand
,{
priv
.
addJob
(
removeCommand
,{
...
@@ -213,7 +267,8 @@
...
@@ -213,7 +267,8 @@
options
:
param
.
options
,
options
:
param
.
options
,
callbacks
:{
success
:
param
.
success
,
error
:
param
.
error
}
callbacks
:{
success
:
param
.
success
,
error
:
param
.
error
}
});
});
};
}
});
/**
/**
* Get a list of documents.
* Get a list of documents.
...
@@ -230,7 +285,9 @@
...
@@ -230,7 +285,9 @@
* callback is given in parameter, "callback" is changed as "success",
* callback is given in parameter, "callback" is changed as "success",
* called on success.
* called on success.
*/
*/
that
.
allDocs
=
function
()
{
Object
.
defineProperty
(
that
,
"
allDocs
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
()
{
var
param
=
priv
.
getParam
(
arguments
,
'
no doc
'
);
var
param
=
priv
.
getParam
(
arguments
,
'
no doc
'
);
param
.
options
.
max_retry
=
param
.
options
.
max_retry
||
3
;
param
.
options
.
max_retry
=
param
.
options
.
max_retry
||
3
;
param
.
options
.
metadata_only
=
(
param
.
options
.
metadata_only
=
(
...
@@ -240,7 +297,8 @@
...
@@ -240,7 +297,8 @@
options
:
param
.
options
,
options
:
param
.
options
,
callbacks
:{
success
:
param
.
success
,
error
:
param
.
error
}
callbacks
:{
success
:
param
.
success
,
error
:
param
.
error
}
});
});
};
}
});
return
that
;
return
that
;
};
// End Class jio
};
// End Class jio
OfficeJS/src/jio/jioNamespace.js
View file @
dfebe7c8
var
jioNamespace
=
(
function
(
spec
,
my
)
{
var
storage_type_object
=
{
// -> 'key':constructorFunction
'
base
'
:
function
()
{}
// overidden by jio
};
var
jioNamespace
=
(
function
(
spec
)
{
var
that
=
{};
var
that
=
{};
spec
=
spec
||
{};
spec
=
spec
||
{};
my
=
my
||
{};
// Attributes //
// Attributes //
var
storage_type_o
=
{
// -> 'key':constructorFunction
'
base
'
:
storage
,
'
handler
'
:
storageHandler
};
// Methods //
// Methods //
/**
* Returns a storage from a storage description.
* @method storage
* @param {object} spec The specifications.
* @param {object} my The protected object.
* @param {string} forcetype Force storage type
* @return {object} The storage object.
*/
that
.
storage
=
function
(
spec
,
my
,
forcetype
)
{
spec
=
spec
||
{};
my
=
my
||
{};
var
type
=
forcetype
||
spec
.
type
||
'
base
'
;
if
(
!
storage_type_o
[
type
])
{
throw
invalidStorageType
({
type
:
type
,
message
:
'
Storage does not exists.
'
});
}
return
storage_type_o
[
type
](
spec
,
my
);
};
/**
/**
* Creates a new jio instance.
* Creates a new jio instance.
* @method newJio
* @method newJio
...
@@ -39,14 +18,19 @@ var jioNamespace = (function(spec, my) {
...
@@ -39,14 +18,19 @@ var jioNamespace = (function(spec, my) {
* - {string} spec.storage.applicationname: The application name
* - {string} spec.storage.applicationname: The application name
* @return {object} The new Jio instance.
* @return {object} The new Jio instance.
*/
*/
that
.
newJio
=
function
(
spec
)
{
Object
.
defineProperty
(
that
,
"
newJio
"
,{
var
storage
=
spec
;
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
(
spec
)
{
var
storage
=
spec
,
instance
=
null
;
if
(
typeof
storage
===
'
string
'
)
{
if
(
typeof
storage
===
'
string
'
)
{
storage
=
JSON
.
parse
(
storage
);
storage
=
JSON
.
parse
(
storage
);
}
}
storage
=
storage
||
{
type
:
'
base
'
};
storage
=
storage
||
{
type
:
'
base
'
};
return
jio
(
spec
);
instance
=
jio
(
spec
);
};
instance
.
start
();
return
instance
;
}
});
/**
/**
* Add a storage type to jio.
* Add a storage type to jio.
...
@@ -54,13 +38,16 @@ var jioNamespace = (function(spec, my) {
...
@@ -54,13 +38,16 @@ var jioNamespace = (function(spec, my) {
* @param {string} type The storage type
* @param {string} type The storage type
* @param {function} constructor The associated constructor
* @param {function} constructor The associated constructor
*/
*/
that
.
addStorageType
=
function
(
type
,
constructor
)
{
Object
.
defineProperty
(
that
,
"
addStorageType
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
(
type
,
constructor
)
{
constructor
=
constructor
||
function
(){
return
null
;};
constructor
=
constructor
||
function
(){
return
null
;};
if
(
storage_type_o
[
type
])
{
if
(
storage_type_object
[
type
])
{
throw
invalidStorageType
({
type
:
type
,
message
:
'
Already known.
'
});
throw
invalidStorageType
({
type
:
type
,
message
:
'
Already known.
'
});
}
}
storage_type_o
[
type
]
=
constructor
;
storage_type_object
[
type
]
=
constructor
;
};
}
});
return
that
;
return
that
;
}());
}());
OfficeJS/src/jio/jobs/job.js
View file @
dfebe7c8
var
job
=
function
(
spec
,
my
)
{
var
job
=
function
(
spec
)
{
var
that
=
{};
var
that
=
{};
spec
=
spec
||
{};
spec
=
spec
||
{};
my
=
my
||
{};
// Attributes //
// Attributes //
var
priv
=
{};
var
priv
=
{};
priv
.
id
=
my
.
jobIdHandler
.
nextId
();
priv
.
id
=
jobIdHandler
.
nextId
();
priv
.
command
=
spec
.
command
;
priv
.
command
=
spec
.
command
;
priv
.
storage
=
spec
.
storage
;
priv
.
storage
=
spec
.
storage
;
priv
.
status
=
initialStatus
();
priv
.
status
=
initialStatus
();
...
@@ -76,7 +75,7 @@ var job = function(spec, my) {
...
@@ -76,7 +75,7 @@ var job = function(spec, my) {
*/
*/
that
.
waitForJob
=
function
(
job
)
{
that
.
waitForJob
=
function
(
job
)
{
if
(
priv
.
status
.
getLabel
()
!==
'
wait
'
)
{
if
(
priv
.
status
.
getLabel
()
!==
'
wait
'
)
{
priv
.
status
=
waitStatus
({}
,
my
);
priv
.
status
=
waitStatus
({});
}
}
priv
.
status
.
waitForJob
(
job
);
priv
.
status
.
waitForJob
(
job
);
};
};
...
@@ -99,7 +98,7 @@ var job = function(spec, my) {
...
@@ -99,7 +98,7 @@ var job = function(spec, my) {
*/
*/
that
.
waitForTime
=
function
(
ms
)
{
that
.
waitForTime
=
function
(
ms
)
{
if
(
priv
.
status
.
getLabel
()
!==
'
wait
'
)
{
if
(
priv
.
status
.
getLabel
()
!==
'
wait
'
)
{
priv
.
status
=
waitStatus
({}
,
my
);
priv
.
status
=
waitStatus
({});
}
}
priv
.
status
.
waitForTime
(
ms
);
priv
.
status
.
waitForTime
(
ms
);
};
};
...
@@ -124,7 +123,7 @@ var job = function(spec, my) {
...
@@ -124,7 +123,7 @@ var job = function(spec, my) {
that
.
notAccepted
=
function
()
{
that
.
notAccepted
=
function
()
{
priv
.
command
.
onEndDo
(
function
()
{
priv
.
command
.
onEndDo
(
function
()
{
priv
.
status
=
failStatus
();
priv
.
status
=
failStatus
();
my
.
jobManager
.
terminateJob
(
that
);
jobManager
.
terminateJob
(
that
);
});
});
priv
.
command
.
error
({
priv
.
command
.
error
({
status
:
11
,
statusText
:
'
Not Accepted
'
,
error
:
'
not_accepted
'
,
status
:
11
,
statusText
:
'
Not Accepted
'
,
error
:
'
not_accepted
'
,
...
@@ -171,7 +170,7 @@ var job = function(spec, my) {
...
@@ -171,7 +170,7 @@ var job = function(spec, my) {
});
});
priv
.
command
.
onEndDo
(
function
(
status
)
{
priv
.
command
.
onEndDo
(
function
(
status
)
{
priv
.
status
=
status
;
priv
.
status
=
status
;
my
.
jobManager
.
terminateJob
(
that
);
jobManager
.
terminateJob
(
that
);
});
});
priv
.
command
.
execute
(
priv
.
storage
);
priv
.
command
.
execute
(
priv
.
storage
);
};
};
...
...
OfficeJS/src/jio/jobs/jobIdHandler.js
View file @
dfebe7c8
var
jobIdHandler
=
(
function
(
spec
,
my
)
{
var
jobIdHandler
=
(
function
(
spec
)
{
var
that
=
{};
var
that
=
{};
spec
=
spec
||
{};
spec
=
spec
||
{};
my
=
my
||
{};
// Attributes //
// Attributes //
var
id
=
0
;
var
id
=
0
;
// Methods //
// Methods //
...
...
OfficeJS/src/jio/jobs/jobManager.js
View file @
dfebe7c8
var
jobManager
=
(
function
(
spec
,
my
)
{
var
jobManager
=
(
function
(
spec
)
{
var
that
=
{};
var
that
=
{};
spec
=
spec
||
{};
spec
=
spec
||
{};
my
=
my
||
{};
// Attributes //
// Attributes //
var
job_array_name
=
'
jio/job_array
'
;
var
job_array_name
=
'
jio/job_array
'
;
var
priv
=
{};
var
priv
=
{};
...
@@ -10,9 +9,6 @@ var jobManager = (function(spec, my) {
...
@@ -10,9 +9,6 @@ var jobManager = (function(spec, my) {
priv
.
interval
=
200
;
priv
.
interval
=
200
;
priv
.
job_array
=
[];
priv
.
job_array
=
[];
my
.
jobManager
=
that
;
my
.
jobIdHandler
=
jobIdHandler
;
// Methods //
// Methods //
/**
/**
* Get the job array name in the localStorage
* Get the job array name in the localStorage
...
@@ -140,11 +136,11 @@ var jobManager = (function(spec, my) {
...
@@ -140,11 +136,11 @@ var jobManager = (function(spec, my) {
var
i
,
jio_job_array
;
var
i
,
jio_job_array
;
jio_job_array
=
LocalOrCookieStorage
.
getItem
(
'
jio/job_array/
'
+
id
)
||
[];
jio_job_array
=
LocalOrCookieStorage
.
getItem
(
'
jio/job_array/
'
+
id
)
||
[];
for
(
i
=
0
;
i
<
jio_job_array
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
jio_job_array
.
length
;
i
+=
1
)
{
var
command_object
=
command
(
jio_job_array
[
i
].
command
,
my
);
var
command_object
=
command
(
jio_job_array
[
i
].
command
);
if
(
command_object
.
canBeRestored
())
{
if
(
command_object
.
canBeRestored
())
{
that
.
addJob
(
job
(
that
.
addJob
(
job
(
{
storage
:
jio
Namespace
.
storage
(
jio_job_array
[
i
].
storage
,
my
),
{
storage
:
jio
.
storage
(
jio_job_array
[
i
].
storage
),
command
:
command_object
}
,
my
));
command
:
command_object
}));
}
}
}
}
};
};
...
...
OfficeJS/src/jio/jobs/jobRules.js
View file @
dfebe7c8
var
jobRules
=
(
function
(
spec
,
my
)
{
var
jobRules
=
(
function
(
spec
)
{
var
that
=
{};
var
that
=
{};
// Attributes //
// Attributes //
var
priv
=
{};
var
priv
=
{};
priv
.
compare
=
{};
priv
.
compare
=
{};
priv
.
action
=
{};
priv
.
action
=
{};
that
.
eliminate
=
function
()
{
return
'
eliminate
'
;
};
Object
.
defineProperty
(
that
,
"
eliminate
"
,{
that
.
update
=
function
()
{
return
'
update
'
;
};
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
that
.
dontAccept
=
function
()
{
return
'
dont accept
'
;
};
function
()
{
return
'
eliminate
'
;
}
that
.
wait
=
function
()
{
return
'
wait
'
;
};
});
that
.
none
=
function
()
{
return
'
none
'
;
};
Object
.
defineProperty
(
that
,
"
update
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
()
{
return
'
update
'
;
}
});
Object
.
defineProperty
(
that
,
"
dontAccept
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
()
{
return
'
dont accept
'
;
}
});
Object
.
defineProperty
(
that
,
"
wait
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
()
{
return
'
wait
'
;
}
});
Object
.
defineProperty
(
that
,
"
none
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
()
{
return
'
none
'
;
}
});
that
.
default_action
=
that
.
none
;
that
.
default_action
=
that
.
none
;
that
.
default_compare
=
function
(
job1
,
job2
)
{
that
.
default_compare
=
function
(
job1
,
job2
)
{
return
(
job1
.
getCommand
().
getDocId
()
===
return
(
job1
.
getCommand
().
getDocId
()
===
...
@@ -70,12 +85,15 @@ var jobRules = (function(spec, my) {
...
@@ -70,12 +85,15 @@ var jobRules = (function(spec, my) {
* @param job2 {object} The new job.
* @param job2 {object} The new job.
* @return {string} The action string.
* @return {string} The action string.
*/
*/
that
.
validateJobAccordingToJob
=
function
(
job1
,
job2
)
{
Object
.
defineProperty
(
that
,
"
validateJobAccordingToJob
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
(
job1
,
job2
)
{
if
(
priv
.
canCompare
(
job1
,
job2
))
{
if
(
priv
.
canCompare
(
job1
,
job2
))
{
return
{
action
:
priv
.
getAction
(
job1
,
job2
),
job
:
job1
};
return
{
action
:
priv
.
getAction
(
job1
,
job2
),
job
:
job1
};
}
}
return
{
action
:
that
.
default_action
(
job1
,
job2
),
job
:
job1
};
return
{
action
:
that
.
default_action
(
job1
,
job2
),
job
:
job1
};
};
}
});
/**
/**
* Adds a rule the action rules.
* Adds a rule the action rules.
...
@@ -85,12 +103,16 @@ var jobRules = (function(spec, my) {
...
@@ -85,12 +103,16 @@ var jobRules = (function(spec, my) {
* @param method2 {string} The action label from the new job.
* @param method2 {string} The action label from the new job.
* @param rule {function} The rule that return an action string.
* @param rule {function} The rule that return an action string.
*/
*/
that
.
addActionRule
=
function
(
method1
,
ongoing
,
method2
,
rule
)
{
Object
.
defineProperty
(
that
,
"
addActionRule
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
(
method1
,
ongoing
,
method2
,
rule
)
{
var
ongoing_s
=
(
ongoing
?
'
on going
'
:
'
not on going
'
);
var
ongoing_s
=
(
ongoing
?
'
on going
'
:
'
not on going
'
);
priv
.
action
[
method1
]
=
priv
.
action
[
method1
]
||
{};
priv
.
action
[
method1
]
=
priv
.
action
[
method1
]
||
{};
priv
.
action
[
method1
][
ongoing_s
]
=
priv
.
action
[
method1
][
ongoing_s
]
||
{};
priv
.
action
[
method1
][
ongoing_s
]
=
priv
.
action
[
method1
][
ongoing_s
]
||
{};
priv
.
action
[
method1
][
ongoing_s
][
method2
]
=
rule
;
priv
.
action
[
method1
][
ongoing_s
][
method2
]
=
rule
;
};
}
});
/**
/**
* Adds a rule the compare rules.
* Adds a rule the compare rules.
...
@@ -100,10 +122,13 @@ var jobRules = (function(spec, my) {
...
@@ -100,10 +122,13 @@ var jobRules = (function(spec, my) {
* @param rule {function} The rule that return a boolean
* @param rule {function} The rule that return a boolean
* - true if job1 and job2 can be compared, else false.
* - true if job1 and job2 can be compared, else false.
*/
*/
that
.
addCompareRule
=
function
(
method1
,
method2
,
rule
)
{
Object
.
defineProperty
(
that
,
"
addCompareRule
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
(
method1
,
method2
,
rule
)
{
priv
.
compare
[
method1
]
=
priv
.
compare
[
method1
]
||
{};
priv
.
compare
[
method1
]
=
priv
.
compare
[
method1
]
||
{};
priv
.
compare
[
method1
][
method2
]
=
rule
;
priv
.
compare
[
method1
][
method2
]
=
rule
;
};
}
});
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
// Adding some rules
// Adding some rules
...
...
OfficeJS/src/jio/storages/storage.js
View file @
dfebe7c8
...
@@ -7,12 +7,12 @@ var storage = function(spec, my) {
...
@@ -7,12 +7,12 @@ var storage = function(spec, my) {
priv
.
type
=
spec
.
type
||
''
;
priv
.
type
=
spec
.
type
||
''
;
// Methods //
// Methods //
that
.
getType
=
function
()
{
Object
.
defineProperty
(
that
,
"
getType
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
()
{
return
priv
.
type
;
return
priv
.
type
;
};
}
that
.
setType
=
function
(
type
)
{
});
priv
.
type
=
type
;
};
/**
/**
* Execute the command on this storage.
* Execute the command on this storage.
...
@@ -41,7 +41,8 @@ var storage = function(spec, my) {
...
@@ -41,7 +41,8 @@ var storage = function(spec, my) {
that
.
validate
=
function
()
{
that
.
validate
=
function
()
{
var
mess
=
that
.
validateState
();
var
mess
=
that
.
validateState
();
if
(
mess
)
{
if
(
mess
)
{
that
.
error
({
status
:
0
,
statusText
:
'
Invalid Storage
'
,
that
.
error
({
status
:
0
,
statusText
:
'
Invalid Storage
'
,
error
:
'
invalid_storage
'
,
error
:
'
invalid_storage
'
,
message
:
mess
,
reason
:
mess
});
message
:
mess
,
reason
:
mess
});
return
false
;
return
false
;
...
@@ -86,5 +87,31 @@ var storage = function(spec, my) {
...
@@ -86,5 +87,31 @@ var storage = function(spec, my) {
that
.
error
=
function
()
{};
that
.
error
=
function
()
{};
that
.
end
=
function
()
{};
// terminate the current job.
that
.
end
=
function
()
{};
// terminate the current job.
priv
.
newCommand
=
function
(
method
,
spec
)
{
var
o
=
spec
||
{};
o
.
label
=
method
;
return
command
(
o
,
my
);
};
that
.
addJob
=
function
(
method
,
storage_spec
,
doc
,
option
,
success
,
error
)
{
var
command_opt
=
{
options
:
option
,
callbacks
:{
success
:
success
,
error
:
error
}
};
if
(
doc
)
{
if
(
method
===
'
get
'
)
{
command_opt
.
docid
=
doc
;
}
else
{
command_opt
.
doc
=
doc
;
}
}
jobManager
.
addJob
(
job
({
storage
:
my
.
storage
(
storage_spec
||
{}),
command
:
priv
.
newCommand
(
method
,
command_opt
)
},
my
)
);
};
return
that
;
return
that
;
};
};
OfficeJS/src/jio/storages/storageHandler.js
deleted
100644 → 0
View file @
8b66f91e
var
storageHandler
=
function
(
spec
,
my
)
{
spec
=
spec
||
{};
my
=
my
||
{};
var
that
=
storage
(
spec
,
my
),
priv
=
{};
priv
.
newCommand
=
function
(
method
,
spec
)
{
var
o
=
spec
||
{};
o
.
label
=
method
;
return
command
(
o
,
my
);
};
that
.
addJob
=
function
(
method
,
storage_spec
,
doc
,
option
,
success
,
error
)
{
var
command_opt
=
{
options
:
option
,
callbacks
:{
success
:
success
,
error
:
error
}
};
if
(
doc
)
{
if
(
method
===
'
get
'
)
{
command_opt
.
docid
=
doc
;
}
else
{
command_opt
.
doc
=
doc
;
}
}
my
.
jobManager
.
addJob
(
job
({
storage
:
jioNamespace
.
storage
(
storage_spec
||
{}),
command
:
priv
.
newCommand
(
method
,
command_opt
)
},
my
)
);
};
return
that
;
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment