Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
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
Aurélien Vermylen
jio
Commits
52c0fa78
Commit
52c0fa78
authored
Feb 24, 2017
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coding style + use of clearroad code
parent
3c0a2748
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
15 deletions
+91
-15
nodejs/node_modules/clearroad.js
nodejs/node_modules/clearroad.js
+56
-0
nodejs/server.js
nodejs/server.js
+35
-15
No files found.
nodejs/node_modules/clearroad.js
0 → 100644
View file @
52c0fa78
function
ClearRoadBillingPeriodRegistration
()
{
if
(
!
(
this
instanceof
ClearRoadBillingPeriodRegistration
))
{
return
new
ClearRoadBillingPeriodRegistration
();
}
// cleanup the local storage before each run
var
DATABASE
=
"
cr-billing-period-registration
"
;
// indexedDB.deleteDatabase('jio:' + DATABASE);
this
.
jio
=
jIO
.
createJIO
({
type
:
"
replicate
"
,
use_remote_post
:
false
,
conflict_handling
:
1
,
check_local_modification
:
false
,
check_local_creation
:
true
,
check_local_deletion
:
false
,
check_remote_modification
:
false
,
check_remote_creation
:
false
,
check_remote_deletion
:
false
,
local_sub_storage
:
{
type
:
"
mapping
"
,
map_id
:
[
"
equalSubProperty
"
,
"
reference
"
],
sub_storage
:
{
type
:
"
query
"
,
sub_storage
:
{
type
:
"
uuid
"
,
sub_storage
:
{
type
:
"
memory
"
,
database
:
DATABASE
}
}
}
},
remote_sub_storage
:
{
type
:
"
mapping
"
,
map_id
:
[
"
equalSubProperty
"
,
"
reference
"
],
mapping_dict
:
{
"
portal_type
"
:
[
"
equalValue
"
,
"
Billing Period Message
"
],
"
parent_relative_url
"
:
[
"
equalValue
"
,
"
billing_period_message_module
"
]},
sub_storage
:
{
type
:
"
erp5
"
,
url
:
"
https://softinst69465.host.vifib.net/erp5/web_site_module/hateoas
"
,
default_view_reference
:
"
jio_view
"
}
}
});
}
ClearRoadBillingPeriodRegistration
.
prototype
=
new
ClearRoadBillingPeriodRegistration
();
ClearRoadBillingPeriodRegistration
.
prototype
.
constructor
=
ClearRoadBillingPeriodRegistration
;
ClearRoadBillingPeriodRegistration
.
prototype
.
post
=
function
(){
return
this
.
jio
.
post
.
apply
(
this
.
jio
,
arguments
);
};
ClearRoadBillingPeriodRegistration
.
prototype
.
sync
=
function
(){
return
this
.
jio
.
repair
.
apply
(
this
.
jio
,
arguments
);
};
module
.
exports
=
ClearRoadBillingPeriodRegistration
nodejs/server.js
View file @
52c0fa78
// server.js
// where your node app starts
URI
=
require
(
"
uri-js
"
);
RSVP
=
require
(
'
rsvp
'
);
UriTemplate
=
require
(
"
uritemplate
"
);
moment
=
require
(
'
moment
'
);
navigator
=
require
(
'
navigator
'
);
Rusha
=
require
(
'
rusha
'
);
FormData
=
require
(
'
formdata
'
);
atob
=
require
(
'
atob
'
);
FileReader
=
require
(
"
FileReader
"
);
Blob
=
require
(
"
Blob
"
);
localStorage
=
require
(
'
node-localstorage
'
);
window
=
global
;
sessionStorage
=
{};
"
use strict
"
global
.
URI
=
require
(
"
uri-js
"
);
global
.
RSVP
=
require
(
'
rsvp
'
);
global
.
UriTemplate
=
require
(
"
uritemplate
"
);
global
.
moment
=
require
(
'
moment
'
);
global
.
navigator
=
require
(
'
navigator
'
);
global
.
Rusha
=
require
(
'
rusha
'
);
global
.
FormData
=
require
(
'
formdata
'
);
global
.
atob
=
require
(
'
atob
'
);
global
.
FileReader
=
require
(
"
FileReader
"
);
global
.
Blob
=
require
(
"
Blob
"
);
global
.
localStorage
=
require
(
'
node-localstorage
'
);
global
.
btoa
=
require
(
'
btoa
'
);
global
.
XMLHttpRequest
=
require
(
'
w3c-xmlhttprequest
'
).
XMLHttpRequest
global
.
window
=
global
;
global
.
sessionStorage
=
{};
var
jIO
=
require
(
'
jio
'
);
var
ClearRoadBillingPeriodRegistration
=
require
(
"
clearroad
"
);
var
cr
=
new
ClearRoadBillingPeriodRegistration
();
console
.
log
(
"
init
"
);
cr
.
post
({
"
reference
"
:
"
Q42
"
,
"
start_date
"
:
"
2017-02-01T00:00:00Z
"
,
"
stop_date
"
:
"
2017-03-01T00:00:00Z
"
}).
push
(
function
(){
console
.
log
(
"
start sync...
"
);
return
cr
.
sync
();
}).
push
(
function
(){
console
.
info
(
"
Sync done
"
);
},
function
(
error
)
{
console
.
info
(
"
Error :
"
);
console
.
warn
(
error
.
stack
)
console
.
warn
(
error
);
});
// init project
...
...
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