Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
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
dream
Commits
58ac2d20
Commit
58ac2d20
authored
Dec 05, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
expandSchema method updated to read definitions
parent
a13d02eb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
12 deletions
+60
-12
dream/platform/src/jsplumb/jsplumb.js
dream/platform/src/jsplumb/jsplumb.js
+60
-12
No files found.
dream/platform/src/jsplumb/jsplumb.js
View file @
58ac2d20
...
...
@@ -107,7 +107,7 @@
});
console
.
log
(
"
getNODEID 2
"
);
console
.
log
(
node_id
);
console
.
log
(
gadget
.
props
.
data
.
graph
.
main_graph
.
node
);
console
.
log
(
gadget
.
props
.
data
.
graph
.
node
);
return
node_id
;
}
...
...
@@ -116,8 +116,8 @@
// Generate a node id
var
n
=
1
,
class_def
=
gadget
.
props
.
data
.
class_definition
[
element
.
_class
],
id
=
class_def
.
allOf
[
1
].
properties
.
id
.
_
default
||
element
.
_class
;
while
(
gadget
.
props
.
data
.
graph
.
main_graph
.
node
[
id
+
n
]
!==
undefined
)
{
id
=
class_def
.
allOf
[
1
].
properties
.
id
.
default
||
element
.
_class
;
while
(
gadget
.
props
.
data
.
graph
.
node
[
id
+
n
]
!==
undefined
)
{
n
+=
1
;
}
console
.
log
(
"
generateNODEID 2
"
);
...
...
@@ -416,10 +416,13 @@
// references
// TODO: check for a library that would provide full support
console
.
log
(
"
expandSCHEMA 1
"
);
var
property
,
referenced
,
i
,
var
property
,
referenced
,
i
,
j
,
len
,
expanded_class_definition
=
{
properties
:
class_definition
.
properties
||
{}},
ref_word_list
,
ref_word
;
ref_word_list
,
ref_word
,
ref_definition_list
,
ref_definition_word
,
ref_definition
,
sub_ref_def
,
sub_ref_def_list
,
sub_ref_def_word
,
sub_ref_def_root
;
if
(
class_definition
.
allOf
)
{
for
(
i
=
0
;
i
<
class_definition
.
allOf
.
length
;
i
+=
1
)
{
referenced
=
class_definition
.
allOf
[
i
];
...
...
@@ -430,10 +433,54 @@
full_schema
.
class_definition
[
ref_word
],
full_schema
);
}
console
.
log
(
full_schema
.
class_definition
.
definitions
);
if
(
referenced
.
properties
)
{
console
.
log
(
"
[[[[[[[[[[]]]]]]]]]]
"
);
console
.
log
(
referenced
.
properties
);
for
(
property
in
referenced
.
properties
)
{
if
(
referenced
.
properties
.
hasOwnProperty
(
property
))
{
if
(
referenced
.
properties
[
property
].
type
)
{
if
(
referenced
.
properties
[
property
].
type
||
referenced
.
properties
[
property
].
$ref
)
{
console
.
log
(
"
..
"
);
console
.
log
(
property
);
if
(
referenced
.
properties
[
property
].
$ref
)
{
ref_definition_list
=
referenced
.
properties
[
property
].
$ref
.
split
(
"
/
"
);
ref_definition_word
=
ref_definition_list
[
ref_definition_list
.
length
-
1
];
ref_definition
=
full_schema
.
class_definition
.
definitions
[
ref_definition_word
];
console
.
log
(
"
(((((((())))))))
"
);
console
.
log
(
ref_definition
);
if
(
ref_definition
.
allOf
)
{
if
(
ref_definition
.
allOf
[
1
].
oneOf
)
{
len
=
ref_definition
.
allOf
[
1
].
oneOf
.
length
-
1
;
for
(
j
=
0
;
j
<=
len
;
j
+=
1
)
{
console
.
log
(
"
---------
"
+
j
);
console
.
log
(
ref_definition
.
allOf
[
1
].
oneOf
[
j
]);
if
(
ref_definition
.
allOf
[
1
]
.
oneOf
[
j
].
$ref
)
{
sub_ref_def_list
=
ref_definition
.
allOf
[
1
]
.
oneOf
[
j
].
$ref
.
split
(
"
/
"
);
console
.
log
(
"
>>>>>>
"
);
sub_ref_def_word
=
sub_ref_def_list
[
sub_ref_def_list
.
length
-
1
];
sub_ref_def_root
=
sub_ref_def_list
[
sub_ref_def_list
.
length
-
2
];
sub_ref_def
=
full_schema
.
class_definition
.
definitions
[
sub_ref_def_root
][
sub_ref_def_word
];
console
.
log
(
sub_ref_def
);
ref_definition
.
allOf
[
1
].
oneOf
[
j
]
=
sub_ref_def
;
}
}
}
}
expanded_class_definition
.
properties
[
property
]
=
ref_definition
;
console
.
log
(
"
for property
"
+
property
+
"
, definition:
"
);
console
.
log
(
ref_definition
);
}
else
{
expanded_class_definition
.
properties
[
property
]
=
referenced
.
properties
[
property
];
}
...
...
@@ -442,7 +489,9 @@
}
}
}
console
.
log
(
"
expandSCHEMA 1
"
);
}
console
.
log
(
"
expandSCHEMA 2
"
);
console
.
log
(
expanded_class_definition
);
return
expanded_class_definition
;
}
...
...
@@ -548,7 +597,6 @@
function
openNodeEditionDialog
(
gadget
,
element
)
{
console
.
log
(
"
openNODEDIALOG 1
"
);
console
.
log
(
class_definition
);
var
node_id
=
getNodeId
(
gadget
,
element
.
id
),
node_data
=
gadget
.
props
.
data
.
graph
.
node
[
node_id
],
node_edit_popup
=
$
(
gadget
.
props
.
element
).
find
(
'
#popup-edit-template
'
),
...
...
@@ -581,7 +629,7 @@
console
.
log
(
"
openNODEDIALOG 1.35
"
);
console
.
log
(
node_edit_popup
);
console
.
log
(
node_edit_popup
.
find
(
"
.node_class
"
));
console
.
log
(
gadget
.
props
.
data
.
graph
.
main_graph
.
node
);
console
.
log
(
gadget
.
props
.
data
.
graph
.
node
);
console
.
log
(
node_data
);
console
.
log
(
node_edit_popup
.
find
(
"
.node_class
"
).
text
(
node_data
.
_class
));
// Set the name of the popup to the node class
...
...
@@ -911,7 +959,7 @@
$
.
each
(
this
.
props
.
data
.
graph
.
edge
,
function
(
key
,
value
)
{
addEdge
(
gadget
,
key
,
value
);
});
console
.
log
(
"
startservice WORKFLOW EDITOR
2
"
);
console
.
log
(
"
startservice WORKFLOW EDITOR
7
"
);
return
RSVP
.
all
([
waitForDrop
(
gadget
),
...
...
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