Umstellung core portal auf legacy free application type. Update script enthalten!

git-svn-id: https://svn.libreccm.org/ccm/trunk@894 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2011-05-04 14:53:25 +00:00
parent 6d4a9227ac
commit cb5e7b8130
9 changed files with 141 additions and 23 deletions

View File

@ -2,8 +2,8 @@
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
name="ccm-core"
prettyName="Core"
version="6.6.1"
release="2"
version="6.6.3"
release="1"
shared="true"
webapp="ROOT"
buildHooks="build-hooks.xml">

View File

@ -0,0 +1,22 @@
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public License
-- as published by the Free Software Foundation; either version 2.1 of
-- the License, or (at your option) any later version.
--
-- This library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public
-- License along with this library; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--
-- $Id: remove_legacy_portal.sql pboy $
-- delete core portals legacy entry in apm_package_types
-- there es no entry in acs_objects!
delete from apm_package_types
where package_key like 'portal' ;

View File

@ -0,0 +1,25 @@
--
-- Copyright (C) 2008 Peter Boy All Rights Reserved.
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public License
-- as published by the Free Software Foundation; either version 2.1 of
-- the License, or (at your option) any later version.
--
-- This library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public
-- License along with this library; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--
-- $Id: oracle-se-6.6.2-6.6.3.sql 293 2011-01-07 15:10:39Z pboy $
PROMPT Red Hat Enterprise CORE 6.6.1 -> 6.6.2 Upgrade Script (Oracle)
-- delete core portals entry in apm_package_types
-- there es no entry in acs_objects!
@@ ../default/upgrade/6.6.2-6.6.3/remove_legacy_portal.sql

View File

@ -0,0 +1,29 @@
--
-- Copyright (C) 2011 Peter Boy All Rights Reserved.
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public License
-- as published by the Free Software Foundation; either version 2.1 of
-- the License, or (at your option) any later version.
--
-- This library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public
-- License along with this library; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--
-- $DateTime: 2011/05/10 23:15:09 $
\echo Red Hat Enterprise CORE 6.6.2 -> 6.6.3 Upgrade Script (PostgreSQL)
-- delete core portals entry in apm_package_types
-- there es no entry in acs_objects!
begin;
\i ../default/upgrade/6.6.2-6.6.3/remove_legacy_portal.sql
commit;

View File

@ -38,6 +38,9 @@
<script sql="ccm-core/upgrade/::database::-6.6.0-6.6.1.sql"/>
</version>
<version from="6.6.1" to="6.6.2">
<script sql="ccm-core/upgrade/::database::-6.6.0-6.6.1.sql"/>
<script sql="ccm-core/upgrade/::database::-6.6.1-6.6.2.sql"/>
</version>
<version from="6.6.2" to="6.6.3">
<script sql="ccm-core/upgrade/::database::-6.6.2-6.6.3.sql"/>
</version>
</upgrade>

View File

@ -45,6 +45,10 @@ import org.apache.log4j.Logger;
/**
* XXX JAVADOC XXX
*
* ResourceType / Resource.pdl maintains the tables application_types and
* applications. Creating a ResourceType results in a kind of legacy free
* application type (without linkage to permissions and legacy compatible layer).
*
* @see com.arsdigita.kernel.Resource
* @see com.arsdigita.kernel.ResourceTypeCollection
* @author Jim Parsons &lt;<a href="mailto:jparsons@redhat.com">jparsons@redhat.com</a>&gt;
@ -55,13 +59,19 @@ public class ResourceType extends DomainObject {
/** The logging object for this class. */
private static final Logger s_log = Logger.getLogger(ResourceType.class);
// ===== Constants ======================================================= //
// ===== Constants ====================================================== //
/** The fully qualified model name of the underlying data object, which in
* this case is the same as the Java type. */
* this case is the same as the Java type. */
public static final String BASE_DATA_OBJECT_TYPE =
"com.arsdigita.kernel.ResourceType";
/**
* Accessor method for this class Base Data Object Type, i.e. the
* underlying data object.
*
* @return String data object type name
*/
@Override
protected String getBaseDataObjectType() {
return BASE_DATA_OBJECT_TYPE;
@ -102,10 +112,15 @@ public class ResourceType extends DomainObject {
// ===== Class Methods =================================================== //
public static ResourceType createResourceType
(String title, String resourceObjectType) {
return new ResourceType
(BASE_DATA_OBJECT_TYPE, title, resourceObjectType);
/**
*
* @param title
* @param resourceObjectType
* @return
*/
public static ResourceType createResourceType(String title,
String resourceObjectType) {
return new ResourceType(BASE_DATA_OBJECT_TYPE, title, resourceObjectType);
}
// No null params.

View File

@ -509,11 +509,19 @@ public class CoreLoader extends PackageLoader {
permissionsNode.mountPackage(permissionsInstance);
}
/**
* Load core's basic portal infrastructure.
*/
private void loadPortal() {
/* Portal now legacy free. To be deleted when transistion is completed.
s_log.info("Adding package type: portal");
PackageType packageType = PackageType.create
("portal", "Portal", "Portals", "http://arsdigita.com/portal");
*/
s_log.info("Adding resource type: portal");
// ResourceType manages the entries in table application_types and
// therefore actually creates a sort of new style legacy free
// application type
ResourceType type = ResourceType.createResourceType
("Portal", Portal.BASE_DATA_OBJECT_TYPE);
type.setDescription("A Portal!");

View File

@ -27,8 +27,8 @@ import java.util.Set;
import org.apache.log4j.Logger;
import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.kernel.PackageType;
//import com.arsdigita.domain.DataObjectNotFoundException;
//import com.arsdigita.kernel.PackageType;
import com.arsdigita.kernel.ResourceType;
import com.arsdigita.persistence.DataCollection;
import com.arsdigita.persistence.DataObject;
@ -41,7 +41,11 @@ import com.arsdigita.web.Web;
/**
*
* Represents a portlet application type.
*
* It is actually a child of ResourceType where ResourceTypes is parent of
* ApplicationType and actually handles entries in table aplication_types (and
* is used by class ApplicationType to handle application entries).
*
* @author Justin Ross
* @version $Id: PortletType.java 287 2005-02-22 00:29:02Z sskracic $
@ -49,8 +53,8 @@ import com.arsdigita.web.Web;
public class PortletType extends ResourceType {
/** The logging object for this class. */
private static final Logger s_cat =
Logger.getLogger(PortletType.class.getName());
private static final Logger s_cat = Logger
.getLogger(PortletType.class.getName());
/**
* The fully qualified model name of the underlying data object, which in
@ -75,7 +79,8 @@ public class PortletType extends ResourceType {
}
/**
* Create a new Portlet from packageType.
* Create a new Portlet Type to persist in data storage.
*
* Do not instantiate directly, use createPortletType(...) instead!
* @param dataObjectType
* @param title
@ -91,9 +96,8 @@ public class PortletType extends ResourceType {
Assert.exists(title, "title");
Assert.exists(profile, "profile");
Assert.exists(portletObjectType, "portletObjectType");
/* Portal now legacy free. To be deleted when transistion is completed.
PackageType packageType = null;
// is com.arsdigita.portal.Portal initialized
try {
packageType = PackageType.findByKey("portal");
@ -104,7 +108,19 @@ public class PortletType extends ResourceType {
s_cat.error(message);
throw new IllegalStateException(message);
}
*/
// is com.arsdigita.portal.Portal initialized?
if ( !ResourceType.isInstalled(Portal.BASE_DATA_OBJECT_TYPE) ) {
String message =
"The PackageType 'portal' is not installed. It must be " +
"installed in order to create a new PortletType.";
s_cat.error(message);
throw new IllegalStateException(message);
} else {
s_cat.debug(" Portal ResourceType " + Portal.BASE_DATA_OBJECT_TYPE
+ " is installed.");
}
setTitle(title);
setResourceObjectType(portletObjectType);
@ -234,7 +250,7 @@ public class PortletType extends ResourceType {
return hasFullPageView.booleanValue();
}
protected void setFullPageView(boolean hasFullPageView) {
protected final void setFullPageView(boolean hasFullPageView) {
set("hasFullPageView", new Boolean(hasFullPageView));
}
@ -246,7 +262,7 @@ public class PortletType extends ResourceType {
return hasEmbeddedView.booleanValue();
}
protected void setEmbeddedView(boolean hasEmbeddedView) {
protected final void setEmbeddedView(boolean hasEmbeddedView) {
set("hasEmbeddedView", new Boolean(hasEmbeddedView));
}
@ -258,7 +274,7 @@ public class PortletType extends ResourceType {
}
// Param profile can be null.
protected void setProfile(String profile) {
protected final void setProfile(String profile) {
set("profile", profile);
}

View File

@ -26,7 +26,7 @@ import com.arsdigita.portalworkspace.Workspace;
/**
*
* Used by the jsp, specified in web.xml and used to construct a perspnal
* Used by the jsp, specified in web.xml and used to construct a personal
* homepage for an loggedIn user
*/
public class DefaultWorkspaceSelectionModel extends WorkspaceSelectionModel {