Diverse Kleinigkeiten / Formatierungen.
git-svn-id: https://svn.libreccm.org/ccm/trunk@932 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
f9e93351e6
commit
bca1734e3c
|
|
@ -0,0 +1,223 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2004 Red Hat Inc. 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
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.faq;
|
||||
|
||||
import com.arsdigita.faq.ui.FaqQuestionsPortlet;
|
||||
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.domain.DomainObjectInstantiator;
|
||||
import com.arsdigita.initializer.Configuration;
|
||||
import com.arsdigita.initializer.InitializationException;
|
||||
import com.arsdigita.kernel.*;
|
||||
import com.arsdigita.persistence.*;
|
||||
import com.arsdigita.web.Application;
|
||||
import com.arsdigita.web.ApplicationType;
|
||||
import com.arsdigita.portal.apportlet.AppPortletType;
|
||||
import com.arsdigita.dispatcher.ObjectNotFoundException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* OldInitializer
|
||||
*
|
||||
* Initializes the faq package.
|
||||
*
|
||||
*
|
||||
* @author <a href="mailto:teadams@arsdigita.com">Tracy Adams</a>
|
||||
* @version $Revision: #8 $ $Date: 2004/08/17 $
|
||||
*/
|
||||
|
||||
public class OldInitializer
|
||||
|
||||
implements com.arsdigita.initializer.Initializer {
|
||||
|
||||
private Configuration m_conf = new Configuration();
|
||||
public static final String versionId = "$Id: //apps/faq/dev/src/com/arsdigita/faq/Initializer.java#8 $ by $Author: dennis $, $DateTime: 2004/08/17 23:26:27 $";
|
||||
|
||||
private static Logger s_log =
|
||||
Logger.getLogger(OldInitializer.class);
|
||||
|
||||
public OldInitializer() throws InitializationException {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the configuration object used by this initializer.
|
||||
**/
|
||||
|
||||
public Configuration getConfiguration() {
|
||||
return m_conf;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called on startup. Note. As you can not find a call
|
||||
* to this method in enterprise.ini, this method
|
||||
* may appear to execute mysteriously.
|
||||
* However, the process that runs through enterprise.ini
|
||||
* automitically calls the startup() method of any
|
||||
* class that implements com.arsdigita.util.initializer.OldInitializer
|
||||
* present in enterprise.ini
|
||||
*
|
||||
**/
|
||||
|
||||
|
||||
public void startup() {
|
||||
|
||||
s_log.info("Faq Initializer starting.");
|
||||
|
||||
|
||||
TransactionContext txn = SessionManager.getSession()
|
||||
.getTransactionContext();
|
||||
txn.beginTxn();
|
||||
|
||||
// Register Faq domain object
|
||||
|
||||
DomainObjectInstantiator instantiator;
|
||||
|
||||
instantiator = new ACSObjectInstantiator() {
|
||||
protected DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new Faq(dataObject);
|
||||
}
|
||||
};
|
||||
|
||||
DomainObjectFactory.registerInstantiator
|
||||
(Faq.BASE_DATA_OBJECT_TYPE, instantiator);
|
||||
|
||||
checkFaqSetup();
|
||||
|
||||
|
||||
// Register the portlets
|
||||
instantiator = new ACSObjectInstantiator() {
|
||||
protected DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new FaqQuestionsPortlet(dataObject);
|
||||
}
|
||||
};
|
||||
|
||||
DomainObjectFactory.registerInstantiator
|
||||
(FaqQuestionsPortlet.BASE_DATA_OBJECT_TYPE, instantiator);
|
||||
|
||||
txn.commitTxn();
|
||||
|
||||
URLFinder faqFinder = new URLFinder() {
|
||||
public String find(OID oid, String context) throws NoValidURLException {
|
||||
return find(oid);
|
||||
}
|
||||
public String find(OID oid) throws NoValidURLException {
|
||||
QAPair pair;
|
||||
try {
|
||||
pair = (QAPair) DomainObjectFactory.newInstance(oid);
|
||||
} catch (DataObjectNotFoundException e) {
|
||||
throw new ObjectNotFoundException("No such FAQ item: " + oid + " .may have been deleted.");
|
||||
}
|
||||
|
||||
String url = pair.getFaq().getPrimaryURL() + "#" + pair.getID();
|
||||
return url;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
URLService.registerFinder(QAPair.BASE_DATA_OBJECT_TYPE, faqFinder);
|
||||
|
||||
s_log.debug("Faq Initializer done.");
|
||||
}
|
||||
|
||||
private void checkFaqSetup() {
|
||||
/* This checks to see if a package by this name
|
||||
* is present. If it isn't, setupFaq
|
||||
* will do the necessary setup such as add the
|
||||
* package type, package instance, site node
|
||||
* and style sheet.
|
||||
*/
|
||||
try {
|
||||
s_log.debug("Faq Initializer - verifying setup.");
|
||||
PackageType FaqType = PackageType.findByKey("faq");
|
||||
} catch (DataObjectNotFoundException e) {
|
||||
setupFaq();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void setupFaq() {
|
||||
s_log.info("Faq Initializer - setting up new package");
|
||||
|
||||
/** Adding the package type to the installation
|
||||
*/
|
||||
|
||||
PackageType FaqType = PackageType.create(
|
||||
"faq", "FAQ ", "FAQ s",
|
||||
"http://arsdigita.com/faq");
|
||||
s_log.debug("Just added package type FAQ ");
|
||||
|
||||
/** Adding a style sheet
|
||||
*/
|
||||
|
||||
// Stylesheet FaqSheet =
|
||||
// Stylesheet.createStylesheet("/packages/faq/xsl/faq.xsl");
|
||||
// FaqType.addStylesheet(FaqSheet);
|
||||
|
||||
|
||||
/** Mapping the package type to a dispatcher
|
||||
* class
|
||||
*/
|
||||
|
||||
FaqType.setDispatcherClass("com.arsdigita.faq.FaqDispatcher");
|
||||
|
||||
/** Saving changes
|
||||
*/
|
||||
|
||||
FaqType.save();
|
||||
|
||||
final ApplicationType faqAppType = ApplicationType.createApplicationType
|
||||
(FaqType, "FAQ Application", Faq.BASE_DATA_OBJECT_TYPE);
|
||||
faqAppType.save();
|
||||
|
||||
KernelExcursion ex = new KernelExcursion() {
|
||||
protected void excurse() {
|
||||
setParty(Kernel.getSystemParty());
|
||||
Application faqApp = Application.createApplication
|
||||
(faqAppType, "faq", "FAQ", null);
|
||||
faqApp.save();
|
||||
}
|
||||
};
|
||||
ex.run();
|
||||
|
||||
|
||||
// register the faq portlet
|
||||
AppPortletType portletType = AppPortletType.createAppPortletType
|
||||
("Faq Questions Portlet", AppPortletType.WIDE_PROFILE,
|
||||
FaqQuestionsPortlet.BASE_DATA_OBJECT_TYPE);
|
||||
portletType.setProviderApplicationType(faqAppType);
|
||||
portletType.setPortalApplication(true);
|
||||
portletType.save();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Called on shutdown. It's probably not a good idea to depend on this
|
||||
* being called.
|
||||
**/
|
||||
|
||||
public void shutdown() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,15 +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
|
||||
* License (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.arsdigita.com/ADPL.txt
|
||||
* 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.
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -20,8 +24,6 @@ import java.math.BigDecimal;
|
|||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.kernel.SiteNode;
|
||||
import com.arsdigita.kernel.ui.ACSObjectSelectionModel;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.event.FormValidationListener;
|
||||
|
|
|
|||
|
|
@ -1,21 +1,25 @@
|
|||
/* * 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
|
||||
* License (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.arsdigita.com/ADPL.txt
|
||||
* 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.
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.london.shortcuts.ui;
|
||||
|
||||
import com.arsdigita.bebop.Table;
|
||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
import com.arsdigita.bebop.table.TableModel;
|
||||
|
|
@ -38,6 +42,10 @@ import com.arsdigita.bebop.Component;
|
|||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.bebop.ExternalLink;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ShortcutsTable extends Table {
|
||||
private static final Category log =
|
||||
Category.getInstance(ShortcutsTable.class.getName());
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import com.arsdigita.kernel.Group;
|
|||
import com.arsdigita.kernel.Party;
|
||||
import com.arsdigita.kernel.PartyCollection;
|
||||
import com.arsdigita.kernel.Resource;
|
||||
import com.arsdigita.kernel.SiteNode;
|
||||
import com.arsdigita.kernel.User;
|
||||
import com.arsdigita.kernel.permissions.PermissionDescriptor;
|
||||
import com.arsdigita.kernel.permissions.PermissionService;
|
||||
|
|
@ -36,8 +35,6 @@ import com.arsdigita.persistence.DataQuery;
|
|||
import com.arsdigita.persistence.DataQueryDataCollectionAdapter;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.persistence.SessionManager;
|
||||
// import com.arsdigita.persistence.Filter;
|
||||
// import com.arsdigita.persistence.PersistenceException;
|
||||
import com.arsdigita.persistence.Filter;
|
||||
import com.arsdigita.portal.apportlet.AppPortlet;
|
||||
import com.arsdigita.portal.Portlet;
|
||||
|
|
|
|||
Loading…
Reference in New Issue