Diverse kleine Formatierungen, Kommentare, etc.

git-svn-id: https://svn.libreccm.org/ccm/trunk@885 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2011-04-30 20:12:52 +00:00
parent 8267552268
commit 7b5df202c2
6 changed files with 217 additions and 166 deletions

View File

@ -59,6 +59,7 @@ import org.apache.log4j.Logger;
* a fresh installation of the whole system. * a fresh installation of the whole system.
* *
* @author Justin Ross <jross@redhat.com> * @author Justin Ross <jross@redhat.com>
* @author Peter Boy <pboy@barkhof.uni-bremen.de>
* @version $Id: Loader.java 2070 2010-01-28 08:47:41Z pboy $ * @version $Id: Loader.java 2070 2010-01-28 08:47:41Z pboy $
*/ */
public class Loader extends PackageLoader { public class Loader extends PackageLoader {
@ -66,11 +67,13 @@ public class Loader extends PackageLoader {
private static final Logger s_log = Logger.getLogger(Loader.class); private static final Logger s_log = Logger.getLogger(Loader.class);
private StringParameter m_url = new StringParameter( private StringParameter m_url = new StringParameter(
"com.arsdigita.portalworkspace.default_url", Parameter.REQUIRED, "com.arsdigita.portalworkspace.default_url",
Parameter.REQUIRED,
"/portal/"); "/portal/");
private StringParameter m_title = new StringParameter( private StringParameter m_title = new StringParameter(
"com.arsdigita.portalworkspace.default_title", Parameter.REQUIRED, "com.arsdigita.portalworkspace.default_title",
Parameter.REQUIRED,
"Portal Homepage"); "Portal Homepage");
/** Actually a kind of misnomer. In the creation process it is used to /** Actually a kind of misnomer. In the creation process it is used to
@ -81,7 +84,7 @@ public class Loader extends PackageLoader {
Parameter.REQUIRED, Boolean.TRUE); Parameter.REQUIRED, Boolean.TRUE);
/** /**
* Standard constructor. * Standard constructor loads/registers the configuration parameter.
*/ */
public Loader() { public Loader() {
register(m_isPublic); register(m_isPublic);
@ -151,7 +154,7 @@ public class Loader extends PackageLoader {
} }
s_log.debug("node name is " + name); s_log.debug("node name is " + name);
// set up the portal node // set up the portal default node (instance)
// Workspace workspace = Workspace.createWorkspace(name, title, // Workspace workspace = Workspace.createWorkspace(name, title,
// parent, Boolean.TRUE.equals(isPublic)); // parent, Boolean.TRUE.equals(isPublic));
Workspace workspace = Workspace.createWorkspace(type, name, title, Workspace workspace = Workspace.createWorkspace(type, name, title,

View File

@ -31,24 +31,20 @@ import com.arsdigita.persistence.SessionManager;
import com.arsdigita.util.StringUtils; import com.arsdigita.util.StringUtils;
import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.util.UncheckedWrapperException;
/**
*
*
*/
public class PageLayout extends DomainObject { public class PageLayout extends DomainObject {
public static final String ID = "id"; public static final String ID = "id";
public static final String TITLE = "title"; public static final String TITLE = "title";
public static final String DESCRIPTION = "description"; public static final String DESCRIPTION = "description";
public static final String FORMAT = "format"; public static final String FORMAT = "format";
public static final String FORMAT_ONE_COLUMN = "100%"; public static final String FORMAT_ONE_COLUMN = "100%";
public static final String FORMAT_TWO_COLUMNS = "50%,50%"; public static final String FORMAT_TWO_COLUMNS = "50%,50%";
public static final String FORMAT_THREE_COLUMNS = "30%,40%,30%"; public static final String FORMAT_THREE_COLUMNS = "30%,40%,30%";
public static final String FORMAT_FOUR_COLUMNS = "25%,25%,25%,25%"; public static final String FORMAT_FOUR_COLUMNS = "25%,25%,25%,25%";
public static final String BASE_DATA_OBJECT_TYPE = public static final String BASE_DATA_OBJECT_TYPE =
"com.arsdigita.portalworkspace.PageLayout"; "com.arsdigita.portalworkspace.PageLayout";
@ -68,7 +64,11 @@ public class PageLayout extends DomainObject {
super(oid); super(oid);
} }
/**
*
*/
public void initialize() { public void initialize() {
super.initialize(); super.initialize();
if (isNew()) { if (isNew()) {
@ -96,6 +96,13 @@ public class PageLayout extends DomainObject {
throw new RuntimeException("Cannot find page layout for " + format); throw new RuntimeException("Cannot find page layout for " + format);
} }
/**
*
* @param title
* @param description
* @param format
* @return
*/
public static PageLayout create(String title, String description, public static PageLayout create(String title, String description,
String format) { String format) {
PageLayout page = new PageLayout(); PageLayout page = new PageLayout();

View File

@ -1,16 +1,19 @@
/* /*
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved. * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
* *
* The contents of this file are subject to the ArsDigita Public * This library is free software; you can redistribute it and/or
* License (the "License"); you may not use this file except in * modify it under the terms of the GNU Lesser General Public License
* compliance with the License. You may obtain a copy of * as published by the Free Software Foundation; either version 2.1 of
* the License at http://www.arsdigita.com/ADPL.txt * the License, or (at your option) any later version.
* *
* Software distributed under the License is distributed on an "AS * This library is distributed in the hope that it will be useful,
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * but WITHOUT ANY WARRANTY; without even the implied warranty of
* implied. See the License for the specific language governing * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* rights and limitations under the License. * 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
*/ */
package com.arsdigita.portalworkspace; package com.arsdigita.portalworkspace;
@ -48,9 +51,9 @@ import com.arsdigita.xml.Element;
/** /**
* Dynamically render the portlets for the current portal. If any * Dynamically render the portlets for the current portal. If any portlets are
* portlets are stateful, retrieve a renderer from cache so that the page can * stateful, retrieve a renderer from cache so that the page can manage the
* manage the state of the portlet. * state of the portlet.
* *
* ONLY VALID FOR BROWSE MODE, use com.arsdigita.portal.ui.PersistentPortal * ONLY VALID FOR BROWSE MODE, use com.arsdigita.portal.ui.PersistentPortal
* for edit mode! * for edit mode!
@ -88,10 +91,9 @@ public class StatefulPersistentPortal extends SimpleContainer {
* @param portal the portalSelectionModel used by the Dynamic PortalModelBuilder * @param portal the portalSelectionModel used by the Dynamic PortalModelBuilder
* @param name * @param name
*/ */
public StatefulPersistentPortal( public StatefulPersistentPortal(PortalSelectionModel portal, String name) {
PortalSelectionModel portal,
String name) {
s_log.debug("IN constructor" + name ); s_log.debug("IN constructor" + name );
m_portal = portal; m_portal = portal;
setTag("portal:portal"); setTag("portal:portal");
setNamespace(PortalConstants.PORTAL_XML_NS); setNamespace(PortalConstants.PORTAL_XML_NS);
@ -123,6 +125,7 @@ public class StatefulPersistentPortal extends SimpleContainer {
s_log.debug("stateful portlet - I am going to instantiate " + s_log.debug("stateful portlet - I am going to instantiate " +
requiredRenderers + " renderers"); requiredRenderers + " renderers");
List renderers = new ArrayList(); List renderers = new ArrayList();
for (int i = 0; i < requiredRenderers; i++) { for (int i = 0; i < requiredRenderers; i++) {
StatefulPortletRenderer renderer = factory.getRenderer(); StatefulPortletRenderer renderer = factory.getRenderer();
renderers.add(renderer); renderers.add(renderer);
@ -134,9 +137,11 @@ public class StatefulPersistentPortal extends SimpleContainer {
m_stateful.put(type.getResourceObjectType(), renderers); m_stateful.put(type.getResourceObjectType(), renderers);
} }
}
m_portalModelBuilder = } // end while
new StatefulPersistentPortalModelBuilder(portal, m_stateful);
m_portalModelBuilder = new StatefulPersistentPortalModelBuilder(portal,
m_stateful);
} }
@ -186,7 +191,9 @@ public class StatefulPersistentPortal extends SimpleContainer {
} }
/** /**
* return the number of renderers for the given portlet type currently registered on the page * return the number of renderers for the given portlet type currently
* registered on the page
*
* @param portletType * @param portletType
* @return * @return
*/ */

View File

@ -1,17 +1,21 @@
/* /*
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved. * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
* *
* The contents of this file are subject to the ArsDigita Public * This library is free software; you can redistribute it and/or
* License (the "License"); you may not use this file except in * modify it under the terms of the GNU Lesser General Public License
* compliance with the License. You may obtain a copy of * as published by the Free Software Foundation; either version 2.1 of
* the License at http://www.arsdigita.com/ADPL.txt * the License, or (at your option) any later version.
* *
* Software distributed under the License is distributed on an "AS * This library is distributed in the hope that it will be useful,
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * but WITHOUT ANY WARRANTY; without even the implied warranty of
* implied. See the License for the specific language governing * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* rights and limitations under the License. * 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
*/ */
package com.arsdigita.portalworkspace; package com.arsdigita.portalworkspace;
import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DataObjectNotFoundException;

View File

@ -1,16 +1,19 @@
/* /*
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved. * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
* *
* The contents of this file are subject to the ArsDigita Public * This library is free software; you can redistribute it and/or
* License (the "License"); you may not use this file except in * modify it under the terms of the GNU Lesser General Public License
* compliance with the License. You may obtain a copy of * as published by the Free Software Foundation; either version 2.1 of
* the License at http://www.arsdigita.com/ADPL.txt * the License, or (at your option) any later version.
* *
* Software distributed under the License is distributed on an "AS * This library is distributed in the hope that it will be useful,
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * but WITHOUT ANY WARRANTY; without even the implied warranty of
* implied. See the License for the specific language governing * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* rights and limitations under the License. * 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
*/ */
package com.arsdigita.portalworkspace; package com.arsdigita.portalworkspace;
@ -18,12 +21,24 @@ package com.arsdigita.portalworkspace;
import com.arsdigita.domain.DomainCollection; import com.arsdigita.domain.DomainCollection;
import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.DataCollection;
/**
*
*
*/
public class WorkspaceCollection extends DomainCollection { public class WorkspaceCollection extends DomainCollection {
/**
*
* @param wks
*/
public WorkspaceCollection(DataCollection wks) { public WorkspaceCollection(DataCollection wks) {
super(wks); super(wks);
} }
/**
*
* @return
*/
public Workspace getWorkspace() { public Workspace getWorkspace() {
return (Workspace) getDomainObject(); return (Workspace) getDomainObject();
} }

View File

@ -1,16 +1,19 @@
/* /*
* Copyright (C) 2001 ArsDigita Corporation. All Rights Reserved. * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
* *
* The contents of this file are subject to the ArsDigita Public * This library is free software; you can redistribute it and/or
* License (the "License"); you may not use this file except in * modify it under the terms of the GNU Lesser General Public License
* compliance with the License. You may obtain a copy of * as published by the Free Software Foundation; either version 2.1 of
* the License at http://www.arsdigita.com/ADPL.txt * the License, or (at your option) any later version.
* *
* Software distributed under the License is distributed on an "AS * This library is distributed in the hope that it will be useful,
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * but WITHOUT ANY WARRANTY; without even the implied warranty of
* implied. See the License for the specific language governing * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* rights and limitations under the License. * 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
*/ */
package com.arsdigita.portalworkspace; package com.arsdigita.portalworkspace;
@ -18,12 +21,24 @@ package com.arsdigita.portalworkspace;
import com.arsdigita.persistence.DataAssociationCursor; import com.arsdigita.persistence.DataAssociationCursor;
import com.arsdigita.portal.PortalCollection; import com.arsdigita.portal.PortalCollection;
/**
*
*
*/
public class WorkspacePageCollection extends PortalCollection { public class WorkspacePageCollection extends PortalCollection {
/**
*
* @param portals
*/
public WorkspacePageCollection(DataAssociationCursor portals) { public WorkspacePageCollection(DataAssociationCursor portals) {
super(portals); super(portals);
} }
/**
*
* @return
*/
public WorkspacePage getPage() { public WorkspacePage getPage() {
return (WorkspacePage) getDomainObject(); return (WorkspacePage) getDomainObject();
} }