Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio-main
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hardik Juneja
jio-main
Commits
2784ba5a
Commit
2784ba5a
authored
Dec 21, 2012
by
Sven Franck
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'attachments' of
https://git.erp5.org/repos/jio
into attachments
parents
1771adbe
4b3851ae
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
31 deletions
+34
-31
src/jio/commands/command.js
src/jio/commands/command.js
+1
-5
src/jio/commands/putAttachmentCommand.js
src/jio/commands/putAttachmentCommand.js
+0
-2
src/jio/jio.intro.js
src/jio/jio.intro.js
+0
-17
src/jio/jio.outro.js
src/jio/jio.outro.js
+1
-6
src/jio/storages/storage.js
src/jio/storages/storage.js
+32
-1
No files found.
src/jio/commands/command.js
View file @
2784ba5a
...
...
@@ -21,15 +21,11 @@ var command = function(spec, my) {
priv
.
tried
=
0
;
priv
.
doc
=
spec
.
doc
||
{};
priv
.
doc
.
_id
=
priv
.
doc
.
_id
||
generateUuid
()
;
priv
.
doc
.
_id
=
priv
.
doc
.
_id
;
priv
.
docid
=
spec
.
docid
||
''
;
// xxx fixed spec.content to spec.doc.content for PUTATTACHMENT
// xxx need extra check for GET, otherwise spec.doc is undefined
console
.
log
(
"
COMMAND
"
);
console
.
log
(
spec
);
console
.
log
(
spec
.
doc
);
console
.
log
(
spec
.
doc
.
content
);
priv
.
content
=
spec
.
doc
===
undefined
?
undefined
:
typeof
spec
.
doc
.
content
===
'
string
'
?
spec
.
doc
.
content
:
...
...
src/jio/commands/putAttachmentCommand.js
View file @
2784ba5a
...
...
@@ -11,8 +11,6 @@ var putAttachmentCommand = function(spec, my) {
that
.
executeOn
=
function
(
storage
)
{
storage
.
putAttachment
(
that
);
};
console
.
log
(
"
putAttachmentCommand
"
);
console
.
log
(
typeof
that
.
getContent
()
);
that
.
validateState
=
function
()
{
if
(
typeof
that
.
getContent
()
!==
'
string
'
)
{
that
.
error
({
...
...
src/jio/jio.intro.js
View file @
2784ba5a
var
jio
=
function
(
spec
)
{
var
generateUuid
=
function
()
{
var
S4
=
function
()
{
var
i
,
string
=
Math
.
floor
(
Math
.
random
()
*
0x10000
/* 65536 */
).
toString
(
16
);
for
(
i
=
string
.
length
;
i
<
4
;
i
+=
1
)
{
string
=
'
0
'
+
string
;
}
return
string
;
};
return
S4
()
+
S4
()
+
"
-
"
+
S4
()
+
"
-
"
+
S4
()
+
"
-
"
+
S4
()
+
"
-
"
+
S4
()
+
S4
()
+
S4
();
};
src/jio/jio.outro.js
View file @
2784ba5a
...
...
@@ -147,11 +147,6 @@
};
priv
.
parametersToObject
=
function
(
list
,
default_options
)
{
console
.
log
(
"
aloha
"
);
console
.
log
(
"
what do we have
"
);
console
.
log
(
list
);
console
.
log
(
default_options
);
var
k
,
i
=
0
,
callbacks
=
[],
param
=
{
options
:{}};
for
(
i
=
0
;
i
<
list
.
length
;
i
+=
1
)
{
if
(
typeof
list
[
i
]
===
'
object
'
)
{
...
...
@@ -353,7 +348,7 @@
{
max_retry
:
0
}
);
priv
.
addJob
(
putAttachmentCommand
,{
priv
.
addJob
(
putAttachmentCommand
,{
doc
:{
_id
:
id
,
content
:
doc
,
_rev
:
rev
,
mimetype
:
mimetype
},
options
:
param
.
options
,
callbacks
:{
success
:
param
.
success
,
error
:
param
.
error
}
...
...
src/jio/storages/storage.js
View file @
2784ba5a
...
...
@@ -14,6 +14,28 @@ var storage = function(spec, my) {
}
});
/**
* Generate a new uuid
* @method generateUuid
* @return {string} The new uuid
*/
that
.
generateUuid
=
function
()
{
var
S4
=
function
()
{
var
i
,
string
=
Math
.
floor
(
Math
.
random
()
*
0x10000
/* 65536 */
).
toString
(
16
);
for
(
i
=
string
.
length
;
i
<
4
;
i
+=
1
)
{
string
=
'
0
'
+
string
;
}
return
string
;
};
return
S4
()
+
S4
()
+
"
-
"
+
S4
()
+
"
-
"
+
S4
()
+
"
-
"
+
S4
()
+
"
-
"
+
S4
()
+
S4
()
+
S4
();
};
/**
* Generates a hash code of a string
* @method hashCode
...
...
@@ -232,6 +254,15 @@ var storage = function(spec, my) {
});
};
that
.
_putAttachment
=
function
()
{
setTimeout
(
function
()
{
that
.
error
(
that
.
createErrorObject
(
0
,
"
Not Implemented Yet
"
,
"
\"
PutAttachment
\"
command is not implemented
"
));
});
};
that
.
_get
=
function
()
{
setTimeout
(
function
()
{
that
.
error
(
that
.
createErrorObject
(
...
...
@@ -240,7 +271,7 @@ var storage = function(spec, my) {
});
};
that
.
_all
d
ocs
=
function
()
{
that
.
_all
D
ocs
=
function
()
{
setTimeout
(
function
()
{
that
.
error
(
that
.
createErrorObject
(
0
,
"
Not Implemented Yet
"
,
...
...
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