Created
July 24, 2012 15:02
-
-
Save dearaujoj/3170516 to your computer and use it in GitHub Desktop.
Universal importer sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE | |
v_GroupName varchar2(200); | |
BEGIN | |
v_GroupName := 'Phantom0B'; | |
Delete From uax_import_instances | |
Where GroupName = v_GroupName; | |
Delete From uax_import_properties | |
Where GroupName = v_GroupName; | |
/* ----------------------------------------------------- | |
ROOT Directory (Phantom0B) | |
*/ | |
--- Root Directory Object | |
Insert into uax_import_instances | |
Select v_GroupName | |
,'Phantom0B' -- ID | |
,'universalDirectory' -- type(Object) | |
From dual; | |
Insert into uax_import_properties | |
Select v_GroupName | |
,'Phantom0B' -- ID | |
,'identification', 'name', 'Phantom0B' | |
From dual | |
Union | |
Select v_GroupName | |
,'Phantom0B' -- ID | |
,'identification', 'fullName' | |
,'C:\AnalysisSrc\CASTUI\Phantom\Phantom0B' | |
From dual | |
Union | |
Select v_GroupName | |
,'Phantom0B' -- ID | |
,'shell', 'fullPath' | |
,'C:\AnalysisSrc\CASTUI\Phantom\Phantom0B' | |
From dual | |
; | |
--- Parent Link | |
Insert into uax_import_instances | |
Select v_GroupName | |
,'RootProj_Phantom0B' -- ID | |
,'parentLink' -- type(link) | |
From dual; | |
Insert into uax_import_properties | |
Select v_GroupName | |
,'RootProj_Phantom0B' -- ID | |
,'link','caller','Phantom0B' | |
From dual | |
Union | |
Select v_GroupName | |
,'RootProj_Phantom0B' -- ID | |
,'link','callee','%ProjectRoot%' | |
From dual; | |
/* ----------------------------------------------------- | |
source file (SourceFile.XML) | |
*/ | |
--- source file Object | |
Insert into uax_import_instances | |
Select v_GroupName | |
,'SourceFile.XML' -- ID | |
,'sourceFile' -- type(Object) | |
From dual; | |
Insert into uax_import_properties | |
Select v_GroupName | |
,'SourceFile.XML' -- ID | |
,'identification', 'name', 'SourceFile.XML' | |
From dual | |
Union | |
Select v_GroupName | |
,'SourceFile.XML' -- ID | |
,'identification', 'fullName' | |
,'C:\AnalysisSrc\CASTUI\Phantom\Phantom0B\SourceFile.XML' | |
From dual | |
Union | |
Select v_GroupName | |
,'SourceFile.XML' -- ID | |
,'shell', 'fullPath' | |
,'C:\AnalysisSrc\CASTUI\Phantom\Phantom0B\SourceFile.XML' | |
From dual | |
Union | |
Select v_GroupName | |
,'SourceFile.XML' -- ID | |
,'bookmark', 'source' | |
,'C:\AnalysisSrc\CASTUI\Phantom\Phantom0B\SourceFile.XML' | |
From dual | |
Union | |
Select v_GroupName | |
,'SourceFile.XML' -- ID | |
,'synchronizable', 'lastModifiedDate' | |
,'(2012,07,24,12,00,00)' | |
From dual | |
Union | |
Select v_GroupName | |
,'SourceFile.XML' -- ID | |
,'POSITIONABLE', 'POSITIONS', 'SourceFile.XML(1,1,223,13)' | |
From dual | |
; | |
--- Parent Link | |
Insert into uax_import_instances | |
Select v_GroupName | |
,'Phantom0B_SourceFile.XML' -- ID | |
,'parentLink' -- type(link) | |
From dual; | |
Insert into uax_import_properties | |
Select v_GroupName | |
,'Phantom0B_SourceFile.XML' -- ID | |
,'link','caller','SourceFile.XML' | |
From dual | |
Union | |
Select v_GroupName | |
,'Phantom0B_SourceFile.XML' -- ID | |
,'link','callee','Phantom0B' | |
From dual; | |
/* ----------------------------------------------------- | |
Phantom Object (Ghost) | |
*/ | |
--- Phantom Object | |
Insert into uax_import_instances | |
Select v_GroupName | |
,'Ghost_0B' -- ID | |
,'Phantom' -- type(Object) | |
From dual; | |
Insert into uax_import_properties | |
Select v_GroupName | |
,'Ghost_0B' -- ID | |
,'identification', 'name', 'Ghost_0B' | |
From dual | |
Union | |
Select v_GroupName | |
,'Ghost_0B' -- ID | |
,'identification', 'fullName' | |
,'C:\AnalysisSrc\CASTUI\Phantom\Phantom0B\SourceFile.XML.Ghost_0B' | |
From dual | |
Union | |
Select v_GroupName | |
,'Ghost_0B' -- ID | |
,'POSITIONABLE', 'POSITIONS', 'SourceFile.XML(1,1,1,3)' | |
From dual | |
Union | |
Select v_GroupName | |
,'Ghost_0B' -- ID | |
,'synchronizable', 'lastModifiedDate' | |
,'(2012,07,25,20,00,00)' | |
From dual | |
Union | |
Select v_GroupName | |
,'Ghost_0B' -- ID | |
,'bookmark', 'source' | |
,'C:\AnalysisSrc\CASTUI\Phantom\Phantom0B\SourceFile.XML' | |
From dual | |
; | |
--- Parent Link | |
Insert into uax_import_instances | |
Select v_GroupName | |
,'SourceFile.XML_Ghost_0B' -- ID | |
,'parentLink' -- type(link) | |
From dual | |
; | |
Insert into uax_import_properties | |
Select v_GroupName | |
,'SourceFile.XML_Ghost_0B' -- ID | |
,'link','caller','Ghost_0B' | |
From dual | |
Union | |
Select v_GroupName | |
,'SourceFile.XML_Ghost_0B' -- ID | |
,'link','callee','SourceFile.XML' | |
From dual | |
; | |
-- SourceFile.XML Source code with isInSourceLink | |
Insert into uax_import_instances | |
Select v_GroupName | |
,'SourceFile.XML_source' -- ID | |
,'isInSourceLink' -- type(link) | |
From dual | |
; | |
Insert into uax_import_properties | |
Select v_GroupName | |
,'SourceFile.XML_source' -- ID | |
,'link','caller','SourceFile.XML' | |
From dual | |
Union | |
Select v_GroupName | |
,'SourceFile.XML_source' -- ID | |
,'link','callee','SourceFile.XML' | |
From dual | |
; | |
-- Ghost_0B Source code with isInSourceLink | |
Insert into uax_import_instances | |
Select v_GroupName | |
,'SourceFile.XML_source_Ghost_0B' -- ID | |
,'isInSourceLink' -- type(link) | |
From dual | |
; | |
Insert into uax_import_properties | |
Select v_GroupName | |
,'SourceFile.XML_source_Ghost_0B' -- ID | |
,'link','caller','Ghost_0B' | |
From dual | |
Union | |
Select v_GroupName | |
,'SourceFile.XML_source_Ghost_0B' -- ID | |
,'link','callee','SourceFile.XML' | |
From dual | |
; | |
COMMIT; | |
END; |
For isInSourceLink of SourceFile.xml, Insert SQL needs to be fixed.
The ID string is not 'SourceFile.XML_source_Ghost_0B' but 'SourceFile.XML_source'.
And is it correct that both caller and collee has same Object ID?(Source code of SourceFile.xml is not displayed in Enlighten.)
Yes you are right, bad copy/paste ;-), I have changed the SQL.
As it is written in the documentation there should be a link of this type between the file and itself.
Added POSITIONABLE property for source file in order to have the code displayed in Code Viewer. Positions had to be adapted according the file length.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added several modifications according to Universal Importer documentation p. 26 for Code Viewer:
of the file in which the object is defined, i.e. each object must inherit from the bookmark
category.
defined, in particular there must be a link of this type between the file and itself.
contain the name of the file in which the object is defined followed by its positions, i.e.
each object must inherit from the POSITIONABLE category.