From c62dd99a864eb36adb434c5d0f88271a109591c1 Mon Sep 17 00:00:00 2001 From: jensp Date: Fri, 28 Jun 2013 13:46:46 +0000 Subject: [PATCH] =?UTF-8?q?Aktueller=20Stand=20des=20Applications=20Tab=20?= =?UTF-8?q?unter=20/ccm/admin/.=20Unter=20anderem=20k=C3=B6nnen=20die=20Ei?= =?UTF-8?q?nstellungen=20f=C3=BCr=20ccm-cms-publicpersonalprofile=20und=20?= =?UTF-8?q?ccm-themedirector=20(Anlegen=20neuer=20Themes)=20jetzt=20=C3=BC?= =?UTF-8?q?ber=20/ccm/admin/=20verwaltet=20werden.=20Au=C3=9Ferdem=20ist?= =?UTF-8?q?=20es=20m=C3=B6glich=20neue=20Shortcuts=20und=20neue=20ContentS?= =?UTF-8?q?ections=20=C3=BCber=20/ccm/admin=20anzulegen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@2231 8810af33-2d31-482b-a856-94f89814c4df --- .../com/arsdigita/cms/contentassets/Note.java | 173 ++++++++--------- .../cms/contentassets/NotesInitializer.java | 56 +++--- .../application.xml | 4 +- .../PublicPersonalProfileNavItemsAddForm.java | 4 +- .../ui/SiteProxyPropertyForm.java | 29 ++- ...a.ui.admin.applications.ApplicationManager | 3 + .../com/arsdigita/cms/CMSResources.properties | 1 + .../arsdigita/cms/CMSResources_de.properties | 1 + .../cms/CMSResources_en_GB.properties | 1 + .../arsdigita/cms/CMSResources_fr.properties | 1 + .../cms/ContentCenterAppManager.java | 51 +++++ .../com/arsdigita/cms/ServiceAppManager.java | 50 +++++ .../ContentSectionAppManager.java | 53 ++++++ .../ContentSectionCreateForm.java | 112 +++++++++++ .../ui/category/CategoryTreeModelBuilder.java | 4 +- ...a.ui.admin.applications.ApplicationManager | 2 + .../globalization/GlobalizationHelper.java | 2 +- .../arsdigita/ui/admin/AdminAppManager.java | 50 +++++ .../ui/admin/AdminResources.properties | 3 + .../ui/admin/AdminResources_de.properties | 3 + .../ui/admin/AdminResources_en.properties | 3 + .../ui/admin/AdminResources_fr.properties | 3 + .../admin/ApplicationsAdministrationTab.java | 3 +- .../MultiInstanceApplicationPane.java | 20 +- .../arsdigita/ui/login/LoginAppManager.java | 51 +++++ ...a.ui.admin.applications.ApplicationManager | 1 + .../london/search/SearchAppManager.java | 46 +++++ ...a.ui.admin.applications.ApplicationManager | 1 + .../web/themes/mandalay/layout/search.xml | 2 +- ...a.ui.admin.applications.ApplicationManager | 1 + .../SciPublicationsAppManager.java | 50 +++++ ...a.ui.admin.applications.ApplicationManager | 1 + .../shortcuts/ShortcutsAppManager.java | 42 ++++ ...a.ui.admin.applications.ApplicationManager | 1 + .../arsdigita/subsite/SubsiteAppManager.java | 49 +++++ .../arsdigita/subsite/ui/AppManagerPanel.java | 60 ++++++ .../subsite/ui/ControlCenterPanel.java | 17 +- ...a.ui.admin.applications.ApplicationManager | 1 + .../themedirector/ThemeDirector.java | 19 ++ .../ThemeDirectorAppManager.java | 43 +++++ .../themedirector/ui/ThemeControlPanel.java | 180 +++++++++--------- 41 files changed, 951 insertions(+), 246 deletions(-) create mode 100644 ccm-cms/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager create mode 100644 ccm-cms/src/com/arsdigita/cms/ContentCenterAppManager.java create mode 100644 ccm-cms/src/com/arsdigita/cms/ServiceAppManager.java create mode 100644 ccm-cms/src/com/arsdigita/cms/contentsection/ContentSectionAppManager.java create mode 100644 ccm-cms/src/com/arsdigita/cms/contentsection/ContentSectionCreateForm.java create mode 100644 ccm-core/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager create mode 100644 ccm-core/src/com/arsdigita/ui/admin/AdminAppManager.java create mode 100644 ccm-core/src/com/arsdigita/ui/login/LoginAppManager.java create mode 100644 ccm-ldn-search/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager create mode 100644 ccm-ldn-search/src/com/arsdigita/london/search/SearchAppManager.java create mode 100644 ccm-ldn-terms/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager create mode 100644 ccm-sci-publications/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager create mode 100644 ccm-sci-publications/src/com/arsdigita/cms/scipublications/SciPublicationsAppManager.java create mode 100644 ccm-shortcuts/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager create mode 100644 ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutsAppManager.java create mode 100644 ccm-subsite/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager create mode 100644 ccm-subsite/src/com/arsdigita/subsite/SubsiteAppManager.java create mode 100644 ccm-subsite/src/com/arsdigita/subsite/ui/AppManagerPanel.java create mode 100644 ccm-themedirector/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager create mode 100644 ccm-themedirector/src/com/arsdigita/themedirector/ThemeDirectorAppManager.java diff --git a/ccm-cms-assets-notes/src/com/arsdigita/cms/contentassets/Note.java b/ccm-cms-assets-notes/src/com/arsdigita/cms/contentassets/Note.java index 7537d497a..3b793a584 100755 --- a/ccm-cms-assets-notes/src/com/arsdigita/cms/contentassets/Note.java +++ b/ccm-cms-assets-notes/src/com/arsdigita/cms/contentassets/Note.java @@ -13,7 +13,6 @@ * 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.cms.contentassets; import java.util.Date; @@ -40,8 +39,7 @@ import org.apache.log4j.Logger; */ public class Note extends ACSObject { - private static final Logger s_log = Logger.getLogger( Note.class ); - + private static final Logger s_log = Logger.getLogger(Note.class); /** PDL stuff */ public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contentassets.Note"; @@ -49,19 +47,18 @@ public class Note extends ACSObject { static { s_log.debug("Static initalizer is starting..."); DomainObjectFactory.registerInstantiator( - BASE_DATA_OBJECT_TYPE, - new DomainObjectInstantiator() { - @Override - public DomainObjectInstantiator resolveInstantiator - ( DataObject dataObject ) { - return this; - } - - protected DomainObject doNewInstance( DataObject dataObject ) { - return new Note( dataObject ); - } + BASE_DATA_OBJECT_TYPE, + new DomainObjectInstantiator() { + @Override + public DomainObjectInstantiator resolveInstantiator(DataObject dataObject) { + return this; } - ); + + protected DomainObject doNewInstance(DataObject dataObject) { + return new Note(dataObject); + } + + }); s_log.debug("Static initalizer finished."); } @@ -73,125 +70,128 @@ public class Note extends ACSObject { public static final String AUDIT = "auditing"; public static final String CREATION_DATE = AUDIT + "." + BasicAuditTrail.CREATION_DATE; - - private BasicAuditTrail auditTrail; - private boolean m_isNew = false; private Note() { - super( BASE_DATA_OBJECT_TYPE ); + super(BASE_DATA_OBJECT_TYPE); } - public Note( String type ) { - super( type ); + public Note(String type) { + super(type); } - public Note( DataObject obj ) { - super( obj ); + public Note(DataObject obj) { + super(obj); } - public static Note create( ContentItem item ) { - DataCollection notes = getNotes( item ); + public static Note create(ContentItem item) { + DataCollection notes = getNotes(item); long nextRank = notes.size(); Note note = new Note(); - note.set( OWNER, item ); - note.set( RANK, new Long( (int)nextRank ) ); + note.set(OWNER, item); + note.set(RANK, new Long((int) nextRank)); return note; } /** - * Register auditing observer - * (non-Javadoc) - * @see com.arsdigita.domain.DomainObject#initialize() - */ + * Register auditing observer + * (non-Javadoc) + * @see com.arsdigita.domain.DomainObject#initialize() + */ @Override - protected void initialize() { - super.initialize(); + protected void initialize() { + super.initialize(); - DataObject dataObj = (DataObject) get(AUDIT); - if (dataObj != null) { - auditTrail = new BasicAuditTrail(dataObj); - } else { - // creates a new one when one doesn't already exist - auditTrail = BasicAuditTrail.retrieveForACSObject(this); - } + DataObject dataObj = (DataObject) get(AUDIT); + if (dataObj != null) { + auditTrail = new BasicAuditTrail(dataObj); + } else { + // creates a new one when one doesn't already exist + auditTrail = BasicAuditTrail.retrieveForACSObject(this); + } - addObserver(new AuditingObserver(auditTrail)); - } - - public String getContent() { - return (String) get( CONTENT ); + addObserver(new AuditingObserver(auditTrail)); } - public void setContent( String content ) { - set( CONTENT, content ); + public String getContent() { + return (String) get(CONTENT); + } + + public void setContent(String content) { + set(CONTENT, content); } public long getRank() { - Long rank = (Long) get( RANK ); - Assert.exists( rank, Long.class ); + Long rank = (Long) get(RANK); + Assert.exists(rank, Long.class); return rank.longValue(); } - public void setRank( long newRank ) { - DataCollection notes = getNotes( getOwner() ); + public void setRank(long newRank) { + DataCollection notes = getNotes(getOwner()); - if( newRank < 0 ) newRank = 0; + if (newRank < 0) { + newRank = 0; + } Note last = null; long currentRank = 0; - while( notes.next() ) { - if( newRank == currentRank ) currentRank++; + while (notes.next()) { + if (newRank == currentRank) { + currentRank++; + } - Note current = (Note) DomainObjectFactory.newInstance - ( notes.getDataObject() ); + Note current = (Note) DomainObjectFactory.newInstance(notes.getDataObject()); - if( equals( current ) ) continue; + if (equals(current)) { + continue; + } - if( current.getRank() != currentRank ) - current.set( RANK, new Long( currentRank ) ); + if (current.getRank() != currentRank) { + current.set(RANK, new Long(currentRank)); + } currentRank++; } notes.close(); - if( newRank > currentRank ) - set( RANK, new Long( currentRank ) ); - else - set( RANK, new Long( newRank ) ); + if (newRank > currentRank) { + set(RANK, new Long(currentRank)); + } else { + set(RANK, new Long(newRank)); + } } public ContentItem getOwner() { - DataObject obj = (DataObject) get( OWNER ); - Assert.exists( obj, DataObject.class ); + DataObject obj = (DataObject) get(OWNER); + Assert.exists(obj, DataObject.class); - return (ContentItem) DomainObjectFactory.newInstance( obj ); + return (ContentItem) DomainObjectFactory.newInstance(obj); } - public User getNoteAuthor () { - return auditTrail.getCreationUser(); + public User getNoteAuthor() { + return auditTrail.getCreationUser(); } - - public Date getCreationDate () { - return auditTrail.getCreationDate(); - } - - public static DataCollection getNotes( ContentItem item ) { - Assert.exists( item, ContentItem.class ); - if( s_log.isDebugEnabled() ) { - s_log.debug( "Retrieving notes for " + item.getOID() ); + public Date getCreationDate() { + return auditTrail.getCreationDate(); + } + + public static DataCollection getNotes(ContentItem item) { + Assert.exists(item, ContentItem.class); + + if (s_log.isDebugEnabled()) { + s_log.debug("Retrieving notes for " + item.getOID()); } - DataCollection notes = SessionManager.getSession().retrieve - ( BASE_DATA_OBJECT_TYPE ); + DataCollection notes = SessionManager.getSession().retrieve(BASE_DATA_OBJECT_TYPE); - notes.addEqualsFilter( OWNER, item.getID() ); - notes.addOrder( RANK ); + notes.addEqualsFilter(OWNER, item.getID()); + notes.addOrder(RANK); return notes; } @@ -199,23 +199,26 @@ public class Note extends ACSObject { @Override protected void beforeDelete() { // Put this note at the end so other notes will be correctly reordered - setRank( Long.MAX_VALUE ); + setRank(Long.MAX_VALUE); } @Override protected void beforeSave() { super.beforeSave(); - if( isNew() ) m_isNew = true; + if (isNew()) { + m_isNew = true; + } } @Override protected void afterSave() { super.afterSave(); - if( m_isNew ) { - PermissionService.setContext( this, getOwner() ); + if (m_isNew) { + PermissionService.setContext(this, getOwner()); m_isNew = false; } } + } diff --git a/ccm-cms-assets-notes/src/com/arsdigita/cms/contentassets/NotesInitializer.java b/ccm-cms-assets-notes/src/com/arsdigita/cms/contentassets/NotesInitializer.java index 752707876..d1a4d2bc9 100755 --- a/ccm-cms-assets-notes/src/com/arsdigita/cms/contentassets/NotesInitializer.java +++ b/ccm-cms-assets-notes/src/com/arsdigita/cms/contentassets/NotesInitializer.java @@ -13,7 +13,6 @@ * 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.cms.contentassets; import com.arsdigita.cms.ContentPage; @@ -42,7 +41,7 @@ public class NotesInitializer extends ContentAssetInitializer { * super class. */ public NotesInitializer() { - super( "ccm-cms-assets-notes.pdl.mf" ); + super("ccm-cms-assets-notes.pdl.mf"); } /** @@ -50,74 +49,81 @@ public class NotesInitializer extends ContentAssetInitializer { * @param ev */ @Override - public void init( DomainInitEvent ev ) { - super.init( ev ); + public void init(DomainInitEvent ev) { + super.init(ev); - ContentType.registerXSLFile( - null, - "/themes/heirloom/contentassets/notes/xsl/index.xsl" ); - DomainObjectTraversal.registerAdapter( - Note.BASE_DATA_OBJECT_TYPE, - new SimpleDomainObjectTraversalAdapter(), - SimpleXMLGenerator.ADAPTER_CONTEXT ); + ContentType.registerXSLFile( + null, + "/themes/heirloom/contentassets/notes/xsl/index.xsl"); + DomainObjectTraversal.registerAdapter( + Note.BASE_DATA_OBJECT_TYPE, + new SimpleDomainObjectTraversalAdapter(), + SimpleXMLGenerator.ADAPTER_CONTEXT); SimpleEditStep.addAdditionalDisplayComponent(new NotesSummary()); } /** - * The base type against which the asset is defined, + * + * @return The base type against which the asset is defined, * typically com.arsdigita.cms.ContentPage */ + @Override public String getBaseType() { return ContentPage.BASE_DATA_OBJECT_TYPE; } - /** - * Returns the path to the XML file defintions for the asset, eg: + /** + * @return the path to the XML file defintions for the asset, eg: * /WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/FileAttachments.xml */ + @Override public String getTraversalXML() { return TRAVERSAL_ADAPTER_BASE_DIR + "Notes.xml"; } /** - * The name of the association between the item + * @return The name of the association between the item * and the asset, eg 'fileAttachments'. */ + @Override public String getProperty() { return Note.NOTES; } /** - * The class of the authoring kit step + * @return The class of the authoring kit step */ + @Override public Class getAuthoringStep() { return NotesStep.class; } /** - * The label for the authoring step + * @return The label for the authoring step */ + @Override public GlobalizedMessage getAuthoringStepLabel() { return new GlobalizedMessage( - "com.arsdigita.cms.contentassets.notes_authoring_step_label", - "com.arsdigita.cms.contentassets.NotesResources" - ); + "com.arsdigita.cms.contentassets.notes_authoring_step_label", + "com.arsdigita.cms.contentassets.NotesResources"); } /** - * The description for the authoring step + * @return The description for the authoring step */ + @Override public GlobalizedMessage getAuthoringStepDescription() { return new GlobalizedMessage( - "com.arsdigita.cms.contentassets.notes_authoring_step_description", - "com.arsdigita.cms.contentassets.NotesResources" - ); + "com.arsdigita.cms.contentassets.notes_authoring_step_description", + "com.arsdigita.cms.contentassets.NotesResources"); } /** - * The sort key for the authoring step + * @return The sort key for the authoring step */ + @Override public int getAuthoringStepSortKey() { return NotesConfig.getInstance().getAssetStepSortKey(); } + } diff --git a/ccm-cms-personalcontentcomponent/application.xml b/ccm-cms-personalcontentcomponent/application.xml index 8fc6f9efd..44cbc3c3a 100644 --- a/ccm-cms-personalcontentcomponent/application.xml +++ b/ccm-cms-personalcontentcomponent/application.xml @@ -1,7 +1,7 @@ diff --git a/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/publicpersonalprofile/ui/PublicPersonalProfileNavItemsAddForm.java b/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/publicpersonalprofile/ui/PublicPersonalProfileNavItemsAddForm.java index 80e2baf9e..8943a446d 100644 --- a/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/publicpersonalprofile/ui/PublicPersonalProfileNavItemsAddForm.java +++ b/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/publicpersonalprofile/ui/PublicPersonalProfileNavItemsAddForm.java @@ -139,7 +139,7 @@ public class PublicPersonalProfileNavItemsAddForm addInitListener(this); addProcessListener(this); addValidationListener(this); - + addSubmissionListener(this); } public void init(final FormSectionEvent fse) throws FormProcessException { @@ -294,6 +294,8 @@ public class PublicPersonalProfileNavItemsAddForm data.put(PublicPersonalProfileNavItem.LANG, ""); data.put(PublicPersonalProfileNavItem.LABEL, ""); data.put(PublicPersonalProfileNavItem.GENERATOR_CLASS, ""); + + throw new FormProcessException("Canceled"); } } } diff --git a/ccm-cms-types-siteproxy/src/com/arsdigita/cms/contenttypes/ui/SiteProxyPropertyForm.java b/ccm-cms-types-siteproxy/src/com/arsdigita/cms/contenttypes/ui/SiteProxyPropertyForm.java index d98450b6e..3496b5be3 100755 --- a/ccm-cms-types-siteproxy/src/com/arsdigita/cms/contenttypes/ui/SiteProxyPropertyForm.java +++ b/ccm-cms-types-siteproxy/src/com/arsdigita/cms/contenttypes/ui/SiteProxyPropertyForm.java @@ -30,14 +30,13 @@ import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ui.authoring.BasicPageForm; - /** * Form to edit the basic properties of an SiteProxy. This form can be * extended to create forms for SiteProxy subclasses. */ public class SiteProxyPropertyForm extends BasicPageForm - implements FormProcessListener, - FormInitListener { + implements FormProcessListener, + FormInitListener { private TextField m_url; @@ -56,10 +55,9 @@ public class SiteProxyPropertyForm extends BasicPageForm */ protected void addWidgets() { super.addWidgets(); - + add(new Label("URL:")); - ParameterModel urlParam - = new StringParameter("url"); + ParameterModel urlParam = new StringParameter("url"); m_url = new TextField(urlParam); m_url.setSize(40); add(m_url); @@ -67,24 +65,23 @@ public class SiteProxyPropertyForm extends BasicPageForm /** Form initialisation hook. Fills widgets with data. */ public void init(FormSectionEvent fse) { - SiteProxy site - = (SiteProxy) super.initBasicWidgets(fse); - - m_url.setValue(fse.getPageState(), + SiteProxy site = (SiteProxy) super.initBasicWidgets(fse); + + m_url.setValue(fse.getPageState(), site.getURL()); } - + /** Form processing hook. Saves SiteProxy object. */ public void process(FormSectionEvent fse) { - SiteProxy site - = (SiteProxy) super.processBasicWidgets(fse); + SiteProxy site = (SiteProxy) super.processBasicWidgets(fse); // save only if save button was pressed if (site != null - && getSaveCancelSection().getSaveButton() - .isSelected(fse.getPageState())) { - site.setURL((String)m_url.getValue(fse.getPageState())); + && getSaveCancelSection().getSaveButton() + .isSelected(fse.getPageState())) { + site.setURL((String) m_url.getValue(fse.getPageState())); site.save(); } } + } diff --git a/ccm-cms/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager b/ccm-cms/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager new file mode 100644 index 000000000..44096adb6 --- /dev/null +++ b/ccm-cms/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager @@ -0,0 +1,3 @@ +com.arsdigita.cms.ContentCenterAppManager +com.arsdigita.cms.ServiceAppManager +com.arsdigita.cms.contentsection.ContentSectionAppManager \ No newline at end of file diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources.properties index 61c92e20c..1771fc76e 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources.properties @@ -1017,3 +1017,4 @@ cms.ui.authoring.no_types_registered=No types registered cms.ui.authoring.create_new=Create new: cms.ui.authoring.go=Go cms.ui.upload=File Upload +cms.ui.section.new_section_name=Name of the new Content Section diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties index 14a1ff4d2..8c8b53648 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties @@ -1010,3 +1010,4 @@ cms.ui.authoring.create_new=Neuer Inhalt: cms.ui.authoring.go=Anlegen #File Upload cms.ui.upload=Datei laden +cms.ui.section.new_section_name=Name der neuen Content Section diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties index 97451e8d3..4788b7ca2 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties @@ -58,3 +58,4 @@ cms.ui.authoring.create_new=Create new: cms.ui.authoring.go=Go #File Upload cms.ui.upload=File Upload +cms.ui.section.new_section_name= diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties index b1441f85f..5abc3ac94 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties @@ -539,3 +539,4 @@ cms.ui.authoring.go=Go cms.ui.title=Title #File Upload cms.ui.upload=Transf\u00e9re +cms.ui.section.new_section_name= diff --git a/ccm-cms/src/com/arsdigita/cms/ContentCenterAppManager.java b/ccm-cms/src/com/arsdigita/cms/ContentCenterAppManager.java new file mode 100644 index 000000000..1f7645f2c --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/ContentCenterAppManager.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.cms; + +import com.arsdigita.bebop.BoxPanel; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.SimpleContainer; +import com.arsdigita.ui.admin.GlobalizationUtil; +import com.arsdigita.ui.admin.applications.AbstractSingletonApplicationManager; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class ContentCenterAppManager extends AbstractSingletonApplicationManager { + + public Class getApplication() { + return ContentCenter.class; + } + + /** + * ContentCenter has no global settings. + * + * @return A panel with a message that there no settings yet. + */ + public SimpleContainer getApplicationAdminForm() { + final BoxPanel panel = new BoxPanel(BoxPanel.VERTICAL); + + panel.add(new Label(GlobalizationUtil.globalize("ui.admin.applications.no_settings"))); + + return panel; + } + +} diff --git a/ccm-cms/src/com/arsdigita/cms/ServiceAppManager.java b/ccm-cms/src/com/arsdigita/cms/ServiceAppManager.java new file mode 100644 index 000000000..7ca2cb7d2 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/ServiceAppManager.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.cms; + +import com.arsdigita.bebop.BoxPanel; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.SimpleContainer; +import com.arsdigita.ui.admin.GlobalizationUtil; +import com.arsdigita.ui.admin.applications.AbstractSingletonApplicationManager; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class ServiceAppManager extends AbstractSingletonApplicationManager { + + public Class getApplication() { + return Service.class; + } + + /** + * + * @return Just a panel with a label because this app has no settings yet. + */ + public SimpleContainer getApplicationAdminForm() { + final BoxPanel panel = new BoxPanel(BoxPanel.VERTICAL); + + panel.add(new Label(GlobalizationUtil.globalize("ui.admin.applications.no_settings"))); + + return panel; + } + +} diff --git a/ccm-cms/src/com/arsdigita/cms/contentsection/ContentSectionAppManager.java b/ccm-cms/src/com/arsdigita/cms/contentsection/ContentSectionAppManager.java new file mode 100644 index 000000000..7c94d892a --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/contentsection/ContentSectionAppManager.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.cms.contentsection; + +import com.arsdigita.bebop.BoxPanel; +import com.arsdigita.bebop.Form; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.SimpleContainer; +import com.arsdigita.cms.ContentSection; +import com.arsdigita.ui.admin.GlobalizationUtil; +import com.arsdigita.ui.admin.applications.ApplicationManager; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class ContentSectionAppManager implements ApplicationManager { + + public Class getApplication() { + return ContentSection.class; + } + + public SimpleContainer getApplicationAdminForm() { + final BoxPanel panel = new BoxPanel(BoxPanel.VERTICAL); + + panel.add(new Label(GlobalizationUtil.globalize("ui.admin.applications.no_settings"))); + + return panel; + } + + public Form getApplicationCreateForm() { + return new ContentSectionCreateForm(); + } + + +} diff --git a/ccm-cms/src/com/arsdigita/cms/contentsection/ContentSectionCreateForm.java b/ccm-cms/src/com/arsdigita/cms/contentsection/ContentSectionCreateForm.java new file mode 100644 index 000000000..bff8e4673 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/contentsection/ContentSectionCreateForm.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.cms.contentsection; + +import com.arsdigita.bebop.ColumnPanel; +import com.arsdigita.bebop.Form; +import com.arsdigita.bebop.FormData; +import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.SaveCancelSection; +import com.arsdigita.bebop.event.FormProcessListener; +import com.arsdigita.bebop.event.FormSectionEvent; +import com.arsdigita.bebop.event.FormSubmissionListener; +import com.arsdigita.bebop.form.TextField; +import com.arsdigita.bebop.parameters.NotEmptyValidationListener; +import com.arsdigita.bebop.parameters.NotNullValidationListener; +import com.arsdigita.cms.util.GlobalizationUtil; +import com.arsdigita.persistence.SessionManager; +import com.arsdigita.persistence.TransactionContext; + +/** + * Form for creating a new ContentSection. Used by the {@link ContentSectionAppManager}. + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class ContentSectionCreateForm extends Form { + + public final static String FORM_NAME = "ContentSectionCreateForm"; + private final static String NEW_SECTION_NAME = "newSectionName"; + private final SaveCancelSection saveCancelSection; + + public ContentSectionCreateForm() { + super(FORM_NAME); + + add(new Label(GlobalizationUtil.globalize("cms.ui.section.new_section_name"))); + final TextField sectionNameField = new TextField(NEW_SECTION_NAME); + sectionNameField.setMaxLength(256); + sectionNameField.addValidationListener(new NotNullValidationListener()); + sectionNameField.addValidationListener(new NotEmptyValidationListener()); + add(sectionNameField); + + saveCancelSection = new SaveCancelSection(); + add(saveCancelSection, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT); + + addProcessListener(new ContentSectionCreateProcessListener()); + addSubmissionListener(new ContentSectionSubmissionListener()); + } + + private class ContentSectionCreateProcessListener implements FormProcessListener { + + private final ContentSectionConfig config = ContentSectionConfig.getInstance(); + + public ContentSectionCreateProcessListener() { + //Nothing for now + } + + public void process(final FormSectionEvent event) throws FormProcessException { + final FormData data = event.getFormData(); + + final String newSectionName = data.getString(NEW_SECTION_NAME); + +// final TransactionContext tctx = SessionManager.getSession().getTransactionContext(); +// tctx.beginTxn(); + ContentSectionSetup.setupContentSectionAppInstance(newSectionName, + config.getDefaultRoles(), + config.getDefaultWorkflows(), + config.isPubliclyViewable(), + config.getItemResolverClass(), + config.getTemplateResolverClass(), + config.getContentSectionsContentTypes(), + config.getUseSectionCategories(), + config.getCategoryFileList()); +// tctx.commitTxn(); + + data.put(NEW_SECTION_NAME, ""); + } + + } + + private class ContentSectionSubmissionListener implements FormSubmissionListener { + + public ContentSectionSubmissionListener() { + //Nothing for now + } + + public void submitted(final FormSectionEvent event) throws FormProcessException { + if (saveCancelSection.getCancelButton().isSelected(event.getPageState())) { + event.getFormData().put(NEW_SECTION_NAME, ""); + + throw new FormProcessException("Canceled"); + } + } + + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryTreeModelBuilder.java b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryTreeModelBuilder.java index ac73f02e3..54c75daf5 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryTreeModelBuilder.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryTreeModelBuilder.java @@ -49,16 +49,16 @@ class CategoryTreeModelBuilder extends LockableImpl m_contextModel = contextModel; } - public final TreeModel makeModel(final Tree tree, final PageState state) { final ContentSection section = CMS.getContext().getContentSection(); - final Category root = Category.getRootForObject(section, + final Category root = Category.getRootForObject(section, getUseContext(state)); String order = ContentSection.getConfig().getCategoryTreeOrder(); final CategoryTreeModelLite model = new CategoryTreeModelLite(root, order); return model; } + private String getUseContext(PageState state) { String context = null; if (m_contextModel != null) { diff --git a/ccm-core/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager b/ccm-core/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager new file mode 100644 index 000000000..89a8dc2e7 --- /dev/null +++ b/ccm-core/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager @@ -0,0 +1,2 @@ +com.arsdigita.ui.admin.AdminAppManager +com.arsdigita.ui.login.LoginAppManager \ No newline at end of file diff --git a/ccm-core/src/com/arsdigita/globalization/GlobalizationHelper.java b/ccm-core/src/com/arsdigita/globalization/GlobalizationHelper.java index 765db13c4..82cba0471 100644 --- a/ccm-core/src/com/arsdigita/globalization/GlobalizationHelper.java +++ b/ccm-core/src/com/arsdigita/globalization/GlobalizationHelper.java @@ -132,7 +132,7 @@ public class GlobalizationHelper { private static java.util.Locale scanLocale(String lang) { // Protect against empty lang string - if (lang != null) { + if ((lang != null) && !(lang.isEmpty())) { // Split the string and create the Locale object StringTokenizer paramValues = new StringTokenizer(lang, "_"); if (paramValues.countTokens() > 1) { diff --git a/ccm-core/src/com/arsdigita/ui/admin/AdminAppManager.java b/ccm-core/src/com/arsdigita/ui/admin/AdminAppManager.java new file mode 100644 index 000000000..f06f559d8 --- /dev/null +++ b/ccm-core/src/com/arsdigita/ui/admin/AdminAppManager.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.ui.admin; + +import com.arsdigita.bebop.BoxPanel; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.SimpleContainer; +import com.arsdigita.ui.admin.applications.AbstractSingletonApplicationManager; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class AdminAppManager extends AbstractSingletonApplicationManager { + + public Class getApplication() { + return Admin.class; + } + + /** + * Just returns a empty panel. Admin app has no settings for now. + * + * @return + */ + public SimpleContainer getApplicationAdminForm() { + final BoxPanel panel = new BoxPanel(BoxPanel.VERTICAL); + + panel.add(new Label(GlobalizationUtil.globalize("ui.admin.applications.no_settings"))); + + return panel; + } + +} diff --git a/ccm-core/src/com/arsdigita/ui/admin/AdminResources.properties b/ccm-core/src/com/arsdigita/ui/admin/AdminResources.properties index 7c8d5dbb6..2e6dcb9d3 100644 --- a/ccm-core/src/com/arsdigita/ui/admin/AdminResources.properties +++ b/ccm-core/src/com/arsdigita/ui/admin/AdminResources.properties @@ -127,3 +127,6 @@ ui.admin.MultiInstanceApplicationPane.create_instance=Create new instance ui.admin.SingletonApplicationPane.manage.heading=Edit settings ui.admin.SingletonApplicationPane.manage.no_admin_pane_found=No admin pane for applications of type '{0}' found. ui.admin.applications.ApplicationInfoSection.desc.label=Description +ui.admin.applications.no_settings=This application has no settings (yet). +ui.admin.applications.form_not_compatible_now=This application administration form is not yet compatible with this application pane. Please use the applications own administration form. +ui.admin.applications.ApplicationInstancePane.manage.heading=Instance specific settings diff --git a/ccm-core/src/com/arsdigita/ui/admin/AdminResources_de.properties b/ccm-core/src/com/arsdigita/ui/admin/AdminResources_de.properties index 686c55be9..7b7d584f0 100644 --- a/ccm-core/src/com/arsdigita/ui/admin/AdminResources_de.properties +++ b/ccm-core/src/com/arsdigita/ui/admin/AdminResources_de.properties @@ -127,3 +127,6 @@ ui.admin.MultiInstanceApplicationPane.create_instance=Neue instanz anlegen ui.admin.SingletonApplicationPane.manage.heading=Eigenschaften bearbeiten ui.admin.SingletonApplicationPane.manage.no_admin_pane_found=Keine Admin-Formular f\u00fcr Applikationen des Types {0} gefunden ui.admin.applications.ApplicationInfoSection.desc.label=Beschreibung +ui.admin.applications.no_settings=Diese Applikation hat (noch) keine Einstellungen. +ui.admin.applications.form_not_compatible_now=Das Formular zur Verwaltung dieser Application ist derzeit noch nicht kompatibel mit dieser Administrationsoberfl\u00e4che. Bitte nutzen Sie den Administrationsoberfl\u00e4che der Application. +ui.admin.applications.ApplicationInstancePane.manage.heading=Einstellungen der Instanz diff --git a/ccm-core/src/com/arsdigita/ui/admin/AdminResources_en.properties b/ccm-core/src/com/arsdigita/ui/admin/AdminResources_en.properties index 1276d793d..8ef0388b4 100755 --- a/ccm-core/src/com/arsdigita/ui/admin/AdminResources_en.properties +++ b/ccm-core/src/com/arsdigita/ui/admin/AdminResources_en.properties @@ -127,3 +127,6 @@ ui.admin.MultiInstanceApplicationPane.create_instance= ui.admin.SingletonApplicationPane.manage.heading= ui.admin.SingletonApplicationPane.manage.no_admin_pane_found= ui.admin.applications.ApplicationInfoSection.desc.label= +ui.admin.applications.no_settings= +ui.admin.applications.form_not_compatible_now= +ui.admin.applications.ApplicationInstancePane.manage.heading= diff --git a/ccm-core/src/com/arsdigita/ui/admin/AdminResources_fr.properties b/ccm-core/src/com/arsdigita/ui/admin/AdminResources_fr.properties index 10da70198..02e8b7083 100755 --- a/ccm-core/src/com/arsdigita/ui/admin/AdminResources_fr.properties +++ b/ccm-core/src/com/arsdigita/ui/admin/AdminResources_fr.properties @@ -113,3 +113,6 @@ ui.admin.MultiInstanceApplicationPane.create_instance= ui.admin.SingletonApplicationPane.manage.heading= ui.admin.SingletonApplicationPane.manage.no_admin_pane_found= ui.admin.applications.ApplicationInfoSection.desc.label= +ui.admin.applications.no_settings= +ui.admin.applications.form_not_compatible_now= +ui.admin.applications.ApplicationInstancePane.manage.heading= diff --git a/ccm-core/src/com/arsdigita/ui/admin/ApplicationsAdministrationTab.java b/ccm-core/src/com/arsdigita/ui/admin/ApplicationsAdministrationTab.java index 04cdcecd1..395a3f447 100644 --- a/ccm-core/src/com/arsdigita/ui/admin/ApplicationsAdministrationTab.java +++ b/ccm-core/src/com/arsdigita/ui/admin/ApplicationsAdministrationTab.java @@ -171,7 +171,8 @@ public class ApplicationsAdministrationTab extends BoxPanel implements AdminCons application, managementForms.get(application.getClass().getName()).getApplicationAdminForm()); } - instancePanes.put(application.getClass().getName(), instPane); + //instancePanes.put(application.getClass().getName(), instPane); + instancePanes.put(application.getPath(), instPane); } @Override diff --git a/ccm-core/src/com/arsdigita/ui/admin/applications/MultiInstanceApplicationPane.java b/ccm-core/src/com/arsdigita/ui/admin/applications/MultiInstanceApplicationPane.java index b9ec4498c..6b8d84d1e 100644 --- a/ccm-core/src/com/arsdigita/ui/admin/applications/MultiInstanceApplicationPane.java +++ b/ccm-core/src/com/arsdigita/ui/admin/applications/MultiInstanceApplicationPane.java @@ -21,7 +21,6 @@ package com.arsdigita.ui.admin.applications; import com.arsdigita.bebop.Form; import com.arsdigita.bebop.Label; import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.SimpleContainer; import com.arsdigita.bebop.Table; import com.arsdigita.bebop.table.TableColumn; import com.arsdigita.bebop.table.TableModel; @@ -51,13 +50,17 @@ public class MultiInstanceApplicationPane extends BaseApp final ApplicationCollection applications = Application.retrieveAllApplications(applicationType. getApplicationObjectType()); + applications.rewind(); final Table table = new Table(); - table.getColumnModel().add(new TableColumn(COL_TITLE, GlobalizationUtil.globalize( - "ui.admin.applicationsMultiInstanceApplicationPane.instances.table.col_title.header"))); - table.getColumnModel().add(new TableColumn(COL_URL, GlobalizationUtil.globalize( - "ui.admin.applicationsMultiInstanceApplicationPane.instances.table.col_url.header"))); - table.getColumnModel().add(new TableColumn(COL_DESC, GlobalizationUtil.globalize( - "ui.admin.applicationsMultiInstanceApplicationPane.instances.table.col_desc.header"))); + table.getColumnModel().add(new TableColumn(COL_TITLE, + new Label(GlobalizationUtil.globalize( + "ui.admin.applicationsMultiInstanceApplicationPane.instances.table.col_title.header")))); + table.getColumnModel().add(new TableColumn(COL_URL, + new Label(GlobalizationUtil.globalize( + "ui.admin.applicationsMultiInstanceApplicationPane.instances.table.col_url.header")))); + table.getColumnModel().add(new TableColumn(COL_DESC, + new Label(GlobalizationUtil.globalize( + "ui.admin.applicationsMultiInstanceApplicationPane.instances.table.col_desc.header")))); table.setModelBuilder(new ApplicationInstancesTableModelBuilder(applications)); @@ -110,6 +113,9 @@ public class MultiInstanceApplicationPane extends BaseApp } public boolean nextRow() { + if (applications.isAfterLast()) { + applications.rewind(); + } return applications.next(); } diff --git a/ccm-core/src/com/arsdigita/ui/login/LoginAppManager.java b/ccm-core/src/com/arsdigita/ui/login/LoginAppManager.java new file mode 100644 index 000000000..1edda3986 --- /dev/null +++ b/ccm-core/src/com/arsdigita/ui/login/LoginAppManager.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.ui.login; + +import com.arsdigita.bebop.BoxPanel; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.SimpleContainer; +import com.arsdigita.ui.admin.GlobalizationUtil; +import com.arsdigita.ui.admin.applications.AbstractSingletonApplicationManager; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class LoginAppManager extends AbstractSingletonApplicationManager { + + public Class getApplication() { + return Login.class; + } + + /** + * Just returns a empty panel. Admin app has no settings for now. + * + * @return + */ + public SimpleContainer getApplicationAdminForm() { + final BoxPanel panel = new BoxPanel(BoxPanel.VERTICAL); + + panel.add(new Label(GlobalizationUtil.globalize("ui.admin.applications.no_settings"))); + + return panel; + } + +} diff --git a/ccm-ldn-search/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager b/ccm-ldn-search/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager new file mode 100644 index 000000000..204898f19 --- /dev/null +++ b/ccm-ldn-search/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager @@ -0,0 +1 @@ +com.arsdigita.london.search.SearchAppManager \ No newline at end of file diff --git a/ccm-ldn-search/src/com/arsdigita/london/search/SearchAppManager.java b/ccm-ldn-search/src/com/arsdigita/london/search/SearchAppManager.java new file mode 100644 index 000000000..b38303109 --- /dev/null +++ b/ccm-ldn-search/src/com/arsdigita/london/search/SearchAppManager.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.london.search; + +import com.arsdigita.bebop.BoxPanel; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.SimpleContainer; +import com.arsdigita.ui.admin.GlobalizationUtil; +import com.arsdigita.ui.admin.applications.AbstractSingletonApplicationManager; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class SearchAppManager extends AbstractSingletonApplicationManager{ + + public Class getApplication() { + return Search.class; + } + + public SimpleContainer getApplicationAdminForm() { + final BoxPanel panel = new BoxPanel(BoxPanel.VERTICAL); + + panel.add(new Label(GlobalizationUtil.globalize("ui.admin.applications.no_settings"))); + + return panel; + } + +} diff --git a/ccm-ldn-terms/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager b/ccm-ldn-terms/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager new file mode 100644 index 000000000..6304006c7 --- /dev/null +++ b/ccm-ldn-terms/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager @@ -0,0 +1 @@ +com.arsdigita.london.terms.TermsAppManager \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/mandalay/layout/search.xml b/ccm-sci-bundle/web/themes/mandalay/layout/search.xml index 682906f29..58dba6e8c 100755 --- a/ccm-sci-bundle/web/themes/mandalay/layout/search.xml +++ b/ccm-sci-bundle/web/themes/mandalay/layout/search.xml @@ -29,7 +29,7 @@ - + diff --git a/ccm-sci-publications/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager b/ccm-sci-publications/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager new file mode 100644 index 000000000..b5d088f9b --- /dev/null +++ b/ccm-sci-publications/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager @@ -0,0 +1 @@ +com.arsdigita.cms.scipublications.SciPublicationsAppManager \ No newline at end of file diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/SciPublicationsAppManager.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/SciPublicationsAppManager.java new file mode 100644 index 000000000..fb7044c19 --- /dev/null +++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/SciPublicationsAppManager.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.cms.scipublications; + +import com.arsdigita.bebop.BoxPanel; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.SimpleContainer; +import com.arsdigita.ui.admin.GlobalizationUtil; +import com.arsdigita.ui.admin.applications.AbstractSingletonApplicationManager; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class SciPublicationsAppManager extends AbstractSingletonApplicationManager { + + public Class getApplication() { + return SciPublications.class; + } + + /** + * + * @return Just a simple Message for now because this applications has no settings yet. + */ + public SimpleContainer getApplicationAdminForm() { + final BoxPanel panel = new BoxPanel(BoxPanel.VERTICAL); + + panel.add(new Label(GlobalizationUtil.globalize("ui.admin.applications.no_settings"))); + + return panel; + } + +} diff --git a/ccm-shortcuts/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager b/ccm-shortcuts/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager new file mode 100644 index 000000000..51c55f490 --- /dev/null +++ b/ccm-shortcuts/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager @@ -0,0 +1 @@ +com.arsdigita.shortcuts.ShortcutsAppManager \ No newline at end of file diff --git a/ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutsAppManager.java b/ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutsAppManager.java new file mode 100644 index 000000000..2bd581cc9 --- /dev/null +++ b/ccm-shortcuts/src/com/arsdigita/shortcuts/ShortcutsAppManager.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.shortcuts; + +import com.arsdigita.bebop.SimpleContainer; +import com.arsdigita.shortcuts.ui.AdminPanel; +import com.arsdigita.ui.admin.applications.AbstractSingletonApplicationManager; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class ShortcutsAppManager extends AbstractSingletonApplicationManager{ + + public Class getApplication() { + return Shortcuts.class; + } + + public SimpleContainer getApplicationAdminForm() { + return new AdminPanel(); + } + + + +} diff --git a/ccm-subsite/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager b/ccm-subsite/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager new file mode 100644 index 000000000..79eaecf8b --- /dev/null +++ b/ccm-subsite/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager @@ -0,0 +1 @@ +com.arsdigita.subsite.SubsiteAppManager \ No newline at end of file diff --git a/ccm-subsite/src/com/arsdigita/subsite/SubsiteAppManager.java b/ccm-subsite/src/com/arsdigita/subsite/SubsiteAppManager.java new file mode 100644 index 000000000..148c914dc --- /dev/null +++ b/ccm-subsite/src/com/arsdigita/subsite/SubsiteAppManager.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.subsite; + +import com.arsdigita.bebop.BoxPanel; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.Link; +import com.arsdigita.bebop.SimpleContainer; +import com.arsdigita.ui.admin.GlobalizationUtil; +import com.arsdigita.ui.admin.applications.AbstractSingletonApplicationManager; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class SubsiteAppManager extends AbstractSingletonApplicationManager{ + + public Class getApplication() { + return Subsite.class; + } + + public SimpleContainer getApplicationAdminForm() { + final BoxPanel panel = new BoxPanel(BoxPanel.VERTICAL); + final Label warnLabel = new Label(GlobalizationUtil.globalize("ui.admin.applications.form_not_compatible_now")); + warnLabel.setClassAttr("warning"); + panel.add(warnLabel); + panel.add(new Link("Subsite Admin", "/admin/subsite")); + + return panel; + } + +} diff --git a/ccm-subsite/src/com/arsdigita/subsite/ui/AppManagerPanel.java b/ccm-subsite/src/com/arsdigita/subsite/ui/AppManagerPanel.java new file mode 100644 index 000000000..fa61e3c26 --- /dev/null +++ b/ccm-subsite/src/com/arsdigita/subsite/ui/AppManagerPanel.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.subsite.ui; + +import com.arsdigita.bebop.BoxPanel; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.Link; +import com.arsdigita.bebop.Page; +import com.arsdigita.bebop.SimpleContainer; +import com.arsdigita.subsite.Subsite; +import com.arsdigita.ui.admin.GlobalizationUtil; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class AppManagerPanel extends SimpleContainer { + +// private final SiteSelectionModel selectionModel = new SiteSelectionModel(new BigDecimalParameter("site")); + + public AppManagerPanel() { + super(Subsite.SUBSITE_XML_PREFIX + "controlCenter", + Subsite.SUBSITE_XML_NS); + + final BoxPanel panel = new BoxPanel(BoxPanel.VERTICAL); + final Label warnLabel = new Label(GlobalizationUtil.globalize("ui.admin.applications.form_not_compatible_now")); + warnLabel.setClassAttr("warning"); + add(warnLabel); + panel.add(warnLabel); + panel.add(new Link("", "/ccm/admin/subsite")); +// add(new SiteListing(selectionModel)); +// add(new SiteForm("site", selectionModel)); + + add(panel); + } + + @Override + public void register(final Page page) { + super.register(page); +// page.addGlobalStateParam(selectionModel.getStateParameter()); + } + +} diff --git a/ccm-subsite/src/com/arsdigita/subsite/ui/ControlCenterPanel.java b/ccm-subsite/src/com/arsdigita/subsite/ui/ControlCenterPanel.java index 4bc4b1686..a3b25a3fa 100755 --- a/ccm-subsite/src/com/arsdigita/subsite/ui/ControlCenterPanel.java +++ b/ccm-subsite/src/com/arsdigita/subsite/ui/ControlCenterPanel.java @@ -18,6 +18,7 @@ package com.arsdigita.subsite.ui; +import com.arsdigita.bebop.Page; import com.arsdigita.subsite.Subsite; import com.arsdigita.bebop.SimpleContainer; @@ -26,20 +27,16 @@ import com.arsdigita.bebop.SimpleContainer; * */ public class ControlCenterPanel extends SimpleContainer { - - private SiteSelectionModel m_site; - + /** * - * @param site + * @param selectionModel */ - public ControlCenterPanel(SiteSelectionModel site) { + public ControlCenterPanel(final SiteSelectionModel selectionModel) { super(Subsite.SUBSITE_XML_PREFIX + "controlCenter", Subsite.SUBSITE_XML_NS); - m_site = site; - - add(new SiteListing(m_site)); - add(new SiteForm("site", m_site)); - } + add(new SiteListing(selectionModel)); + add(new SiteForm("site", selectionModel)); + } } diff --git a/ccm-themedirector/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager b/ccm-themedirector/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager new file mode 100644 index 000000000..8aa1146d7 --- /dev/null +++ b/ccm-themedirector/src/META-INF/services/com.arsdigita.ui.admin.applications.ApplicationManager @@ -0,0 +1 @@ +com.arsdigita.themedirector.ThemeDirectorAppManager \ No newline at end of file diff --git a/ccm-themedirector/src/com/arsdigita/themedirector/ThemeDirector.java b/ccm-themedirector/src/com/arsdigita/themedirector/ThemeDirector.java index 31a03a0fd..c4f9c2ebc 100755 --- a/ccm-themedirector/src/com/arsdigita/themedirector/ThemeDirector.java +++ b/ccm-themedirector/src/com/arsdigita/themedirector/ThemeDirector.java @@ -22,6 +22,7 @@ import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.persistence.OID; import com.arsdigita.persistence.DataObject; import com.arsdigita.web.Application; +import com.arsdigita.web.ApplicationCollection; import org.apache.log4j.Logger; @@ -48,6 +49,24 @@ public class ThemeDirector extends Application { return s_config; } + /** + * ThemeDirector is a singleton for now. + * + * @return The application instance of the theme director + */ + public static ThemeDirector getThemeDirector() { + final ApplicationCollection apps = Application.retrieveAllApplications(BASE_DATA_OBJECT_TYPE); + final ThemeDirector themeDirector; + if (apps.next()) { + themeDirector = (ThemeDirector) apps.getApplication(); + } else { + themeDirector = null; + } + + apps.close(); + return themeDirector; + } + public ThemeDirector(DataObject obj) { super(obj); } diff --git a/ccm-themedirector/src/com/arsdigita/themedirector/ThemeDirectorAppManager.java b/ccm-themedirector/src/com/arsdigita/themedirector/ThemeDirectorAppManager.java new file mode 100644 index 000000000..48268b417 --- /dev/null +++ b/ccm-themedirector/src/com/arsdigita/themedirector/ThemeDirectorAppManager.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.themedirector; + +import com.arsdigita.bebop.BoxPanel; +import com.arsdigita.bebop.SimpleContainer; +import com.arsdigita.themedirector.ui.ThemeControlPanel; +import com.arsdigita.ui.admin.applications.AbstractSingletonApplicationManager; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class ThemeDirectorAppManager extends AbstractSingletonApplicationManager { + + public Class getApplication() { + return ThemeDirector.class; + } + + public SimpleContainer getApplicationAdminForm() { + final BoxPanel panel = new BoxPanel(BoxPanel.VERTICAL); + panel.add(new ThemeControlPanel()); + return panel; + } + +} diff --git a/ccm-themedirector/src/com/arsdigita/themedirector/ui/ThemeControlPanel.java b/ccm-themedirector/src/com/arsdigita/themedirector/ui/ThemeControlPanel.java index b59e67c63..f298b6e37 100755 --- a/ccm-themedirector/src/com/arsdigita/themedirector/ui/ThemeControlPanel.java +++ b/ccm-themedirector/src/com/arsdigita/themedirector/ui/ThemeControlPanel.java @@ -15,21 +15,13 @@ * 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.themedirector.ui; -import com.arsdigita.themedirector.Theme; -import com.arsdigita.themedirector.ThemeDirector; -import com.arsdigita.themedirector.ThemeDirectorConstants; -import com.arsdigita.themedirector.ui.listeners.CancelListener; -import com.arsdigita.themedirector.util.GlobalizationUtil; - import com.arsdigita.bebop.ActionLink; import com.arsdigita.bebop.Form; import com.arsdigita.bebop.FormData; import com.arsdigita.bebop.FormProcessException; import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; import com.arsdigita.bebop.List; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.SimpleContainer; @@ -44,17 +36,19 @@ import com.arsdigita.bebop.form.Option; import com.arsdigita.bebop.form.SingleSelect; import com.arsdigita.bebop.form.Submit; import com.arsdigita.bebop.parameters.BigDecimalParameter; -import com.arsdigita.persistence.SessionManager; import com.arsdigita.persistence.DataCollection; +import com.arsdigita.persistence.SessionManager; +import com.arsdigita.themedirector.Theme; +import com.arsdigita.themedirector.ThemeDirector; +import com.arsdigita.themedirector.ThemeDirectorConstants; +import com.arsdigita.themedirector.ui.listeners.CancelListener; +import com.arsdigita.themedirector.util.GlobalizationUtil; import com.arsdigita.toolbox.ui.ActionGroup; import com.arsdigita.toolbox.ui.Cancellable; import com.arsdigita.toolbox.ui.SelectionPanel; import com.arsdigita.util.UncheckedWrapperException; -import com.arsdigita.web.Web; - import java.math.BigDecimal; import java.util.TooManyListenersException; - import org.apache.log4j.Logger; /** @@ -63,51 +57,45 @@ import org.apache.log4j.Logger; * to show the correct forms/containers on the left */ public class ThemeControlPanel extends SelectionPanel implements ThemeDirectorConstants { - - private static final Logger s_log = Logger.getLogger(ThemeControlPanel.class); - private ThemeSelectionModel m_theme; - private ThemeContainer m_themeContainer; - private Form m_themeForm; - private BigDecimalParameter m_defaultThemeParam = new BigDecimalParameter( "defaultTheme" ); + private static final Logger LOGGER = Logger.getLogger(ThemeControlPanel.class); + private final ThemeSelectionModel selectionModel; + //private final ThemeContainer themeContainer; + private final Form themeForm; + private final BigDecimalParameter defaultThemeParam = new BigDecimalParameter("defaultTheme"); public ThemeControlPanel() { super(new Label(GlobalizationUtil.globalize("theme.available_themes")), new ThemeListModelBuilder()); - setIntroPane(new Label(GlobalizationUtil.globalize - ("theme.select_or_create"))); + setIntroPane(new Label(GlobalizationUtil.globalize("theme.select_or_create"))); + + ((List) getSelector()).setEmptyView(new Label(GlobalizationUtil.globalize("theme.none_available"))); - ((List)getSelector()).setEmptyView - (new Label(GlobalizationUtil.globalize("theme.none_available"))); - // add the theme container - m_theme = new ThemeSelectionModel(getSelectionModel()); - m_themeContainer = new ThemeContainer(m_theme, getBody()); - setItemPane(m_themeContainer); + selectionModel = new ThemeSelectionModel(getSelectionModel()); + final ThemeContainer themeContainer = new ThemeContainer(selectionModel, getBody()); + setItemPane(themeContainer); // add the "create a theme" form - m_themeForm = new ThemeForm("themeForm", m_theme); - m_themeForm.addSubmissionListener - (new CancelListener((Cancellable)m_themeForm, getBody())); - m_themeForm.addProcessListener(new FormProcessListener() { - public void process(FormSectionEvent e) - throws FormProcessException { - resetPane(e.getPageState()); - } - }); + themeForm = new ThemeForm("themeForm", selectionModel); + themeForm.addSubmissionListener(new CancelListener((Cancellable) themeForm, getBody())); + themeForm.addProcessListener(new FormProcessListener() { + public void process(final FormSectionEvent event) throws FormProcessException { + resetPane(event.getPageState()); + } - ActionLink addThemeLink = - new ActionLink(new Label(GlobalizationUtil.globalize - ("theme.create_new_theme"))); + }); + + final ActionLink addThemeLink = new ActionLink(new Label(GlobalizationUtil.globalize("theme.create_new_theme"))); addThemeLink.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - m_theme.setSelectedObject(e.getPageState(), null); - m_themeForm.setVisible(e.getPageState(), true); - } - }); - getBody().add(m_themeForm); - getBody().connect(addThemeLink, m_themeForm); + public void actionPerformed(final ActionEvent event) { + selectionModel.setSelectedObject(event.getPageState(), null); + themeForm.setVisible(event.getPageState(), true); + } + }); + getBody().add(themeForm); + getBody().connect(addThemeLink, themeForm); addAction(addThemeLink, ActionGroup.ADD); // add the "Download default base styxle" form @@ -116,85 +104,87 @@ public class ThemeControlPanel extends SelectionPanel implements ThemeDirectorCo // package installed, probably filtered by theme file extensions (xsl, // css, etc). /* - getBody().add(new Label(GlobalizationUtil - .globalize("theme.download_default_base_styles"))); - Link downloadFilesLink = new Link(new Label(GlobalizationUtil.globalize - ("theme.download_default_base_styles")), - "download/" + ALL_STYLES_ZIP_NAME); - addAction(downloadFilesLink, ActionGroup.ADD); -*/ + getBody().add(new Label(GlobalizationUtil + .globalize("theme.download_default_base_styles"))); + Link downloadFilesLink = new Link(new Label(GlobalizationUtil.globalize + ("theme.download_default_base_styles")), + "download/" + ALL_STYLES_ZIP_NAME); + addAction(downloadFilesLink, ActionGroup.ADD); + */ // add the "Select Standard Theme" form - Form defaultThemeForm = createDefaultThemeForm(); - addAction( defaultThemeForm ); + final Form defaultThemeForm = createDefaultThemeForm(); + addAction(defaultThemeForm); } private Form createDefaultThemeForm() { - Form defaultThemeForm = new Form("defaultThemeForm", new SimpleContainer()); - defaultThemeForm.add( new Label( GlobalizationUtil.globalize - ( "theme.set_default_theme" ) ) ); + final Form defaultThemeForm = new Form("defaultThemeForm", new SimpleContainer()); + defaultThemeForm.add(new Label(GlobalizationUtil.globalize("theme.set_default_theme"))); - SingleSelect themes = new SingleSelect( m_defaultThemeParam ); - themes.addOption( new Option( null, new Label( GlobalizationUtil.globalize( "theme.none" ) ) ) ); + final SingleSelect themes = new SingleSelect(defaultThemeParam); + themes.addOption(new Option(null, new Label(GlobalizationUtil.globalize("theme.none")))); try { - themes.addPrintListener( new PrintListener() { - public void prepare( PrintEvent ev ) { - SingleSelect target = (SingleSelect) ev.getTarget(); - - DataCollection options = SessionManager.getSession().retrieve - ( Theme.BASE_DATA_OBJECT_TYPE ); - options.addNotEqualsFilter( Theme.LAST_PUBLISHED_DATE, null ); - options.addOrder( Theme.TITLE ); - while( options.next() ) { - target.addOption( new Option( options.get( Theme.ID ).toString(), - options.get( Theme.TITLE ).toString() ) ); + themes.addPrintListener(new PrintListener() { + public void prepare(final PrintEvent event) { + final SingleSelect target = (SingleSelect) event.getTarget(); + final DataCollection options = SessionManager.getSession().retrieve(Theme.BASE_DATA_OBJECT_TYPE); + options.addNotEqualsFilter(Theme.LAST_PUBLISHED_DATE, null); + options.addOrder(Theme.TITLE); + while (options.next()) { + target.addOption(new Option(options.get(Theme.ID).toString(), + options.get(Theme.TITLE).toString())); } } - } ); - } catch( TooManyListenersException ex ) { + }); + } catch (TooManyListenersException ex) { // Don't be stupid - throw new UncheckedWrapperException( "An impossible, pointless exception occurred", ex ); + throw new UncheckedWrapperException("An impossible, pointless exception occurred", ex); } - defaultThemeForm.add( themes ); + defaultThemeForm.add(themes); - defaultThemeForm.add( new Submit( GlobalizationUtil.globalize( "theme.save" ) ) ); + defaultThemeForm.add(new Submit(GlobalizationUtil.globalize("theme.save"))); - defaultThemeForm.addInitListener( new FormInitListener() { - public void init( FormSectionEvent ev ) { - FormData data = ev.getFormData(); + defaultThemeForm.addInitListener(new FormInitListener() { + public void init(final FormSectionEvent event) { + final FormData data = event.getFormData(); - ThemeDirector app = (ThemeDirector) Web.getContext().getApplication(); - Theme theme = app.getDefaultTheme(); + //ThemeDirector app = (ThemeDirector) Web.getContext().getApplication(); + final ThemeDirector app = ThemeDirector.getThemeDirector(); + final Theme theme = app.getDefaultTheme(); - if( null != theme ) - data.put( m_defaultThemeParam.getName(), theme.getID() ); + if (null != theme) { + data.put(defaultThemeParam.getName(), theme.getID()); + } } - } ); - defaultThemeForm.addProcessListener( new FormProcessListener() { - public void process( FormSectionEvent ev ) { - FormData data = ev.getFormData(); - BigDecimal themeID = (BigDecimal) data.get( m_defaultThemeParam.getName() ); + }); + + defaultThemeForm.addProcessListener(new FormProcessListener() { + public void process(final FormSectionEvent event) { + final FormData data = event.getFormData(); + final BigDecimal themeID = (BigDecimal) data.get(defaultThemeParam.getName()); Theme theme = null; - if( null != themeID ) { - theme = Theme.retrieve( themeID ); + if (null != themeID) { + theme = Theme.retrieve(themeID); } - ThemeDirector app = (ThemeDirector) Web.getContext().getApplication(); - app.setDefaultTheme( theme ); + //ThemeDirector app = (ThemeDirector) Web.getContext().getApplication(); + final ThemeDirector app = ThemeDirector.getThemeDirector(); + app.setDefaultTheme(theme); } - } ); + + }); return defaultThemeForm; } - private void resetPane(PageState state) { + private void resetPane(final PageState state) { getBody().reset(state); if (getSelectionModel().isSelected(state)) { - s_log.debug("The selection model is selected; displaying " + - "the item pane"); + LOGGER.debug("The selection model is selected; displaying the item pane"); getBody().push(state, getItemPane()); } } + }