Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OBITools3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OBITools
OBITools3
Commits
b1090574
Commit
b1090574
authored
Nov 07, 2018
by
Celine Mercier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
View import: associated column informations are now correctly updated
with the new versions
parent
8faabd3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
1 deletion
+45
-1
src/obidms.c
src/obidms.c
+45
-1
No files found.
src/obidms.c
View file @
b1090574
...
...
@@ -1526,7 +1526,9 @@ int obi_import_view(const char* dms_path_1, const char* dms_path_2, const char*
Obiview_p
view_1
;
Obiview_p
view_2
;
obiversion_t
new_version
;
int
i
;
int
i
,
j
;
OBIDMS_column_header_p
header
=
NULL
;
OBIDMS_column_header_p
header_2
=
NULL
;
dms_1
=
obi_open_dms
(
dms_path_1
);
if
(
dms_1
==
NULL
)
...
...
@@ -1606,6 +1608,48 @@ int obi_import_view(const char* dms_path_1, const char* dms_path_2, const char*
}
}
// Go through columns again to update associated columns
for
(
i
=
0
;
i
<
(
view_1
->
infos
->
column_count
);
i
++
)
{
header
=
obi_column_get_header_from_name
(
dms_1
,
((((
view_1
->
infos
)
->
column_references
)[
i
]).
column_refs
).
column_name
,
((((
view_1
->
infos
)
->
column_references
)[
i
]).
column_refs
).
version
);
if
(
header
==
NULL
)
{
obidebug
(
1
,
"
\n
Error opening a column header while importing a view"
);
return
-
1
;
}
if
(
header
->
returned_data_type
==
OBI_QUAL
)
// TODO maybe there should be a bool in column headers
{
// Look for the index of the associated column in the list
for
(
j
=
0
;
j
<
(
view_1
->
infos
->
column_count
);
j
++
)
{
if
((
strcmp
((
header
->
associated_column
).
column_name
,
((((
view_1
->
infos
)
->
column_references
)[
j
]).
column_refs
).
column_name
)
==
0
)
&&
((
header
->
associated_column
).
version
==
((((
view_1
->
infos
)
->
column_references
)[
j
]).
column_refs
).
version
))
break
;
}
header_2
=
obi_column_get_header_from_name
(
dms_2
,
((((
view_2
->
infos
)
->
column_references
)[
i
]).
column_refs
).
column_name
,
((((
view_2
->
infos
)
->
column_references
)[
i
]).
column_refs
).
version
);
if
(
header_2
==
NULL
)
{
obidebug
(
1
,
"
\n
Error opening a column header while importing a view"
);
return
-
1
;
}
// Update version of associated column
(
header_2
->
associated_column
).
version
=
((((
view_2
->
infos
)
->
column_references
)[
j
]).
column_refs
).
version
;
if
(
obi_close_header
(
header_2
)
<
0
)
{
obidebug
(
1
,
"
\n
Error closing a column header while importing a view"
);
return
-
1
;
}
}
if
(
obi_close_header
(
header
)
<
0
)
{
obidebug
(
1
,
"
\n
Error closing a column header while importing a view"
);
return
-
1
;
}
}
// Close the views
if
(
obi_save_and_close_view
(
view_1
)
<
0
)
{
...
...
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