
START TRANSACTION;

INSERT INTO NODE (NODE_ORDER,ASCENDING,VISIBLE,CONTENT_ID,KEY_ROOT_DOMAIN_OBJECT,KEY_PARENT,KEY_CHILD,OJB_CONCRETE_CLASS) VALUES (40,1,1,'382b0518-1431-102b-8308-0016ec91a6df:fb206e9a-3dc4-440f-a7f8-4838c67fad16',1,1,2,'net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode')  ;

INSERT INTO CONTENT (EXECUTION_PATH,VISIBLE,KEY_MODULE_ROOT_DOMAIN_OBJECT,MAXIMIZABLE,PREFIX,KEY_INITIAL_CONTENT,CONTENT_ID,CREATION_DATE,NAME,TITLE,BODY,DESCRIPTION,NORMALIZED_NAME,KEY_ROOT_DOMAIN_OBJECT,KEY_AVAILABILITY_POLICY,KEY_PORTAL,KEY_CREATOR,OJB_CONCRETE_CLASS) VALUES (null,null,null,null,'/internationalRelatOffice',null,'fb206e9a-3dc4-440f-a7f8-4838c67fad16','2008-01-17 12:19:09','pt35:Gabinete de Relações Internacionais','pt35:Gabinete de Relações Internacionais',null,null,'pt35:gabinete-de-relacoes-internacionais',1,null,null,null,'net.sourceforge.fenixedu.domain.functionalities.Module')  ;

UPDATE NODE SET NODE_ORDER=40,ASCENDING=1,VISIBLE=1,CONTENT_ID='382b0518-1431-102b-8308-0016ec91a6df:fb206e9a-3dc4-440f-a7f8-4838c67fad16',KEY_ROOT_DOMAIN_OBJECT=1,KEY_PARENT=3,KEY_CHILD=4,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '382b0518-1431-102b-8308-0016ec91a6df:fb206e9a-3dc4-440f-a7f8-4838c67fad16'  ;

UPDATE CONTENT SET EXECUTION_PATH=null,VISIBLE=null,KEY_MODULE_ROOT_DOMAIN_OBJECT=null,MAXIMIZABLE=null,PREFIX='/internationalRelatOffice',KEY_INITIAL_CONTENT=null,CONTENT_ID='fb206e9a-3dc4-440f-a7f8-4838c67fad16',CREATION_DATE='2008-01-17 12:19:09',NAME='pt35:Gabinete de Relações Internacionais',TITLE='pt35:Gabinete de Relações Internacionais',BODY=null,DESCRIPTION=null,NORMALIZED_NAME='pt35:gabinete-de-relacoes-internacionais',KEY_ROOT_DOMAIN_OBJECT=1,KEY_AVAILABILITY_POLICY=null,KEY_PORTAL=null,KEY_CREATOR=null,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.functionalities.Module' WHERE CONTENT_ID = 'fb206e9a-3dc4-440f-a7f8-4838c67fad16'  ;

CREATE TEMPORARY TABLE UUID_TEMP_TABLE(COUNTER integer, UUID varchar(255), FROM_UUID varchar(255));

INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(1,'382b0518-1431-102b-8308-0016ec91a6df','382b0518-1431-102b-8308-0016ec91a6df:fb206e9a-3dc4-440f-a7f8-4838c67fad16') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(2,'fb206e9a-3dc4-440f-a7f8-4838c67fad16','382b0518-1431-102b-8308-0016ec91a6df:fb206e9a-3dc4-440f-a7f8-4838c67fad16') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(3,'382b0518-1431-102b-8308-0016ec91a6df','382b0518-1431-102b-8308-0016ec91a6df:fb206e9a-3dc4-440f-a7f8-4838c67fad16') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(4,'fb206e9a-3dc4-440f-a7f8-4838c67fad16','382b0518-1431-102b-8308-0016ec91a6df:fb206e9a-3dc4-440f-a7f8-4838c67fad16') ;
ALTER TABLE UUID_TEMP_TABLE ADD INDEX (COUNTER), ADD INDEX (UUID), ADD INDEX (FROM_UUID); 


UPDATE NODE T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_PARENT=CT.ID_INTERNAL WHERE T.KEY_PARENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE NODE T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_CHILD=CT.ID_INTERNAL WHERE T.KEY_CHILD=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_INITIAL_CONTENT=CT.ID_INTERNAL WHERE T.KEY_INITIAL_CONTENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_PORTAL=CT.ID_INTERNAL WHERE T.KEY_PORTAL=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, AVAILABILITY_POLICY CT set T.KEY_AVAILABILITY_POLICY=CT.ID_INTERNAL WHERE T.KEY_AVAILABILITY_POLICY=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE AVAILABILITY_POLICY T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_CONTENT=CT.ID_INTERNAL WHERE T.KEY_CONTENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
DROP TABLE UUID_TEMP_TABLE;

INSERT INTO NODE (NODE_ORDER,ASCENDING,VISIBLE,CONTENT_ID,KEY_ROOT_DOMAIN_OBJECT,KEY_PARENT,KEY_CHILD,OJB_CONCRETE_CLASS) VALUES (0,1,1,'fb206e9a-3dc4-440f-a7f8-4838c67fad16:41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b',1,5,6,'net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode')  ;

INSERT INTO CONTENT (EXECUTION_PATH,VISIBLE,KEY_EXECUTION_PATH_VALUE,CONTENT_ID,CREATION_DATE,NAME,TITLE,BODY,DESCRIPTION,NORMALIZED_NAME,KEY_ROOT_DOMAIN_OBJECT,KEY_AVAILABILITY_POLICY,KEY_PORTAL,KEY_CREATOR,OJB_CONCRETE_CLASS) VALUES ('/index.do',null,1135,'41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b','2008-01-17 12:19:32','pt6:Inicio','pt6:Inicio',null,null,'pt6:inicio',1,null,null,null,'net.sourceforge.fenixedu.domain.functionalities.Functionality')  ;

UPDATE NODE SET NODE_ORDER=0,ASCENDING=1,VISIBLE=1,CONTENT_ID='fb206e9a-3dc4-440f-a7f8-4838c67fad16:41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b',KEY_ROOT_DOMAIN_OBJECT=1,KEY_PARENT=7,KEY_CHILD=8,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = 'fb206e9a-3dc4-440f-a7f8-4838c67fad16:41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b'  ;

UPDATE CONTENT SET EXECUTION_PATH='/index.do',VISIBLE=null,KEY_EXECUTION_PATH_VALUE=1135,CONTENT_ID='41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b',CREATION_DATE='2008-01-17 12:19:32',NAME='pt6:Inicio',TITLE='pt6:Inicio',BODY=null,DESCRIPTION=null,NORMALIZED_NAME='pt6:inicio',KEY_ROOT_DOMAIN_OBJECT=1,KEY_AVAILABILITY_POLICY=null,KEY_PORTAL=null,KEY_CREATOR=null,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.functionalities.Functionality' WHERE CONTENT_ID = '41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b'  ;

CREATE TEMPORARY TABLE UUID_TEMP_TABLE(COUNTER integer, UUID varchar(255), FROM_UUID varchar(255));

INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(5,'fb206e9a-3dc4-440f-a7f8-4838c67fad16','fb206e9a-3dc4-440f-a7f8-4838c67fad16:41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(6,'41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b','fb206e9a-3dc4-440f-a7f8-4838c67fad16:41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(7,'fb206e9a-3dc4-440f-a7f8-4838c67fad16','fb206e9a-3dc4-440f-a7f8-4838c67fad16:41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(8,'41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b','fb206e9a-3dc4-440f-a7f8-4838c67fad16:41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b') ;
ALTER TABLE UUID_TEMP_TABLE ADD INDEX (COUNTER), ADD INDEX (UUID), ADD INDEX (FROM_UUID); 


UPDATE NODE T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_PARENT=CT.ID_INTERNAL WHERE T.KEY_PARENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE NODE T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_CHILD=CT.ID_INTERNAL WHERE T.KEY_CHILD=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_INITIAL_CONTENT=CT.ID_INTERNAL WHERE T.KEY_INITIAL_CONTENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_PORTAL=CT.ID_INTERNAL WHERE T.KEY_PORTAL=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, AVAILABILITY_POLICY CT set T.KEY_AVAILABILITY_POLICY=CT.ID_INTERNAL WHERE T.KEY_AVAILABILITY_POLICY=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE AVAILABILITY_POLICY T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_CONTENT=CT.ID_INTERNAL WHERE T.KEY_CONTENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
DROP TABLE UUID_TEMP_TABLE;

INSERT INTO CONTENT (ENABLED,MODIFICATION_DATE,MAXIMIZABLE,PREFIX,KEY_INITIAL_CONTENT,CONTENT_ID,CREATION_DATE,NAME,TITLE,BODY,DESCRIPTION,NORMALIZED_NAME,KEY_ROOT_DOMAIN_OBJECT,KEY_AVAILABILITY_POLICY,KEY_PORTAL,KEY_CREATOR,OJB_CONCRETE_CLASS) VALUES (null,null,null,null,null,'ad0563cd-736d-4682-9500-5705d724d4cb','2008-01-17 12:20:07','pt35:Gabinete de Relações Internacionais',null,null,null,'pt35:gabinete-de-relacoes-internacionais',1,null,null,null,'net.sourceforge.fenixedu.domain.Section')  ;

INSERT INTO NODE (NODE_ORDER,ASCENDING,VISIBLE,CONTENT_ID,KEY_ROOT_DOMAIN_OBJECT,KEY_PARENT,KEY_CHILD,OJB_CONCRETE_CLASS) VALUES (38,1,1,'382b0734-1431-102b-8308-0016ec91a6df:ad0563cd-736d-4682-9500-5705d724d4cb',1,9,10,'net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode')  ;

UPDATE NODE SET NODE_ORDER=48,ASCENDING=1,VISIBLE=1,CONTENT_ID='382b0734-1431-102b-8308-0016ec91a6df:25abc654-f86e-102a-aeb6-0013d3b09da0',KEY_ROOT_DOMAIN_OBJECT=1,KEY_PARENT=11,KEY_CHILD=12,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '382b0734-1431-102b-8308-0016ec91a6df:25abc654-f86e-102a-aeb6-0013d3b09da0'  ;

UPDATE CONTENT SET ENABLED=null,MODIFICATION_DATE=null,MAXIMIZABLE=null,PREFIX=null,KEY_INITIAL_CONTENT=null,CONTENT_ID='ad0563cd-736d-4682-9500-5705d724d4cb',CREATION_DATE='2008-01-17 12:20:07',NAME='pt35:Gabinete de Relações Internacionais',TITLE=null,BODY=null,DESCRIPTION=null,NORMALIZED_NAME='pt35:gabinete-de-relacoes-internacionais',KEY_ROOT_DOMAIN_OBJECT=1,KEY_AVAILABILITY_POLICY=null,KEY_PORTAL=null,KEY_CREATOR=null,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.Section' WHERE CONTENT_ID = 'ad0563cd-736d-4682-9500-5705d724d4cb'  ;

UPDATE NODE SET NODE_ORDER=42,ASCENDING=1,VISIBLE=1,CONTENT_ID='382b0734-1431-102b-8308-0016ec91a6df:2574818a-f86e-102a-aeb6-0013d3b09da0',KEY_ROOT_DOMAIN_OBJECT=1,KEY_PARENT=13,KEY_CHILD=14,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '382b0734-1431-102b-8308-0016ec91a6df:2574818a-f86e-102a-aeb6-0013d3b09da0'  ;

UPDATE NODE SET NODE_ORDER=39,ASCENDING=1,VISIBLE=1,CONTENT_ID='382b0734-1431-102b-8308-0016ec91a6df:28c2c83e4c5146fb8d3923191b3aaf08',KEY_ROOT_DOMAIN_OBJECT=1,KEY_PARENT=15,KEY_CHILD=16,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '382b0734-1431-102b-8308-0016ec91a6df:28c2c83e4c5146fb8d3923191b3aaf08'  ;

UPDATE NODE SET NODE_ORDER=44,ASCENDING=1,VISIBLE=1,CONTENT_ID='382b0734-1431-102b-8308-0016ec91a6df:3936a368-1431-102b-8308-0016ec91a6df',KEY_ROOT_DOMAIN_OBJECT=1,KEY_PARENT=17,KEY_CHILD=18,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '382b0734-1431-102b-8308-0016ec91a6df:3936a368-1431-102b-8308-0016ec91a6df'  ;

UPDATE NODE SET NODE_ORDER=43,ASCENDING=1,VISIBLE=1,CONTENT_ID='382b0734-1431-102b-8308-0016ec91a6df:2574881a-f86e-102a-aeb6-0013d3b09da0',KEY_ROOT_DOMAIN_OBJECT=1,KEY_PARENT=19,KEY_CHILD=20,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '382b0734-1431-102b-8308-0016ec91a6df:2574881a-f86e-102a-aeb6-0013d3b09da0'  ;

UPDATE NODE SET NODE_ORDER=40,ASCENDING=1,VISIBLE=1,CONTENT_ID='382b0734-1431-102b-8308-0016ec91a6df:b68579ac982cc3c10b4b0018f6f3f60c',KEY_ROOT_DOMAIN_OBJECT=1,KEY_PARENT=21,KEY_CHILD=22,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '382b0734-1431-102b-8308-0016ec91a6df:b68579ac982cc3c10b4b0018f6f3f60c'  ;

UPDATE NODE SET NODE_ORDER=38,ASCENDING=1,VISIBLE=1,CONTENT_ID='382b0734-1431-102b-8308-0016ec91a6df:ad0563cd-736d-4682-9500-5705d724d4cb',KEY_ROOT_DOMAIN_OBJECT=1,KEY_PARENT=23,KEY_CHILD=24,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '382b0734-1431-102b-8308-0016ec91a6df:ad0563cd-736d-4682-9500-5705d724d4cb'  ;

UPDATE NODE SET NODE_ORDER=46,ASCENDING=1,VISIBLE=1,CONTENT_ID='382b0734-1431-102b-8308-0016ec91a6df:259fb95e-f86e-102a-aeb6-0013d3b09da0',KEY_ROOT_DOMAIN_OBJECT=1,KEY_PARENT=25,KEY_CHILD=26,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '382b0734-1431-102b-8308-0016ec91a6df:259fb95e-f86e-102a-aeb6-0013d3b09da0'  ;

UPDATE NODE SET NODE_ORDER=45,ASCENDING=1,VISIBLE=1,CONTENT_ID='382b0734-1431-102b-8308-0016ec91a6df:2586b648-f86e-102a-aeb6-0013d3b09da0',KEY_ROOT_DOMAIN_OBJECT=1,KEY_PARENT=27,KEY_CHILD=28,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '382b0734-1431-102b-8308-0016ec91a6df:2586b648-f86e-102a-aeb6-0013d3b09da0'  ;

UPDATE NODE SET NODE_ORDER=41,ASCENDING=1,VISIBLE=1,CONTENT_ID='382b0734-1431-102b-8308-0016ec91a6df:2553ca76-f86e-102a-aeb6-0013d3b09da0',KEY_ROOT_DOMAIN_OBJECT=1,KEY_PARENT=29,KEY_CHILD=30,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '382b0734-1431-102b-8308-0016ec91a6df:2553ca76-f86e-102a-aeb6-0013d3b09da0'  ;

UPDATE NODE SET NODE_ORDER=47,ASCENDING=1,VISIBLE=1,CONTENT_ID='382b0734-1431-102b-8308-0016ec91a6df:259fbb84-f86e-102a-aeb6-0013d3b09da0',KEY_ROOT_DOMAIN_OBJECT=1,KEY_PARENT=31,KEY_CHILD=32,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '382b0734-1431-102b-8308-0016ec91a6df:259fbb84-f86e-102a-aeb6-0013d3b09da0'  ;

CREATE TEMPORARY TABLE UUID_TEMP_TABLE(COUNTER integer, UUID varchar(255), FROM_UUID varchar(255));

INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(9,'382b0734-1431-102b-8308-0016ec91a6df','382b0734-1431-102b-8308-0016ec91a6df:ad0563cd-736d-4682-9500-5705d724d4cb') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(10,'ad0563cd-736d-4682-9500-5705d724d4cb','382b0734-1431-102b-8308-0016ec91a6df:ad0563cd-736d-4682-9500-5705d724d4cb') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(11,'382b0734-1431-102b-8308-0016ec91a6df','382b0734-1431-102b-8308-0016ec91a6df:25abc654-f86e-102a-aeb6-0013d3b09da0') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(12,'25abc654-f86e-102a-aeb6-0013d3b09da0','382b0734-1431-102b-8308-0016ec91a6df:25abc654-f86e-102a-aeb6-0013d3b09da0') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(13,'382b0734-1431-102b-8308-0016ec91a6df','382b0734-1431-102b-8308-0016ec91a6df:2574818a-f86e-102a-aeb6-0013d3b09da0') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(14,'2574818a-f86e-102a-aeb6-0013d3b09da0','382b0734-1431-102b-8308-0016ec91a6df:2574818a-f86e-102a-aeb6-0013d3b09da0') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(15,'382b0734-1431-102b-8308-0016ec91a6df','382b0734-1431-102b-8308-0016ec91a6df:28c2c83e4c5146fb8d3923191b3aaf08') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(16,'28c2c83e4c5146fb8d3923191b3aaf08','382b0734-1431-102b-8308-0016ec91a6df:28c2c83e4c5146fb8d3923191b3aaf08') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(17,'382b0734-1431-102b-8308-0016ec91a6df','382b0734-1431-102b-8308-0016ec91a6df:3936a368-1431-102b-8308-0016ec91a6df') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(18,'3936a368-1431-102b-8308-0016ec91a6df','382b0734-1431-102b-8308-0016ec91a6df:3936a368-1431-102b-8308-0016ec91a6df') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(19,'382b0734-1431-102b-8308-0016ec91a6df','382b0734-1431-102b-8308-0016ec91a6df:2574881a-f86e-102a-aeb6-0013d3b09da0') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(20,'2574881a-f86e-102a-aeb6-0013d3b09da0','382b0734-1431-102b-8308-0016ec91a6df:2574881a-f86e-102a-aeb6-0013d3b09da0') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(21,'382b0734-1431-102b-8308-0016ec91a6df','382b0734-1431-102b-8308-0016ec91a6df:b68579ac982cc3c10b4b0018f6f3f60c') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(22,'b68579ac982cc3c10b4b0018f6f3f60c','382b0734-1431-102b-8308-0016ec91a6df:b68579ac982cc3c10b4b0018f6f3f60c') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(23,'382b0734-1431-102b-8308-0016ec91a6df','382b0734-1431-102b-8308-0016ec91a6df:ad0563cd-736d-4682-9500-5705d724d4cb') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(24,'ad0563cd-736d-4682-9500-5705d724d4cb','382b0734-1431-102b-8308-0016ec91a6df:ad0563cd-736d-4682-9500-5705d724d4cb') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(25,'382b0734-1431-102b-8308-0016ec91a6df','382b0734-1431-102b-8308-0016ec91a6df:259fb95e-f86e-102a-aeb6-0013d3b09da0') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(26,'259fb95e-f86e-102a-aeb6-0013d3b09da0','382b0734-1431-102b-8308-0016ec91a6df:259fb95e-f86e-102a-aeb6-0013d3b09da0') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(27,'382b0734-1431-102b-8308-0016ec91a6df','382b0734-1431-102b-8308-0016ec91a6df:2586b648-f86e-102a-aeb6-0013d3b09da0') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(28,'2586b648-f86e-102a-aeb6-0013d3b09da0','382b0734-1431-102b-8308-0016ec91a6df:2586b648-f86e-102a-aeb6-0013d3b09da0') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(29,'382b0734-1431-102b-8308-0016ec91a6df','382b0734-1431-102b-8308-0016ec91a6df:2553ca76-f86e-102a-aeb6-0013d3b09da0') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(30,'2553ca76-f86e-102a-aeb6-0013d3b09da0','382b0734-1431-102b-8308-0016ec91a6df:2553ca76-f86e-102a-aeb6-0013d3b09da0') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(31,'382b0734-1431-102b-8308-0016ec91a6df','382b0734-1431-102b-8308-0016ec91a6df:259fbb84-f86e-102a-aeb6-0013d3b09da0') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(32,'259fbb84-f86e-102a-aeb6-0013d3b09da0','382b0734-1431-102b-8308-0016ec91a6df:259fbb84-f86e-102a-aeb6-0013d3b09da0') ;
ALTER TABLE UUID_TEMP_TABLE ADD INDEX (COUNTER), ADD INDEX (UUID), ADD INDEX (FROM_UUID); 


UPDATE NODE T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_PARENT=CT.ID_INTERNAL WHERE T.KEY_PARENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE NODE T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_CHILD=CT.ID_INTERNAL WHERE T.KEY_CHILD=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_INITIAL_CONTENT=CT.ID_INTERNAL WHERE T.KEY_INITIAL_CONTENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_PORTAL=CT.ID_INTERNAL WHERE T.KEY_PORTAL=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, AVAILABILITY_POLICY CT set T.KEY_AVAILABILITY_POLICY=CT.ID_INTERNAL WHERE T.KEY_AVAILABILITY_POLICY=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE AVAILABILITY_POLICY T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_CONTENT=CT.ID_INTERNAL WHERE T.KEY_CONTENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
DROP TABLE UUID_TEMP_TABLE;

INSERT INTO NODE (NODE_ORDER,ASCENDING,VISIBLE,CONTENT_ID,KEY_ROOT_DOMAIN_OBJECT,KEY_PARENT,KEY_CHILD,OJB_CONCRETE_CLASS) VALUES (0,1,1,'ad0563cd-736d-4682-9500-5705d724d4cb:41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b',1,33,34,'net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode')  ;

UPDATE NODE SET NODE_ORDER=0,ASCENDING=1,VISIBLE=1,CONTENT_ID='ad0563cd-736d-4682-9500-5705d724d4cb:41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b',KEY_ROOT_DOMAIN_OBJECT=1,KEY_PARENT=35,KEY_CHILD=36,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = 'ad0563cd-736d-4682-9500-5705d724d4cb:41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b'  ;

CREATE TEMPORARY TABLE UUID_TEMP_TABLE(COUNTER integer, UUID varchar(255), FROM_UUID varchar(255));

INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(33,'ad0563cd-736d-4682-9500-5705d724d4cb','ad0563cd-736d-4682-9500-5705d724d4cb:41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(34,'41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b','ad0563cd-736d-4682-9500-5705d724d4cb:41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(35,'ad0563cd-736d-4682-9500-5705d724d4cb','ad0563cd-736d-4682-9500-5705d724d4cb:41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(36,'41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b','ad0563cd-736d-4682-9500-5705d724d4cb:41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b') ;
ALTER TABLE UUID_TEMP_TABLE ADD INDEX (COUNTER), ADD INDEX (UUID), ADD INDEX (FROM_UUID); 


UPDATE NODE T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_PARENT=CT.ID_INTERNAL WHERE T.KEY_PARENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE NODE T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_CHILD=CT.ID_INTERNAL WHERE T.KEY_CHILD=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_INITIAL_CONTENT=CT.ID_INTERNAL WHERE T.KEY_INITIAL_CONTENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_PORTAL=CT.ID_INTERNAL WHERE T.KEY_PORTAL=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, AVAILABILITY_POLICY CT set T.KEY_AVAILABILITY_POLICY=CT.ID_INTERNAL WHERE T.KEY_AVAILABILITY_POLICY=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE AVAILABILITY_POLICY T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_CONTENT=CT.ID_INTERNAL WHERE T.KEY_CONTENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
DROP TABLE UUID_TEMP_TABLE;

UPDATE CONTENT SET ENABLED=null,MODIFICATION_DATE=null,MAXIMIZABLE=null,PREFIX=null,KEY_INITIAL_CONTENT=37,CONTENT_ID='ad0563cd-736d-4682-9500-5705d724d4cb',CREATION_DATE='2008-01-17 12:20:07',NAME='pt35:Gabinete de Relações Internacionais',TITLE=null,BODY=null,DESCRIPTION=null,NORMALIZED_NAME='pt35:gabinete-de-relacoes-internacionais',KEY_ROOT_DOMAIN_OBJECT=1,KEY_AVAILABILITY_POLICY=null,KEY_PORTAL=null,KEY_CREATOR=null,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.Section' WHERE CONTENT_ID = 'ad0563cd-736d-4682-9500-5705d724d4cb'  ;

CREATE TEMPORARY TABLE UUID_TEMP_TABLE(COUNTER integer, UUID varchar(255), FROM_UUID varchar(255));

INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(37,'41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b','ad0563cd-736d-4682-9500-5705d724d4cb') ;
ALTER TABLE UUID_TEMP_TABLE ADD INDEX (COUNTER), ADD INDEX (UUID), ADD INDEX (FROM_UUID); 


UPDATE NODE T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_PARENT=CT.ID_INTERNAL WHERE T.KEY_PARENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE NODE T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_CHILD=CT.ID_INTERNAL WHERE T.KEY_CHILD=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_INITIAL_CONTENT=CT.ID_INTERNAL WHERE T.KEY_INITIAL_CONTENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_PORTAL=CT.ID_INTERNAL WHERE T.KEY_PORTAL=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, AVAILABILITY_POLICY CT set T.KEY_AVAILABILITY_POLICY=CT.ID_INTERNAL WHERE T.KEY_AVAILABILITY_POLICY=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE AVAILABILITY_POLICY T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_CONTENT=CT.ID_INTERNAL WHERE T.KEY_CONTENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
DROP TABLE UUID_TEMP_TABLE;

INSERT INTO AVAILABILITY_POLICY (EXPRESSION,TARGET_GROUP,CONTENT_ID,KEY_ROOT_DOMAIN_OBJECT,KEY_CONTENT,OJB_CONCRETE_CLASS) VALUES ('role(INTERNATIONAL_RELATION_OFFICE)','role(INTERNATIONAL_RELATION_OFFICE)','728533b8-1918-4bac-9025-eb766a64091d',1,38,'net.sourceforge.fenixedu.domain.functionalities.ExpressionGroupAvailability')  ;

UPDATE CONTENT SET ENABLED=null,MODIFICATION_DATE=null,MAXIMIZABLE=null,PREFIX=null,KEY_INITIAL_CONTENT=39,CONTENT_ID='ad0563cd-736d-4682-9500-5705d724d4cb',CREATION_DATE='2008-01-17 12:20:07',NAME='pt35:Gabinete de Relações Internacionais',TITLE=null,BODY=null,DESCRIPTION=null,NORMALIZED_NAME='pt35:gabinete-de-relacoes-internacionais',KEY_ROOT_DOMAIN_OBJECT=1,KEY_AVAILABILITY_POLICY=40,KEY_PORTAL=null,KEY_CREATOR=null,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.Section' WHERE CONTENT_ID = 'ad0563cd-736d-4682-9500-5705d724d4cb'  ;

UPDATE AVAILABILITY_POLICY SET EXPRESSION='role(INTERNATIONAL_RELATION_OFFICE)',TARGET_GROUP='role(INTERNATIONAL_RELATION_OFFICE)',CONTENT_ID='728533b8-1918-4bac-9025-eb766a64091d',KEY_ROOT_DOMAIN_OBJECT=1,KEY_CONTENT=41,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.functionalities.ExpressionGroupAvailability' WHERE CONTENT_ID = '728533b8-1918-4bac-9025-eb766a64091d'  ;

CREATE TEMPORARY TABLE UUID_TEMP_TABLE(COUNTER integer, UUID varchar(255), FROM_UUID varchar(255));

INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(38,'ad0563cd-736d-4682-9500-5705d724d4cb','728533b8-1918-4bac-9025-eb766a64091d') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(39,'41d0a3c1-4f99-4d3c-ab36-6bc05aacbb2b','ad0563cd-736d-4682-9500-5705d724d4cb') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(40,'728533b8-1918-4bac-9025-eb766a64091d','ad0563cd-736d-4682-9500-5705d724d4cb') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(41,'ad0563cd-736d-4682-9500-5705d724d4cb','728533b8-1918-4bac-9025-eb766a64091d') ;
ALTER TABLE UUID_TEMP_TABLE ADD INDEX (COUNTER), ADD INDEX (UUID), ADD INDEX (FROM_UUID); 


UPDATE NODE T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_PARENT=CT.ID_INTERNAL WHERE T.KEY_PARENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE NODE T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_CHILD=CT.ID_INTERNAL WHERE T.KEY_CHILD=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_INITIAL_CONTENT=CT.ID_INTERNAL WHERE T.KEY_INITIAL_CONTENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_PORTAL=CT.ID_INTERNAL WHERE T.KEY_PORTAL=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, AVAILABILITY_POLICY CT set T.KEY_AVAILABILITY_POLICY=CT.ID_INTERNAL WHERE T.KEY_AVAILABILITY_POLICY=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE AVAILABILITY_POLICY T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_CONTENT=CT.ID_INTERNAL WHERE T.KEY_CONTENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
DROP TABLE UUID_TEMP_TABLE;



COMMIT;
