|
|
AssertPartitions ()
|
/**
/* Copy partition table as it cannot be imported with non-primary group index
Copy tenantGroupMembers to support Delete of those not imported
(CopyChildTable will replace "tenantGroupDetails" ) */
method public override void ImportTree(pcfile as char):
define variable cntxt as TenantGroupContext no-undo.
define variable reader as JSONLoader no-undo.
reader = new JSONLoader().
cntxt = cast(Context,TenantGroupContext).
mPartitionTable = cntxt:CreateImportTable("partitions").
mTenantGroupMembersTable = cntxt:CreateImportTable("tenantGroupMembers").
reader:LoadFromFile(this-object,pcfile,"replace").
/* destructor delete ds and auto deletes the tt */
cntxt:CopyChildTable("partitions",mPartitionTable).
cntxt:CopyChildTable("tenantGroupMembers",mTenantGroupMembersTable).
finally:
delete object mPartitionTable no-error.
delete object mTenantGroupMembersTable no-error.
delete object reader no-error.
end finally.
end method.
***/
|
|
|
OpenEdge.DataAdmin.Binding.IDataAdminModel CreateLocalContext ()
|
/* local context needed - child collections */
|
|
|
ExportTree (character)
|
/*
/* write specified collections (default all) */
method public override void WriteTree(tree as IContextTree,pcCollections as char):
define variable i as integer no-undo.
define variable cntxt as TenantGroupContext no-undo.
define variable cColl as character no-undo.
define variable hCopy as handle no-undo.
if not valid-object(Context) then
do:
cntxt = new TenantGroupContext().
Attach(cntxt).
end.
tree:SetHandle(SerializeName,mDefaultBuffer,mDefaultBuffer:rowid).
do i = 1 to num-entries(pccollections):
ccoll = entry(i,pccollections).
case ccoll:
when "partitions" then
do:
tree:SetJoin(SerializeName,"partitions","Name,TenantGroupName").
if valid-handle(mPartitionTable) then
do:
tree:SetHandle("partitions",mPartitionTable:default-buffer-handle).
end.
else do:
Partitions:WriteTree(tree,"").
end.
end.
when "tenantgroupmembers" then
do:
tree:SetJoin(SerializeName,"tenantGroupMembers","Name,TenantGroupName").
if valid-handle(mTenantGroupMembersTable) then
do:
tree:SetHandle("tenantGroupMembers",mTenantGroupMembersTable:default-buffer-handle).
end.
else do:
TenantGroupMembers:WriteTree(tree).
end.
end.
end.
end.
end method.
*/
|
|
|
ExportTree (character, character)
|
/** override to get codewriter if .p and to handle collections for this */
|
|
|
CHARACTER GetCreateError ()
|
|
|
|
WriteTree (IContextTree, character)
|
/* write specified collections (default all)
See override in ExportTree(file,collection) that deals with tenants versus TenantGroupMembers for .p */
|