Merged V3.2 to HEAD

15586: Merged V3.1 to V3.2
      14863: Fixed ETHREEOH-2223: Oracle version-specific schema update failure in upgrading from 2.1A build to 3.1 build
      15041: Further fix for ETHREEOH-2223: Oracle version-specific schema update failure in upgrading from 2.1A build to 3.1 build
      15428: The ipAddress field of HibernateNodeDaoServiceImpl is 39 characters long (Transaction.hbm.xml modified)
      15472: Incremented schema version number for SQL patch
      15502: ETHREEOH-2292: Deployment failure in case of IPv6 on Win 2k8
             *NOTE*: Removed Derby scripts as it's no longer supported
   15588: (record only after Derby script removal) Fixed over-zelous move of Derby scripts
   15589: Removed hard-coded GUEST reference
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /alfresco/BRANCHES/V3.1:r14863,15041,15428,15472,15502
   Merged /alfresco/BRANCHES/V3.2:r15586,15588-15589


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16863 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-10-13 13:02:56 +00:00
parent 69249332d3
commit e31a8bf882
12 changed files with 187 additions and 451 deletions

View File

@@ -114,6 +114,7 @@
<ref bean="patch.db-V2.1-RemoveWcmSubmittedAspect" /> <ref bean="patch.db-V2.1-RemoveWcmSubmittedAspect" />
<ref bean="patch.db-V2.1-AuditPathIndex" /> <ref bean="patch.db-V2.1-AuditPathIndex" />
<ref bean="patch.db-V3.0-0-CreateActivitiesExtras" /> <ref bean="patch.db-V3.0-0-CreateActivitiesExtras" />
<ref bean="patch.db-V3.1-Allow-IPv6" />
<ref bean="patch.db-V3.2-Remove-AVM-Issuer" /> <ref bean="patch.db-V3.2-Remove-AVM-Issuer" />
<ref bean="patch.db-V3.2-Modify-AVM-MimeType" /> <ref bean="patch.db-V3.2-Modify-AVM-MimeType" />
<ref bean="patch.db-V3.2-Upgrade-JBPM" /> <ref bean="patch.db-V3.2-Upgrade-JBPM" />

View File

@@ -1,79 +0,0 @@
--
-- Title: Activities Schema - Extras (Indexes, Identity)
-- Database: Derby
-- Since: V3.0.0 Schema
--
-- Activity Post
-- Hibernate workaround - to add identity column
DROP TABLE alf_activity_post;
CREATE TABLE alf_activity_post (
sequence_id bigint generated by default as identity (start with 1),
post_date timestamp NOT NULL,
status varchar(10) NOT NULL,
activity_data varchar(4000) NOT NULL,
post_user_id varchar(255) NOT NULL,
job_task_node integer NOT NULL,
site_network varchar(255) default NULL,
app_tool varchar(36) default NULL,
activity_type varchar(255) NOT NULL,
last_modified timestamp NOT NULL,
primary key (sequence_id)
);
CREATE INDEX post_jobtasknode_idx ON alf_activity_post(job_task_node);
CREATE INDEX post_status_idx ON alf_activity_post(status);
-- Activity Feed
-- Hibernate workaround - to add identity column
DROP TABLE alf_activity_feed;
CREATE TABLE alf_activity_feed (
id bigint generated by default as identity (start with 1),
post_id bigint default NULL,
post_date timestamp NOT NULL,
activity_summary varchar(4000) default NULL,
feed_user_id varchar(255) NOT NULL,
activity_type varchar(255) NOT NULL,
activity_format varchar(10) default NULL,
site_network varchar(255) default NULL,
app_tool varchar(36) default NULL,
post_user_id varchar(255) NOT NULL,
feed_date timestamp NOT NULL,
primary key (id)
);
CREATE INDEX feed_postdate_idx ON alf_activity_feed(post_date);
CREATE INDEX feed_postuserid_idx ON alf_activity_feed(post_user_id);
CREATE INDEX feed_feeduserid_idx ON alf_activity_feed(feed_user_id);
CREATE INDEX feed_sitenetwork_idx ON alf_activity_feed(site_network);
CREATE INDEX feed_activityformat_idx ON alf_activity_feed(activity_format);
-- Activity Feed Control
-- Hibernate workaround - to add identity column
DROP TABLE alf_activity_feed_control;
CREATE TABLE alf_activity_feed_control (
id bigint generated by default as identity (start with 1),
feed_user_id varchar(255) NOT NULL,
site_network varchar(255) NOT NULL,
app_tool varchar(36) default NULL,
last_modified timestamp NOT NULL,
primary key (id)
);
CREATE INDEX feedctrl_feeduserid_idx ON alf_activity_feed_control(feed_user_id);
--
-- Record script finish
--
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V3.0-0-CreateActivitiesExtras';
INSERT INTO alf_applied_patch
(id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
VALUES
(
'patch.db-V3.0-0-CreateActivitiesExtras', 'Executed script create V3.0: Created activities extras',
0, 125, -1, 126, CURRENT_TIMESTAMP, 'UNKNOWN', 1, 1, 'Script completed'
);

View File

@@ -1,74 +0,0 @@
--
-- Title: Create Content tables
-- Database: Derby
-- Since: V3.2 Schema 2012
-- Author: Derek Hulley
--
-- Please contact support@alfresco.com if you need assistance with the upgrade.
--
CREATE TABLE alf_mimetype
(
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
version BIGINT NOT NULL,
mimetype_str VARCHAR(100) NOT NULL,
PRIMARY KEY (id),
UNIQUE (mimetype_str)
);
CREATE TABLE alf_encoding
(
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
version BIGINT NOT NULL,
encoding_str VARCHAR(100) NOT NULL,
PRIMARY KEY (id),
UNIQUE (encoding_str)
);
-- This table may exist during upgrades, but must be removed.
-- The drop statement is therefore optional.
DROP TABLE alf_content_url; --(optional)
CREATE TABLE alf_content_url
(
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
version BIGINT NOT NULL,
content_url VARCHAR(255) NOT NULL,
content_url_short VARCHAR(12) NOT NULL,
content_url_crc BIGINT NOT NULL,
content_size BIGINT NOT NULL,
CONSTRAINT idx_alf_cont_url_crc UNIQUE (content_url_short, content_url_crc),
PRIMARY KEY (id)
);
CREATE TABLE alf_content_data
(
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
version BIGINT NOT NULL,
content_url_id BIGINT,
content_mimetype_id BIGINT,
content_encoding_id BIGINT,
content_locale_id BIGINT,
CONSTRAINT fk_alf_cont_url FOREIGN KEY (content_url_id) REFERENCES alf_content_url (id),
CONSTRAINT fk_alf_cont_mim FOREIGN KEY (content_mimetype_id) REFERENCES alf_mimetype (id),
CONSTRAINT fk_alf_cont_enc FOREIGN KEY (content_encoding_id) REFERENCES alf_encoding (id),
CONSTRAINT fk_alf_cont_loc FOREIGN KEY (content_locale_id) REFERENCES alf_locale (id),
PRIMARY KEY (id)
);
CREATE TABLE alf_content_clean
(
content_url VARCHAR(255) NOT NULL
);
CREATE INDEX idx_alf_contentclean_url ON alf_content_clean(content_url);
--
-- Record script finish
--
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V3.2-ContentTables';
INSERT INTO alf_applied_patch
(id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
VALUES
(
'patch.db-V3.2-ContentTables', 'Manually executed script upgrade V3.2: Content Tables',
0, 2011, -1, 2012, null, 'UNKOWN', 1, 1, 'Script completed'
);

View File

@@ -1,46 +0,0 @@
--
-- Title: Create lock tables
-- Database: Derby
-- Since: V3.2 Schema 2011
-- Author: Derek Hulley
--
-- Please contact support@alfresco.com if you need assistance with the upgrade.
--
CREATE TABLE alf_lock_resource
(
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
version BIGINT NOT NULL,
qname_ns_id BIGINT NOT NULL,
qname_localname VARCHAR(255) NOT NULL,
CONSTRAINT fk_alf_lockr_ns FOREIGN KEY (qname_ns_id) REFERENCES alf_namespace (id),
CONSTRAINT fk_alf_lockr_id PRIMARY KEY (id),
CONSTRAINT idx_alf_lockr_key UNIQUE (qname_ns_id, qname_localname)
);
CREATE TABLE alf_lock
(
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
version BIGINT NOT NULL,
shared_resource_id BIGINT NOT NULL,
excl_resource_id BIGINT NOT NULL,
lock_token VARCHAR(36) NOT NULL,
start_time BIGINT NOT NULL,
expiry_time BIGINT NOT NULL,
CONSTRAINT fk_alf_lock_shared FOREIGN KEY (shared_resource_id) REFERENCES alf_lock_resource (id),
CONSTRAINT fk_alf_lock_excl FOREIGN KEY (excl_resource_id) REFERENCES alf_lock_resource (id),
CONSTRAINT fk_alf_lock_id PRIMARY KEY (id),
CONSTRAINT idx_alf_lock_key UNIQUE (shared_resource_id, excl_resource_id)
);
--
-- Record script finish
--
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V3.2-LockTables';
INSERT INTO alf_applied_patch
(id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
VALUES
(
'patch.db-V3.2-LockTables', 'Manually executed script upgrade V3.2: Lock Tables',
0, 2010, -1, 2011, null, 'UNKOWN', 1, 1, 'Script completed'
);

View File

@@ -0,0 +1,21 @@
--
-- Title: Increase the ipAddress field length to allow IPv6 adresses
-- Database: MySQL
-- Since: V3.1 schema 1009
--
-- Please contact support@alfresco.com if you need assistance with the upgrade.
--
ALTER TABLE alf_server MODIFY ip_address varchar(39) NOT NULL;
--
-- Record script finish
--
DELETE FROM alf_applied_patch WHERE id = 'patch.db-V3.1-Allow-IPv6';
INSERT INTO alf_applied_patch
(id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
VALUES
(
'patch.db-V3.1-Allow-IPv6', 'Manually executed script upgrade V3.1: Increase the ipAddress field length',
0, 2019, -1, 2020, null, 'UNKOWN', 1, 1, 'Script completed'
);

View File

@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="alfresco.activities">
<insert id="insert_activity_feedcontrol" parameterClass="FeedControl">
insert into alf_activity_feed_control (id, feed_user_id, site_network, app_tool, last_modified)
values (DEFAULT, #feedUserId#, #siteNetwork#, #appTool#, #lastModified#)
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
<insert id="insert_activity_feed" parameterClass="ActivityFeed">
insert into alf_activity_feed (id, activity_type, activity_summary, activity_format, feed_user_id, post_user_id, post_date, post_id, site_network, app_tool, feed_date)
values (DEFAULT, #activityType#, #activitySummary#, #activitySummaryFormat#, #feedUserId#, #postUserId#, #postDate#, #postId#, #siteNetwork#, #appTool#, #feedDate#)
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
<insert id="insert_activity_post" parameterClass="ActivityPost">
insert into alf_activity_post (sequence_id, status, activity_data, post_user_id, post_date, activity_type, site_network, app_tool, job_task_node, last_modified)
values (DEFAULT, #status#, #activityData#, #userId#, #postDate#, #activityType#, #siteNetwork#, #appTool#, #jobTaskNode#, #lastModified#)
<!-- optionally return auto-generated primary key - only required for debug (can be commented out) -->
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
</sqlMap>

View File

@@ -1,37 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="alfresco.content">
<insert id="insert_Mimetype" parameterClass="Mimetype" >
<include refid="insert_Mimetype_AutoIncrement"/>
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
<insert id="insert_Encoding" parameterClass="Encoding" >
<include refid="insert_Encoding_AutoIncrement"/>
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
<insert id="insert_ContentUrl" parameterClass="ContentUrl" >
<include refid="insert_ContentUrl_AutoIncrement"/>
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
<insert id="insert_ContentData" parameterClass="ContentData" >
<include refid="insert_ContentData_AutoIncrement"/>
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
</sqlMap>

View File

@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="alfresco.lock">
<insert id="insert_LockResource" parameterClass="LockResource" >
<include refid="insert_LockResource_AutoIncrement"/>
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
<insert id="insert_Lock" parameterClass="Lock" >
<include refid="insert_Lock_AutoIncrement"/>
<selectKey resultClass="long" keyProperty="id" type="post">
values IDENTITY_VAL_LOCAL()
</selectKey>
</insert>
</sqlMap>

View File

@@ -1921,4 +1921,16 @@
</property> </property>
</bean> </bean>
<bean id="patch.db-V3.1-Allow-IPv6" class="org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch" parent="basePatch">
<property name="id"><value>patch.db-V3.1-Allow-IPv6</value></property>
<property name="description"><value>patch.schemaUpgradeScript.description</value></property>
<property name="fixesFromSchema"><value>0</value></property>
<property name="fixesToSchema"><value>3003</value></property>
<property name="targetSchema"><value>3004</value></property>
<property name="scriptUrl">
<!-- Share a create script -->
<value>classpath:alfresco/dbscripts/upgrade/3.1/${db.script.dialect}/IPv6-patch.sql</value>
</property>
</bean>
</beans> </beans>

View File

@@ -19,4 +19,4 @@ version.build=@build-number@
# Schema number # Schema number
version.schema=3003 version.schema=3004

View File

@@ -50,7 +50,7 @@
<generator class="native" /> <generator class="native" />
</id> </id>
<natural-id> <natural-id>
<property name="ipAddress" column="ip_address" type="string" length="15" not-null="true" /> <property name="ipAddress" column="ip_address" type="string" length="39" not-null="true" />
</natural-id> </natural-id>
<!-- Optimistic locking --> <!-- Optimistic locking -->
<version column="version" name="version" type="long" /> <version column="version" name="version" type="long" />

View File

@@ -114,12 +114,12 @@ public class AuthenticationContextImpl implements AuthenticationContext
public String getGuestUserName() public String getGuestUserName()
{ {
return PermissionService.GUEST_AUTHORITY.toLowerCase(); return AuthenticationUtil.getGuestUserName();
} }
public boolean isGuestUserName(String userName) public boolean isGuestUserName(String userName)
{ {
return PermissionService.GUEST_AUTHORITY.equalsIgnoreCase(this.tenantService.getBaseNameUser(userName)); return AuthenticationUtil.getGuestUserName().equalsIgnoreCase(this.tenantService.getBaseNameUser(userName));
} }
public Authentication setCurrentAuthentication(Authentication authentication) public Authentication setCurrentAuthentication(Authentication authentication)