- 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-94f89814c4dfmaster
parent
0c492b9aaf
commit
18be8f11c6
|
|
@ -49,15 +49,14 @@ import com.arsdigita.cms.ContentType;
|
||||||
import com.arsdigita.cms.Folder;
|
import com.arsdigita.cms.Folder;
|
||||||
import com.arsdigita.cms.SecurityManager;
|
import com.arsdigita.cms.SecurityManager;
|
||||||
import com.arsdigita.cms.dispatcher.Utilities;
|
import com.arsdigita.cms.dispatcher.Utilities;
|
||||||
import com.arsdigita.cms.ui.folder.FolderManipulator;
|
|
||||||
import com.arsdigita.cms.ui.folder.FolderSelectionModel;
|
import com.arsdigita.cms.ui.folder.FolderSelectionModel;
|
||||||
import com.arsdigita.globalization.GlobalizedMessage;
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
import com.arsdigita.persistence.CompoundFilter;
|
import com.arsdigita.persistence.CompoundFilter;
|
||||||
import com.arsdigita.persistence.FilterFactory;
|
import com.arsdigita.persistence.FilterFactory;
|
||||||
|
import com.arsdigita.toolbox.GlobalisationUtil;
|
||||||
import com.arsdigita.util.Assert;
|
import com.arsdigita.util.Assert;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.StringTokenizer;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Browse folders and items. If the user clicks on a folder, the folder
|
* 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 )
|
* @pre ( key != null )
|
||||||
*/
|
*/
|
||||||
private static GlobalizedMessage globalize(String key) {
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
COMMENT.00=BUTTONS/LINKS/LABELS
|
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.save=Save
|
||||||
cms.ui.folder.cancel=Cancel
|
cms.ui.folder.cancel=Cancel
|
||||||
cms.ui.folder.edit=Edit
|
cms.ui.folder.edit=Edit
|
||||||
cms.ui.folder.delete=Delete
|
cms.ui.folder.delete=Delete
|
||||||
cms.ui.folder.move=Move
|
cms.ui.folder.move=Move {0} items from {1} to {2}.
|
||||||
cms.ui.folder.copy=Copy
|
cms.ui.folder.copy=Copy {0} items from {1}
|
||||||
cms.ui.folder.go=Go
|
cms.ui.folder.go=Go
|
||||||
cms.ui.folder.name=Name
|
cms.ui.folder.name=Name
|
||||||
cms.ui.folder.type=Type
|
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.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.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.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_already_exists=There is already an item in the target folder named: {0}
|
||||||
cms.ui.folder.item_is_live= is live; you must unpublish it before moving it.
|
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
|
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.no_such_item=Item ID supplied does not match an existing Content Item.
|
||||||
cms.ui.folder.filter.all=All
|
cms.ui.folder.filter.all=All
|
||||||
cms.ui.folder.filter=Filter for work
|
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.languages=Languages
|
||||||
cms.ui.folder.delete_confirmation=Permanently delete this item?
|
cms.ui.folder.delete_confirmation=Permanently delete this item?
|
||||||
cms.ui.folder.additionalInfo=Info
|
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
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ cms.ui.folder.save=Speichern
|
||||||
cms.ui.folder.cancel=Abbrechen
|
cms.ui.folder.cancel=Abbrechen
|
||||||
cms.ui.folder.edit=Editieren
|
cms.ui.folder.edit=Editieren
|
||||||
cms.ui.folder.delete=L\u00f6schen
|
cms.ui.folder.delete=L\u00f6schen
|
||||||
cms.ui.folder.move=Verschieben
|
cms.ui.folder.move=Verschiebe {0} Dokumente von {1} nach {2}.
|
||||||
cms.ui.folder.copy=Kopieren
|
cms.ui.folder.copy=Kopiere {0} Dokumente von {1} nach
|
||||||
cms.ui.folder.go=Los
|
cms.ui.folder.go=Los
|
||||||
cms.ui.folder.name=Name
|
cms.ui.folder.name=Name
|
||||||
cms.ui.folder.type=Typ
|
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.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.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.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_already_exists=Es gibt schon einen Eintrag im Zielordner mit Namen: {0}
|
||||||
cms.ui.folder.item_is_live=ist ver\u00f6ffentlicht. Sie m\u00fcssen ihn zum Verschieben zur\u00fcckholen
|
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 zum L\u00f6schen oder Verschieben.
|
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.no_such_item=Die verwendete Eintrags-ID pa\u00dft zu keinem Eintrag.
|
||||||
|
|
||||||
cms.ui.folder.remove_asset_link=Entfernen
|
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.filter_do=Filtern
|
||||||
cms.ui.folder.languages=Sprachen
|
cms.ui.folder.languages=Sprachen
|
||||||
cms.ui.folder.delete_confirmation=Wollen Sie dieses Content-Item l\u00f6schen?
|
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.creation_date=Erstellungsdatum
|
||||||
cms.ui.folder.last_modified=Letzte \u00c4nderung
|
cms.ui.folder.last_modified=Letzte \u00c4nderung
|
||||||
cms.ui.folder.index=Index
|
cms.ui.folder.index=Index
|
||||||
cms.ui.folder.additionalInfo=Info
|
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
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ cms.ui.folder.save=Sauver
|
||||||
cms.ui.folder.cancel=Annuler
|
cms.ui.folder.cancel=Annuler
|
||||||
cms.ui.folder.edit=Modifier
|
cms.ui.folder.edit=Modifier
|
||||||
cms.ui.folder.delete=Effacer
|
cms.ui.folder.delete=Effacer
|
||||||
cms.ui.folder.move=D\u00e9placer
|
cms.ui.folder.move=
|
||||||
cms.ui.folder.copy=Copier
|
cms.ui.folder.copy=
|
||||||
cms.ui.folder.go=Go
|
cms.ui.folder.go=Go
|
||||||
cms.ui.folder.name=Nom
|
cms.ui.folder.name=Nom
|
||||||
cms.ui.folder.type=Type
|
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.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.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.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_already_exists=Il y a d\u00e9j\u00e0 un \u00e9l\u00e9ment dans le dossier destination appel\u00e9: {0}
|
||||||
cms.ui.folder.item_is_live=est en ligne ; Vous devez le d\u00e9-publier avant de le d\u00e9placer.
|
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
|
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.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.filter.all=
|
||||||
cms.ui.folder.languages=
|
cms.ui.folder.languages=
|
||||||
cms.ui.folder.delete_confirmation=
|
cms.ui.folder.delete_confirmation=
|
||||||
cms.ui.folder.additionalInfo=
|
cms.ui.folder.additionalInfo=
|
||||||
|
cms.ui.folder.move.action=
|
||||||
|
cms.ui.folder.copy.action=
|
||||||
|
cms.ui.folder.publish.action=
|
||||||
|
cms.ui.folder.unpublish.action=
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ import com.arsdigita.kernel.Kernel;
|
||||||
import com.arsdigita.kernel.permissions.PermissionService;
|
import com.arsdigita.kernel.permissions.PermissionService;
|
||||||
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
|
||||||
import com.arsdigita.persistence.OID;
|
import com.arsdigita.persistence.OID;
|
||||||
|
import com.arsdigita.toolbox.GlobalisationUtil;
|
||||||
import com.arsdigita.toolbox.ui.FormatStandards;
|
import com.arsdigita.toolbox.ui.FormatStandards;
|
||||||
import com.arsdigita.util.Assert;
|
import com.arsdigita.util.Assert;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
@ -65,9 +66,8 @@ import java.util.Iterator;
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Browse folders and items. If the user clicks on a folder, the folder
|
* Browse folders and items. If the user clicks on a folder, the folder selection model is updated.
|
||||||
* selection model is updated. If the user clicks on any other item, an separate
|
* If the user clicks on any other item, an separate item selection model is updated.
|
||||||
* item selection model is updated.
|
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:lutter@arsdigita.com">David Lutterkort</a>
|
* @author <a href="mailto:lutter@arsdigita.com">David Lutterkort</a>
|
||||||
* @author Sören Bernstein <quasi@quasiweb.de>
|
* @author Sören Bernstein <quasi@quasiweb.de>
|
||||||
|
|
@ -123,8 +123,8 @@ public class FolderBrowser extends Table {
|
||||||
|
|
||||||
setModelBuilder(new FolderTableModelBuilder(currentFolder));
|
setModelBuilder(new FolderTableModelBuilder(currentFolder));
|
||||||
setColumnModel(new DefaultTableColumnModel(hideIndexColumn()
|
setColumnModel(new DefaultTableColumnModel(hideIndexColumn()
|
||||||
? s_noIndexHeaders
|
? s_noIndexHeaders
|
||||||
: s_headers));
|
: s_headers));
|
||||||
setHeader(new TableHeader(getColumnModel()));
|
setHeader(new TableHeader(getColumnModel()));
|
||||||
// DEE 1/18/02: the folder table model builder needs to know about
|
// DEE 1/18/02: the folder table model builder needs to know about
|
||||||
// 'this' in order to set visibility, but 'this' isn't available
|
// 'this' in order to set visibility, but 'this' isn't available
|
||||||
|
|
@ -166,7 +166,7 @@ public class FolderBrowser extends Table {
|
||||||
m_nameColumn.setCellRenderer(new NameCellRenderer());
|
m_nameColumn.setCellRenderer(new NameCellRenderer());
|
||||||
m_nameColumn.setHeaderRenderer(new HeaderCellRenderer(SORT_KEY_NAME));
|
m_nameColumn.setHeaderRenderer(new HeaderCellRenderer(SORT_KEY_NAME));
|
||||||
getColumn(1).setCellRenderer(new LanguagesCellRenderer());
|
getColumn(1).setCellRenderer(new LanguagesCellRenderer());
|
||||||
getColumn(2).setHeaderRenderer(new HeaderCellRenderer(SORT_KEY_TITLE));
|
getColumn(2).setHeaderRenderer(new HeaderCellRenderer(SORT_KEY_TITLE));
|
||||||
getColumn(5).setHeaderRenderer(new HeaderCellRenderer(
|
getColumn(5).setHeaderRenderer(new HeaderCellRenderer(
|
||||||
SORT_KEY_CREATION_DATE));
|
SORT_KEY_CREATION_DATE));
|
||||||
getColumn(6).setHeaderRenderer(new HeaderCellRenderer(
|
getColumn(6).setHeaderRenderer(new HeaderCellRenderer(
|
||||||
|
|
@ -217,9 +217,9 @@ public class FolderBrowser extends Table {
|
||||||
Folder folder = (Folder) m_currentFolder.getSelectedObject(state);
|
Folder folder = (Folder) m_currentFolder.getSelectedObject(state);
|
||||||
Assert.exists(folder);
|
Assert.exists(folder);
|
||||||
|
|
||||||
boolean canDelete =
|
boolean canDelete
|
||||||
sm.canAccess(state.getRequest(), SecurityManager.DELETE_ITEM,
|
= sm.canAccess(state.getRequest(), SecurityManager.DELETE_ITEM,
|
||||||
folder);
|
folder);
|
||||||
|
|
||||||
m_deleteColumn.setVisible(state, canDelete);
|
m_deleteColumn.setVisible(state, canDelete);
|
||||||
}
|
}
|
||||||
|
|
@ -263,7 +263,7 @@ public class FolderBrowser extends Table {
|
||||||
private class FolderTableModelBuilder
|
private class FolderTableModelBuilder
|
||||||
extends AbstractTableModelBuilder
|
extends AbstractTableModelBuilder
|
||||||
implements PaginationModelBuilder,
|
implements PaginationModelBuilder,
|
||||||
FolderManipulator.FilterFormModelBuilder {
|
FolderManipulator.FilterFormModelBuilder {
|
||||||
|
|
||||||
private FolderSelectionModel m_folder;
|
private FolderSelectionModel m_folder;
|
||||||
private RequestLocal m_size;
|
private RequestLocal m_size;
|
||||||
|
|
@ -275,7 +275,7 @@ public class FolderBrowser extends Table {
|
||||||
}
|
}
|
||||||
|
|
||||||
public FolderTableModelBuilder(FolderSelectionModel sel,
|
public FolderTableModelBuilder(FolderSelectionModel sel,
|
||||||
FolderBrowser fb) {
|
FolderBrowser fb) {
|
||||||
super();
|
super();
|
||||||
m_folder = sel;
|
m_folder = sel;
|
||||||
m_size = new RequestLocal();
|
m_size = new RequestLocal();
|
||||||
|
|
@ -291,8 +291,8 @@ public class FolderBrowser extends Table {
|
||||||
} else {
|
} else {
|
||||||
t.getRowSelectionModel().clearSelection(s);
|
t.getRowSelectionModel().clearSelection(s);
|
||||||
s_log.debug(String.format("filter = '%s'", s.getValue(m_filter)));
|
s_log.debug(String.format("filter = '%s'", s.getValue(m_filter)));
|
||||||
Folder.ItemCollection itemColl =
|
Folder.ItemCollection itemColl
|
||||||
(Folder.ItemCollection) m_itemColl.get(s);
|
= (Folder.ItemCollection) m_itemColl.get(s);
|
||||||
s_log.debug(String.format("itemColl.size = %d", itemColl.size()));
|
s_log.debug(String.format("itemColl.size = %d", itemColl.size()));
|
||||||
|
|
||||||
m_folderSize = itemColl.size();
|
m_folderSize = itemColl.size();
|
||||||
|
|
@ -364,7 +364,7 @@ public class FolderBrowser extends Table {
|
||||||
size = new Integer((int) itemColl.size());
|
size = new Integer((int) itemColl.size());
|
||||||
|
|
||||||
itemColl.setRange(new Integer(paginator.getFirst(state)),
|
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 sortKey = (String) state.getValue(m_sortType);
|
||||||
String direction = "asc";
|
String direction = "asc";
|
||||||
|
|
@ -375,13 +375,13 @@ public class FolderBrowser extends Table {
|
||||||
|
|
||||||
if (sortKey.equals(SORT_KEY_TITLE)) {
|
if (sortKey.equals(SORT_KEY_TITLE)) {
|
||||||
itemColl.setOrder("lower(item." + ContentItem.DISPLAY_NAME
|
itemColl.setOrder("lower(item." + ContentItem.DISPLAY_NAME
|
||||||
+ ") " + direction);
|
+ ") " + direction);
|
||||||
} else if (sortKey.equals(SORT_KEY_NAME)) {
|
} else if (sortKey.equals(SORT_KEY_NAME)) {
|
||||||
itemColl.setOrder("lower(item." + ContentItem.NAME + ") "
|
itemColl.setOrder("lower(item." + ContentItem.NAME + ") "
|
||||||
+ direction);
|
+ direction);
|
||||||
} else if (sortKey.equals(SORT_KEY_LAST_MODIFIED_DATE)) {
|
} else if (sortKey.equals(SORT_KEY_LAST_MODIFIED_DATE)) {
|
||||||
itemColl.setOrder("item.auditing.lastModifiedDate "
|
itemColl.setOrder("item.auditing.lastModifiedDate "
|
||||||
+ direction);
|
+ direction);
|
||||||
} else if (sortKey.equals(SORT_KEY_CREATION_DATE)) {
|
} else if (sortKey.equals(SORT_KEY_CREATION_DATE)) {
|
||||||
itemColl.setOrder("item.auditing.creationDate " + direction);
|
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
|
* Indicates whether the paginator should be visible, based on the visibility of the folder
|
||||||
* visibility of the folder browser itself.
|
* browser itself.
|
||||||
*
|
*
|
||||||
* @return true if folder browser is visible, or if the associated
|
* @return true if folder browser is visible, or if the associated folder browser is
|
||||||
* folder browser is unknown.
|
* unknown.
|
||||||
*/
|
*/
|
||||||
public boolean isVisible(PageState state) {
|
public boolean isVisible(PageState state) {
|
||||||
return (m_fb != null) ? m_fb.isVisible(state) : true;
|
return (m_fb != null) ? m_fb.isVisible(state) : true;
|
||||||
|
|
@ -421,9 +421,9 @@ public class FolderBrowser extends Table {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Component getComponent(final Table table, final PageState state,
|
public Component getComponent(final Table table, final PageState state,
|
||||||
Object value,
|
Object value,
|
||||||
boolean isSelected, Object key,
|
boolean isSelected, Object key,
|
||||||
int row, int column) {
|
int row, int column) {
|
||||||
String headerName = (String) ((GlobalizedMessage) value).localize();
|
String headerName = (String) ((GlobalizedMessage) value).localize();
|
||||||
String sortKey = (String) state.getValue(m_sortType);
|
String sortKey = (String) state.getValue(m_sortType);
|
||||||
final boolean isCurrentKey = sortKey.equals(m_key);
|
final boolean isCurrentKey = sortKey.equals(m_key);
|
||||||
|
|
@ -445,14 +445,14 @@ public class FolderBrowser extends Table {
|
||||||
// by default, everything sorts "up" unless it
|
// by default, everything sorts "up" unless it
|
||||||
// is the current key and it is already pointing up
|
// is the current key and it is already pointing up
|
||||||
if (SORT_ACTION_UP.equals(currentSortDirection)
|
if (SORT_ACTION_UP.equals(currentSortDirection)
|
||||||
&& isCurrentKey) {
|
&& isCurrentKey) {
|
||||||
sortDirectionAction = SORT_ACTION_DOWN;
|
sortDirectionAction = SORT_ACTION_DOWN;
|
||||||
} else {
|
} else {
|
||||||
sortDirectionAction = SORT_ACTION_UP;
|
sortDirectionAction = SORT_ACTION_UP;
|
||||||
}
|
}
|
||||||
ps.setControlEvent(table,
|
ps.setControlEvent(table,
|
||||||
sortDirectionAction,
|
sortDirectionAction,
|
||||||
m_key);
|
m_key);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Label l = new Label();
|
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
|
* Produce links to view an item or control links for folders to change into the folder.
|
||||||
* the folder.
|
|
||||||
*/
|
*/
|
||||||
private class NameCellRenderer extends DefaultTableCellRenderer {
|
private class NameCellRenderer extends DefaultTableCellRenderer {
|
||||||
|
|
||||||
|
|
@ -485,14 +484,14 @@ public class FolderBrowser extends Table {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Component getComponent(Table table, PageState state, Object value,
|
public Component getComponent(Table table, PageState state, Object value,
|
||||||
boolean isSelected, Object key,
|
boolean isSelected, Object key,
|
||||||
int row, int column) {
|
int row, int column) {
|
||||||
|
|
||||||
Folder.ItemCollection coll = (Folder.ItemCollection) value;
|
Folder.ItemCollection coll = (Folder.ItemCollection) value;
|
||||||
String name = coll.getName();
|
String name = coll.getName();
|
||||||
if (coll.isFolder()) {
|
if (coll.isFolder()) {
|
||||||
return super.getComponent(table, state, name,
|
return super.getComponent(table, state, name,
|
||||||
isSelected, key, row, column);
|
isSelected, key, row, column);
|
||||||
} else {
|
} else {
|
||||||
ContentSection section = CMS.getContext().getContentSection();
|
ContentSection section = CMS.getContext().getContentSection();
|
||||||
BigDecimal id = coll.getID();
|
BigDecimal id = coll.getID();
|
||||||
|
|
@ -502,7 +501,7 @@ public class FolderBrowser extends Table {
|
||||||
} else {
|
} else {
|
||||||
ItemResolver resolver = section.getItemResolver();
|
ItemResolver resolver = section.getItemResolver();
|
||||||
return new Link(name, resolver.generateItemURL(state, id,
|
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>
|
* Added by: Sören Bernstein <quasi@quasiweb.de>
|
||||||
*
|
*
|
||||||
* Produce links to view an item in a specific language and show all
|
* Produce links to view an item in a specific language and show all existing language version
|
||||||
* existing language version and the live status in the folder browser.
|
* and the live status in the folder browser.
|
||||||
*/
|
*/
|
||||||
private class LanguagesCellRenderer extends DefaultTableCellRenderer {
|
private class LanguagesCellRenderer extends DefaultTableCellRenderer {
|
||||||
|
|
||||||
|
|
@ -522,8 +521,8 @@ public class FolderBrowser extends Table {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Component getComponent(Table table, PageState state, Object value,
|
public Component getComponent(Table table, PageState state, Object value,
|
||||||
boolean isSelected, Object key,
|
boolean isSelected, Object key,
|
||||||
int row, int column) {
|
int row, int column) {
|
||||||
|
|
||||||
Folder.ItemCollection coll = (Folder.ItemCollection) value;
|
Folder.ItemCollection coll = (Folder.ItemCollection) value;
|
||||||
String name = coll.getName();
|
String name = coll.getName();
|
||||||
|
|
@ -544,15 +543,12 @@ public class FolderBrowser extends Table {
|
||||||
ContentBundle bundle = cp.getContentBundle();
|
ContentBundle bundle = cp.getContentBundle();
|
||||||
ContentSection section = CMS.getContext().getContentSection();
|
ContentSection section = CMS.getContext().getContentSection();
|
||||||
|
|
||||||
|
|
||||||
if (bundle != null
|
if (bundle != null
|
||||||
&& !(cp instanceof LanguageInvariantContentItem
|
&& !(cp instanceof LanguageInvariantContentItem
|
||||||
&& ((LanguageInvariantContentItem) cp).isLanguageInvariant())) {
|
&& ((LanguageInvariantContentItem) cp).isLanguageInvariant())) {
|
||||||
|
|
||||||
Iterator<String> languages = bundle.getLanguages().iterator();
|
Iterator<String> languages = bundle.getLanguages().iterator();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
StringBuilder temp = new StringBuilder(20);
|
StringBuilder temp = new StringBuilder(20);
|
||||||
SimpleContainer container = new SimpleContainer();
|
SimpleContainer container = new SimpleContainer();
|
||||||
|
|
||||||
|
|
@ -582,11 +578,11 @@ public class FolderBrowser extends Table {
|
||||||
ItemResolver resolver = section.getItemResolver();
|
ItemResolver resolver = section.getItemResolver();
|
||||||
container.add(
|
container.add(
|
||||||
new Link(langLabel,
|
new Link(langLabel,
|
||||||
resolver.generateItemURL(state,
|
resolver.generateItemURL(state,
|
||||||
ci.getID(),
|
ci.getID(),
|
||||||
name,
|
name,
|
||||||
section,
|
section,
|
||||||
coll.getVersion())));
|
coll.getVersion())));
|
||||||
}
|
}
|
||||||
if (languages.hasNext()) {
|
if (languages.hasNext()) {
|
||||||
container.add(new Label(" ", false));
|
container.add(new Label(" ", false));
|
||||||
|
|
@ -623,8 +619,8 @@ public class FolderBrowser extends Table {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Component getComponent(Table table, PageState state, Object value,
|
public Component getComponent(Table table, PageState state, Object value,
|
||||||
boolean isSelected, Object key,
|
boolean isSelected, Object key,
|
||||||
int row, int column) {
|
int row, int column) {
|
||||||
if (((Boolean) value).booleanValue()) {
|
if (((Boolean) value).booleanValue()) {
|
||||||
return s_link;
|
return s_link;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -636,8 +632,8 @@ public class FolderBrowser extends Table {
|
||||||
private final class IndexToggleRenderer implements TableCellRenderer {
|
private final class IndexToggleRenderer implements TableCellRenderer {
|
||||||
|
|
||||||
public Component getComponent(Table table, PageState state, Object value,
|
public Component getComponent(Table table, PageState state, Object value,
|
||||||
boolean isSelected, Object key, int row,
|
boolean isSelected, Object key, int row,
|
||||||
int column) {
|
int column) {
|
||||||
|
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
return new Label(GlobalizationUtil.globalize("cms.ui.folder.na"));
|
return new Label(GlobalizationUtil.globalize("cms.ui.folder.na"));
|
||||||
|
|
@ -712,7 +708,7 @@ public class FolderBrowser extends Table {
|
||||||
//m_itemColl = folder.getItems();
|
//m_itemColl = folder.getItems();
|
||||||
//}
|
//}
|
||||||
public FolderTableModel(FolderBrowser table, PageState state,
|
public FolderTableModel(FolderBrowser table, PageState state,
|
||||||
Folder.ItemCollection itemColl) {
|
Folder.ItemCollection itemColl) {
|
||||||
m_state = state;
|
m_state = state;
|
||||||
m_table = table;
|
m_table = table;
|
||||||
m_itemColl = itemColl;
|
m_itemColl = itemColl;
|
||||||
|
|
@ -757,8 +753,8 @@ public class FolderBrowser extends Table {
|
||||||
return FormatStandards.formatDate(creationDate);
|
return FormatStandards.formatDate(creationDate);
|
||||||
}
|
}
|
||||||
case LAST_MODIFIED: {
|
case LAST_MODIFIED: {
|
||||||
java.util.Date lastModified =
|
java.util.Date lastModified
|
||||||
m_itemColl.getLastModifiedDate();
|
= m_itemColl.getLastModifiedDate();
|
||||||
if (lastModified == null) {
|
if (lastModified == null) {
|
||||||
return "--";
|
return "--";
|
||||||
}
|
}
|
||||||
|
|
@ -782,8 +778,8 @@ public class FolderBrowser extends Table {
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
throw new IndexOutOfBoundsException("Column index "
|
throw new IndexOutOfBoundsException("Column index "
|
||||||
+ columnIndex
|
+ columnIndex
|
||||||
+ " not in table model.");
|
+ " not in table model.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -820,7 +816,8 @@ public class FolderBrowser extends Table {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s_log.isDebugEnabled()) {
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -828,7 +825,7 @@ public class FolderBrowser extends Table {
|
||||||
public Object getKeyAt(int columnIndex) {
|
public Object getKeyAt(int columnIndex) {
|
||||||
// Mark folders by using their negative ID (dirty, dirty)
|
// Mark folders by using their negative ID (dirty, dirty)
|
||||||
return (m_itemColl.isFolder()) ? m_itemColl.getID().negate()
|
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();
|
ContentBundle currentIndexItem = (ContentBundle) folder.getIndexItem();
|
||||||
if (currentIndexItem == null || (currentIndexItem.getID().
|
if (currentIndexItem == null || (currentIndexItem.getID().
|
||||||
compareTo(contentItem.getID())
|
compareTo(contentItem.getID())
|
||||||
!= 0)) {
|
!= 0)) {
|
||||||
folder.setIndexItem(contentItem);
|
folder.setIndexItem(contentItem);
|
||||||
} else {
|
} else {
|
||||||
folder.removeIndexItem();
|
folder.removeIndexItem();
|
||||||
|
|
@ -894,7 +891,11 @@ public class FolderBrowser extends Table {
|
||||||
* @param key The resource key @pre ( key != null )
|
* @param key The resource key @pre ( key != null )
|
||||||
*/
|
*/
|
||||||
private static GlobalizedMessage globalize(String key) {
|
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() {
|
private static boolean hideIndexColumn() {
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -28,15 +28,15 @@ public class PublishLock {
|
||||||
private PublishLock() {
|
private PublishLock() {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static synchronized PublishLock getInstance() {
|
public static synchronized PublishLock getInstance() {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected synchronized void lock(final ContentItem item) {
|
public synchronized void lock(final ContentItem item) {
|
||||||
lock(item, "publish");
|
lock(item, "publish");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected synchronized void lock(final ContentItem item,
|
public synchronized void lock(final ContentItem item,
|
||||||
final String action) {
|
final String action) {
|
||||||
SessionManager.getSession().getTransactionContext().beginTxn();
|
SessionManager.getSession().getTransactionContext().beginTxn();
|
||||||
final DataObject lock = SessionManager.getSession().create(
|
final DataObject lock = SessionManager.getSession().create(
|
||||||
|
|
@ -49,7 +49,7 @@ public class PublishLock {
|
||||||
SessionManager.getSession().getTransactionContext().commitTxn();
|
SessionManager.getSession().getTransactionContext().commitTxn();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected synchronized void unlock(final ContentItem item) {
|
public synchronized void unlock(final ContentItem item) {
|
||||||
SessionManager.getSession().getTransactionContext().beginTxn();
|
SessionManager.getSession().getTransactionContext().beginTxn();
|
||||||
final DataCollection collection = SessionManager.getSession().retrieve(
|
final DataCollection collection = SessionManager.getSession().retrieve(
|
||||||
LOCK_OBJECT_TYPE);
|
LOCK_OBJECT_TYPE);
|
||||||
|
|
@ -66,7 +66,7 @@ public class PublishLock {
|
||||||
SessionManager.getSession().getTransactionContext().commitTxn();
|
SessionManager.getSession().getTransactionContext().commitTxn();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected synchronized boolean isLocked(final ContentItem item) {
|
public synchronized boolean isLocked(final ContentItem item) {
|
||||||
final DataCollection collection = SessionManager.getSession().retrieve(
|
final DataCollection collection = SessionManager.getSession().retrieve(
|
||||||
LOCK_OBJECT_TYPE);
|
LOCK_OBJECT_TYPE);
|
||||||
collection.addFilter(String.format("%s = '%s'", LOCKED_OID,
|
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();
|
SessionManager.getSession().getTransactionContext().beginTxn();
|
||||||
final DataCollection collection = SessionManager.getSession().retrieve(
|
final DataCollection collection = SessionManager.getSession().retrieve(
|
||||||
LOCK_OBJECT_TYPE);
|
LOCK_OBJECT_TYPE);
|
||||||
|
|
@ -99,7 +99,7 @@ public class PublishLock {
|
||||||
SessionManager.getSession().getTransactionContext().commitTxn();
|
SessionManager.getSession().getTransactionContext().commitTxn();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected synchronized boolean hasError(final ContentItem item) {
|
public synchronized boolean hasError(final ContentItem item) {
|
||||||
final DataCollection collection = SessionManager.getSession().retrieve(
|
final DataCollection collection = SessionManager.getSession().retrieve(
|
||||||
LOCK_OBJECT_TYPE);
|
LOCK_OBJECT_TYPE);
|
||||||
collection.addFilter(String.format("%s = '%s'", LOCKED_OID,
|
collection.addFilter(String.format("%s = '%s'", LOCKED_OID,
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -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.description_hint=The long description of the domain
|
||||||
terms.domain.ui.version_hint=The current version number, eg 1.00
|
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.domain.ui.released_hint=The release date of the current version
|
||||||
|
terms.ui.pick_one=-- pick one --
|
||||||
|
|
|
||||||
|
|
@ -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.description_hint=Eine ausf\u00fchrlichere Beschreibung der Domain
|
||||||
terms.domain.ui.version_hint=Die aktuelle Version, z.B. 1.00
|
terms.domain.ui.version_hint=Die aktuelle Version, z.B. 1.00
|
||||||
terms.domain.ui.released_hint=Das Ver\u00f6ffentlichungsdatum der aktuellen Version.
|
terms.domain.ui.released_hint=Das Ver\u00f6ffentlichungsdatum der aktuellen Version.
|
||||||
|
terms.ui.pick_one=-- Ausw\u00e4hlen --
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.london.terms.ui;
|
package com.arsdigita.london.terms.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
|
|
@ -24,49 +23,52 @@ import com.arsdigita.bebop.form.SingleSelect;
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
import com.arsdigita.domain.DomainObjectFactory;
|
||||||
import com.arsdigita.london.terms.Domain;
|
import com.arsdigita.london.terms.Domain;
|
||||||
import com.arsdigita.categorization.ui.AbstractCategoryPicker;
|
import com.arsdigita.categorization.ui.AbstractCategoryPicker;
|
||||||
|
import com.arsdigita.london.terms.util.TermsGlobalizationUtil;
|
||||||
import com.arsdigita.persistence.DataCollection;
|
import com.arsdigita.persistence.DataCollection;
|
||||||
import com.arsdigita.persistence.OID;
|
import com.arsdigita.persistence.OID;
|
||||||
import com.arsdigita.persistence.SessionManager;
|
import com.arsdigita.persistence.SessionManager;
|
||||||
|
|
||||||
|
/**
|
||||||
/**
|
*
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class RootCategoryPicker extends AbstractCategoryPicker {
|
public class RootCategoryPicker extends AbstractCategoryPicker {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param name
|
* @param name
|
||||||
*/
|
*/
|
||||||
public RootCategoryPicker(String name) {
|
public RootCategoryPicker(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param state
|
* @param state
|
||||||
* @param target
|
* @param target
|
||||||
*/
|
*/
|
||||||
protected void addOptions( PageState state,
|
protected void addOptions(PageState state,
|
||||||
SingleSelect target) {
|
SingleSelect target) {
|
||||||
|
|
||||||
DataCollection domains = SessionManager
|
DataCollection domains = SessionManager
|
||||||
.getSession()
|
.getSession()
|
||||||
.retrieve(Domain.BASE_DATA_OBJECT_TYPE);
|
.retrieve(Domain.BASE_DATA_OBJECT_TYPE);
|
||||||
domains.addPath("model.id");
|
domains.addPath("model.id");
|
||||||
domains.addPath("model.objectType");
|
domains.addPath("model.objectType");
|
||||||
domains.addOrder("title");
|
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()) {
|
while (domains.next()) {
|
||||||
Domain domain = (Domain) DomainObjectFactory
|
Domain domain = (Domain) DomainObjectFactory
|
||||||
.newInstance(domains.getDataObject());
|
.newInstance(domains.getDataObject());
|
||||||
|
|
||||||
target.addOption(
|
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(),
|
domains.get("model.id")).toString(),
|
||||||
domain.getTitle()));
|
domain.getTitle()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,156 +22,145 @@
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<xsl:stylesheet
|
<xsl:stylesheet
|
||||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||||
xmlns:nav="http://ccm.redhat.com/navigation"
|
xmlns:nav="http://ccm.redhat.com/navigation"
|
||||||
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
||||||
xmlns:mandalay="http://mandalay.quasiweb.de"
|
xmlns:mandalay="http://mandalay.quasiweb.de"
|
||||||
exclude-result-prefixes="xsl bebop cms nav mandalay"
|
exclude-result-prefixes="xsl bebop cms nav mandalay"
|
||||||
version="1.0"
|
version="1.0"
|
||||||
>
|
>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
************************************************
|
************************************************
|
||||||
** Template for the DescTab for a SciProject **
|
** Template for the DescTab for a SciProject **
|
||||||
************************************************
|
************************************************
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<xsl:template name="CT_SciProject_graphics"
|
<xsl:template name="CT_SciProject_graphics"
|
||||||
match="projectDescription"
|
match="projectDescription"
|
||||||
mode="tabs">
|
mode="tabs">
|
||||||
|
|
||||||
<xsl:variable name="setImage">
|
<xsl:variable name="setImage">
|
||||||
<xsl:call-template name="mandalay:getSetting">
|
<xsl:call-template name="mandalay:getSetting">
|
||||||
<xsl:with-param name="module" select="'SciProject'"/>
|
<xsl:with-param name="module" select="'SciProject'"/>
|
||||||
<xsl:with-param name="setting" select="'descTab/setImage'"/>
|
<xsl:with-param name="setting" select="'descTab/setImage'"/>
|
||||||
<xsl:with-param name="default" select="'true'"/>
|
<xsl:with-param name="default" select="'true'"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
<xsl:variable name="setImageCaption">
|
<xsl:variable name="setImageCaption">
|
||||||
<xsl:call-template name="mandalay:getSetting">
|
<xsl:call-template name="mandalay:getSetting">
|
||||||
<xsl:with-param name="module" select="'SciProject'"/>
|
<xsl:with-param name="module" select="'SciProject'"/>
|
||||||
<xsl:with-param name="setting" select="'tabs/setImageCaption'"/>
|
<xsl:with-param name="setting" select="'tabs/setImageCaption'"/>
|
||||||
<xsl:with-param name="default" select="'true'"/>
|
<xsl:with-param name="default" select="'true'"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
<xsl:variable name="setImageMaxHeight">
|
<xsl:variable name="setImageMaxHeight">
|
||||||
<xsl:call-template name="mandalay:getSetting">
|
<xsl:call-template name="mandalay:getSetting">
|
||||||
<xsl:with-param name="module" select="'SciProject'"/>
|
<xsl:with-param name="module" select="'SciProject'"/>
|
||||||
<xsl:with-param name="setting" select="'tabs/setImageMaxHeight'"/>
|
<xsl:with-param name="setting" select="'tabs/setImageMaxHeight'"/>
|
||||||
<xsl:with-param name="default" select="''"/>
|
<xsl:with-param name="default" select="''"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
<xsl:variable name="setImageMaxWidth">
|
<xsl:variable name="setImageMaxWidth">
|
||||||
<xsl:call-template name="mandalay:getSetting">
|
<xsl:call-template name="mandalay:getSetting">
|
||||||
<xsl:with-param name="module" select="'SciProject'"/>
|
<xsl:with-param name="module" select="'SciProject'"/>
|
||||||
<xsl:with-param name="setting" select="'tabs/setImageMaxWidth'"/>
|
<xsl:with-param name="setting" select="'tabs/setImageMaxWidth'"/>
|
||||||
<xsl:with-param name="default" select="''"/>
|
<xsl:with-param name="default" select="''"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
<xsl:variable name="setShowHeading">
|
<xsl:variable name="setShowHeading">
|
||||||
<xsl:call-template name="mandalay:getSetting">
|
<xsl:call-template name="mandalay:getSetting">
|
||||||
<xsl:with-param name="module" select="'SciProject'"/>
|
<xsl:with-param name="module" select="'SciProject'"/>
|
||||||
<xsl:with-param name="setting" select="'tabs/setShowHeading'"/>
|
<xsl:with-param name="setting" select="'tabs/setShowHeading'"/>
|
||||||
<xsl:with-param name="default" select="'false'"/>
|
<xsl:with-param name="default" select="'false'"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
<xsl:variable name="setShortDesc">
|
<xsl:variable name="setShortDesc">
|
||||||
<xsl:call-template name="mandalay:getSetting">
|
<xsl:call-template name="mandalay:getSetting">
|
||||||
<xsl:with-param name="module" select="'SciProject'"/>
|
<xsl:with-param name="module" select="'SciProject'"/>
|
||||||
<xsl:with-param name="setting" select="'descTab/setShortDesc'"/>
|
<xsl:with-param name="setting" select="'descTab/setShortDesc'"/>
|
||||||
<xsl:with-param name="default" select="'true'"/>
|
<xsl:with-param name="default" select="'true'"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
<xsl:variable name="setFunding">
|
<xsl:variable name="setFunding">
|
||||||
<xsl:call-template name="mandalay:getSetting">
|
<xsl:call-template name="mandalay:getSetting">
|
||||||
<xsl:with-param name="module" select="'SciProject'"/>
|
<xsl:with-param name="module" select="'SciProject'"/>
|
||||||
<xsl:with-param name="setting" select="'descTab/setFunding'"/>
|
<xsl:with-param name="setting" select="'descTab/setFunding'"/>
|
||||||
<xsl:with-param name="default" select="'false'"/>
|
<xsl:with-param name="default" select="'false'"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
<xsl:variable name="setFundingVolume">
|
<xsl:variable name="setFundingVolume">
|
||||||
<xsl:call-template name="mandalay:getSetting">
|
<xsl:call-template name="mandalay:getSetting">
|
||||||
<xsl:with-param name="module" select="'SciProject'"/>
|
<xsl:with-param name="module" select="'SciProject'"/>
|
||||||
<xsl:with-param name="setting" select="'descTab/setFundingVolume'"/>
|
<xsl:with-param name="setting" select="'descTab/setFundingVolume'"/>
|
||||||
<xsl:with-param name="default" select="'true'"/>
|
<xsl:with-param name="default" select="'true'"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
|
|
||||||
<div class="activeTab">
|
<div class="activeTab">
|
||||||
|
|
||||||
<xsl:if test="$setImage = 'true'">
|
<xsl:if test="$setImage = 'true'">
|
||||||
<xsl:for-each select="$resultTree//cms:item">
|
<xsl:for-each select="$resultTree//cms:item">
|
||||||
<xsl:call-template name="mandalay:imageAttachment">
|
<xsl:call-template name="mandalay:imageAttachment">
|
||||||
<xsl:with-param name="showCaption" select="$setImageCaption" />
|
<xsl:with-param name="showCaption" select="$setImageCaption" />
|
||||||
<xsl:with-param name="maxHeight" select="$setImageMaxHeight" />
|
<xsl:with-param name="maxHeight" select="$setImageMaxHeight" />
|
||||||
<xsl:with-param name="maxWidth" select="$setImageMaxWidth" />
|
<xsl:with-param name="maxWidth" select="$setImageMaxWidth" />
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
|
||||||
<xsl:if test="$setShowHeading = 'true'">
|
<xsl:if test="$setShowHeading = 'true'">
|
||||||
<h2>
|
<h2>
|
||||||
<xsl:call-template name="mandalay:getStaticText">
|
<xsl:call-template name="mandalay:getStaticText">
|
||||||
<xsl:with-param name="module" select="'SciProject'"/>
|
<xsl:with-param name="module" select="'SciProject'"/>
|
||||||
<xsl:with-param name="id" select="'descTab/heading'"/>
|
<xsl:with-param name="id" select="'descTab/heading'"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</h2>
|
</h2>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
|
||||||
<xsl:if test="$setShortDesc = 'true'">
|
<xsl:if test="$setShortDesc = 'true'">
|
||||||
<div id="lead">
|
<div id="lead">
|
||||||
<xsl:value-of disable-output-escaping="yes" select="./shortDescription"/>
|
<xsl:value-of disable-output-escaping="yes" select="./shortDescription"/>
|
||||||
</div>
|
</div>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
|
||||||
<div class="mainBody projectDesc">
|
<div class="mainBody projectDesc">
|
||||||
<xsl:value-of disable-output-escaping="yes" select="./description"/>
|
<xsl:value-of disable-output-escaping="yes" select="./description"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3>
|
<xsl:if test="(string-length(./funding) > 0) and ($setFunding = 'true')">
|
||||||
<xsl:call-template name="mandalay:getStaticText">
|
|
||||||
<xsl:with-param name="module" select="'SciProject'"/>
|
<h3>
|
||||||
<xsl:with-param name="id" select="'descTab/fundingHeading'"/>
|
<xsl:call-template name="mandalay:getStaticText">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="module" select="'SciProject'"/>
|
||||||
</h3>
|
<xsl:with-param name="id" select="'descTab/fundingHeading'"/>
|
||||||
<div class="mainBody projectFunding">
|
</xsl:call-template>
|
||||||
<xsl:value-of disable-output-escaping="yes" select="./funding"/>
|
</h3>
|
||||||
</div>
|
<div class="mainBody projectFunding">
|
||||||
|
<xsl:value-of disable-output-escaping="yes" select="./funding"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<xsl:if test="(string-length(./fundingVolume) > 0) and ($setFundingVolume = 'true')">
|
<xsl:if test="(string-length(./fundingVolume) > 0) and ($setFundingVolume = 'true')">
|
||||||
<div class="projectFundingVolume">
|
<div class="projectFundingVolume">
|
||||||
<span>
|
<span>
|
||||||
<xsl:call-template name="mandalay:getStaticText">
|
<xsl:call-template name="mandalay:getStaticText">
|
||||||
<xsl:with-param name="module" select="'SciProject'"/>
|
<xsl:with-param name="module" select="'SciProject'"/>
|
||||||
<xsl:with-param name="id" select="'descTab/fundingVolume'"/>
|
<xsl:with-param name="id" select="'descTab/fundingVolume'"/>
|
||||||
</xsl:call-template>
|
</xsl:call-template>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<xsl:value-of select="./fundingVolume"/>
|
<xsl:value-of select="./fundingVolume"/>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<xsl:if test="(string-length(./fundingVolume) > 0) and ($setFundingVolume = 'true')">
|
</xsl:if>
|
||||||
<div class="projectFundingVolume">
|
|
||||||
<span>
|
</xsl:if>
|
||||||
<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>
|
|
||||||
|
|
||||||
<div class="endFloat"/>
|
|
||||||
</xsl:if>
|
|
||||||
|
|
||||||
<div class="endFloat"/>
|
<div class="endFloat"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,7 @@ public class SciDepartmentProjectsTab implements GenericOrgaUnitTab {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void generateXml(final GenericOrganizationalUnit orgaunit,
|
public void generateXml(final GenericOrganizationalUnit orgaunit,
|
||||||
final Element parent,
|
final Element parent,
|
||||||
final PageState state) {
|
final PageState state) {
|
||||||
|
|
|
||||||
|
|
@ -64,17 +64,21 @@ import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class creates the administration input form.
|
* Class creates the administration input form.
|
||||||
*
|
*
|
||||||
* Used by ControlCenterPanel to construct the 'create new site' and
|
* Used by ControlCenterPanel to construct the 'create new site' and 'edit existing site' input
|
||||||
* 'edit existing site' input forms.
|
* forms.
|
||||||
*/
|
*/
|
||||||
public class SiteForm extends Form {
|
public class SiteForm extends Form {
|
||||||
|
|
||||||
/** A logger instance. */
|
/**
|
||||||
|
* A logger instance.
|
||||||
|
*/
|
||||||
private static final Logger s_log = Logger.getLogger(SiteForm.class);
|
private static final Logger s_log = Logger.getLogger(SiteForm.class);
|
||||||
private SiteSelectionModel m_site;
|
private SiteSelectionModel m_site;
|
||||||
private BigDecimal siteDefaultRootPageID;
|
private BigDecimal siteDefaultRootPageID;
|
||||||
/** Input field subsite title */
|
/**
|
||||||
|
* Input field subsite title
|
||||||
|
*/
|
||||||
private TextField m_title;
|
private TextField m_title;
|
||||||
private TextField m_hostname;
|
private TextField m_hostname;
|
||||||
private TextArea m_description;
|
private TextArea m_description;
|
||||||
|
|
@ -84,17 +88,17 @@ public class SiteForm extends Form {
|
||||||
private SingleSelect m_themes;
|
private SingleSelect m_themes;
|
||||||
private SaveCancelSection m_buttons;
|
private SaveCancelSection m_buttons;
|
||||||
private final static String DEFAULT_APP = "DEFAULT_APP";
|
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 = "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 = "OTHER_STYLE";
|
||||||
private final static String OTHER_STYLE_LABEL = "Other (type in box below)";
|
private final static String OTHER_STYLE_LABEL = "Other (type in box below)";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor create input widgets and adds them to form.
|
* Constructor create input widgets and adds them to form.
|
||||||
*
|
*
|
||||||
* @param name
|
* @param name
|
||||||
* @param site
|
* @param site
|
||||||
*/
|
*/
|
||||||
public SiteForm(String name, SiteSelectionModel site) {
|
public SiteForm(String name, SiteSelectionModel site) {
|
||||||
|
|
||||||
|
|
@ -113,7 +117,7 @@ public class SiteForm extends Form {
|
||||||
m_title.addValidationListener(new NotNullValidationListener());
|
m_title.addValidationListener(new NotNullValidationListener());
|
||||||
m_title.setMetaDataAttribute("title", "Title");
|
m_title.setMetaDataAttribute("title", "Title");
|
||||||
m_title.setHint((String) SubsiteGlobalizationUtil.globalize("subsite.ui.title.hint").
|
m_title.setHint((String) SubsiteGlobalizationUtil.globalize("subsite.ui.title.hint").
|
||||||
localize());
|
localize());
|
||||||
m_title.setSize(40);
|
m_title.setSize(40);
|
||||||
add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.title.label")));
|
add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.title.label")));
|
||||||
add(m_title); // adds title input field to form
|
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.setMetaDataAttribute("title", "Hostname");
|
||||||
m_hostname.setSize(40);
|
m_hostname.setSize(40);
|
||||||
m_hostname.setHint((String) SubsiteGlobalizationUtil.globalize("subsite.ui.hostname.hint").
|
m_hostname.setHint((String) SubsiteGlobalizationUtil.globalize("subsite.ui.hostname.hint").
|
||||||
localize());
|
localize());
|
||||||
add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.hostname.label")));
|
add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.hostname.label")));
|
||||||
add(m_hostname); // adds hostname input field to form
|
add(m_hostname); // adds hostname input field to form
|
||||||
|
|
||||||
|
|
@ -138,7 +142,7 @@ public class SiteForm extends Form {
|
||||||
m_description.setCols(45);
|
m_description.setCols(45);
|
||||||
m_description.setRows(4);
|
m_description.setRows(4);
|
||||||
m_description.setHint((String) SubsiteGlobalizationUtil.globalize(
|
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(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.description.label")));
|
||||||
add(m_description); // adds description input field to form
|
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
|
/* Setup selection box for subsite start page (front page) Application
|
||||||
* by URL */
|
* by URL */
|
||||||
m_customFrontpageApp = new SingleSelect(
|
m_customFrontpageApp = new SingleSelect(
|
||||||
new StringParameter("customFrontpageApp"));
|
new StringParameter("customFrontpageApp"));
|
||||||
m_customFrontpageApp.setMetaDataAttribute("title", "Front Page (url)");
|
m_customFrontpageApp.setMetaDataAttribute("title", "Front Page (url)");
|
||||||
// m_customFrontpageApp.setSize(40);
|
// m_customFrontpageApp.setSize(40);
|
||||||
m_customFrontpageApp.setHint((String) SubsiteGlobalizationUtil.globalize(
|
m_customFrontpageApp.setHint((String) SubsiteGlobalizationUtil.globalize(
|
||||||
"subsite.ui.customfrontpage.hint").
|
"subsite.ui.customfrontpage.hint").
|
||||||
localize());
|
localize());
|
||||||
try {
|
try {
|
||||||
m_customFrontpageApp.addPrintListener(new FrontpageAppListener());
|
m_customFrontpageApp.addPrintListener(new FrontpageAppListener());
|
||||||
} catch (TooManyListenersException ex) {
|
} catch (TooManyListenersException ex) {
|
||||||
|
|
@ -165,7 +169,7 @@ public class SiteForm extends Form {
|
||||||
m_themes = new SingleSelect(new StringParameter("selectStyleDir"));
|
m_themes = new SingleSelect(new StringParameter("selectStyleDir"));
|
||||||
m_themes.setMetaDataAttribute("title", "XSLT Directory");
|
m_themes.setMetaDataAttribute("title", "XSLT Directory");
|
||||||
m_themes.setHint((String) SubsiteGlobalizationUtil.globalize("subsite.ui.theme.hint").
|
m_themes.setHint((String) SubsiteGlobalizationUtil.globalize("subsite.ui.theme.hint").
|
||||||
localize());
|
localize());
|
||||||
try {
|
try {
|
||||||
m_themes.addPrintListener(new ThemesListener());
|
m_themes.addPrintListener(new ThemesListener());
|
||||||
} catch (TooManyListenersException ex) {
|
} catch (TooManyListenersException ex) {
|
||||||
|
|
@ -180,48 +184,46 @@ public class SiteForm extends Form {
|
||||||
m_styleDir.setMetaDataAttribute("title", "XSLT Directory (Other)");
|
m_styleDir.setMetaDataAttribute("title", "XSLT Directory (Other)");
|
||||||
m_styleDir.setSize(40);
|
m_styleDir.setSize(40);
|
||||||
m_styleDir.setHint(
|
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(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.styledir.label")));
|
||||||
add(m_styleDir); // adds inputfield style dir to form
|
add(m_styleDir); // adds inputfield style dir to form
|
||||||
|
|
||||||
|
|
||||||
/* Setup selection box for cagtegory domain */
|
/* Setup selection box for cagtegory domain */
|
||||||
m_rootCategory = (CategoryPicker) Classes.newInstance(
|
m_rootCategory = (CategoryPicker) Classes.newInstance(
|
||||||
Subsite.getConfig().getRootCategoryPicker(),
|
Subsite.getConfig().getRootCategoryPicker(),
|
||||||
new Class[]{String.class},
|
new Class[]{String.class},
|
||||||
new Object[]{"rootCategory"});
|
new Object[]{"rootCategory"});
|
||||||
if (m_rootCategory instanceof Widget) {
|
if (m_rootCategory instanceof Widget) {
|
||||||
((Widget) m_rootCategory).setMetaDataAttribute("title", "Root category");
|
((Widget) m_rootCategory).setMetaDataAttribute("title", "Root category");
|
||||||
((Widget) m_rootCategory).setHint((String) SubsiteGlobalizationUtil.globalize(
|
((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(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.root_category.label")));
|
||||||
add(m_rootCategory); // adds domain category selection box to form
|
add(m_rootCategory); // adds domain category selection box to form
|
||||||
|
|
||||||
|
|
||||||
m_buttons = new SaveCancelSection();
|
m_buttons = new SaveCancelSection();
|
||||||
m_buttons.getSaveButton().setButtonLabel(SubsiteGlobalizationUtil.globalize(
|
m_buttons.getSaveButton().setButtonLabel(SubsiteGlobalizationUtil.globalize(
|
||||||
"subsite.ui.save"));
|
"subsite.ui.save"));
|
||||||
m_buttons.getSaveButton().setHint("Save the details in the form");
|
m_buttons.getSaveButton().setHint("Save the details in the form");
|
||||||
m_buttons.getCancelButton().setButtonLabel(SubsiteGlobalizationUtil.globalize(
|
m_buttons.getCancelButton().setButtonLabel(SubsiteGlobalizationUtil.globalize(
|
||||||
"subsite.ui.cancel"));
|
"subsite.ui.cancel"));
|
||||||
m_buttons.getCancelButton().setHint("Abort changes & reset the form");
|
m_buttons.getCancelButton().setHint("Abort changes & reset the form");
|
||||||
add(m_buttons);
|
add(m_buttons);
|
||||||
|
|
||||||
|
|
||||||
addSubmissionListener(new SiteSubmissionListener());
|
addSubmissionListener(new SiteSubmissionListener());
|
||||||
addProcessListener(new SiteProcessListener());
|
addProcessListener(new SiteProcessListener());
|
||||||
addInitListener(new SiteInitListener());
|
addInitListener(new SiteInitListener());
|
||||||
addValidationListener(new SiteValidationListener());
|
addValidationListener(new SiteValidationListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private class SiteSubmissionListener implements FormSubmissionListener {
|
private class SiteSubmissionListener implements FormSubmissionListener {
|
||||||
|
|
||||||
public void submitted(FormSectionEvent e)
|
public void submitted(FormSectionEvent e)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
|
|
||||||
if (m_buttons.getCancelButton().isSelected(state)) {
|
if (m_buttons.getCancelButton().isSelected(state)) {
|
||||||
|
|
@ -255,14 +257,14 @@ public class SiteForm extends Form {
|
||||||
if (OTHER_STYLE.equals(themeDir)) {
|
if (OTHER_STYLE.equals(themeDir)) {
|
||||||
if (StringUtils.emptyString(styleDir)) {
|
if (StringUtils.emptyString(styleDir)) {
|
||||||
data.addError(SubsiteGlobalizationUtil.globalize(
|
data.addError(SubsiteGlobalizationUtil.globalize(
|
||||||
"subsite.ui.other_style_missing",
|
"subsite.ui.other_style_missing",
|
||||||
new String[]{OTHER_STYLE_LABEL}));
|
new String[]{OTHER_STYLE_LABEL}));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!StringUtils.emptyString(styleDir)) {
|
if (!StringUtils.emptyString(styleDir)) {
|
||||||
data.addError(SubsiteGlobalizationUtil.globalize(
|
data.addError(SubsiteGlobalizationUtil.globalize(
|
||||||
"subsite.ui.other_style_invalid",
|
"subsite.ui.other_style_invalid",
|
||||||
new String[]{OTHER_STYLE_LABEL}));
|
new String[]{OTHER_STYLE_LABEL}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -274,7 +276,7 @@ public class SiteForm extends Form {
|
||||||
String test = testExist.getDefaultDomainClass();
|
String test = testExist.getDefaultDomainClass();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
data.addError(SubsiteGlobalizationUtil.globalize(
|
data.addError(SubsiteGlobalizationUtil.globalize(
|
||||||
"subsite.ui.root_category_missing"));
|
"subsite.ui.root_category_missing"));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End if (!m_buttons ...)
|
} // End if (!m_buttons ...)
|
||||||
|
|
@ -282,7 +284,7 @@ public class SiteForm extends Form {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether hostname is alreafy in use.
|
* Checks whether hostname is alreafy in use.
|
||||||
*/
|
*/
|
||||||
private class HostNameValidationListener implements ParameterListener {
|
private class HostNameValidationListener implements ParameterListener {
|
||||||
|
|
@ -294,7 +296,7 @@ public class SiteForm extends Form {
|
||||||
Site site = m_site.getSelectedSite(e.getPageState());
|
Site site = m_site.getSelectedSite(e.getPageState());
|
||||||
if (hostname != null && hostname.toString().length() > 0) {
|
if (hostname != null && hostname.toString().length() > 0) {
|
||||||
DataCollection sites = SessionManager.getSession()
|
DataCollection sites = SessionManager.getSession()
|
||||||
.retrieve(Site.BASE_DATA_OBJECT_TYPE);
|
.retrieve(Site.BASE_DATA_OBJECT_TYPE);
|
||||||
sites.addEqualsFilter("lower(" + Site.HOSTNAME + ")",
|
sites.addEqualsFilter("lower(" + Site.HOSTNAME + ")",
|
||||||
hostname.toLowerCase());
|
hostname.toLowerCase());
|
||||||
if (site != null) {
|
if (site != null) {
|
||||||
|
|
@ -302,7 +304,7 @@ public class SiteForm extends Form {
|
||||||
}
|
}
|
||||||
if (sites.size() > 0) {
|
if (sites.size() > 0) {
|
||||||
data.addError(SubsiteGlobalizationUtil.globalize(
|
data.addError(SubsiteGlobalizationUtil.globalize(
|
||||||
"subsite.ui.hostname_already_in_use"));
|
"subsite.ui.hostname_already_in_use"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -310,20 +312,18 @@ public class SiteForm extends Form {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the form.
|
* Initializes the form. (when a new input form is requested by user either by editing an
|
||||||
* (when a new input form is requested by user either by editing an
|
|
||||||
* existing subsite or by creating a new one).
|
* existing subsite or by creating a new one).
|
||||||
*/
|
*/
|
||||||
private class SiteInitListener implements FormInitListener {
|
private class SiteInitListener implements FormInitListener {
|
||||||
|
|
||||||
public void init(FormSectionEvent e)
|
public void init(FormSectionEvent e)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
|
|
||||||
Site site = m_site.getSelectedSite(state);
|
Site site = m_site.getSelectedSite(state);
|
||||||
|
|
||||||
|
|
||||||
if (site == null) {
|
if (site == null) {
|
||||||
m_title.setValue(state, null);
|
m_title.setValue(state, null);
|
||||||
m_hostname.setValue(state, null);
|
m_hostname.setValue(state, null);
|
||||||
|
|
@ -340,10 +340,10 @@ public class SiteForm extends Form {
|
||||||
// BigDecimal siteDefaultRootPageID
|
// BigDecimal siteDefaultRootPageID
|
||||||
BigDecimal currentFrontpageID = site.getFrontPage().getID();
|
BigDecimal currentFrontpageID = site.getFrontPage().getID();
|
||||||
s_log.debug(" Site default frontpage is: " + siteDefaultRootPageID
|
s_log.debug(" Site default frontpage is: " + siteDefaultRootPageID
|
||||||
+ ", Current frontpage is: " + currentFrontpageID);
|
+ ", Current frontpage is: " + currentFrontpageID);
|
||||||
m_customFrontpageApp.setValue(
|
m_customFrontpageApp.setValue(
|
||||||
state,
|
state,
|
||||||
currentFrontpageID == siteDefaultRootPageID ? DEFAULT_APP
|
currentFrontpageID == siteDefaultRootPageID ? DEFAULT_APP
|
||||||
: currentFrontpageID.toString());
|
: currentFrontpageID.toString());
|
||||||
|
|
||||||
String styleURL = site.getStyleDirectory();
|
String styleURL = site.getStyleDirectory();
|
||||||
|
|
@ -376,12 +376,12 @@ public class SiteForm extends Form {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private class SiteProcessListener implements FormProcessListener {
|
private class SiteProcessListener implements FormProcessListener {
|
||||||
|
|
||||||
public void process(FormSectionEvent e)
|
public void process(FormSectionEvent e)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
|
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
|
|
||||||
|
|
@ -403,20 +403,20 @@ public class SiteForm extends Form {
|
||||||
|
|
||||||
/* Pre-process selected frontpage application: retrieve application */
|
/* Pre-process selected frontpage application: retrieve application */
|
||||||
String subsiteSelectedFrontpage = (String) m_customFrontpageApp
|
String subsiteSelectedFrontpage = (String) m_customFrontpageApp
|
||||||
.getValue(state);
|
.getValue(state);
|
||||||
s_log.debug(" Site default frontpage ID is: " + siteDefaultRootPageID
|
s_log.debug(" Site default frontpage ID is: " + siteDefaultRootPageID
|
||||||
+ ", selected frontpage Value is: "
|
+ ", selected frontpage Value is: "
|
||||||
+ subsiteSelectedFrontpage);
|
+ subsiteSelectedFrontpage);
|
||||||
Application frontpageApp;
|
Application frontpageApp;
|
||||||
if (subsiteSelectedFrontpage.equals(DEFAULT_APP)) {
|
if (subsiteSelectedFrontpage.equals(DEFAULT_APP)) {
|
||||||
s_log.debug("About to create frontpage app ID: " + DEFAULT_APP);
|
s_log.debug("About to create frontpage app ID: " + DEFAULT_APP);
|
||||||
frontpageApp = Application
|
frontpageApp = Application
|
||||||
.retrieveApplication(siteDefaultRootPageID);
|
.retrieveApplication(siteDefaultRootPageID);
|
||||||
} else {
|
} else {
|
||||||
s_log.debug("About to create frontpage app ID: "
|
s_log.debug("About to create frontpage app ID: "
|
||||||
+ subsiteSelectedFrontpage);
|
+ subsiteSelectedFrontpage);
|
||||||
frontpageApp = Application
|
frontpageApp = Application
|
||||||
.retrieveApplication(new BigDecimal(subsiteSelectedFrontpage));
|
.retrieveApplication(new BigDecimal(subsiteSelectedFrontpage));
|
||||||
}
|
}
|
||||||
Assert.exists(frontpageApp, Application.class);
|
Assert.exists(frontpageApp, Application.class);
|
||||||
s_log.debug("Created frontpage app ID: " + frontpageApp.getID());
|
s_log.debug("Created frontpage app ID: " + frontpageApp.getID());
|
||||||
|
|
@ -431,7 +431,7 @@ public class SiteForm extends Form {
|
||||||
// subsite with an added comment:
|
// subsite with an added comment:
|
||||||
// "NB, explicitly don't set cat on shared front page!"
|
// "NB, explicitly don't set cat on shared front page!"
|
||||||
s_log.debug("Front page application ID: "
|
s_log.debug("Front page application ID: "
|
||||||
+ frontpageApp.getID());
|
+ frontpageApp.getID());
|
||||||
s_log.debug("About to set cat on dedicated front page.");
|
s_log.debug("About to set cat on dedicated front page.");
|
||||||
Category.setRootForObject(frontpageApp, root);
|
Category.setRootForObject(frontpageApp, root);
|
||||||
|
|
||||||
|
|
@ -461,7 +461,7 @@ public class SiteForm extends Form {
|
||||||
m_site.clearSelection(state);
|
m_site.clearSelection(state);
|
||||||
|
|
||||||
Application app = Application
|
Application app = Application
|
||||||
.retrieveApplicationForPath("/navigation/");
|
.retrieveApplicationForPath("/navigation/");
|
||||||
Category.setRootForObject(app,
|
Category.setRootForObject(app,
|
||||||
root,
|
root,
|
||||||
site.getTemplateContext().getContext());
|
site.getTemplateContext().getContext());
|
||||||
|
|
@ -471,7 +471,7 @@ public class SiteForm extends Form {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private class FrontpageAppListener implements PrintListener {
|
private class FrontpageAppListener implements PrintListener {
|
||||||
|
|
||||||
|
|
@ -481,14 +481,16 @@ public class SiteForm extends Form {
|
||||||
ApplicationCollection customApps;
|
ApplicationCollection customApps;
|
||||||
|
|
||||||
// target.addOption(new Option(SELECT_APP, SELECT_APP_LABEL));
|
// 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()
|
String[] customAppTypes = (String[]) Subsite.getConfig()
|
||||||
.getFrontPageApplicationTypes();
|
.getFrontPageApplicationTypes();
|
||||||
if (customAppTypes != null) {
|
if (customAppTypes != null) {
|
||||||
for (int i = 0; i < customAppTypes.length; i++) {
|
for (int i = 0; i < customAppTypes.length; i++) {
|
||||||
customApps = Application.retrieveAllApplications(
|
customApps = Application.retrieveAllApplications(
|
||||||
customAppTypes[i]);
|
customAppTypes[i]);
|
||||||
while (customApps.next()) {
|
while (customApps.next()) {
|
||||||
/* Create an entry for each application, consisting
|
/* Create an entry for each application, consisting
|
||||||
* of the (BigDecimal) ID as value and the URL as
|
* of the (BigDecimal) ID as value and the URL as
|
||||||
|
|
@ -507,7 +509,7 @@ public class SiteForm extends Form {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private class ThemesListener implements PrintListener {
|
private class ThemesListener implements PrintListener {
|
||||||
|
|
||||||
|
|
@ -516,7 +518,9 @@ public class SiteForm extends Form {
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
Map themes = Subsite.getConfig().getThemes();
|
Map themes = Subsite.getConfig().getThemes();
|
||||||
Set entrySet = themes.entrySet();
|
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) {
|
if (entrySet != null) {
|
||||||
Iterator entries = entrySet.iterator();
|
Iterator entries = entrySet.iterator();
|
||||||
while (entries.hasNext()) {
|
while (entries.hasNext()) {
|
||||||
|
|
@ -530,4 +534,5 @@ public class SiteForm extends Form {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,3 +25,5 @@ subsite.ui.edit=Edit
|
||||||
subsite.ui.delete=Delete
|
subsite.ui.delete=Delete
|
||||||
subsite.ui.delete.confirm=Are you sure to delete the subsite {0}?
|
subsite.ui.delete.confirm=Are you sure to delete the subsite {0}?
|
||||||
subsite.ui.no_subsites=No subites defined
|
subsite.ui.no_subsites=No subites defined
|
||||||
|
subsite.ui.default_app_label=Site Wide Default
|
||||||
|
subsite.ui.default_style_label=Site Wide Default
|
||||||
|
|
|
||||||
|
|
@ -25,3 +25,5 @@ subsite.ui.edit=Bearbeiten
|
||||||
subsite.ui.delete=L\u00f6schen
|
subsite.ui.delete=L\u00f6schen
|
||||||
subsite.ui.delete.confirm=Sind Sie sicher, dass Sie die Subsite {0} l\u00f6schen wollen?
|
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.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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue