Index: kernel-impl/src/main/sql/mssql/sakai_site.sql =================================================================== --- kernel-impl/src/main/sql/mssql/sakai_site.sql (revision 71223) +++ kernel-impl/src/main/sql/mssql/sakai_site.sql (revision 71608) @@ -44,7 +44,10 @@ IS_SPECIAL CHAR(1) NULL CHECK (IS_SPECIAL IN (1, 0)), IS_USER CHAR(1) NULL - CHECK (IS_USER IN (1, 0)) + CHECK (IS_USER IN (1, 0)), + IS_SOFTLY_DELETED CHAR(1) NULL + CHECK (IS_SOFTLY_DELETED IN (1, 0)), + SOFTLY_DELETED_DATE DATETIME NULL ) ; sp_tableoption 'SAKAI_SITE', 'large value types out of row', 'true' @@ -210,7 +213,7 @@ ; -- Create sites for the administrator. -INSERT INTO SAKAI_SITE VALUES('~admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, 0, 0, '', null, null, null, null, 0, 1 ) +INSERT INTO SAKAI_SITE VALUES('~admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, 0, 0, '', null, null, null, null, 0, 1, 0, null ) INSERT INTO SAKAI_SITE_PAGE VALUES('~admin-100', '~admin', 'Home', '0', 1, '0' ) INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('~admin', '~admin-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('~admin-110', '~admin-100', '~admin', 'sakai.motd', 1, 'Message of the Day', NULL ) @@ -244,7 +247,7 @@ INSERT INTO SAKAI_SITE_PAGE VALUES('~admin-1000', '~admin', 'Super User', '0', 13, '0' ) INSERT INTO SAKAI_SITE_TOOL VALUES('~admin-1010', '~admin-1000', '~admin', 'sakai.su', 1, 'Super User', NULL ) -INSERT INTO SAKAI_SITE VALUES('!admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, 0, 0, '', null, null, null, null, 0, 0 ) +INSERT INTO SAKAI_SITE VALUES('!admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, 0, 0, '', null, null, null, null, 0, 0, 0, null ) INSERT INTO SAKAI_SITE_PAGE VALUES('!admin-100', '!admin', 'Home', '0', 1, '0' ) INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!admin', '!admin-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!admin-110', '!admin-100', '!admin', 'sakai.motd', 1, 'Message of the Day', NULL ) @@ -282,7 +285,7 @@ -- Create the !error site to be displayed when there is a problem accessing a site. -INSERT INTO SAKAI_SITE VALUES('!error', 'Site Unavailable', null, null, 'The site you requested is not available.', null, null, null, 1, 0, 0, '', null, null, null, null, 1, 0 ) +INSERT INTO SAKAI_SITE VALUES('!error', 'Site Unavailable', null, null, 'The site you requested is not available.', null, null, null, 1, 0, 0, '', null, null, null, null, 1, 0, 0, null ) UPDATE SAKAI_SITE SET CREATEDBY='admin' WHERE SITE_ID = '!error' UPDATE SAKAI_SITE SET MODIFIEDBY='admin' WHERE SITE_ID = '!error' UPDATE SAKAI_SITE SET MODIFIEDON='2003-06-24 12:10:53.597' WHERE SITE_ID = '!error' @@ -295,7 +298,7 @@ -- Create the !urlError site to be used when there is a problem understanding the user's request url. -INSERT INTO SAKAI_SITE VALUES('!urlError', 'Invalid URL', null, null, 'The URL you entered is invalid. SOLUTIONS: Please check for spelling errors or typos. Make sure you are using the right URL. Type a URL to try again.', null, null, null, 1, 0, 0, '', null, null, null, null, 1, 0 ) +INSERT INTO SAKAI_SITE VALUES('!urlError', 'Invalid URL', null, null, 'The URL you entered is invalid. SOLUTIONS: Please check for spelling errors or typos. Make sure you are using the right URL. Type a URL to try again.', null, null, null, 1, 0, 0, '', null, null, null, null, 1, 0, 0, null ) UPDATE SAKAI_SITE SET CREATEDBY='admin' WHERE SITE_ID = '!urlError' UPDATE SAKAI_SITE SET MODIFIEDBY='admin' WHERE SITE_ID = '!urlError' UPDATE SAKAI_SITE SET MODIFIEDON='2003-06-24 12:10:53.597' WHERE SITE_ID = '!urlError' @@ -308,7 +311,7 @@ -- Create the !gateway site to be used for the user's initial view of Sakai. -INSERT INTO SAKAI_SITE VALUES('!gateway', 'Gateway', null, null, 'The Gateway Site', null, null, null, 1, 0, 0, '', null, null, null, null, 1, 0 ) +INSERT INTO SAKAI_SITE VALUES('!gateway', 'Gateway', null, null, 'The Gateway Site', null, null, null, 1, 0, 0, '', null, null, null, null, 1, 0, 0, null ) UPDATE SAKAI_SITE SET MODIFIEDBY='admin' WHERE SITE_ID = '!gateway' UPDATE SAKAI_SITE SET MODIFIEDON='2003-11-26 03:45:22.061' WHERE SITE_ID = '!gateway' INSERT INTO SAKAI_SITE_PAGE VALUES('!gateway-100', '!gateway', 'Welcome', '0', 1, '0' ) @@ -341,7 +344,7 @@ -- Create the !user site to be used as the template for a new user's site. -INSERT INTO SAKAI_SITE VALUES('!user', 'My Workspace', null, null, 'My Workspace Site', null, null, null, 1, 0, 0, '', null, null, null, null, 1, 0 ) +INSERT INTO SAKAI_SITE VALUES('!user', 'My Workspace', null, null, 'My Workspace Site', null, null, null, 1, 0, 0, '', null, null, null, null, 1, 0, 0, null ) INSERT INTO SAKAI_SITE_PAGE VALUES('!user-100', '!user', 'Home', '0', 1, '0' ) INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!user', '!user-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!user-110', '!user-100', '!user', 'sakai.motd', 1, 'Message of the Day', NULL ) @@ -369,7 +372,7 @@ -- Create the !worksite site. -INSERT INTO SAKAI_SITE VALUES('!worksite', 'worksite', null, null, null, '', '', null, 0, 0, 0, 'access', null, null, null, null, 1, 0 ) +INSERT INTO SAKAI_SITE VALUES('!worksite', 'worksite', null, null, null, '', '', null, 0, 0, 0, 'access', null, null, null, null, 1, 0, 0, null ) UPDATE SAKAI_SITE SET CREATEDBY='admin' WHERE SITE_ID = '!worksite' UPDATE SAKAI_SITE SET MODIFIEDBY='admin' WHERE SITE_ID = '!worksite' UPDATE SAKAI_SITE SET MODIFIEDON='2003-06-24 12:10:53.597' WHERE SITE_ID = '!worksite' Index: kernel-impl/src/main/sql/mysql/sakai_site.sql =================================================================== --- kernel-impl/src/main/sql/mysql/sakai_site.sql (revision 71223) +++ kernel-impl/src/main/sql/mysql/sakai_site.sql (revision 71608) @@ -41,7 +41,10 @@ IS_USER CHAR(1) NULL CHECK (IS_USER IN (1, 0)), CUSTOM_PAGE_ORDERED CHAR(1) NULL - CHECK (CUSTOM_PAGE_ORDERED IN (1, 0)) + CHECK (CUSTOM_PAGE_ORDERED IN (1, 0)), + IS_SOFTLY_DELETED CHAR(1) NULL + CHECK (IS_SOFTLY_DELETED IN (1, 0)), + SOFTLY_DELETED_DATE DATETIME NULL ); ALTER TABLE SAKAI_SITE @@ -196,7 +199,7 @@ -- Create sites for the administrator. -INSERT INTO SAKAI_SITE VALUES('~admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 0, 1, 0); +INSERT INTO SAKAI_SITE VALUES('~admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 0, 1, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('~admin-100', '~admin', 'Home', '0', 1, '0' ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('~admin', '~admin-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('~admin-110', '~admin-100', '~admin', 'sakai.motd', 1, 'Message of the Day', NULL ); @@ -232,7 +235,7 @@ INSERT INTO SAKAI_SITE_PAGE VALUES('~admin-1200', '~admin', 'User Membership', '0', 14, '0' ); INSERT INTO SAKAI_SITE_TOOL VALUES('~admin-1210', '~admin-1200', '~admin', 'sakai.usermembership', 1, 'User Membership', NULL ); -INSERT INTO SAKAI_SITE VALUES('!admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 0, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 0, 0, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('!admin-100', '!admin', 'Home', '0', 1, '0' ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!admin', '!admin-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!admin-110', '!admin-100', '!admin', 'sakai.motd', 1, 'Message of the Day', NULL ); @@ -271,21 +274,21 @@ -- Create the !error site to be displayed when there is a problem accessing a site. -INSERT INTO SAKAI_SITE VALUES('!error', 'Site Unavailable', null, null, 'The site you requested is not available.', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 1, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!error', 'Site Unavailable', null, null, 'The site you requested is not available.', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 1, 0, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('!error-100', '!error', 'Site Unavailable', '1', 1, '0' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!error-110', '!error-100', '!error', 'sakai.iframe.site', 1, 'Site Unavailable', NULL ); INSERT INTO SAKAI_SITE_TOOL_PROPERTY VALUES('!error', '!error-110', 'height', '400px' ); -- Create the !urlError site to be used when there is a problem understanding the user's request url. -INSERT INTO SAKAI_SITE VALUES('!urlError', 'Invalid URL', null, null, 'The URL you entered is invalid. SOLUTIONS: Please check for spelling errors or typos. Make sure you are using the right URL. Type a URL to try again.', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 1, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!urlError', 'Invalid URL', null, null, 'The URL you entered is invalid. SOLUTIONS: Please check for spelling errors or typos. Make sure you are using the right URL. Type a URL to try again.', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 1, 0, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('!urlError-100', '!urlError', 'Invalid URL', '1', 1, '0' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!urlError-110', '!urlError-100', '!urlError', 'sakai.iframe.site', 1, 'Invalid URL', NULL ); INSERT INTO SAKAI_SITE_TOOL_PROPERTY VALUES('!urlError', '!urlError-110', 'height', '400px' ); -- Create the !gateway site to be used for the user's initial view of Sakai. -INSERT INTO SAKAI_SITE VALUES('!gateway', 'Gateway', null, null, 'The Gateway Site', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 1, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!gateway', 'Gateway', null, null, 'The Gateway Site', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 1, 0, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('!gateway-100', '!gateway', 'Welcome', '0', 1, '0' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!gateway-110', '!gateway-100', '!gateway', 'sakai.motd', 1, 'Message of the day', NULL ); INSERT INTO SAKAI_SITE_TOOL VALUES('!gateway-120', '!gateway-100', '!gateway', 'sakai.iframe.service', 2, 'Welcome!', NULL ); @@ -317,7 +320,7 @@ -- Create the !user site to be used as the template for a new user's site. -INSERT INTO SAKAI_SITE VALUES('!user', 'My Workspace', null, null, 'My Workspace Site', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 1, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!user', 'My Workspace', null, null, 'My Workspace Site', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 1, 0, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('!user-100', '!user', 'Home', '1', 1, '0' ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!user', '!user-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!user-110', '!user-100', '!user', 'sakai.motd', 1, 'Message of the Day', '0,0' ); @@ -348,7 +351,7 @@ -- Create the !worksite site. -INSERT INTO SAKAI_SITE VALUES('!worksite', 'worksite', null, null, null, '', '', null, 0, 0, 0, 'access', 'admin', 'admin', NOW(), NOW(), 1, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!worksite', 'worksite', null, null, null, '', '', null, 0, 0, 0, 'access', 'admin', 'admin', NOW(), NOW(), 1, 0, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('!worksite-100', '!worksite', 'Home', '1', 1, '0' ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!worksite', '!worksite-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!worksite-110', '!worksite-100', '!worksite', 'sakai.iframe.site', 1, 'My Workspace Information', NULL ); @@ -383,7 +386,7 @@ -- Create the mercury site. -INSERT INTO SAKAI_SITE VALUES('mercury', 'mercury site', null, null, null, '', '', null, 1, 1, 1, 'access', 'admin', 'admin', NOW(), NOW(), 0, 0, 0); +INSERT INTO SAKAI_SITE VALUES('mercury', 'mercury site', null, null, null, '', '', null, 1, 1, 1, 'access', 'admin', 'admin', NOW(), NOW(), 0, 0, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('mercury-100', 'mercury', 'Home', '1', 1, '0' ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('mercury', 'mercury-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('mercury-110', 'mercury-100', 'mercury', 'sakai.iframe.site', 1, 'My Workspace Information', NULL ); Index: kernel-impl/src/main/sql/oracle/sakai_site.sql =================================================================== --- kernel-impl/src/main/sql/oracle/sakai_site.sql (revision 71223) +++ kernel-impl/src/main/sql/oracle/sakai_site.sql (revision 71608) @@ -41,7 +41,10 @@ IS_USER CHAR(1) NULL CHECK (IS_USER IN (1, 0)), CUSTOM_PAGE_ORDERED CHAR(1) NULL - CHECK (CUSTOM_PAGE_ORDERED IN (1, 0)) + CHECK (CUSTOM_PAGE_ORDERED IN (1, 0)), + IS_SOFTLY_DELETED CHAR(1) NULL + CHECK (IS_SOFTLY_DELETED IN (1, 0)), + SOFTLY_DELETED_DATE DATETIME NULL ); ALTER TABLE SAKAI_SITE @@ -211,7 +214,7 @@ -- Create sites for the administrator. -INSERT INTO SAKAI_SITE VALUES('~admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, 0, 0, '', null, null, null, null, 0, 1, 0); +INSERT INTO SAKAI_SITE VALUES('~admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, 0, 0, '', null, null, null, null, 0, 1, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('~admin-100', '~admin', 'Home', '0', 1, '0' ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('~admin', '~admin-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('~admin-110', '~admin-100', '~admin', 'sakai.motd', 1, 'Message of the Day', NULL ); @@ -246,7 +249,7 @@ INSERT INTO SAKAI_SITE_PAGE VALUES('~admin-1200', '~admin', 'User Membership', '0', 14, '0' ); INSERT INTO SAKAI_SITE_TOOL VALUES('~admin-1210', '~admin-1200', '~admin', 'sakai.usermembership', 1, 'User Membership', NULL ); -INSERT INTO SAKAI_SITE VALUES('!admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, 0, 0, '', null, null, null, null, 0, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, 0, 0, '', null, null, null, null, 0, 0, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('!admin-100', '!admin', 'Home', '0', 1, '0' ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!admin', '!admin-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!admin-110', '!admin-100', '!admin', 'sakai.motd', 1, 'Message of the Day', NULL ); @@ -285,7 +288,7 @@ -- Create the !error site to be displayed when there is a problem accessing a site. -INSERT INTO SAKAI_SITE VALUES('!error', 'Site Unavailable', null, null, 'The site you requested is not available.', null, null, null, 1, 0, 0, '', null, null, null, null, 1, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!error', 'Site Unavailable', null, null, 'The site you requested is not available.', null, null, null, 1, 0, 0, '', null, null, null, null, 1, 0, 0, 0, null); UPDATE SAKAI_SITE SET CREATEDBY='admin' WHERE SITE_ID = '!error'; UPDATE SAKAI_SITE SET MODIFIEDBY='admin' WHERE SITE_ID = '!error'; UPDATE SAKAI_SITE SET MODIFIEDON=TO_TIMESTAMP('20030624121053597','YYYYMMDDHHMISSFF6') WHERE SITE_ID = '!error'; @@ -296,7 +299,7 @@ -- Create the !urlError site to be used when there is a problem understanding the user's request url. -INSERT INTO SAKAI_SITE VALUES('!urlError', 'Invalid URL', null, null, 'The URL you entered is invalid. SOLUTIONS: Please check for spelling errors or typos. Make sure you are using the right URL. Type a URL to try again.', null, null, null, 1, 0, 0, '', null, null, null, null, 1, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!urlError', 'Invalid URL', null, null, 'The URL you entered is invalid. SOLUTIONS: Please check for spelling errors or typos. Make sure you are using the right URL. Type a URL to try again.', null, null, null, 1, 0, 0, '', null, null, null, null, 1, 0, 0, 0, null); UPDATE SAKAI_SITE SET CREATEDBY='admin' WHERE SITE_ID = '!urlError'; UPDATE SAKAI_SITE SET MODIFIEDBY='admin' WHERE SITE_ID = '!urlError'; UPDATE SAKAI_SITE SET MODIFIEDON=TO_TIMESTAMP('20030624121053597','YYYYMMDDHHMISSFF3') WHERE SITE_ID = '!urlError'; @@ -307,7 +310,7 @@ -- Create the !gateway site to be used for the user's initial view of Sakai. -INSERT INTO SAKAI_SITE VALUES('!gateway', 'Gateway', null, null, 'The Gateway Site', null, null, null, 1, 0, 0, '', null, null, null, null, 1, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!gateway', 'Gateway', null, null, 'The Gateway Site', null, null, null, 1, 0, 0, '', null, null, null, null, 1, 0, 0, 0, null); UPDATE SAKAI_SITE SET MODIFIEDBY='admin' WHERE SITE_ID = '!gateway'; UPDATE SAKAI_SITE SET MODIFIEDON=TO_TIMESTAMP('20031126034522061','YYYYMMDDHHMISSFF3') WHERE SITE_ID = '!gateway'; INSERT INTO SAKAI_SITE_PAGE VALUES('!gateway-100', '!gateway', 'Welcome', '0', 1, '0' ); @@ -340,7 +343,7 @@ -- Create the !user site to be used as the template for a new user's site. -INSERT INTO SAKAI_SITE VALUES('!user', 'My Workspace', null, null, 'My Workspace Site', null, null, null, 1, 0, 0, '', null, null, null, null, 1, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!user', 'My Workspace', null, null, 'My Workspace Site', null, null, null, 1, 0, 0, '', null, null, null, null, 1, 0, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('!user-100', '!user', 'Home', '1', 1, '0' ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!user', '!user-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!user-110', '!user-100', '!user', 'sakai.motd', 1, 'Message of the Day', '0,0' ); @@ -371,7 +374,7 @@ -- Create the !worksite site. -INSERT INTO SAKAI_SITE VALUES('!worksite', 'worksite', null, null, null, '', '', null, 0, 0, 0, 'access', null, null, null, null, 1, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!worksite', 'worksite', null, null, null, '', '', null, 0, 0, 0, 'access', null, null, null, null, 1, 0, 0, 0, null); UPDATE SAKAI_SITE SET CREATEDBY='admin' WHERE SITE_ID = '!worksite'; UPDATE SAKAI_SITE SET MODIFIEDBY='admin' WHERE SITE_ID = '!worksite'; UPDATE SAKAI_SITE SET MODIFIEDON=TO_TIMESTAMP('20030624121053597','YYYYMMDDHHMISSFF3') WHERE SITE_ID = '!worksite'; @@ -410,7 +413,7 @@ -- Create the mercury site. -INSERT INTO SAKAI_SITE VALUES('mercury', 'mercury site', null, null, null, '', '', null, 1, 1, 1, 'access', null, null, null, null, 0, 0, 0); +INSERT INTO SAKAI_SITE VALUES('mercury', 'mercury site', null, null, null, '', '', null, 1, 1, 1, 'access', null, null, null, null, 0, 0, 0, 0, null); UPDATE SAKAI_SITE SET CREATEDBY='admin' WHERE SITE_ID = 'mercury'; UPDATE SAKAI_SITE SET MODIFIEDBY='admin' WHERE SITE_ID = 'mercury'; UPDATE SAKAI_SITE SET MODIFIEDON=TO_TIMESTAMP('20030624121053597','YYYYMMDDHHMISSFF3') WHERE SITE_ID = 'mercury'; Index: kernel-impl/src/main/sql/db2/sakai_site.sql =================================================================== --- kernel-impl/src/main/sql/db2/sakai_site.sql (revision 71223) +++ kernel-impl/src/main/sql/db2/sakai_site.sql (revision 71608) @@ -39,7 +39,10 @@ IS_SPECIAL CHAR(1), CHECK (IS_SPECIAL IN ('1', '0')), IS_USER CHAR(1), - CHECK (IS_USER IN ('1', '0')) + CHECK (IS_USER IN ('1', '0')), + IS_SOFTLY_DELETED CHAR(1), + CHECK (IS_SOFTLY_DELETED IN ('1', '0')), + SOFTLY_DELETED_DATE TIMESTAMP ) ORGANIZE BY DIMENSIONS(PUBLISHED, JOINABLE, PUBVIEW, IS_SPECIAL, IS_USER); ALTER TABLE SAKAI_SITE @@ -188,7 +191,7 @@ -- Create sites for the administrator. -INSERT INTO SAKAI_SITE VALUES('~admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, '0', '0', '', 'admin', 'admin', CURRENT TIMESTAMP, CURRENT TIMESTAMP, '0', '1' ); +INSERT INTO SAKAI_SITE VALUES('~admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, '0', '0', '', 'admin', 'admin', CURRENT TIMESTAMP, CURRENT TIMESTAMP, '0', '1', '0', null); INSERT INTO SAKAI_SITE_PAGE VALUES('~admin-100', '~admin', 'Home', '0', 1, '0' ); INSERT INTO SAKAI_SITE_TOOL VALUES('~admin-110', '~admin-100', '~admin', 'sakai.motd', 1, 'Message of the Day', NULL ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('~admin', '~admin-100', 'is_home_page', 'true' ); @@ -222,7 +225,7 @@ INSERT INTO SAKAI_SITE_PAGE VALUES('~admin-1000', '~admin', 'Super User', '0', 13, '0' ); INSERT INTO SAKAI_SITE_TOOL VALUES('~admin-1010', '~admin-1000', '~admin', 'sakai.su', 1, 'Super User', NULL ); -INSERT INTO SAKAI_SITE VALUES('!admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, '0', '0', '', 'admin', 'admin', CURRENT TIMESTAMP, CURRENT TIMESTAMP, '0', '0' ); +INSERT INTO SAKAI_SITE VALUES('!admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, '0', '0', '', 'admin', 'admin', CURRENT TIMESTAMP, CURRENT TIMESTAMP, '0', '0', '0', null); INSERT INTO SAKAI_SITE_PAGE VALUES('!admin-100', '!admin', 'Home', '0', 1, '0' ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!admin', '!admin-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!admin-110', '!admin-100', '!admin', 'sakai.motd', 1, 'Message of the Day', NULL ); @@ -260,7 +263,7 @@ -- Create the !error site to be displayed when there is a problem accessing a site. -INSERT INTO SAKAI_SITE VALUES('!error', 'Site Unavailable', null, null, 'The site you requested is not available.', null, null, null, 1, '0', '0', '', 'admin', 'admin', CURRENT TIMESTAMP, CURRENT TIMESTAMP, '1', '0' ); +INSERT INTO SAKAI_SITE VALUES('!error', 'Site Unavailable', null, null, 'The site you requested is not available.', null, null, null, 1, '0', '0', '', 'admin', 'admin', CURRENT TIMESTAMP, CURRENT TIMESTAMP, '1', '0', '0', null); UPDATE SAKAI_SITE SET CREATEDBY='admin' WHERE SITE_ID = '!error'; UPDATE SAKAI_SITE SET MODIFIEDBY='admin' WHERE SITE_ID = '!error'; UPDATE SAKAI_SITE SET MODIFIEDON='2003-06-24 12:10:53.597000' WHERE SITE_ID = '!error'; @@ -271,7 +274,7 @@ -- Create the !urlError site to be used when there is a problem understanding the user's request url. -INSERT INTO SAKAI_SITE VALUES('!urlError', 'Invalid URL', null, null, 'The URL you entered is invalid. SOLUTIONS: Please check for spelling errors or typos. Make sure you are using the right URL. Type a URL to try again.', null, null, null, 1, '0', '0', '', 'admin', 'admin', CURRENT TIMESTAMP, CURRENT TIMESTAMP, '1', '0' ); +INSERT INTO SAKAI_SITE VALUES('!urlError', 'Invalid URL', null, null, 'The URL you entered is invalid. SOLUTIONS: Please check for spelling errors or typos. Make sure you are using the right URL. Type a URL to try again.', null, null, null, 1, '0', '0', '', 'admin', 'admin', CURRENT TIMESTAMP, CURRENT TIMESTAMP, '1', '0', '0', null); UPDATE SAKAI_SITE SET CREATEDBY='admin' WHERE SITE_ID = '!urlError'; UPDATE SAKAI_SITE SET MODIFIEDBY='admin' WHERE SITE_ID = '!urlError'; UPDATE SAKAI_SITE SET MODIFIEDON='2003-06-24 12:10:53.597000' WHERE SITE_ID = '!urlError'; @@ -282,7 +285,7 @@ -- Create the !gateway site to be used for the user's initial view of Sakai. -INSERT INTO SAKAI_SITE VALUES('!gateway', 'Gateway', null, null, 'The Gateway Site', null, null, null, 1, '0', '0', '', 'admin', 'admin', CURRENT TIMESTAMP, CURRENT TIMESTAMP, '1', '0' ); +INSERT INTO SAKAI_SITE VALUES('!gateway', 'Gateway', null, null, 'The Gateway Site', null, null, null, 1, '0', '0', '', 'admin', 'admin', CURRENT TIMESTAMP, CURRENT TIMESTAMP, '1', '0', '0', null); UPDATE SAKAI_SITE SET MODIFIEDBY='admin' WHERE SITE_ID = '!gateway'; UPDATE SAKAI_SITE SET MODIFIEDON='2003-11-26 03:45:22.061000' WHERE SITE_ID = '!gateway'; INSERT INTO SAKAI_SITE_PAGE VALUES('!gateway-100', '!gateway', 'Welcome', '0', 1, '0' ); @@ -315,7 +318,7 @@ -- Create the !user site to be used as the template for a new user's site. -INSERT INTO SAKAI_SITE VALUES('!user', 'My Workspace', null, null, 'My Workspace Site', null, null, null, 1, '0', '0', '', 'admin', 'admin', CURRENT TIMESTAMP, CURRENT TIMESTAMP, '1', '0' ); +INSERT INTO SAKAI_SITE VALUES('!user', 'My Workspace', null, null, 'My Workspace Site', null, null, null, 1, '0', '0', '', 'admin', 'admin', CURRENT TIMESTAMP, CURRENT TIMESTAMP, '1', '0', '0', null); INSERT INTO SAKAI_SITE_PAGE VALUES('!user-100', '!user', 'Home', '0', 1, '0' ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!user', '!user-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!user-110', '!user-100', '!user', 'sakai.motd', 1, 'Message of the Day', NULL ); @@ -343,7 +346,7 @@ -- Create the !worksite site. -INSERT INTO SAKAI_SITE VALUES('!worksite', 'worksite', null, null, null, '', '', null, 0, '0', '0', 'access', 'admin', 'admin', CURRENT TIMESTAMP, CURRENT TIMESTAMP, '1', '0' ); +INSERT INTO SAKAI_SITE VALUES('!worksite', 'worksite', null, null, null, '', '', null, 0, '0', '0', 'access', 'admin', 'admin', CURRENT TIMESTAMP, CURRENT TIMESTAMP, '1', '0', '0', null); UPDATE SAKAI_SITE SET CREATEDBY='admin' WHERE SITE_ID = '!worksite'; UPDATE SAKAI_SITE SET MODIFIEDBY='admin' WHERE SITE_ID = '!worksite'; UPDATE SAKAI_SITE SET MODIFIEDON='2003-06-24 12:10:53.597000' WHERE SITE_ID = '!worksite'; @@ -382,7 +385,7 @@ -- Create the mercury site. -INSERT INTO SAKAI_SITE VALUES('mercury', 'mercury site', null, null, null, '', '', null, 1, '1', '1', 'access', 'admin', 'admin', CURRENT TIMESTAMP, CURRENT TIMESTAMP, '0', '0' ); +INSERT INTO SAKAI_SITE VALUES('mercury', 'mercury site', null, null, null, '', '', null, 1, '1', '1', 'access', 'admin', 'admin', CURRENT TIMESTAMP, CURRENT TIMESTAMP, '0', '0', '0', null); INSERT INTO SAKAI_SITE_PAGE VALUES('mercury-100', 'mercury', 'Home', '1', 1, '0' ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('mercury', 'mercury-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('mercury-110', 'mercury-100', 'mercury', 'sakai.iframe.site', 1, 'My Workspace Information', NULL ); Index: kernel-impl/src/main/sql/hsqldb/sakai_site.sql =================================================================== --- kernel-impl/src/main/sql/hsqldb/sakai_site.sql (revision 71223) +++ kernel-impl/src/main/sql/hsqldb/sakai_site.sql (revision 71608) @@ -39,6 +39,10 @@ -- CHECK (IS_USER IN (1, 0)), CUSTOM_PAGE_ORDERED CHAR(1) NULL, -- CHECK (CUSTOM_PAGE_ORDERED IN (1, 0)), + IS_SOFTLY_DELETED CHAR(1) NULL, +-- CHECK (IS_SOFTLY_DELETED IN (1, 0)), + SOFTLY_DELETED_DATE DATETIME NULL, + PRIMARY KEY (SITE_ID) ); @@ -180,7 +184,7 @@ -- Create sites for the administrator. -INSERT INTO SAKAI_SITE VALUES('~admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 0, 1, 0); +INSERT INTO SAKAI_SITE VALUES('~admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 0, 1, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('~admin-100', '~admin', 'Home', '0', 1, '0' ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('~admin', '~admin-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('~admin-110', '~admin-100', '~admin', 'sakai.motd', 1, 'Message of the Day', NULL ); @@ -215,7 +219,7 @@ INSERT INTO SAKAI_SITE_PAGE VALUES('~admin-1200', '~admin', 'User Membership', '0', 14, '0' ); INSERT INTO SAKAI_SITE_TOOL VALUES('~admin-1210', '~admin-1200', '~admin', 'sakai.usermembership', 1, 'User Membership', NULL ); -INSERT INTO SAKAI_SITE VALUES('!admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 0, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!admin', 'Administration Workspace', null, null, 'Administration Workspace', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 0, 0, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('!admin-100', '!admin', 'Home', '0', 1, '0' ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!admin', '!admin-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!admin-110', '!admin-100', '!admin', 'sakai.motd', 1, 'Message of the Day', NULL ); @@ -254,14 +258,14 @@ -- Create the !error site to be displayed when there is a problem accessing a site. -INSERT INTO SAKAI_SITE VALUES('!error', 'Site Unavailable', null, null, 'The site you requested is not available.', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 1, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!error', 'Site Unavailable', null, null, 'The site you requested is not available.', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 1, 0, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('!error-100', '!error', 'Site Unavailable', '1', 1, '0' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!error-110', '!error-100', '!error', 'sakai.iframe.site', 1, 'Site Unavailable', NULL ); INSERT INTO SAKAI_SITE_TOOL_PROPERTY VALUES('!error', '!error-110', 'height', '400px' ); -- Create the !urlError site to be used when there is a problem understanding the user's request url. -INSERT INTO SAKAI_SITE VALUES('!urlError', 'Invalid URL', null, null, 'The URL you entered is invalid. SOLUTIONS: Please check for spelling errors or typos. Make sure you are using the right URL. Type a URL to try again.', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 1, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!urlError', 'Invalid URL', null, null, 'The URL you entered is invalid. SOLUTIONS: Please check for spelling errors or typos. Make sure you are using the right URL. Type a URL to try again.', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 1, 0, 0, 0, null); --UPDATE SAKAI_SITE SET MODIFIEDON=TO_TIMESTAMP('20030624121053597','YYYYMMDDHHMISSFF3') WHERE SITE_ID = '!urlError'; --UPDATE SAKAI_SITE SET CREATEDON=TO_TIMESTAMP('20030624041508851','YYYYMMDDHHMISSFF3') WHERE SITE_ID = '!urlError'; INSERT INTO SAKAI_SITE_PAGE VALUES('!urlError-100', '!urlError', 'Invalid URL', '1', 1, '0' ); @@ -270,7 +274,7 @@ -- Create the !gateway site to be used for the user's initial view of Sakai. -INSERT INTO SAKAI_SITE VALUES('!gateway', 'Gateway', null, null, 'The Gateway Site', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 1, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!gateway', 'Gateway', null, null, 'The Gateway Site', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 1, 0, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('!gateway-100', '!gateway', 'Welcome', '0', 1, '0' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!gateway-110', '!gateway-100', '!gateway', 'sakai.motd', 1, 'Message of the day', NULL ); INSERT INTO SAKAI_SITE_TOOL VALUES('!gateway-120', '!gateway-100', '!gateway', 'sakai.iframe.service', 2, 'Welcome!', NULL ); @@ -301,7 +305,7 @@ -- Create the !user site to be used as the template for a new user's site. -INSERT INTO SAKAI_SITE VALUES('!user', 'My Workspace', null, null, 'My Workspace Site', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 1, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!user', 'My Workspace', null, null, 'My Workspace Site', null, null, null, 1, 0, 0, '', 'admin', 'admin', NOW(), NOW(), 1, 0, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('!user-100', '!user', 'Home', '1', 1, '0' ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!user', '!user-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!user-110', '!user-100', '!user', 'sakai.motd', 1, 'Message of the Day', '0,0' ); @@ -332,7 +336,7 @@ -- Create the !worksite site. -INSERT INTO SAKAI_SITE VALUES('!worksite', 'worksite', null, null, null, '', '', null, 0, 0, 0, 'access', 'admin', 'admin', NOW(), NOW(), 1, 0, 0); +INSERT INTO SAKAI_SITE VALUES('!worksite', 'worksite', null, null, null, '', '', null, 0, 0, 0, 'access', 'admin', 'admin', NOW(), NOW(), 1, 0, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('!worksite-100', '!worksite', 'Home', '1', 1, '0' ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('!worksite', '!worksite-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('!worksite-110', '!worksite-100', '!worksite', 'sakai.iframe.site', 1, 'Site Information', NULL ); @@ -367,7 +371,7 @@ -- Create the mercury site. -INSERT INTO SAKAI_SITE VALUES('mercury', 'mercury site', null, null, null, '', '', null, 1, 1, 1, 'access', 'admin', 'admin', NOW(), NOW(), 0, 0, 0); +INSERT INTO SAKAI_SITE VALUES('mercury', 'mercury site', null, null, null, '', '', null, 1, 1, 1, 'access', 'admin', 'admin', NOW(), NOW(), 0, 0, 0, 0, null); INSERT INTO SAKAI_SITE_PAGE VALUES('mercury-100', 'mercury', 'Home', '1', 1, '0' ); INSERT INTO SAKAI_SITE_PAGE_PROPERTY VALUES('mercury', 'mercury-100', 'is_home_page', 'true' ); INSERT INTO SAKAI_SITE_TOOL VALUES('mercury-110', 'mercury-100', 'mercury', 'sakai.iframe.site', 1, 'Site Information', NULL ); Index: kernel-impl/src/main/java/org/sakaiproject/site/impl/BaseSite.java =================================================================== --- kernel-impl/src/main/java/org/sakaiproject/site/impl/BaseSite.java (revision 71223) +++ kernel-impl/src/main/java/org/sakaiproject/site/impl/BaseSite.java (revision 71608) @@ -168,6 +168,11 @@ private BaseSiteService siteService; + /** Softly deleted data */ + protected boolean m_isSoftlyDeleted = false; + protected Date m_softlyDeletedDate = null; + + /** * Construct. * @@ -470,7 +475,8 @@ String description, String iconUrl, String infoUrl, String skin, boolean published, boolean joinable, boolean pubView, String joinRole, boolean isSpecial, boolean isUser, String createdBy, Time createdOn, - String modifiedBy, Time modifiedOn, boolean customPageOrdered) + String modifiedBy, Time modifiedOn, boolean customPageOrdered, + boolean isSoftlyDeleted, Date softlyDeletedDate) { this.siteService = siteService; @@ -509,6 +515,11 @@ m_pagesLazy = true; m_groupsLazy = true; + + // soft site deletions - new sites get defaults + m_isSoftlyDeleted = isSoftlyDeleted; + m_softlyDeletedDate = softlyDeletedDate; + } /** @@ -540,6 +551,11 @@ m_type = other.m_type; m_pubView = other.m_pubView; m_customPageOrdered = other.m_customPageOrdered; + + //site copies keep soft site deletion flags + m_isSoftlyDeleted = other.m_isSoftlyDeleted; + m_softlyDeletedDate = other.m_softlyDeletedDate; + if (exact) { m_createdUserId = other.m_createdUserId; @@ -1678,5 +1694,23 @@ return changed; } + public boolean isSoftlyDeleted() { + return m_isSoftlyDeleted; + } + + public Date getSoftlyDeletedDate() { + return m_softlyDeletedDate; + } + + public void setSoftlyDeleted(boolean flag) { + m_isSoftlyDeleted = flag; + if(flag) { + m_softlyDeletedDate = new Date(); + } else { + m_softlyDeletedDate = null; + } + } + + } Index: kernel-impl/src/main/java/org/sakaiproject/site/impl/SiteServiceSql.java =================================================================== --- kernel-impl/src/main/java/org/sakaiproject/site/impl/SiteServiceSql.java (revision 71223) +++ kernel-impl/src/main/java/org/sakaiproject/site/impl/SiteServiceSql.java (revision 71608) @@ -350,4 +350,30 @@ * returns the sql statement which updates a site into the sakai_site table. */ String getUpdateSiteSql(String table); + + /** + * returns the sql statement which is part of the where clause to retrieve sites which are softly deleted + * TODO this could take a param which further filters on date-gracetime + */ + String getSitesWhereSoftlyDeletedOnlySql(); + + /** + * returns the sql statement which is part of the order clause to retrieve sites ordered by softly deleted status + */ + String getSitesOrderSoftlyDeletedAscSql(); + + /** + * returns the sql statement which is part of the order clause to retrieve sites ordered by not being softly deleted + */ + String getSitesOrderSoftlyDeletedDescSql(); + + /** + * returns the sql statement which is part of the order clause to retrieve sites ordered by softly deleted date asc + */ + String getSitesOrderSoftlyDeletedDateAscSql(); + + /** + * returns the sql statement which is part of the order clause to retrieve sites ordered by softly deleted date desc + */ + String getSitesOrderSoftlyDeletedDateDescSql(); } Index: kernel-impl/src/main/java/org/sakaiproject/site/impl/SiteServiceSqlDefault.java =================================================================== --- kernel-impl/src/main/java/org/sakaiproject/site/impl/SiteServiceSqlDefault.java (revision 71223) +++ kernel-impl/src/main/java/org/sakaiproject/site/impl/SiteServiceSqlDefault.java (revision 71608) @@ -289,7 +289,7 @@ { return "SAKAI_SITE.MODIFIEDON DESC"; } - + /** * returns the sql statement which is part of the where clause to retrieve sites. */ @@ -554,4 +554,44 @@ { return "update " + table + " set DESCRIPTION = ?, INFO_URL = ? where SITE_ID = ?"; } + + /** + * returns the sql statement which is part of the where clause to retrieve sites which are softly deleted + */ + public String getSitesWhereSoftlyDeletedOnlySql() + { + return "SAKAI_SITE.IS_SOFTLY_DELETED = '1'"; + } + + /** + * returns the sql statement which is part of the order clause to retrieve sites ordered by softly deleted status + */ + public String getSitesOrderSoftlyDeletedAscSql() + { + return "SAKAI_SITE.IS_SOFTLY_DELETED ASC"; + } + + /** + * returns the sql statement which is part of the order clause to retrieve sites ordered by not being softly deleted + */ + public String getSitesOrderSoftlyDeletedDescSql() + { + return "SAKAI_SITE.IS_SOFTLY_DELETED DESC"; + } + + /** + * returns the sql statement which is part of the order clause to retrieve sites ordered by softly deleted date asc + */ + public String getSitesOrderSoftlyDeletedDateAscSql() + { + return "SAKAI_SITE.SOFTLY_DELETED_DATE ASC"; + } + + /** + * returns the sql statement which is part of the order clause to retrieve sites ordered by softly deleted date desc + */ + public String getSitesOrderSoftlyDeletedDateDescSql() + { + return "SAKAI_SITE.SOFTLY_DELETED_DATE DESC"; + } } Index: kernel-impl/src/main/java/org/sakaiproject/site/impl/BaseSiteService.java =================================================================== --- kernel-impl/src/main/java/org/sakaiproject/site/impl/BaseSiteService.java (revision 71223) +++ kernel-impl/src/main/java/org/sakaiproject/site/impl/BaseSiteService.java (revision 71608) @@ -474,6 +474,8 @@ functionManager().registerFunction(SECURE_UPDATE_SITE_MEMBERSHIP); functionManager().registerFunction(SECURE_UPDATE_GROUP_MEMBERSHIP); functionManager().registerFunction(SECURE_ADD_COURSE_SITE); + functionManager().registerFunction(SITE_VISIT_SOFTLY_DELETED); + } catch (Exception t) { @@ -517,7 +519,13 @@ try { Site site = getSite(id); - if (site.isPublished()) + + //check for softly deleted visit permission + if(site.isSoftlyDeleted()) { + rv = unlockCheck(SITE_VISIT_SOFTLY_DELETED, site.getReference()); + } + + else if (site.isPublished()) { rv = unlockCheck(SITE_VISIT, site.getReference()); } @@ -748,7 +756,12 @@ { // get the site Site rv = getSite(id); - + + //check if user has permission to visit a site that has been softly deleted + if(rv.isSoftlyDeleted()) { + unlock(SITE_VISIT_SOFTLY_DELETED, rv.getReference()); + } + // check for visit permission if (rv.isPublished()) { @@ -1622,6 +1635,13 @@ { return m_storage.getSites(type, ofType, criteria, propertyCriteria, sort, page); } + + /** + * @inheritDoc + */ + public List getSoftlyDeletedSites() { + return m_storage.getSoftlyDeletedSites(); + } /** * @inheritDoc @@ -2551,6 +2571,13 @@ * The Collection to fill in. */ public void readSiteGroups(Site site, Collection groups); + + /** + * Get all sites that have been softly deleted + * + * @return List of Sites or empty list if none. + */ + public List getSoftlyDeletedSites(); } /********************************************************************************************************************************************************************************************************************************************************** Index: kernel-impl/src/main/java/org/sakaiproject/site/impl/DbSiteService.java =================================================================== --- kernel-impl/src/main/java/org/sakaiproject/site/impl/DbSiteService.java (revision 71223) +++ kernel-impl/src/main/java/org/sakaiproject/site/impl/DbSiteService.java (revision 71608) @@ -25,6 +25,7 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.Collection; +import java.util.Date; import java.util.HashSet; import java.util.Iterator; import java.util.List; @@ -71,7 +72,8 @@ /** All fields for site. */ protected String[] m_siteFieldNames = {"SITE_ID", "TITLE", "TYPE", "SHORT_DESC", "DESCRIPTION", "ICON_URL", "INFO_URL", "SKIN", "PUBLISHED", - "JOINABLE", "PUBVIEW", "JOIN_ROLE", "IS_SPECIAL", "IS_USER", "CREATEDBY", "MODIFIEDBY", "CREATEDON", "MODIFIEDON", "CUSTOM_PAGE_ORDERED"}; + "JOINABLE", "PUBVIEW", "JOIN_ROLE", "IS_SPECIAL", "IS_USER", "CREATEDBY", "MODIFIEDBY", "CREATEDON", "MODIFIEDON", "CUSTOM_PAGE_ORDERED", + "IS_SOFTLY_DELETED", "SOFTLY_DELETED_DATE"}; /************************************************************************************************************************************************* * Dependencies @@ -657,6 +659,14 @@ { order = siteServiceSql.getSitesOrder16Sql(); } + else if (sort == SortType.SOFTLY_DELETED_ASC) + { + order = siteServiceSql.getSitesOrderSoftlyDeletedAscSql(); + } + else if (sort == SortType.SOFTLY_DELETED_DESC) + { + order = siteServiceSql.getSitesOrderSoftlyDeletedDescSql(); + } return order; } @@ -826,6 +836,22 @@ /** * {@inheritDoc} */ + public List getSoftlyDeletedSites() { + + List rv = null; + String where = siteServiceSql.getSitesWhereSoftlyDeletedOnlySql(); + Object[] fields = getSitesFields( SelectionType.ANY, null, null, null ); + String order = getSitesOrder( SortType.SOFTLY_DELETED_DATE_ASC ); + + rv = getSelectedResources(where, order, fields, null); + + return rv; + + } + + /** + * {@inheritDoc} + */ public List getSiteTypes() { String statement = siteServiceSql.getTypesSql(); @@ -2050,11 +2076,11 @@ */ protected Object[] fields(String id, Site edit, boolean idAgain) { - Object[] rv = new Object[idAgain ? 20 : 19]; + Object[] rv = new Object[idAgain ? 22 : 21]; rv[0] = caseId(id); if (idAgain) { - rv[19] = rv[0]; + rv[21] = rv[0]; } if (edit == null) @@ -2084,6 +2110,8 @@ rv[16] = now; rv[17] = now; rv[18] = "0"; + rv[19] = "0"; + rv[20] = null; } else @@ -2106,6 +2134,8 @@ rv[16] = edit.getCreatedTime(); rv[17] = edit.getModifiedTime(); rv[18] = edit.isCustomPageOrdered() ? "1" : "0"; + rv[19] = edit.isSoftlyDeleted() ? "1" : "0"; + rv[20] = edit.getSoftlyDeletedDate(); } return rv; @@ -2151,10 +2181,12 @@ modifiedOn = timeService().newTime(ts.getTime()); } boolean customPageOrdered = "1".equals(result.getString(19)) ? true : false; + boolean isSoftlyDeleted = "1".equals(result.getString(20)) ? true : false; + Date softlyDeletedDate = result.getDate(21); // create the Resource from these fields return new BaseSite(DbSiteService.this,id, title, type, shortDesc, description, icon, info, skin, published, joinable, pubView, joinRole, isSpecial, - isUser, createdBy, createdOn, modifiedBy, modifiedOn, customPageOrdered); + isUser, createdBy, createdOn, modifiedBy, modifiedOn, customPageOrdered, isSoftlyDeleted, softlyDeletedDate); } catch (SQLException e) { @@ -2162,5 +2194,6 @@ return null; } } + } } Index: api/src/main/java/org/sakaiproject/site/api/Site.java =================================================================== --- api/src/main/java/org/sakaiproject/site/api/Site.java (revision 71223) +++ api/src/main/java/org/sakaiproject/site/api/Site.java (revision 71608) @@ -23,6 +23,7 @@ import java.io.Serializable; import java.util.Collection; +import java.util.Date; import java.util.List; import org.sakaiproject.authz.api.AuthzGroup; @@ -371,4 +372,22 @@ * true if the site has a custom page ordering, false if not. */ void setCustomPageOrdered(boolean custom); + + /** + * Is this site softly deleted and hence queued for a hard delete? + * @return true if it has been softly deleted + */ + boolean isSoftlyDeleted(); + + /** + * If softly deleted, the date that occurred + * @return date if it has been softly deleted + */ + Date getSoftlyDeletedDate(); + + /** + * Set params for this site as softly deleted + * @param flag true or false + */ + void setSoftlyDeleted(boolean flag); } Index: api/src/main/java/org/sakaiproject/site/api/SiteService.java =================================================================== --- api/src/main/java/org/sakaiproject/site/api/SiteService.java (revision 71223) +++ api/src/main/java/org/sakaiproject/site/api/SiteService.java (revision 71608) @@ -82,6 +82,12 @@ /** Name for the event of removing a site. */ static final String SECURE_REMOVE_SITE = "site.del"; + + /** Name for the event of removing a site softly. */ + static final String SECURE_REMOVE_SITE_SOFTLY = "site.del.soft"; + + /** Name for the event of visiting a softly deleted site. */ + static final String SITE_VISIT_SOFTLY_DELETED = "site.visit.softly.deleted"; /** Name for the event of updating a site. */ static final String SECURE_UPDATE_SITE = "site.upd"; @@ -255,6 +261,18 @@ /** Sort on modified time DESC */ public static final SortType MODIFIED_ON_DESC = new SortType("modified on", false); + + /** Sort on softly deleted ASC */ + public static final SortType SOFTLY_DELETED_ASC = new SortType("softly deleted", true); + + /** Sort on softly deleted DESC */ + public static final SortType SOFTLY_DELETED_DESC = new SortType("softly deleted", false); + + /** Sort on softly deleted ASC */ + public static final SortType SOFTLY_DELETED_DATE_ASC = new SortType("softly deleted date", true); + + /** Sort on softly deleted DESC */ + public static final SortType SOFTLY_DELETED_DATE_DESC = new SortType("softly deleted date", false); } /** @@ -658,7 +676,16 @@ */ List getSites(SelectionType type, Object ofType, String criteria, Map propertyCriteria, SortType sort, PagingPosition page); + /** + * Get all sites that have been softly deleted + * + * @return List of Sites or empty list if none. + */ + List getSoftlyDeletedSites(); + + + /** * Count the Site objets that meet specified criteria. * * @param type Index: api/src/main/java/org/sakaiproject/site/cover/SiteService.java =================================================================== --- api/src/main/java/org/sakaiproject/site/cover/SiteService.java (revision 71223) +++ api/src/main/java/org/sakaiproject/site/cover/SiteService.java (revision 71608) @@ -22,6 +22,8 @@ package org.sakaiproject.site.cover; import org.sakaiproject.component.cover.ComponentManager; +import org.sakaiproject.exception.PermissionException; +import org.sakaiproject.site.api.Site; /** *

@@ -69,7 +71,11 @@ public static java.lang.String SECURE_ADD_USER_SITE = org.sakaiproject.site.api.SiteService.SECURE_ADD_USER_SITE; public static java.lang.String SECURE_REMOVE_SITE = org.sakaiproject.site.api.SiteService.SECURE_REMOVE_SITE; - + + public static java.lang.String SECURE_REMOVE_SITE_SOFTLY = org.sakaiproject.site.api.SiteService.SECURE_REMOVE_SITE_SOFTLY; + + public static java.lang.String SITE_VISIT_SOFTLY_DELETED = org.sakaiproject.site.api.SiteService.SITE_VISIT_SOFTLY_DELETED; + public static java.lang.String SECURE_UPDATE_SITE = org.sakaiproject.site.api.SiteService.SECURE_UPDATE_SITE; public static java.lang.String SECURE_UPDATE_SITE_MEMBERSHIP = org.sakaiproject.site.api.SiteService.SECURE_UPDATE_SITE_MEMBERSHIP; @@ -244,7 +250,7 @@ service.removeSite(param0); } - + public static java.lang.String siteReference(java.lang.String param0) { org.sakaiproject.site.api.SiteService service = getInstance();