- Refactored the FolderManipulator, removing potential NPE etc.

- Texts in the select boxes of the subsite admin form are now localised (Ticket #2032).


git-svn-id: https://svn.libreccm.org/ccm/trunk@2636 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-05-20 09:56:53 +00:00
parent 0c492b9aaf
commit 18be8f11c6
16 changed files with 1130 additions and 673 deletions

View File

@ -49,15 +49,14 @@ import com.arsdigita.cms.ContentType;
import com.arsdigita.cms.Folder;
import com.arsdigita.cms.SecurityManager;
import com.arsdigita.cms.dispatcher.Utilities;
import com.arsdigita.cms.ui.folder.FolderManipulator;
import com.arsdigita.cms.ui.folder.FolderSelectionModel;
import com.arsdigita.globalization.GlobalizedMessage;
import com.arsdigita.persistence.CompoundFilter;
import com.arsdigita.persistence.FilterFactory;
import com.arsdigita.toolbox.GlobalisationUtil;
import com.arsdigita.util.Assert;
import java.math.BigDecimal;
import java.util.StringTokenizer;
/**
* Browse folders and items. If the user clicks on a folder, the folder
@ -483,7 +482,11 @@ public class ItemSearchFolderBrowser extends Table {
* @pre ( key != null )
*/
private static GlobalizedMessage globalize(String key) {
return FolderManipulator.globalize(key);
//return FolderManipulator.globalize(key);
final GlobalisationUtil util = new GlobalisationUtil(
"com.arsdigita.cms."
+ "ui.folder.CMSFolderResources");
return util.globalise(key);
}
}

View File

@ -1,11 +1,11 @@
COMMENT.00=BUTTONS/LINKS/LABELS
cms.ui.folder.edit_selection=Copy or move checked items:
cms.ui.folder.edit_selection=What to do with checked items
cms.ui.folder.save=Save
cms.ui.folder.cancel=Cancel
cms.ui.folder.edit=Edit
cms.ui.folder.delete=Delete
cms.ui.folder.move=Move
cms.ui.folder.copy=Copy
cms.ui.folder.move=Move {0} items from {1} to {2}.
cms.ui.folder.copy=Copy {0} items from {1}
cms.ui.folder.go=Go
cms.ui.folder.name=Name
cms.ui.folder.type=Type
@ -63,9 +63,9 @@ cms.ui.folder.no_source_items_specified=No source items specified.
cms.ui.folder.need_select_target_folder=You need to select a folder to which the items should be copied/moved.
cms.ui.folder.not_within_same_folder=Cannot move/copy items within the same folder.
cms.ui.folder.no_permission=You do not have permission to create, copy, or move items.
cms.ui.folder.item_already_exists=There is already an item in the target folder named:
cms.ui.folder.item_is_live= is live; you must unpublish it before moving it.
cms.ui.folder.no_permission_for_item=You do not have permission to delete or move
cms.ui.folder.item_already_exists=There is already an item in the target folder named: {0}
cms.ui.folder.item_is_live= {0} is live; you must unpublish it before moving it.
cms.ui.folder.no_permission_for_item=You do not have permission to delete or move {0}.
cms.ui.folder.no_such_item=Item ID supplied does not match an existing Content Item.
cms.ui.folder.filter.all=All
cms.ui.folder.filter=Filter for work
@ -73,3 +73,7 @@ cms.ui.folder.filter_do=Filter
cms.ui.folder.languages=Languages
cms.ui.folder.delete_confirmation=Permanently delete this item?
cms.ui.folder.additionalInfo=Info
cms.ui.folder.move.action=Move
cms.ui.folder.copy.action=Copy
cms.ui.folder.publish.action=(Re-)publish
cms.ui.folder.unpublish.action=Unpublish

View File

@ -3,8 +3,8 @@ cms.ui.folder.save=Speichern
cms.ui.folder.cancel=Abbrechen
cms.ui.folder.edit=Editieren
cms.ui.folder.delete=L\u00f6schen
cms.ui.folder.move=Verschieben
cms.ui.folder.copy=Kopieren
cms.ui.folder.move=Verschiebe {0} Dokumente von {1} nach {2}.
cms.ui.folder.copy=Kopiere {0} Dokumente von {1} nach
cms.ui.folder.go=Los
cms.ui.folder.name=Name
cms.ui.folder.type=Typ
@ -57,9 +57,9 @@ cms.ui.folder.no_source_items_specified=Es wurden keine Ursprungseintr\u00e4ge g
cms.ui.folder.need_select_target_folder=Es mu\u00df ein Ordner ausgew\u00e4hlt werden, in den die Eintr\u00e4ge verschoben oder kopiert werden sollen.
cms.ui.folder.not_within_same_folder=Kopieren/Verschieben im gleichen Ordner nicht m\u00f6glich
cms.ui.folder.no_permission=Sie haben nicht die Berechtigung Eintr\u00e4ge zu erzeugen, zu kopieren oder zu verschieben.
cms.ui.folder.item_already_exists=Es gibt schon einen Eintrag im Zielordner mit Namen:
cms.ui.folder.item_is_live=ist ver\u00f6ffentlicht. Sie m\u00fcssen ihn zum Verschieben zur\u00fcckholen
cms.ui.folder.no_permission_for_item=Sie haben nicht die Berechtigung zum L\u00f6schen oder Verschieben.
cms.ui.folder.item_already_exists=Es gibt schon einen Eintrag im Zielordner mit Namen: {0}
cms.ui.folder.item_is_live={0} ist ver\u00f6ffentlicht. Sie m\u00fcssen ihn zum Verschieben depublizieren.
cms.ui.folder.no_permission_for_item=Sie haben nicht die Berechtigung {0} zum L\u00f6schen oder Verschieben.
cms.ui.folder.no_such_item=Die verwendete Eintrags-ID pa\u00dft zu keinem Eintrag.
cms.ui.folder.remove_asset_link=Entfernen
@ -68,8 +68,12 @@ cms.ui.folder.filter=Nach Begriff filtern
cms.ui.folder.filter_do=Filtern
cms.ui.folder.languages=Sprachen
cms.ui.folder.delete_confirmation=Wollen Sie dieses Content-Item l\u00f6schen?
cms.ui.folder.edit_selection=Ausgew\u00e4hlte Items kopieren oder verschieben:
cms.ui.folder.edit_selection=Ausgew\u00e4hlte Items
cms.ui.folder.creation_date=Erstellungsdatum
cms.ui.folder.last_modified=Letzte \u00c4nderung
cms.ui.folder.index=Index
cms.ui.folder.additionalInfo=Info
cms.ui.folder.move.action=Verschieben
cms.ui.folder.copy.action=Kopieren
cms.ui.folder.publish.action=(Re-)Publizieren
cms.ui.folder.unpublish.action=Depublizieren

View File

@ -3,8 +3,8 @@ cms.ui.folder.save=Sauver
cms.ui.folder.cancel=Annuler
cms.ui.folder.edit=Modifier
cms.ui.folder.delete=Effacer
cms.ui.folder.move=D\u00e9placer
cms.ui.folder.copy=Copier
cms.ui.folder.move=
cms.ui.folder.copy=
cms.ui.folder.go=Go
cms.ui.folder.name=Nom
cms.ui.folder.type=Type
@ -60,11 +60,15 @@ cms.ui.folder.no_source_items_specified=Pas d'\u00e9l\u00e9ment source sp\u00e9c
cms.ui.folder.need_select_target_folder=Vous devez s\u00e9lectionner un dossier dans lequel les \u00e9l\u00e9ments seront d\u00e9plac\u00e9s ou copi\u00e9s.
cms.ui.folder.not_within_same_folder=Impossible de d\u00e9placer ou de copier des \u00e9l\u00e9ments \u00e0 l'int\u00e9rieur d'un m\u00eame dossier.
cms.ui.folder.no_permission=Vous n'avez pas l'autorisation de cr\u00e9er, de copier, ou de d\u00e9placer des \u00e9l\u00e9ments.
cms.ui.folder.item_already_exists=Il y a d\u00e9j\u00e0 un \u00e9l\u00e9ment dans le dossier destination appel\u00e9:
cms.ui.folder.item_is_live=est en ligne ; Vous devez le d\u00e9-publier avant de le d\u00e9placer.
cms.ui.folder.no_permission_for_item=Vous n'avez pas l'autorisation de supprimer ou de d\u00e9placer
cms.ui.folder.item_already_exists=Il y a d\u00e9j\u00e0 un \u00e9l\u00e9ment dans le dossier destination appel\u00e9: {0}
cms.ui.folder.item_is_live={0} est en ligne ; Vous devez le d\u00e9-publier avant de le d\u00e9placer.
cms.ui.folder.no_permission_for_item=Vous n'avez pas l'autorisation de supprimer ou de d\u00e9placer {0}.
cms.ui.folder.no_such_item=L'identifiant fourni pour l'\u00e9l\u00e9ment ne correspond pas \u00e0 un contenu existant.
cms.ui.folder.filter.all=
cms.ui.folder.languages=
cms.ui.folder.delete_confirmation=
cms.ui.folder.additionalInfo=
cms.ui.folder.move.action=
cms.ui.folder.copy.action=
cms.ui.folder.publish.action=
cms.ui.folder.unpublish.action=

View File

@ -56,6 +56,7 @@ import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.permissions.PermissionService;
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
import com.arsdigita.persistence.OID;
import com.arsdigita.toolbox.GlobalisationUtil;
import com.arsdigita.toolbox.ui.FormatStandards;
import com.arsdigita.util.Assert;
import org.apache.log4j.Logger;
@ -65,9 +66,8 @@ import java.util.Iterator;
import javax.servlet.ServletException;
/**
* Browse folders and items. If the user clicks on a folder, the folder
* selection model is updated. If the user clicks on any other item, an separate
* item selection model is updated.
* Browse folders and items. If the user clicks on a folder, the folder selection model is updated.
* If the user clicks on any other item, an separate item selection model is updated.
*
* @author <a href="mailto:lutter@arsdigita.com">David Lutterkort</a>
* @author Sören Bernstein <quasi@quasiweb.de>
@ -123,8 +123,8 @@ public class FolderBrowser extends Table {
setModelBuilder(new FolderTableModelBuilder(currentFolder));
setColumnModel(new DefaultTableColumnModel(hideIndexColumn()
? s_noIndexHeaders
: s_headers));
? s_noIndexHeaders
: s_headers));
setHeader(new TableHeader(getColumnModel()));
// DEE 1/18/02: the folder table model builder needs to know about
// 'this' in order to set visibility, but 'this' isn't available
@ -217,9 +217,9 @@ public class FolderBrowser extends Table {
Folder folder = (Folder) m_currentFolder.getSelectedObject(state);
Assert.exists(folder);
boolean canDelete =
sm.canAccess(state.getRequest(), SecurityManager.DELETE_ITEM,
folder);
boolean canDelete
= sm.canAccess(state.getRequest(), SecurityManager.DELETE_ITEM,
folder);
m_deleteColumn.setVisible(state, canDelete);
}
@ -263,7 +263,7 @@ public class FolderBrowser extends Table {
private class FolderTableModelBuilder
extends AbstractTableModelBuilder
implements PaginationModelBuilder,
FolderManipulator.FilterFormModelBuilder {
FolderManipulator.FilterFormModelBuilder {
private FolderSelectionModel m_folder;
private RequestLocal m_size;
@ -275,7 +275,7 @@ public class FolderBrowser extends Table {
}
public FolderTableModelBuilder(FolderSelectionModel sel,
FolderBrowser fb) {
FolderBrowser fb) {
super();
m_folder = sel;
m_size = new RequestLocal();
@ -291,8 +291,8 @@ public class FolderBrowser extends Table {
} else {
t.getRowSelectionModel().clearSelection(s);
s_log.debug(String.format("filter = '%s'", s.getValue(m_filter)));
Folder.ItemCollection itemColl =
(Folder.ItemCollection) m_itemColl.get(s);
Folder.ItemCollection itemColl
= (Folder.ItemCollection) m_itemColl.get(s);
s_log.debug(String.format("itemColl.size = %d", itemColl.size()));
m_folderSize = itemColl.size();
@ -364,7 +364,7 @@ public class FolderBrowser extends Table {
size = new Integer((int) itemColl.size());
itemColl.setRange(new Integer(paginator.getFirst(state)),
new Integer(paginator.getLast(state) + 1));
new Integer(paginator.getLast(state) + 1));
String sortKey = (String) state.getValue(m_sortType);
String direction = "asc";
@ -375,13 +375,13 @@ public class FolderBrowser extends Table {
if (sortKey.equals(SORT_KEY_TITLE)) {
itemColl.setOrder("lower(item." + ContentItem.DISPLAY_NAME
+ ") " + direction);
+ ") " + direction);
} else if (sortKey.equals(SORT_KEY_NAME)) {
itemColl.setOrder("lower(item." + ContentItem.NAME + ") "
+ direction);
+ direction);
} else if (sortKey.equals(SORT_KEY_LAST_MODIFIED_DATE)) {
itemColl.setOrder("item.auditing.lastModifiedDate "
+ direction);
+ direction);
} else if (sortKey.equals(SORT_KEY_CREATION_DATE)) {
itemColl.setOrder("item.auditing.creationDate " + direction);
}
@ -398,11 +398,11 @@ public class FolderBrowser extends Table {
}
/**
* Indicates whether the paginator should be visible, based on the
* visibility of the folder browser itself.
* Indicates whether the paginator should be visible, based on the visibility of the folder
* browser itself.
*
* @return true if folder browser is visible, or if the associated
* folder browser is unknown.
* @return true if folder browser is visible, or if the associated folder browser is
* unknown.
*/
public boolean isVisible(PageState state) {
return (m_fb != null) ? m_fb.isVisible(state) : true;
@ -421,9 +421,9 @@ public class FolderBrowser extends Table {
@Override
public Component getComponent(final Table table, final PageState state,
Object value,
boolean isSelected, Object key,
int row, int column) {
Object value,
boolean isSelected, Object key,
int row, int column) {
String headerName = (String) ((GlobalizedMessage) value).localize();
String sortKey = (String) state.getValue(m_sortType);
final boolean isCurrentKey = sortKey.equals(m_key);
@ -445,14 +445,14 @@ public class FolderBrowser extends Table {
// by default, everything sorts "up" unless it
// is the current key and it is already pointing up
if (SORT_ACTION_UP.equals(currentSortDirection)
&& isCurrentKey) {
&& isCurrentKey) {
sortDirectionAction = SORT_ACTION_DOWN;
} else {
sortDirectionAction = SORT_ACTION_UP;
}
ps.setControlEvent(table,
sortDirectionAction,
m_key);
sortDirectionAction,
m_key);
}
};
Label l = new Label();
@ -474,8 +474,7 @@ public class FolderBrowser extends Table {
}
/**
* Produce links to view an item or control links for folders to change into
* the folder.
* Produce links to view an item or control links for folders to change into the folder.
*/
private class NameCellRenderer extends DefaultTableCellRenderer {
@ -485,14 +484,14 @@ public class FolderBrowser extends Table {
@Override
public Component getComponent(Table table, PageState state, Object value,
boolean isSelected, Object key,
int row, int column) {
boolean isSelected, Object key,
int row, int column) {
Folder.ItemCollection coll = (Folder.ItemCollection) value;
String name = coll.getName();
if (coll.isFolder()) {
return super.getComponent(table, state, name,
isSelected, key, row, column);
isSelected, key, row, column);
} else {
ContentSection section = CMS.getContext().getContentSection();
BigDecimal id = coll.getID();
@ -502,7 +501,7 @@ public class FolderBrowser extends Table {
} else {
ItemResolver resolver = section.getItemResolver();
return new Link(name, resolver.generateItemURL(state, id,
name, section, coll.getVersion()));
name, section, coll.getVersion()));
}
}
}
@ -511,8 +510,8 @@ public class FolderBrowser extends Table {
/**
* Added by: Sören Bernstein <quasi@quasiweb.de>
*
* Produce links to view an item in a specific language and show all
* existing language version and the live status in the folder browser.
* Produce links to view an item in a specific language and show all existing language version
* and the live status in the folder browser.
*/
private class LanguagesCellRenderer extends DefaultTableCellRenderer {
@ -522,8 +521,8 @@ public class FolderBrowser extends Table {
@Override
public Component getComponent(Table table, PageState state, Object value,
boolean isSelected, Object key,
int row, int column) {
boolean isSelected, Object key,
int row, int column) {
Folder.ItemCollection coll = (Folder.ItemCollection) value;
String name = coll.getName();
@ -544,15 +543,12 @@ public class FolderBrowser extends Table {
ContentBundle bundle = cp.getContentBundle();
ContentSection section = CMS.getContext().getContentSection();
if (bundle != null
&& !(cp instanceof LanguageInvariantContentItem
&& ((LanguageInvariantContentItem) cp).isLanguageInvariant())) {
&& !(cp instanceof LanguageInvariantContentItem
&& ((LanguageInvariantContentItem) cp).isLanguageInvariant())) {
Iterator<String> languages = bundle.getLanguages().iterator();
StringBuilder temp = new StringBuilder(20);
SimpleContainer container = new SimpleContainer();
@ -582,11 +578,11 @@ public class FolderBrowser extends Table {
ItemResolver resolver = section.getItemResolver();
container.add(
new Link(langLabel,
resolver.generateItemURL(state,
ci.getID(),
name,
section,
coll.getVersion())));
resolver.generateItemURL(state,
ci.getID(),
name,
section,
coll.getVersion())));
}
if (languages.hasNext()) {
container.add(new Label("&nbsp;", false));
@ -623,8 +619,8 @@ public class FolderBrowser extends Table {
}
public Component getComponent(Table table, PageState state, Object value,
boolean isSelected, Object key,
int row, int column) {
boolean isSelected, Object key,
int row, int column) {
if (((Boolean) value).booleanValue()) {
return s_link;
} else {
@ -636,8 +632,8 @@ public class FolderBrowser extends Table {
private final class IndexToggleRenderer implements TableCellRenderer {
public Component getComponent(Table table, PageState state, Object value,
boolean isSelected, Object key, int row,
int column) {
boolean isSelected, Object key, int row,
int column) {
if (value == null) {
return new Label(GlobalizationUtil.globalize("cms.ui.folder.na"));
@ -712,7 +708,7 @@ public class FolderBrowser extends Table {
//m_itemColl = folder.getItems();
//}
public FolderTableModel(FolderBrowser table, PageState state,
Folder.ItemCollection itemColl) {
Folder.ItemCollection itemColl) {
m_state = state;
m_table = table;
m_itemColl = itemColl;
@ -757,8 +753,8 @@ public class FolderBrowser extends Table {
return FormatStandards.formatDate(creationDate);
}
case LAST_MODIFIED: {
java.util.Date lastModified =
m_itemColl.getLastModifiedDate();
java.util.Date lastModified
= m_itemColl.getLastModifiedDate();
if (lastModified == null) {
return "--";
}
@ -782,8 +778,8 @@ public class FolderBrowser extends Table {
}
default:
throw new IndexOutOfBoundsException("Column index "
+ columnIndex
+ " not in table model.");
+ columnIndex
+ " not in table model.");
}
}
@ -820,7 +816,8 @@ public class FolderBrowser extends Table {
}
if (s_log.isDebugEnabled()) {
s_log.debug("The item is not a folder and doesn't have a live instance; it may be deleted");
s_log.debug(
"The item is not a folder and doesn't have a live instance; it may be deleted");
}
return true;
}
@ -828,7 +825,7 @@ public class FolderBrowser extends Table {
public Object getKeyAt(int columnIndex) {
// Mark folders by using their negative ID (dirty, dirty)
return (m_itemColl.isFolder()) ? m_itemColl.getID().negate()
: m_itemColl.getBundleID();
: m_itemColl.getBundleID();
}
}
@ -875,8 +872,8 @@ public class FolderBrowser extends Table {
ContentBundle currentIndexItem = (ContentBundle) folder.getIndexItem();
if (currentIndexItem == null || (currentIndexItem.getID().
compareTo(contentItem.getID())
!= 0)) {
compareTo(contentItem.getID())
!= 0)) {
folder.setIndexItem(contentItem);
} else {
folder.removeIndexItem();
@ -894,7 +891,11 @@ public class FolderBrowser extends Table {
* @param key The resource key @pre ( key != null )
*/
private static GlobalizedMessage globalize(String key) {
return FolderManipulator.globalize(key);
//return FolderManipulator.globalize(key);
final GlobalisationUtil util = new GlobalisationUtil(
"com.arsdigita.cms.ui.folder.CMSFolderResources");
return util.globalise(key);
}
private static boolean hideIndexColumn() {

File diff suppressed because it is too large Load Diff

View File

@ -28,15 +28,15 @@ public class PublishLock {
private PublishLock() {
}
protected static synchronized PublishLock getInstance() {
public static synchronized PublishLock getInstance() {
return instance;
}
protected synchronized void lock(final ContentItem item) {
public synchronized void lock(final ContentItem item) {
lock(item, "publish");
}
protected synchronized void lock(final ContentItem item,
public synchronized void lock(final ContentItem item,
final String action) {
SessionManager.getSession().getTransactionContext().beginTxn();
final DataObject lock = SessionManager.getSession().create(
@ -49,7 +49,7 @@ public class PublishLock {
SessionManager.getSession().getTransactionContext().commitTxn();
}
protected synchronized void unlock(final ContentItem item) {
public synchronized void unlock(final ContentItem item) {
SessionManager.getSession().getTransactionContext().beginTxn();
final DataCollection collection = SessionManager.getSession().retrieve(
LOCK_OBJECT_TYPE);
@ -66,7 +66,7 @@ public class PublishLock {
SessionManager.getSession().getTransactionContext().commitTxn();
}
protected synchronized boolean isLocked(final ContentItem item) {
public synchronized boolean isLocked(final ContentItem item) {
final DataCollection collection = SessionManager.getSession().retrieve(
LOCK_OBJECT_TYPE);
collection.addFilter(String.format("%s = '%s'", LOCKED_OID,
@ -80,7 +80,7 @@ public class PublishLock {
}
}
protected synchronized void setError(final ContentItem item, final String stacktrace) {
public synchronized void setError(final ContentItem item, final String stacktrace) {
SessionManager.getSession().getTransactionContext().beginTxn();
final DataCollection collection = SessionManager.getSession().retrieve(
LOCK_OBJECT_TYPE);
@ -99,7 +99,7 @@ public class PublishLock {
SessionManager.getSession().getTransactionContext().commitTxn();
}
protected synchronized boolean hasError(final ContentItem item) {
public synchronized boolean hasError(final ContentItem item) {
final DataCollection collection = SessionManager.getSession().retrieve(
LOCK_OBJECT_TYPE);
collection.addFilter(String.format("%s = '%s'", LOCKED_OID,

View File

@ -0,0 +1,76 @@
/*
* Copyright (C) 2002-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.toolbox;
import com.arsdigita.globalization.GlobalizedMessage;
/**
* Utility class for simplify the handling of {@link GlobalizedMessage}. This class is intended as a
more object orientated replacement for the numerous GlobalisationUtil classes with static
methods.
This class should not used directly. Instead create a subclass of this class with a parameter
less constructor which calls the constructor of this class providing the name of the bundle.
*
* @see GlobalizedMessage
*
* @author Jens Pelzetter
* @version $Id$
*/
public class GlobalisationUtil {
private final transient String bundleName;
/**
* Constructor for a new {@link GlobalisationUtil} instance. For normal use cases don't use this
* constructor directly to create an instance of this class. Instead a subclass should be
* created which provides a parameterless constructor which class this constructor with the
* fully qualified name of the appropriate bundle. For some use cases, for example a resource
* bundle which is only used in a single class may be used by simply using this constructor.
*
* @param bundleName Name of the bundle to be used by this {@code GlobalisationUtil} instance.
*/
public GlobalisationUtil(final String bundleName) {
this.bundleName = bundleName;
}
/**
* Lookup the globalised message identified by the provided key in the resource bundle.
*
* @param key Message key
* @return The globalised message.
*/
public GlobalizedMessage globalise(final String key) {
return new GlobalizedMessage(key, bundleName);
}
/**
* Lookup the globalised message identified by the provided key in the resource bundle and
* replace the placeholders in the message with the provided arguments.
*
* @param key The key of the message to lookup.
* @param args Arguments for the placeholders in the message.
* @return The globalised message.
*/
public GlobalizedMessage globalise(final String key,
final Object[] args) {
return new GlobalizedMessage(key, bundleName, args);
}
}

View File

@ -26,3 +26,4 @@ terms.domain.ui.url_hint=The unique URL defining the current version of the doma
terms.domain.ui.description_hint=The long description of the domain
terms.domain.ui.version_hint=The current version number, eg 1.00
terms.domain.ui.released_hint=The release date of the current version
terms.ui.pick_one=-- pick one --

View File

@ -26,3 +26,4 @@ terms.domain.ui.url_hint=Eine eindeutige URL, die die aktuelle Version definiert
terms.domain.ui.description_hint=Eine ausf\u00fchrlichere Beschreibung der Domain
terms.domain.ui.version_hint=Die aktuelle Version, z.B. 1.00
terms.domain.ui.released_hint=Das Ver\u00f6ffentlichungsdatum der aktuellen Version.
terms.ui.pick_one=-- Ausw\u00e4hlen --

View File

@ -15,7 +15,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.london.terms.ui;
import com.arsdigita.bebop.PageState;
@ -24,11 +23,11 @@ import com.arsdigita.bebop.form.SingleSelect;
import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.london.terms.Domain;
import com.arsdigita.categorization.ui.AbstractCategoryPicker;
import com.arsdigita.london.terms.util.TermsGlobalizationUtil;
import com.arsdigita.persistence.DataCollection;
import com.arsdigita.persistence.OID;
import com.arsdigita.persistence.SessionManager;
/**
*
*
@ -48,25 +47,28 @@ public class RootCategoryPicker extends AbstractCategoryPicker {
* @param state
* @param target
*/
protected void addOptions( PageState state,
SingleSelect target) {
protected void addOptions(PageState state,
SingleSelect target) {
DataCollection domains = SessionManager
.getSession()
.retrieve(Domain.BASE_DATA_OBJECT_TYPE);
.getSession()
.retrieve(Domain.BASE_DATA_OBJECT_TYPE);
domains.addPath("model.id");
domains.addPath("model.objectType");
domains.addOrder("title");
target.addOption(new Option(null, "-- pick one --"));
target.addOption(new Option(null,
(String) TermsGlobalizationUtil.globalize("terms.ui.pick_one")
.localize()));
while (domains.next()) {
Domain domain = (Domain) DomainObjectFactory
.newInstance(domains.getDataObject());
.newInstance(domains.getDataObject());
target.addOption(
new Option(new OID((String)domains.get("model.objectType"),
new Option(new OID((String) domains.get("model.objectType"),
domains.get("model.id")).toString(),
domain.getTitle()));
}
}
}

View File

@ -22,156 +22,145 @@
-->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:nav="http://ccm.redhat.com/navigation"
xmlns:cms="http://www.arsdigita.com/cms/1.0"
xmlns:mandalay="http://mandalay.quasiweb.de"
exclude-result-prefixes="xsl bebop cms nav mandalay"
version="1.0"
>
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:nav="http://ccm.redhat.com/navigation"
xmlns:cms="http://www.arsdigita.com/cms/1.0"
xmlns:mandalay="http://mandalay.quasiweb.de"
exclude-result-prefixes="xsl bebop cms nav mandalay"
version="1.0"
>
<!--
************************************************
** Template for the DescTab for a SciProject **
************************************************
-->
<!--
************************************************
** Template for the DescTab for a SciProject **
************************************************
-->
<xsl:template name="CT_SciProject_graphics"
match="projectDescription"
mode="tabs">
<xsl:template name="CT_SciProject_graphics"
match="projectDescription"
mode="tabs">
<xsl:variable name="setImage">
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="setting" select="'descTab/setImage'"/>
<xsl:with-param name="default" select="'true'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="setImageCaption">
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="setting" select="'tabs/setImageCaption'"/>
<xsl:with-param name="default" select="'true'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="setImageMaxHeight">
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="setting" select="'tabs/setImageMaxHeight'"/>
<xsl:with-param name="default" select="''"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="setImageMaxWidth">
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="setting" select="'tabs/setImageMaxWidth'"/>
<xsl:with-param name="default" select="''"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="setShowHeading">
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="setting" select="'tabs/setShowHeading'"/>
<xsl:with-param name="default" select="'false'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="setShortDesc">
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="setting" select="'descTab/setShortDesc'"/>
<xsl:with-param name="default" select="'true'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="setFunding">
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="setting" select="'descTab/setFunding'"/>
<xsl:with-param name="default" select="'false'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="setFundingVolume">
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="setting" select="'descTab/setFundingVolume'"/>
<xsl:with-param name="default" select="'true'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="setImage">
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="setting" select="'descTab/setImage'"/>
<xsl:with-param name="default" select="'true'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="setImageCaption">
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="setting" select="'tabs/setImageCaption'"/>
<xsl:with-param name="default" select="'true'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="setImageMaxHeight">
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="setting" select="'tabs/setImageMaxHeight'"/>
<xsl:with-param name="default" select="''"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="setImageMaxWidth">
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="setting" select="'tabs/setImageMaxWidth'"/>
<xsl:with-param name="default" select="''"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="setShowHeading">
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="setting" select="'tabs/setShowHeading'"/>
<xsl:with-param name="default" select="'false'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="setShortDesc">
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="setting" select="'descTab/setShortDesc'"/>
<xsl:with-param name="default" select="'true'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="setFunding">
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="setting" select="'descTab/setFunding'"/>
<xsl:with-param name="default" select="'false'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="setFundingVolume">
<xsl:call-template name="mandalay:getSetting">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="setting" select="'descTab/setFundingVolume'"/>
<xsl:with-param name="default" select="'true'"/>
</xsl:call-template>
</xsl:variable>
<div class="activeTab">
<div class="activeTab">
<xsl:if test="$setImage = 'true'">
<xsl:for-each select="$resultTree//cms:item">
<xsl:call-template name="mandalay:imageAttachment">
<xsl:with-param name="showCaption" select="$setImageCaption" />
<xsl:with-param name="maxHeight" select="$setImageMaxHeight" />
<xsl:with-param name="maxWidth" select="$setImageMaxWidth" />
</xsl:call-template>
</xsl:for-each>
</xsl:if>
<xsl:if test="$setImage = 'true'">
<xsl:for-each select="$resultTree//cms:item">
<xsl:call-template name="mandalay:imageAttachment">
<xsl:with-param name="showCaption" select="$setImageCaption" />
<xsl:with-param name="maxHeight" select="$setImageMaxHeight" />
<xsl:with-param name="maxWidth" select="$setImageMaxWidth" />
</xsl:call-template>
</xsl:for-each>
</xsl:if>
<xsl:if test="$setShowHeading = 'true'">
<h2>
<xsl:call-template name="mandalay:getStaticText">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="id" select="'descTab/heading'"/>
</xsl:call-template>
</h2>
</xsl:if>
<xsl:if test="$setShowHeading = 'true'">
<h2>
<xsl:call-template name="mandalay:getStaticText">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="id" select="'descTab/heading'"/>
</xsl:call-template>
</h2>
</xsl:if>
<xsl:if test="$setShortDesc = 'true'">
<div id="lead">
<xsl:value-of disable-output-escaping="yes" select="./shortDescription"/>
</div>
</xsl:if>
<xsl:if test="$setShortDesc = 'true'">
<div id="lead">
<xsl:value-of disable-output-escaping="yes" select="./shortDescription"/>
</div>
</xsl:if>
<div class="mainBody projectDesc">
<xsl:value-of disable-output-escaping="yes" select="./description"/>
</div>
<div class="mainBody projectDesc">
<xsl:value-of disable-output-escaping="yes" select="./description"/>
</div>
<h3>
<xsl:call-template name="mandalay:getStaticText">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="id" select="'descTab/fundingHeading'"/>
</xsl:call-template>
</h3>
<div class="mainBody projectFunding">
<xsl:value-of disable-output-escaping="yes" select="./funding"/>
</div>
<xsl:if test="(string-length(./funding) &gt; 0) and ($setFunding = 'true')">
<xsl:if test="(string-length(./fundingVolume) &gt; 0) and ($setFundingVolume = 'true')">
<div class="projectFundingVolume">
<span>
<xsl:call-template name="mandalay:getStaticText">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="id" select="'descTab/fundingVolume'"/>
</xsl:call-template>
</span>
<span>
<xsl:value-of select="./fundingVolume"/>
</span>
</div>
<h3>
<xsl:call-template name="mandalay:getStaticText">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="id" select="'descTab/fundingHeading'"/>
</xsl:call-template>
</h3>
<div class="mainBody projectFunding">
<xsl:value-of disable-output-escaping="yes" select="./funding"/>
</div>
<xsl:if test="(string-length(./fundingVolume) &gt; 0) and ($setFundingVolume = 'true')">
<div class="projectFundingVolume">
<span>
<xsl:call-template name="mandalay:getStaticText">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="id" select="'descTab/fundingVolume'"/>
</xsl:call-template>
</span>
<span>
<xsl:value-of select="./fundingVolume"/>
</span>
</div>
</xsl:if>
<xsl:if test="(string-length(./fundingVolume) &gt; 0) and ($setFundingVolume = 'true')">
<div class="projectFundingVolume">
<span>
<xsl:call-template name="mandalay:getStaticText">
<xsl:with-param name="module" select="'SciProject'"/>
<xsl:with-param name="id" select="'descTab/fundingVolume'"/>
</xsl:call-template>
</span>
<span>
<xsl:value-of select="./fundingVolume"/>
</span>
</div>
<div class="endFloat"/>
</xsl:if>
</xsl:if>
<div class="endFloat"/>
</div>
</xsl:if>
</xsl:template>
<div class="endFloat"/>
</div>
</xsl:template>
</xsl:stylesheet>

View File

@ -130,6 +130,7 @@ public class SciDepartmentProjectsTab implements GenericOrgaUnitTab {
return result;
}
@Override
public void generateXml(final GenericOrganizationalUnit orgaunit,
final Element parent,
final PageState state) {

View File

@ -65,16 +65,20 @@ import org.apache.log4j.Logger;
/**
* Class creates the administration input form.
*
* Used by ControlCenterPanel to construct the 'create new site' and
* 'edit existing site' input forms.
* Used by ControlCenterPanel to construct the 'create new site' and 'edit existing site' input
* forms.
*/
public class SiteForm extends Form {
/** A logger instance. */
/**
* A logger instance.
*/
private static final Logger s_log = Logger.getLogger(SiteForm.class);
private SiteSelectionModel m_site;
private BigDecimal siteDefaultRootPageID;
/** Input field subsite title */
/**
* Input field subsite title
*/
private TextField m_title;
private TextField m_hostname;
private TextArea m_description;
@ -84,9 +88,9 @@ public class SiteForm extends Form {
private SingleSelect m_themes;
private SaveCancelSection m_buttons;
private final static String DEFAULT_APP = "DEFAULT_APP";
private final static String DEFAULT_APP_LABEL = "Site Wide Default ";
private final static String DEFAULT_APP_LABEL = "subsite.ui.default_app_label";
private final static String DEFAULT_STYLE = "DEFAULT_STYLE";
private final static String DEFAULT_STYLE_LABEL = "Site Wide Default ";
private final static String DEFAULT_STYLE_LABEL = "subsite.ui.default_style_label";
private final static String OTHER_STYLE = "OTHER_STYLE";
private final static String OTHER_STYLE_LABEL = "Other (type in box below)";
@ -113,7 +117,7 @@ public class SiteForm extends Form {
m_title.addValidationListener(new NotNullValidationListener());
m_title.setMetaDataAttribute("title", "Title");
m_title.setHint((String) SubsiteGlobalizationUtil.globalize("subsite.ui.title.hint").
localize());
localize());
m_title.setSize(40);
add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.title.label")));
add(m_title); // adds title input field to form
@ -126,7 +130,7 @@ public class SiteForm extends Form {
m_hostname.setMetaDataAttribute("title", "Hostname");
m_hostname.setSize(40);
m_hostname.setHint((String) SubsiteGlobalizationUtil.globalize("subsite.ui.hostname.hint").
localize());
localize());
add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.hostname.label")));
add(m_hostname); // adds hostname input field to form
@ -138,7 +142,7 @@ public class SiteForm extends Form {
m_description.setCols(45);
m_description.setRows(4);
m_description.setHint((String) SubsiteGlobalizationUtil.globalize(
"subsite.ui.description.hint").localize());
"subsite.ui.description.hint").localize());
add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.description.label")));
add(m_description); // adds description input field to form
@ -146,12 +150,12 @@ public class SiteForm extends Form {
/* Setup selection box for subsite start page (front page) Application
* by URL */
m_customFrontpageApp = new SingleSelect(
new StringParameter("customFrontpageApp"));
new StringParameter("customFrontpageApp"));
m_customFrontpageApp.setMetaDataAttribute("title", "Front Page (url)");
// m_customFrontpageApp.setSize(40);
m_customFrontpageApp.setHint((String) SubsiteGlobalizationUtil.globalize(
"subsite.ui.customfrontpage.hint").
localize());
"subsite.ui.customfrontpage.hint").
localize());
try {
m_customFrontpageApp.addPrintListener(new FrontpageAppListener());
} catch (TooManyListenersException ex) {
@ -165,7 +169,7 @@ public class SiteForm extends Form {
m_themes = new SingleSelect(new StringParameter("selectStyleDir"));
m_themes.setMetaDataAttribute("title", "XSLT Directory");
m_themes.setHint((String) SubsiteGlobalizationUtil.globalize("subsite.ui.theme.hint").
localize());
localize());
try {
m_themes.addPrintListener(new ThemesListener());
} catch (TooManyListenersException ex) {
@ -180,35 +184,33 @@ public class SiteForm extends Form {
m_styleDir.setMetaDataAttribute("title", "XSLT Directory (Other)");
m_styleDir.setSize(40);
m_styleDir.setHint(
"Enter the directory for the custom XSLT styles, or leave blank for the default styling.");
"Enter the directory for the custom XSLT styles, or leave blank for the default styling.");
add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.styledir.label")));
add(m_styleDir); // adds inputfield style dir to form
/* Setup selection box for cagtegory domain */
m_rootCategory = (CategoryPicker) Classes.newInstance(
Subsite.getConfig().getRootCategoryPicker(),
new Class[]{String.class},
new Object[]{"rootCategory"});
Subsite.getConfig().getRootCategoryPicker(),
new Class[]{String.class},
new Object[]{"rootCategory"});
if (m_rootCategory instanceof Widget) {
((Widget) m_rootCategory).setMetaDataAttribute("title", "Root category");
((Widget) m_rootCategory).setHint((String) SubsiteGlobalizationUtil.globalize(
"subsite.ui.root_category.hint").localize());
"subsite.ui.root_category.hint").localize());
}
add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.root_category.label")));
add(m_rootCategory); // adds domain category selection box to form
m_buttons = new SaveCancelSection();
m_buttons.getSaveButton().setButtonLabel(SubsiteGlobalizationUtil.globalize(
"subsite.ui.save"));
"subsite.ui.save"));
m_buttons.getSaveButton().setHint("Save the details in the form");
m_buttons.getCancelButton().setButtonLabel(SubsiteGlobalizationUtil.globalize(
"subsite.ui.cancel"));
"subsite.ui.cancel"));
m_buttons.getCancelButton().setHint("Abort changes & reset the form");
add(m_buttons);
addSubmissionListener(new SiteSubmissionListener());
addProcessListener(new SiteProcessListener());
addInitListener(new SiteInitListener());
@ -221,7 +223,7 @@ public class SiteForm extends Form {
private class SiteSubmissionListener implements FormSubmissionListener {
public void submitted(FormSectionEvent e)
throws FormProcessException {
throws FormProcessException {
PageState state = e.getPageState();
if (m_buttons.getCancelButton().isSelected(state)) {
@ -255,14 +257,14 @@ public class SiteForm extends Form {
if (OTHER_STYLE.equals(themeDir)) {
if (StringUtils.emptyString(styleDir)) {
data.addError(SubsiteGlobalizationUtil.globalize(
"subsite.ui.other_style_missing",
new String[]{OTHER_STYLE_LABEL}));
"subsite.ui.other_style_missing",
new String[]{OTHER_STYLE_LABEL}));
}
} else {
if (!StringUtils.emptyString(styleDir)) {
data.addError(SubsiteGlobalizationUtil.globalize(
"subsite.ui.other_style_invalid",
new String[]{OTHER_STYLE_LABEL}));
"subsite.ui.other_style_invalid",
new String[]{OTHER_STYLE_LABEL}));
}
}
@ -274,7 +276,7 @@ public class SiteForm extends Form {
String test = testExist.getDefaultDomainClass();
} catch (Exception ex) {
data.addError(SubsiteGlobalizationUtil.globalize(
"subsite.ui.root_category_missing"));
"subsite.ui.root_category_missing"));
}
} // End if (!m_buttons ...)
@ -294,7 +296,7 @@ public class SiteForm extends Form {
Site site = m_site.getSelectedSite(e.getPageState());
if (hostname != null && hostname.toString().length() > 0) {
DataCollection sites = SessionManager.getSession()
.retrieve(Site.BASE_DATA_OBJECT_TYPE);
.retrieve(Site.BASE_DATA_OBJECT_TYPE);
sites.addEqualsFilter("lower(" + Site.HOSTNAME + ")",
hostname.toLowerCase());
if (site != null) {
@ -302,7 +304,7 @@ public class SiteForm extends Form {
}
if (sites.size() > 0) {
data.addError(SubsiteGlobalizationUtil.globalize(
"subsite.ui.hostname_already_in_use"));
"subsite.ui.hostname_already_in_use"));
}
}
@ -311,19 +313,17 @@ public class SiteForm extends Form {
}
/**
* Initializes the form.
* (when a new input form is requested by user either by editing an
* Initializes the form. (when a new input form is requested by user either by editing an
* existing subsite or by creating a new one).
*/
private class SiteInitListener implements FormInitListener {
public void init(FormSectionEvent e)
throws FormProcessException {
throws FormProcessException {
PageState state = e.getPageState();
Site site = m_site.getSelectedSite(state);
if (site == null) {
m_title.setValue(state, null);
m_hostname.setValue(state, null);
@ -340,10 +340,10 @@ public class SiteForm extends Form {
// BigDecimal siteDefaultRootPageID
BigDecimal currentFrontpageID = site.getFrontPage().getID();
s_log.debug(" Site default frontpage is: " + siteDefaultRootPageID
+ ", Current frontpage is: " + currentFrontpageID);
+ ", Current frontpage is: " + currentFrontpageID);
m_customFrontpageApp.setValue(
state,
currentFrontpageID == siteDefaultRootPageID ? DEFAULT_APP
state,
currentFrontpageID == siteDefaultRootPageID ? DEFAULT_APP
: currentFrontpageID.toString());
String styleURL = site.getStyleDirectory();
@ -381,7 +381,7 @@ public class SiteForm extends Form {
private class SiteProcessListener implements FormProcessListener {
public void process(FormSectionEvent e)
throws FormProcessException {
throws FormProcessException {
PageState state = e.getPageState();
@ -403,20 +403,20 @@ public class SiteForm extends Form {
/* Pre-process selected frontpage application: retrieve application */
String subsiteSelectedFrontpage = (String) m_customFrontpageApp
.getValue(state);
.getValue(state);
s_log.debug(" Site default frontpage ID is: " + siteDefaultRootPageID
+ ", selected frontpage Value is: "
+ subsiteSelectedFrontpage);
+ ", selected frontpage Value is: "
+ subsiteSelectedFrontpage);
Application frontpageApp;
if (subsiteSelectedFrontpage.equals(DEFAULT_APP)) {
s_log.debug("About to create frontpage app ID: " + DEFAULT_APP);
frontpageApp = Application
.retrieveApplication(siteDefaultRootPageID);
.retrieveApplication(siteDefaultRootPageID);
} else {
s_log.debug("About to create frontpage app ID: "
+ subsiteSelectedFrontpage);
+ subsiteSelectedFrontpage);
frontpageApp = Application
.retrieveApplication(new BigDecimal(subsiteSelectedFrontpage));
.retrieveApplication(new BigDecimal(subsiteSelectedFrontpage));
}
Assert.exists(frontpageApp, Application.class);
s_log.debug("Created frontpage app ID: " + frontpageApp.getID());
@ -431,7 +431,7 @@ public class SiteForm extends Form {
// subsite with an added comment:
// "NB, explicitly don't set cat on shared front page!"
s_log.debug("Front page application ID: "
+ frontpageApp.getID());
+ frontpageApp.getID());
s_log.debug("About to set cat on dedicated front page.");
Category.setRootForObject(frontpageApp, root);
@ -461,7 +461,7 @@ public class SiteForm extends Form {
m_site.clearSelection(state);
Application app = Application
.retrieveApplicationForPath("/navigation/");
.retrieveApplicationForPath("/navigation/");
Category.setRootForObject(app,
root,
site.getTemplateContext().getContext());
@ -481,14 +481,16 @@ public class SiteForm extends Form {
ApplicationCollection customApps;
// target.addOption(new Option(SELECT_APP, SELECT_APP_LABEL));
target.addOption(new Option(DEFAULT_APP, DEFAULT_APP_LABEL));
target.addOption(new Option(DEFAULT_APP,
(String) SubsiteGlobalizationUtil
.globalize(DEFAULT_APP_LABEL).localize()));
String[] customAppTypes = (String[]) Subsite.getConfig()
.getFrontPageApplicationTypes();
.getFrontPageApplicationTypes();
if (customAppTypes != null) {
for (int i = 0; i < customAppTypes.length; i++) {
customApps = Application.retrieveAllApplications(
customAppTypes[i]);
customAppTypes[i]);
while (customApps.next()) {
/* Create an entry for each application, consisting
* of the (BigDecimal) ID as value and the URL as
@ -516,7 +518,9 @@ public class SiteForm extends Form {
PageState state = e.getPageState();
Map themes = Subsite.getConfig().getThemes();
Set entrySet = themes.entrySet();
target.addOption(new Option(DEFAULT_STYLE, DEFAULT_STYLE_LABEL));
target.addOption(new Option(DEFAULT_STYLE,
(String) SubsiteGlobalizationUtil.globalize(
DEFAULT_STYLE_LABEL).localize()));
if (entrySet != null) {
Iterator entries = entrySet.iterator();
while (entries.hasNext()) {
@ -530,4 +534,5 @@ public class SiteForm extends Form {
}
}
}

View File

@ -25,3 +25,5 @@ subsite.ui.edit=Edit
subsite.ui.delete=Delete
subsite.ui.delete.confirm=Are you sure to delete the subsite {0}?
subsite.ui.no_subsites=No subites defined
subsite.ui.default_app_label=Site Wide Default
subsite.ui.default_style_label=Site Wide Default

View File

@ -25,3 +25,5 @@ subsite.ui.edit=Bearbeiten
subsite.ui.delete=L\u00f6schen
subsite.ui.delete.confirm=Sind Sie sicher, dass Sie die Subsite {0} l\u00f6schen wollen?
subsite.ui.no_subsites=Es sind keine Subsites eingerichtet.
subsite.ui.default_app_label=Standard f\u00fcr diese Installation
subsite.ui.default_style_label=Standard f\u00fcr diese Installation