Weiter Verbesserungen Lokalisierung, einfügen von setHint() zu Titel, Name und Beschreibung bei Bookmark, Arikel, Agenda MPA.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2245 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2013-07-05 08:24:11 +00:00
parent d03a076b08
commit 3c7e8ddbc3
28 changed files with 427 additions and 134 deletions

View File

@ -46,7 +46,11 @@ import java.util.Map;
import org.apache.log4j.Logger;
/**
* Component displays an "attach new images" screen composed of a listing of
* images of the system to select from and a link to upload a new image. It is
* part of the entry point image authoring step {@see ImageStep}.
*
* It doesn't engage a lot of its own logik but uses CMS default image classes.
*
* @author unknown
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de>
@ -61,7 +65,7 @@ public class ImageStepEdit extends SimpleContainer
private final ImageComponentAttachListener m_attachListener;
/**
* Creates a new ImageStepEdit form.
* Constructor, creates a new ImageStepEdit form.
*
* @param step the parent {@link ImageStep} form
*/
@ -100,6 +104,10 @@ public class ImageStepEdit extends SimpleContainer
}
/**
*
* @param p
*/
@Override
public void register(Page p) {
super.register(p);
@ -124,6 +132,11 @@ public class ImageStepEdit extends SimpleContainer
return m_imageComponent.getComponentsMap().values().iterator();
}
/**
*
* @param ps
* @param activeKey
*/
private void setImageComponent(PageState ps, final String activeKey) {
m_imageComponent.setSelectedKey(ps, activeKey);

View File

@ -106,6 +106,8 @@ public class AgendaPropertyForm extends BasicPageForm
TextArea summary = new TextArea(summaryParam);
summary.setCols(40);
summary.setRows(5);
summary.setHint(AgendaGlobalizationUtil.globalize(
"cms.contenttypes.ui.summary"));
add(summary);
add(new Label(AgendaGlobalizationUtil

View File

@ -94,6 +94,7 @@ public class ArticlePropertyForm extends GenericArticlePropertyForm
TextArea lead = new TextArea(leadParam);
lead.setCols(40);
lead.setRows(5);
lead.setHint(GlobalizationUtil.globalize("cms.contenttypes.ui.lead_hint"));
add(lead);
}

View File

@ -166,6 +166,8 @@ public abstract class MultiPartArticleForm extends FormSection
}
summaryWidget.setRows(5);
summaryWidget.setCols(30);
summaryWidget.setHint(GlobalizationUtil.globalize(
"cms.contenttypes.ui.summary_hint"));
add(summaryWidget);
}

View File

@ -36,7 +36,7 @@ cms.contenttypes.ui.homepage=Homepage:
cms.contenttypes.ui.launch_date=Launch Date:
cms.contenttypes.ui.lead=Description:
cms.contenttypes.ui.name=Name (URL stub):
cms.contenttypes.ui.summary=Description:
cms.contenttypes.ui.summary=Summary:
cms.contenttypes.ui.title=Title:
cms.contentasset.image.ui.view_image=view image
@ -308,7 +308,7 @@ cms.ui.authoringkit.component=Component:
cms.ui.authoringkit.content_type_id=Content Type ID#
cms.ui.authoringkit.create_component=Create Component:
cms.ui.authoringkit.createcomponent=CreateComponent:
cms.ui.authoringkit.current_row_does_not_exists=Current row does not exists
cms.ui.authoringkit.current_row_dont_exists=Current row does not exists
cms.ui.authoringkit.description=Description:
cms.ui.authoringkit.description_bundle=Description Bundle
cms.ui.authoringkit.description_key=Description Key
@ -1037,3 +1037,23 @@ cms.contenttyes.link.ui.button_cancel=Cancel
cms.contenttyes.link.ui.table_no_entries=There are no links for this content item
cms.contentasset.image.ui.caption=Caption:
cms.contentasset.image.ui.use_context=Use Context:
cms.contentasset.image.ui.type=Image Type
cms.contentasset.image.ui.table.link_select=select
cms.contentasset.image.ui.delete_link=delete
cms.contentasset.image.ui.table.header_thumb=Thumbnail
cms.contentasset.image.ui.table.header_name=Name
cms.contentasset.image.ui.table.header_size=Size
cms.contentasset.image.ui.table.header_type=Type
cms.contentasset.image.ui.table.header_action_select=Action
cms.contentasset.image.ui.table.link_delete=Remove from the system
cms.contentasset.image.ui.table.header_action_delete=Delete from the system
cms.contentasset.image.ui.display.name=Name:
cms.contentasset.image.ui.display.type=Image Type:
cms.contentasset.image.ui.display.width=Width:
cms.contentasset.image.ui.display.height=Height:
cms.ui.description_hint=A short characterization of this item. You should limit the text to 2-3 senentces. By default the description is displayed along with the title in every item list.
cms.contenttypes.ui.lead_hint=A short characterization of this item. You should limit the text to 2-3 senentces. By default the description is displayed along with the title in every item list.
cms.contenttypes.ui.description_hint=A short characterization of this item. You should limit the text to 2-3 senentces. By default the description is displayed along with the title in every item list.
cms.contenttypes.ui.summary_hint=Propably 3-4 sentences to characterize the most important and interesting aspects of the item. By default it will be displayed along with the title in all item list, making up an rich information site.
cms.contenttypes.ui.title_hint=The title of the item readable by the user. Besides special circumstances, should not exceed 2 text lines.
cms.contenttypes.ui.name_hint=Nicht Teil des Dokumentes wie es Besuchern angezeigt wird. Es handelt sich um den letzten Teil der URL (nach dem letzten "/") und ist somit Teil der Internet Addresse dieses Dokumentes. Es wird oben im Adressfeld des Browsers angezeigt. Es wird automatisch aus dem Titel generiert, wobei unzul\u00e4ssige Zeichen ersetzt werden. Bei einem sehr langen Titel kann eine manuelle K\u00fcrzung sinnvoll sein, um \u00fcberlange Adresszeilen zu vermeiden.

View File

@ -36,7 +36,7 @@ cms.contenttypes.ui.homepage=Homepage:
cms.contenttypes.ui.launch_date=Ver\u00f6ffentlichungsdatum:
cms.contenttypes.ui.lead=Beschreibung (Lead Text):
cms.contenttypes.ui.name=Name (als Teil-URL):
cms.contenttypes.ui.summary=Beschreibung:
cms.contenttypes.ui.summary=Zusammenfassung:
cms.contenttypes.ui.title=Titel:
cms.contentasset.image.ui.view_image=Bild anzeigen
@ -305,7 +305,7 @@ cms.ui.authoringkit.component=Komponente:
cms.ui.authoringkit.content_type_id=Dokumententyp ID#
cms.ui.authoringkit.create_component=Komponente erstellen:
cms.ui.authoringkit.createcomponent=Komponentenerstellung:
cms.ui.authoringkit.current_row_does_not_exists=Aktuelle Zeile existiert nicht
cms.ui.authoringkit.current_row_dont_exists=Aktuelle Zeile existiert nicht
cms.ui.authoringkit.description=Beschreibung:
cms.ui.authoringkit.description_bundle=Beschreibung Bundle
cms.ui.authoringkit.description_key=Beschreibung Key
@ -1032,3 +1032,23 @@ cms.contenttyes.link.ui.button_cancel=Abbruch
cms.contenttyes.link.ui.table_no_entries=Es sind noch keine Links zugeordnet.
cms.contentasset.image.ui.caption=Bildunterschrift:
cms.contentasset.image.ui.use_context=Kontext:
cms.contentasset.image.ui.type=Bild Typ
cms.contentasset.image.ui.table.link_select=ausw\u00e4hlen
cms.contentasset.image.ui.delete_link=l\u00f6schen
cms.contentasset.image.ui.table.header_thumb=Vorschau
cms.contentasset.image.ui.table.header_name=Name
cms.contentasset.image.ui.table.header_size=Gr\u00f6\u00dfe
cms.contentasset.image.ui.table.header_type=Typ
cms.contentasset.image.ui.table.header_action_select=Aktion
cms.contentasset.image.ui.table.link_delete=Aus dem System endg\u00fcltig l\u00f6schen
cms.contentasset.image.ui.table.header_action_delete=Aus dem System l\u00f6schen
cms.contentasset.image.ui.display.name=Name:
cms.contentasset.image.ui.display.type=Bild Typ:
cms.contentasset.image.ui.display.width=Breite:
cms.contentasset.image.ui.display.height=H\u00f6he:
cms.ui.description_hint=Eine kurze Charakterisierung des Dokumentes, nach M\u00f6glichkeit nicht l\u00e4nger als 2-3 S\u00e4tze. Standardm\u00e4\u00dfig wird die Beschreibung zusammen mit dem Titel in allen Dokumentenliste angezeigt, um so Seiten mit hohem Informationsgehalt zu erzeugen.
cms.contenttypes.ui.lead_hint=Eine kurze Charakterisierung des Dokumentes, nach M\u00f6glichkeit nicht l\u00e4nger als 2-3 S\u00e4tze. Standardm\u00e4\u00dfig wird die Beschreibung zusammen mit dem Titel in allen Dokumentenliste angezeigt, um so Seiten mit hohem Informationsgehalt zu erzeugen.
cms.contenttypes.ui.description_hint=Eine kurze Charakterisierung des Dokumentes, nach M\u00f6glichkeit nicht l\u00e4nger als 2-3 S\u00e4tze. Standardm\u00e4\u00dfig wird die Beschreibung zusammen mit dem Titel in allen Dokumentenliste angezeigt, um so Seiten mit hohem Informationsgehalt zu erzeugen.
cms.contenttypes.ui.summary_hint=Nach M\u00f6glichkeit maximal 3-4 S\u00e4tze zur Charakterisierung der wichtigsten und f\u00fcr Leser interessantesten Aspekte des Dokuments. Standardm\u00e4\u00dfig wird die Beschreibung zusammen mit dem Titel in allen Dokumentenliste angezeigt, um so Seiten mit hohem Informationsgehalt zu erzeugen.
cms.contenttypes.ui.title_hint=Titel des Dokuments wie ihn Besucher lesen sollen. Abgesehen von Sonderf\u00e4llen sollten 2 Zeilen auf keinen Fall \u00fcberschritten werden. Eine Beschr\u00e4nkung auf eine Zeile ist vorzuziehen. Der Titel wird jedesmal zusammen mit dem Dokument angezeigt.
cms.contenttypes.ui.name_hint=Not part of the item as displayed to the user. It is the last part of the URL (after the last "/") and is part of the internet address of this item. It is displayed in the browsers address field. Made up automatically using the title, illegal characters replaced. With a long title you may choose to shorten it to avoid overly long internet addresses.

View File

@ -85,3 +85,23 @@ cms.contenttyes.link.ui.button_cancel=Cancel
cms.contenttyes.link.ui.table_no_entries=There are no links for this content item
cms.contentasset.image.ui.caption=Caption:
cms.contentasset.image.ui.use_context=Use Context:
cms.contentasset.image.ui.type=Image Type
cms.contentasset.image.ui.table.link_select=select
cms.contentasset.image.ui.delete_link=delete
cms.contentasset.image.ui.table.header_thumb=Thumbnail
cms.contentasset.image.ui.table.header_name=Name
cms.contentasset.image.ui.table.header_size=Size
cms.contentasset.image.ui.table.header_type=Type
cms.contentasset.image.ui.table.header_action_select=Action
cms.contentasset.image.ui.table.link_delete=Remove from the system
cms.contentasset.image.ui.table.header_action_delete=Delete from the system
cms.contentasset.image.ui.display.name=Name:
cms.contentasset.image.ui.display.type=Image Type:
cms.contentasset.image.ui.display.width=Width:
cms.contentasset.image.ui.display.height=Height:
cms.ui.description_hint=A short characterization of this item. You should limit the text to 2-3 senentces. By default the description is displayed along with the title in every item list.
cms.contenttypes.ui.lead_hint=A short characterization of this item. You should limit the text to 2-3 senentces. By default the description is displayed along with the title in every item list.
cms.contenttypes.ui.description_hint=A short characterization of this item. You should limit the text to 2-3 senentces. By default the description is displayed along with the title in every item list.
cms.contenttypes.ui.summary_hint=Propably 3-4 sentences to characterize the most important and interesting aspects of the item. By default it will be displayed along with the title in all item list, making up an rich information site.
cms.contenttypes.ui.title_hint=The title of the item readable by the user. Besides special circumstances, should not exceed 2 text lines.
cms.contenttypes.ui.name_hint=Not part of the item as displayed to the user. It is the last part of the URL (after the last "/") and is part of the internet address of this item. It is displayed in the browsers address field. Made up automatically using the title, illegal characters replaced. With a long title you may choose to shorten it to avoid overly long internet addresses.

View File

@ -198,7 +198,7 @@ cms.ui.authoringkit.component=Composant
cms.ui.authoringkit.content_type_id=Type de contenu ID#
cms.ui.authoringkit.create_component=Cr\u00e9er le composant
cms.ui.authoringkit.createcomponent=Cr\u00e9er le composant
cms.ui.authoringkit.current_row_does_not_exists=La ligne en cours n'exsite pas
cms.ui.authoringkit.current_row_dont_exists=La ligne en cours n'exsite pas
cms.ui.authoringkit.description=Description
cms.ui.authoringkit.do_you_really_want_to_delete_this_authoring_step=Etes-vous sur de vouloir effacer cette \u00e9tape d'\u00e9criture ?
cms.ui.authoringkit.label=Etiquette
@ -559,3 +559,23 @@ cms.contenttyes.link.ui.button_cancel=Cancel
cms.contenttyes.link.ui.table_no_entries=There are no links for this content item
cms.contentasset.image.ui.caption=Caption:
cms.contentasset.image.ui.use_context=Use Context:
cms.contentasset.image.ui.type=Image Type
cms.contentasset.image.ui.table.link_select=select
cms.contentasset.image.ui.delete_link=delete
cms.contentasset.image.ui.table.header_thumb=Thumbnail
cms.contentasset.image.ui.table.header_name=Name
cms.contentasset.image.ui.table.header_size=Size
cms.contentasset.image.ui.table.header_type=Type
cms.contentasset.image.ui.table.header_action_select=Action
cms.contentasset.image.ui.table.link_delete=Remove from the system
cms.contentasset.image.ui.table.header_action_delete=Delete from the system
cms.contentasset.image.ui.display.name=Name:
cms.contentasset.image.ui.display.type=Image Type:
cms.contentasset.image.ui.display.width=Width:
cms.contentasset.image.ui.display.height=Height:
cms.ui.description_hint=A short characterization of this item. You should limit the text to 2-3 senentces. By default the description is displayed along with the title in every item list.
cms.contenttypes.ui.lead_hint=A short characterization of this item. You should limit the text to 2-3 senentces. By default the description is displayed along with the title in every item list.
cms.contenttypes.ui.description_hint=A short characterization of this item. You should limit the text to 2-3 senentces. By default the description is displayed along with the title in every item list.
cms.contenttypes.ui.summary_hint=Propably 3-4 sentences to characterize the most important and interesting aspects of the item. By default it will be displayed along with the title in all item list, making up an rich information site.
cms.contenttypes.ui.title_hint=The title of the item readable by the user. Besides special circumstances, should not exceed 2 text lines.
cms.contenttypes.ui.name_hint=Not part of the item as displayed to the user. It is the last part of the URL (after the last "/") and is part of the internet address of this item. It is displayed in the browsers address field. Made up automatically using the title, illegal characters replaced. With a long title you may choose to shorten it to avoid overly long internet addresses.

View File

@ -60,7 +60,7 @@ public class GenericArticlePropertiesStep extends SimpleEditStep {
BasicPageForm editSheet;
editSheet = new GenericArticlePropertyForm(itemModel, this);
add(EDIT_SHEET_NAME,
"Edit",
GlobalizationUtil.globalize("cms.ui.edit"),
new WorkflowLockedComponentAccess(editSheet, itemModel),
editSheet.getSaveCancelSection().getCancelButton());
}

View File

@ -52,13 +52,13 @@ public class GenericOrganizationalUnitContactPropertiesStep
new GenericOrganizationalUnitContactAddForm(itemModel,
this);
add(ADD_CONTACT_SHEET_NAME,
(String) ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.genericorgaunit.add_contact").localize(),
ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.genericorgaunit.add_contact"),
new WorkflowLockedComponentAccess(addContactSheet, itemModel),
addContactSheet.getSaveCancelSection().getCancelButton());
GenericOrganizationalUnitContactTable contactsTable = new GenericOrganizationalUnitContactTable(
itemModel, this);
GenericOrganizationalUnitContactTable contactsTable = new
GenericOrganizationalUnitContactTable(itemModel, this);
setDisplayComponent(contactsTable);
}

View File

@ -57,14 +57,13 @@ public class GenericOrganizationalUnitPersonPropertiesStep
new GenericOrganizationalUnitPersonAddForm(itemModel,
this);
add(ADD_PERSON_SHEET_NAME,
(String) ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.genericorgaunit.add_person").localize(),
ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.genericorgaunit.add_person"),
new WorkflowLockedComponentAccess(addPersonSheet, itemModel),
addPersonSheet.getSaveCancelSection().getCancelButton());
GenericOrganizationalUnitPersonsTable personsTable = new GenericOrganizationalUnitPersonsTable(
itemModel,
this);
GenericOrganizationalUnitPersonsTable personsTable = new
GenericOrganizationalUnitPersonsTable(itemModel,this);
setDisplayComponent(personsTable);
}

View File

@ -28,16 +28,18 @@ import com.arsdigita.bebop.event.TableActionAdapter;
import com.arsdigita.bebop.event.TableActionEvent;
import com.arsdigita.bebop.table.DefaultTableCellRenderer;
import com.arsdigita.bebop.table.TableCellRenderer;
import com.arsdigita.bebop.table.TableColumn;
import com.arsdigita.bebop.table.TableColumnModel;
import com.arsdigita.bebop.table.TableModel;
import com.arsdigita.bebop.table.TableModelBuilder;
import com.arsdigita.cms.CMS;
import com.arsdigita.cms.ImageAsset;
import com.arsdigita.cms.SecurityManager;
import com.arsdigita.cms.Service;
import com.arsdigita.cms.util.GlobalizationUtil;
import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.mimetypes.MimeType;
import com.arsdigita.mimetypes.image.ImageSizer;
import com.arsdigita.persistence.OID;
import com.arsdigita.util.LockableImpl;
import com.arsdigita.web.URL;
@ -66,24 +68,36 @@ import org.apache.log4j.Logger;
*/
public class ImageBrowser extends Table {
private static final Logger s_log = Logger.getLogger(ImageBrowser.class);
private ImageBrowserModelBuilder m_builder;
private static final String[] HEADERS = {"Thumbnail", "Name", "Size", "Type", "Action", ""};
// match columns by (symbolic) index, makes for easier reordering
/** Index into TableColumn for Thumb column */
private static final int THUMB = 0;
/** Index into TableColumn for Name column */
private static final int NAME = 1;
/** Index into TableColumn for Size column */
private static final int SIZE = 2;
/** Index into TableColumn for Type column */
private static final int TYPE = 3;
private static final int LINK = 4;
/** Index into TableColumn for Select link column */
private static final int SELECT = 4;
/** Index into TableColumn for Delete link column */
private static final int DELETE = 5;
private int m_numColumns = -1;
private int m_mode;
private Dimension m_thumbSize;
private static final Logger s_log = Logger.getLogger(ImageBrowser.class);
/**
* Construct a new ImageBrowser with default mode.
*
* @param builder the {@link ImageBrowserModelBuilder} that will supply this
* component with its {@link ImageBrowserModel} during each request
* component with its {@link ImageBrowserModel} during each
* request
*/
public ImageBrowser(ImageBrowserModelBuilder b) {
@ -91,27 +105,63 @@ public class ImageBrowser extends Table {
}
/**
* Construct a new ImageBrowser with requested mode.
* Construct a new ImageBrowser table with requested mode.
*
* @param builder the {@link ImageBrowserModelBuilder} that will supply this
* component with its {@link ImageBrowserModel} during each request
* component with its {@link ImageBrowserModel} during each
* request
* @param mode the component mode (see {@link ImageComponent})
*/
public ImageBrowser(ImageBrowserModelBuilder b, int mode) {
super(new BuilderAdapter(b), HEADERS);
super(); // Create an empty table
m_builder = b;
m_mode = mode;
setThumbnailSize(CMS.getConfig().getImageBrowserThumbnailMaxWidth(),
CMS.getConfig().getImageBrowserThumbnailMaxHeight());
m_builder = b;
getHeader().setDefaultRenderer(new DefaultTableCellRenderer(false));
addColumn(new ThumbnailCellRenderer());
addColumn(new DefaultTableCellRenderer(false));
addColumn(new DefaultTableCellRenderer(false));
addColumn(new DefaultTableCellRenderer(false));
addColumn(new SelectCellRenderer());
addColumn(new DeleteCellRenderer());
/* Add columns and column header to the yet empty table */
TableColumnModel model = getColumnModel();
model.add(new TableColumn(
THUMB,
new Label(GlobalizationUtil.globalize(
"cms.contentasset.image.ui.table.header_thumb")
) ));
model.add(new TableColumn(
NAME,
new Label(GlobalizationUtil.globalize(
"cms.contentasset.image.ui.table.header_name")
) ));
model.add(new TableColumn(
SIZE,
new Label(GlobalizationUtil.globalize(
"cms.contentasset.image.ui.table.header_size")
) ));
model.add(new TableColumn(
TYPE,
new Label(GlobalizationUtil.globalize(
"cms.contentasset.image.ui.table.header_type")
) ));
model.add(new TableColumn(
SELECT,
new Label(GlobalizationUtil.globalize(
"cms.contentasset.image.ui.table.header_action_select")
) ));
model.add(new TableColumn( // Temporary not used due to consistency
DELETE, null // probs with images probably in use
// new Label(GlobalizationUtil.globalize(
// "cms.contentasset.image.ui.table.header_action_delete"))
));
model.get(THUMB).setCellRenderer(new ThumbnailCellRenderer());
model.get(NAME).setCellRenderer(new DefaultTableCellRenderer(false));
model.get(SIZE).setCellRenderer(new DefaultTableCellRenderer(false));
model.get(TYPE).setCellRenderer(new DefaultTableCellRenderer(false));
model.get(SELECT).setCellRenderer(new SelectCellRenderer());
model.get(DELETE).setCellRenderer(new DeleteCellRenderer());
setModelBuilder(new BuilderAdapter(b));
setCellPadding("4");
setBorder("1");
@ -119,13 +169,6 @@ public class ImageBrowser extends Table {
setClassAttr("imageBrowser");
}
/**
*
* @param renderer
*/
private void addColumn(TableCellRenderer renderer) {
getColumn(++m_numColumns).setCellRenderer(renderer);
}
/**
*
@ -181,10 +224,12 @@ public class ImageBrowser extends Table {
@Override
public void cellSelected(TableActionEvent e) {
int c = e.getColumn().intValue();
if (c == LINK) {
linkClicked(e.getPageState(), new BigDecimal((String) e.getRowKey()));
if (c == SELECT) {
linkClicked(e.getPageState(),
new BigDecimal((String) e.getRowKey()));
} else if (c == DELETE) {
deleteClicked(e.getPageState(), new BigDecimal((String) e.getRowKey()));
deleteClicked(e.getPageState(),
new BigDecimal((String) e.getRowKey()));
}
}
@ -206,9 +251,13 @@ public class ImageBrowser extends Table {
String url = Service.getImageURL(a);
// Sets url paramter to resize the images server-side
String resizeParam = "&maxWidth=" + new Double(m_thumbSize.getWidth()).intValue() + "&maxHeight=" + new Double(m_thumbSize.getHeight()).intValue();
String resizeParam = "&maxWidth="
+ new Double(m_thumbSize.getWidth()).intValue()
+ "&maxHeight="
+ new Double(m_thumbSize.getHeight()).intValue();
Image img = new Image(URL.getDispatcherPath() + url + resizeParam, a.getName());
Image img = new Image(URL.getDispatcherPath() + url
+ resizeParam, a.getName());
img.setBorder("0");
return new Link(img, url);
@ -224,16 +273,30 @@ public class ImageBrowser extends Table {
super(true);
}
/**
*
* @param table
* @param state
* @param value
* @param isSelected
* @param key
* @param row
* @param column
* @return
*/
@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) {
if (m_mode == ImageComponent.SELECT_IMAGE || m_mode == ImageComponent.ATTACH_IMAGE) {
return super.getComponent(table, state, value, isSelected, key, row, column);
if (m_mode == ImageComponent.SELECT_IMAGE
|| m_mode == ImageComponent.ATTACH_IMAGE) {
return super.getComponent(table, state, value,
isSelected, key, row, column);
}
return new Label("");
// return new Label(""); // this variant is deprecated!
return new Label();
}
}
@ -247,6 +310,17 @@ public class ImageBrowser extends Table {
super(true);
}
/**
*
* @param table
* @param state
* @param value
* @param isSelected
* @param key
* @param row
* @param column
* @return
*/
@Override
public Component getComponent(Table table, PageState state, Object value,
boolean isSelected, Object key,
@ -258,7 +332,8 @@ public class ImageBrowser extends Table {
boolean canDelete = false;
// SecurityManager sm = Utilities.getSecurityManager(state);
SecurityManager sm = CMS.getSecurityManager(state);
if (sm.canAccess(state.getRequest(), SecurityManager.DELETE_IMAGES)) {
if (sm.canAccess(state.getRequest(),
SecurityManager.DELETE_IMAGES)) {
try {
ImageAsset asset = (ImageAsset) DomainObjectFactory
.newInstance(new
@ -286,7 +361,9 @@ public class ImageBrowser extends Table {
column);
}
}
return new Label("");
// return (Component) null; // used to work for other tables but
// doesn't here for some reason.
return new Label();
}
}
@ -378,11 +455,19 @@ public class ImageBrowser extends Table {
return m.getMimeType();
case ImageBrowser.LINK:
return "select";
case ImageBrowser.SELECT:
// Due to current design has to be a string! Localisation
// works here nevertheless.
return (String) GlobalizationUtil.globalize(
"cms.contentasset.image.ui.table.link_select")
.localize();
case ImageBrowser.DELETE:
return "delete";
// Due to current design has to be a string! Localisation
// works here nevertheless.
return (String) GlobalizationUtil.globalize(
"cms.contentasset.image.ui.table.link_delete")
.localize();
default:
return null;

View File

@ -27,9 +27,12 @@ import org.apache.log4j.Logger;
*
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de>
*/
public abstract class ImageComponentAbstractListener implements FormInitListener, FormProcessListener, FormSubmissionListener {
public abstract class ImageComponentAbstractListener implements FormInitListener,
FormProcessListener,
FormSubmissionListener {
private static final Logger s_log = Logger.getLogger(ImageComponentSelectListener.class);
private static final Logger s_log = Logger.getLogger(
ImageComponentSelectListener.class);
MapComponentSelectionModel m_imageComponent;
public ImageComponentAbstractListener(MapComponentSelectionModel imageComponent) {
@ -62,7 +65,9 @@ public abstract class ImageComponentAbstractListener implements FormInitListener
}
/**
* Call {@link #processImage(com.arsdigita.bebop.event.FormSectionEvent, com.arsdigita.bebop.PageState, com.arsdigita.cms.ui.ImageComponent, com.arsdigita.cms.ReusableImageAsset) }
* Call {@link #processImage(com.arsdigita.bebop.event.FormSectionEvent,
* com.arsdigita.bebop.PageState, com.arsdigita.cms.ui.ImageComponent,
* com.arsdigita.cms.ReusableImageAsset) }
* if the save button was pressed.
*
* @param event the {@link FormSectionEvent}

View File

@ -19,10 +19,12 @@ import org.apache.log4j.Logger;
*/
public class ImageComponentSelectListener extends ImageComponentAbstractListener {
private static final Logger S_LOG = Logger.getLogger(ImageComponentSelectListener.class);
private static final Logger S_LOG = Logger.getLogger(
ImageComponentSelectListener.class);
private final ImageSelectResultComponent m_resultPane;
public ImageComponentSelectListener(MapComponentSelectionModel imageComponent, ImageSelectResultComponent resultPane) {
public ImageComponentSelectListener(MapComponentSelectionModel imageComponent,
ImageSelectResultComponent resultPane) {
super(imageComponent);
m_resultPane = resultPane;
}
@ -33,7 +35,17 @@ public class ImageComponentSelectListener extends ImageComponentAbstractListener
m_resultPane.reset(ps);
}
protected void processImage(FormSectionEvent event, PageState ps, ImageComponent component, ReusableImageAsset image) {
/**
*
* @param event
* @param ps
* @param component
* @param image
*/
protected void processImage(FormSectionEvent event,
PageState ps,
ImageComponent component,
ReusableImageAsset image) {
m_imageComponent.setSelectedKey(ps, ImageSelectPage.RESULT);
m_resultPane.reset(ps);
}

View File

@ -24,6 +24,7 @@ import com.arsdigita.cms.CMS;
import com.arsdigita.cms.ImageAsset;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.Service;
import com.arsdigita.cms.util.GlobalizationUtil;
import com.arsdigita.mimetypes.MimeType;
import com.arsdigita.util.Assert;
import com.arsdigita.web.URL;
@ -35,10 +36,6 @@ import java.math.BigDecimal;
* Displays a single ImageAsset, showing its image, width, height,
* name and mime-type.
*
* TODO: Method generateImagePropertiesXML currently just generates the
* property values. The labels (including localization) are handled by the
* theme. Has to be refactord to provide labels including localization as well.
*
* @author Michael Pih (pihman@arsdigita.com)
* @author Stanislav Freidin (sfreidin@arsdigita.com)
* @version $Id: ImageDisplay.java 287 2005-02-22 00:29:02Z sskracic $
@ -93,9 +90,7 @@ public class ImageDisplay extends SimpleComponent {
}
/**
* Generates the property xml. The xml contains no labels for meta date as
* name, type, width, and height. Labels are currently handled by theme!
* A proper localization has to be done in theme as well!
* Generates the property xml.
*
* @param image
* @param state
@ -104,23 +99,44 @@ public class ImageDisplay extends SimpleComponent {
protected void generateImagePropertiesXML(ImageAsset image,
PageState state,
Element element) {
element.addAttribute("name_label", (String)GlobalizationUtil.globalize(
"cms.contentasset.image.ui.display.name")
.localize());
element.addAttribute("name", image.getName());
element.addAttribute("src", URL.getDispatcherPath() +
Service.getImageURL(image));
element.addAttribute("mime_type_label", (String)GlobalizationUtil.globalize(
"cms.contentasset.image.ui.display.type")
.localize());
MimeType mimeType = image.getMimeType();
if ( mimeType != null ) {
element.addAttribute("mime_type", mimeType.getLabel());
}
element.addAttribute("width_label", (String)GlobalizationUtil.globalize(
"cms.contentasset.image.ui.display.width")
.localize());
BigDecimal width = image.getWidth();
if ( width != null ) {
element.addAttribute("width", width.toString());
} else {
element.addAttribute("width", (String)GlobalizationUtil.globalize(
"cms.ui.unknown")
.localize());
}
element.addAttribute("height_label", (String)GlobalizationUtil.globalize(
"cms.contentasset.image.ui.display.height")
.localize());
BigDecimal height = image.getHeight();
if ( height != null ) {
element.addAttribute("height", height.toString());
} else {
element.addAttribute("height", (String)GlobalizationUtil.globalize(
"cms.ui.unknown")
.localize());
}
}

View File

@ -35,7 +35,8 @@ import java.math.BigDecimal;
* @author unknown
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de>
*/
public class ImageLibraryComponent extends SimpleContainer implements ImageComponent, Resettable {
public class ImageLibraryComponent extends SimpleContainer
implements ImageComponent, Resettable {
private final ImageChooser m_chooser;
private final ItemSelectionModel m_imageModel;

View File

@ -18,7 +18,8 @@ import com.arsdigita.xml.Element;
*
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de>
*/
public class ImageSelectResultComponent extends SimpleContainer implements Resettable {
public class ImageSelectResultComponent extends SimpleContainer
implements Resettable {
boolean m_valid = false;
ImageAsset m_image;
@ -32,7 +33,10 @@ public class ImageSelectResultComponent extends SimpleContainer implements Reset
*
* @param iamge an {@link ImageAsset}
*/
public void setResult(final ImageAsset image/*, final String name, final BigDecimal id, final BigDecimal width, final BigDecimal height*/) {
public void setResult(final ImageAsset image/*, final String name,
* final BigDecimal id,
* final BigDecimal width,
* final BigDecimal height*/) {
m_image = image;
m_valid = (m_image != null);
}

View File

@ -58,11 +58,12 @@ public class ImageUploadComponent extends Form implements ImageComponent {
super("imageUploadComponent", new ColumnPanel(2));
m_mode = mode;
setEncType("multipart/form-data");
// Ignoring deprecated constructor.
m_imageFile = new FileUploadSection("Image Type",
m_imageFile = new FileUploadSection(GlobalizationUtil.globalize(
"cms.contentasset.image.ui.type"),
"image",
ImageAsset.MIME_JPEG);
m_imageFile.getFileUploadWidget().addValidationListener(new NotNullValidationListener());
m_imageFile.getFileUploadWidget()
.addValidationListener(new NotNullValidationListener());
add(m_imageFile, ColumnPanel.FULL_WIDTH);
// Initialize all widgets
@ -123,7 +124,8 @@ public class ImageUploadComponent extends Form implements ImageComponent {
return m_saveCancel;
}
public ReusableImageAsset getImage(FormSectionEvent event) throws FormProcessException {
public ReusableImageAsset getImage(FormSectionEvent event)
throws FormProcessException {
PageState ps = event.getPageState();
String filename = (String) m_imageFile.getFileName(event);
File imageFile = m_imageFile.getFile(event);

View File

@ -56,7 +56,8 @@ public class ImagesPane extends LayoutPanel implements Resettable {
public ImagesPane() {
super();
m_model = new ResettableParameterSingleSelectionModel(new StringParameter(List.SELECTED));
m_model = new ResettableParameterSingleSelectionModel(new
StringParameter(List.SELECTED));
m_model.setDefaultSelection(ImageComponent.LIBRARY);
m_model.addChangeListener(new ImageAdminSelectionListener());
@ -210,7 +211,8 @@ public class ImagesPane extends LayoutPanel implements Resettable {
}
public Object getElement() {
return GlobalizationUtil.globalize("cms.ui.image_" + m_keys.get(m_index)).localize();
return GlobalizationUtil.globalize(
"cms.ui.image_" + m_keys.get(m_index)).localize();
}
public String getKey() {
@ -218,7 +220,8 @@ public class ImagesPane extends LayoutPanel implements Resettable {
}
}
private class ImageAdminListModelBuilder extends LockableImpl implements ListModelBuilder {
private class ImageAdminListModelBuilder extends LockableImpl
implements ListModelBuilder {
public ListModel makeModel(final List list, final PageState state) {
ArrayList<String> keys = new ArrayList(2);
@ -242,7 +245,9 @@ public class ImagesPane extends LayoutPanel implements Resettable {
S_LOG.debug("The selection model is selected; displaying "
+ "the item pane");
ImagesPane.this.setActiveImageComponent(state, state.getControlEventValue());
ImagesPane.this.setActiveImageComponent(
state,
state.getControlEventValue());
}
}
}

View File

@ -49,10 +49,11 @@ public abstract class AuthoringKitSelector extends SimpleContainer {
ContentTypeCollection m_types;
/**
* Construct a new AuthoringKitSelector. Load all the possible authoring kits from the database and construct
* components for them.
* Construct a new AuthoringKitSelector. Load all the possible authoring kits
* from the database and construct components for them.
*
* @param model the {@link ItemSelectionModel} which will supply the selector with the id of a content type
* @param model the {@link ItemSelectionModel} which will supply the selector
* with the id of a content type
*
* @pre itemModel != null
*/
@ -83,8 +84,8 @@ public abstract class AuthoringKitSelector extends SimpleContainer {
}
/**
* Instantiate all the authoring kit wizards. The child class should call this method after it is done with
* initialization
* Instantiate all the authoring kit wizards. The child class should call
* this method after it is done with initialization.
*/
protected void processKit() {
while (m_types.next()) {
@ -103,8 +104,9 @@ public abstract class AuthoringKitSelector extends SimpleContainer {
}
/**
* Instantiate an authoring kit component. Child classes should override this to do the right thing. It is
* permissible for this method to return null.
* Instantiate an authoring kit component. Child classes should override
* this to do the right thing. It is permissible for this method to
* return null.
*
* @param kit for this kit
* @param type for this type

View File

@ -71,13 +71,13 @@ import java.util.ArrayList;
import java.util.Collections;
/**
* <p>This class represents a single authoring kit. The wizard
* accepts a {@link ContentType} in the constructor; it then extracts
* This class represents a single authoring kit. The wizard accepts a
* {@link ContentType} in the constructor; it then extracts
* the {@link AuthoringKit} for the content type, and creates the
* components for all the steps in the kit.</p>
*
* <p>Note that the individual authoring kit steps must provide the
* following constructor:
* Note that the individual authoring kit steps must provide the following
* constructor:
*
* <blockquote><pre><code>
* public TheClass(ItemSelectionModel model, AuthoringKitWizard parent) { ... }
@ -103,7 +103,8 @@ public class AuthoringKitWizard extends LayoutPanel implements Resettable {
ContentType.class
};
//private static final ArrayList s_assets = new ArrayList();
private static final java.util.List<AssetStepEntry> s_assets = new ArrayList<AssetStepEntry>();
private static final java.util.List<AssetStepEntry> s_assets = new
ArrayList<AssetStepEntry>();
private final Object[] m_vals;
private final ContentType m_type;
private final AuthoringKit m_kit;

View File

@ -185,6 +185,7 @@ public abstract class BasicItemForm extends FormSection
titleWidget.setOnKeyUp(
"if (defaulting) { this.form." + NAME
+ ".value = urlize(this.value) }");
titleWidget.setHint(getTitleHint());
add(titleWidget);
// For some content types it is maybe useful to change the label of
@ -201,6 +202,7 @@ public abstract class BasicItemForm extends FormSection
+ "{ defaulting = true; this.value = urlize(this.form." + TITLE
+ ".value) } " + " else { this.value = urlize(this.value); }");
nameWidget.addValidationListener(new NotNullValidationListener());
nameWidget.setHint(getNameHint());
add(nameWidget);
}
@ -428,6 +430,19 @@ public abstract class BasicItemForm extends FormSection
return GlobalizationUtil.globalize("cms.contenttypes.ui.title");
}
/**
* Provides the text for the unser hint providing some detailed information
* how to use this widget.
*
* This method can be overwritten to adjust the text for some content types.
* {@link getTitleLabel()}
*
* @return
*/
protected GlobalizedMessage getTitleHint() {
return GlobalizationUtil.globalize("cms.contenttypes.ui.title_hint");
}
/**
* jensp, 2011-01-28
* This method does the same as {@link #getTitleLabel() } for the label of
@ -438,4 +453,17 @@ public abstract class BasicItemForm extends FormSection
protected GlobalizedMessage getNameLabel() {
return GlobalizationUtil.globalize("cms.contenttypes.ui.name");
}
/**
* Provides the text for the unser hint providing some detailed information
* how to use this widget.
*
* This method can be overwritten to adjust the text for some content types.
* {@link getNameLabel()}
*
* @return
*/
protected GlobalizedMessage getNameHint() {
return GlobalizationUtil.globalize("cms.contenttypes.ui.name_hint");
}
}

View File

@ -37,12 +37,11 @@ import java.math.BigDecimal;
/**
* An invisible component which contains all the
* possible authoring kits. The kits are loaded from the database
* at construction time. The selector chooses which kit to display
* at page rendering time based on the value of the
* content_type state parameter.
* <p>
* An invisible component which contains all the possible authoring kits.
* The kits are loaded from the database at construction time. The selector
* chooses which kit to display at page rendering time based on the value
* of the content_type state parameter.
*
* Essentially, this component is a hack which is used to get around
* the fact that we cannot instantiate stateful components dynamically.
*
@ -54,34 +53,33 @@ public class WizardSelector extends AuthoringKitSelector
private ItemSelectionModel m_itemSel;
/**
* Construct a new WizardSelector. Load all the possible
* authoring kits from the database and construct wizards
* for them.
* Construct a new WizardSelector. Load all the possible authoring kits
* from the database and construct wizards for them.
*
* @param model the {@link ItemSelectionModel} which will
* supply the wizard with its item
* supply the wizard with its item
*
* @param typeModel the {@link ACSObjectSelectionModel} which will
* supply the default content type
* supply the default content type
*
* @pre itemModel != null
*/
public WizardSelector(
ItemSelectionModel model, SingleSelectionModel typeModel
) {
public WizardSelector(ItemSelectionModel model,
SingleSelectionModel typeModel) {
super(typeModel);
m_itemSel = model;
super.processKit();
}
// Get the wizard for the given kit
public Component instantiateKitComponent(
AuthoringKit kit, ContentType type
) {
/**
* Get the wizard for the given kit.
*/
public Component instantiateKitComponent(AuthoringKit kit,
ContentType type) {
ItemSelectionModel itemModel =
new ItemSelectionModel(type,
(BigDecimalParameter)m_itemSel.getStateParameter());
ItemSelectionModel itemModel = new
ItemSelectionModel(type,
(BigDecimalParameter)m_itemSel.getStateParameter());
AuthoringKitWizard w = new AuthoringKitWizard(type, itemModel);
return w;
@ -99,7 +97,9 @@ public class WizardSelector extends AuthoringKitSelector
// Get the current item and extract its content type
if(!m_itemSel.isSelected(state))
throw new RuntimeException( (String) GlobalizationUtil.globalize("cms.ui.authoring.missing_item_id").localize());
throw new RuntimeException( (String) GlobalizationUtil.globalize(
"cms.ui.authoring.missing_item_id")
.localize());
ContentItem item =
(ContentItem)m_itemSel.getSelectedObject(state);
@ -111,7 +111,9 @@ public class WizardSelector extends AuthoringKitSelector
// Try to get the default content type
typeId = (BigDecimal)getComponentSelectionModel().getSelectedKey(state);
if(typeId == null) {
throw new RuntimeException( (String) GlobalizationUtil.globalize("cms.ui.authoring.missing_content_type").localize());
throw new RuntimeException((String) GlobalizationUtil.globalize(
"cms.ui.authoring.missing_content_type")
.localize());
}
} else {
typeId = type.getID();
@ -127,7 +129,9 @@ public class WizardSelector extends AuthoringKitSelector
Component c = getCurrentWizard(state);
if(c == null) {
throw new RuntimeException( (String) GlobalizationUtil.globalize("cms.ui.authoring.no_current_wizard").localize());
throw new RuntimeException( (String) GlobalizationUtil.globalize(
"cms.ui.authoring.no_current_wizard")
.localize());
}
c.generateXML(state, parent);

View File

@ -96,7 +96,8 @@ public class KitPanel extends BoxPanel
//display heading
SimpleContainer heading = new SimpleContainer();
heading.add(new Label(GlobalizationUtil.globalize("cms.ui.authoringkit.authoring_kit_for")));
heading.add(new Label(GlobalizationUtil.globalize(
"cms.ui.authoringkit.authoring_kit_for")));
heading.add(makeContentType());
//edit kit
@ -178,7 +179,8 @@ public class KitPanel extends BoxPanel
//delete step
m_deleteStepPanel = new DeleteStep(m_stepTable.getRowSelectionModel(), m_type);
m_deleteStepPanel = new DeleteStep(m_stepTable.getRowSelectionModel(),
m_type);
m_deleteStepPanel.addProcessListener(clearStepsProcessListener);
m_deleteStepPanel.addSubmissionListener(clearStepsSubmissionListener);
@ -188,7 +190,8 @@ public class KitPanel extends BoxPanel
//create component info
SimpleContainer createComponent = new SimpleContainer();
createComponent.add(new Label(GlobalizationUtil.globalize("cms.ui.authoringkit.create_component")));
createComponent.add(new Label(GlobalizationUtil.globalize(
"cms.ui.authoringkit.create_component")));
createComponent.add(makeCreateComponent());
createComponent.add(new TypeSecurityContainer(m_editKit));
@ -247,12 +250,14 @@ public class KitPanel extends BoxPanel
ContentType type = m_type.getContentType(s);
String createComponent;
if (type.getAuthoringKit() != null){
createComponent = type.getAuthoringKit().getCreateComponent();
createComponent = type.getAuthoringKit()
.getCreateComponent();
if (createComponent == null) {
createComponent = "n/a";
}
} else {
createComponent = "n/a - This is not a creatable Content Type";
createComponent =
"n/a - This is not a creatable Content Type";
}
t.setLabel(createComponent);
@ -328,7 +333,8 @@ public class KitPanel extends BoxPanel
ContentType type = m_type.getContentType(s);
try {
AuthoringKit k = type.getAuthoringKit();
// k may be null if it's a non-creatable content type;
// k may be null if it's a non-creatable
// content type;
return k;
} catch (DataObjectNotFoundException e) {
@ -357,7 +363,10 @@ public class KitPanel extends BoxPanel
public Object getElementAt(int columnIndex) {
if (currentStep == null) {
throw new IllegalArgumentException( (String) GlobalizationUtil.globalize("cms.ui.authoringkit.current_row_does_not_exists").localize());
throw new IllegalArgumentException( (String)
GlobalizationUtil.globalize(
"cms.ui.authoringkit.current_row_dont_exists")
.localize());
}
switch (columnIndex) {
@ -372,7 +381,8 @@ public class KitPanel extends BoxPanel
return currentStep.getLabel();
} else if (currentStep.getLabelBundle() == null) {
return new Label
(GlobalizationUtil.globalize(currentStep.getLabelKey()));
(GlobalizationUtil
.globalize(currentStep.getLabelKey()));
} else {
return new Label
(new GlobalizedMessage(currentStep.getLabelKey(),
@ -396,14 +406,18 @@ public class KitPanel extends BoxPanel
case 5:
return "delete";
default:
throw new IllegalArgumentException("columnIndex exceeds " +
"number of columns available");
throw new IllegalArgumentException(
"columnIndex exceeds " +
"number of columns available");
}
}
public Object getKeyAt(int columnIndex) {
if (currentStep == null) {
throw new IllegalArgumentException( (String) GlobalizationUtil.globalize("cms.ui.authoringkit.current_row_does_not_exists").localize());
throw new IllegalArgumentException( (String)
GlobalizationUtil.globalize(
"cms.ui.authoringkit.current_row_dont_exists")
.localize());
} else {
return currentStep.getID();
}

View File

@ -10,13 +10,19 @@
<xsl:template match="cms:imageDisplay">
<table>
<tr>
<td class="form_label" valign="top">Name:</td>
<td class="form_label" valign="top">
<!-- Name: -->
<xsl:value-of select="@name_label"/>
</td>
<td class="form_value" valign="top">
<xsl:value-of select="@name"/>
</td>
</tr>
<tr>
<td class="form_label" valign="top">Image Type:</td>
<td class="form_label" valign="top">
<!-- Image Type: -->
<xsl:value-of select="@mime_type_label"/>
</td>
<td class="form_value" valign="top">
<xsl:choose>
<xsl:when test="@mime_type">
@ -29,7 +35,10 @@
</td>
</tr>
<tr>
<td class="form_label" valign="top">Width:</td>
<td class="form_label" valign="top">
<!-- Width: -->
<xsl:value-of select="@width_label"/>
</td>
<td class="form_value" valign="top">
<xsl:choose>
<xsl:when test="@width">
@ -42,7 +51,10 @@
</td>
</tr>
<tr>
<td class="form_label" valign="top">Height:</td>
<td class="form_label" valign="top">
<!-- Height: -->
<xsl:value-of select="@height_label"/>
</td>
<td class="form_value" valign="top">
<xsl:choose>
<xsl:when test="@height">

View File

@ -311,7 +311,7 @@ public class Table extends BlockStylable implements BebopConstants {
* Sets a new header for this table.
*
* @param v the new header for this table. If null, the header will be
* hidden.
* hidden.
*/
public void setHeader(TableHeader v) {
Assert.isUnlocked(this);

View File

@ -70,8 +70,8 @@ public class TableHeader extends SimpleComponent {
* Create a new <code>TableHeader</code>
*
* @param model the {@link TableColumnModel} that the header
* will use in order to generate and maintain the
* column headers.
* will use in order to generate and maintain the
* column headers.
*/
public TableHeader(TableColumnModel model) {
m_columnModel = model;

View File

@ -49,6 +49,7 @@ public class Element {
* owner document
*/
private org.w3c.dom.Document m_doc;
private static ThreadLocal s_localDocument = new ThreadLocal() {
@Override
public Object initialValue() {
@ -59,7 +60,9 @@ public class Element {
return builder.newDocumentBuilder().newDocument();
} catch (ParserConfigurationException e) {
s_log.error(e);
throw new UncheckedWrapperException("INTERNAL: Could not create thread local DOM document.", e);
throw new UncheckedWrapperException(
"INTERNAL: Could not create thread local DOM document.",
e);
}
}
@ -77,7 +80,9 @@ public class Element {
// return m_doc;
// }
// public void importElement(final Element element) {
// element.m_element = (org.w3c.dom.Element) this.m_element.getOwnerDocument().importNode(element.m_element, true);
// element.m_element = (org.w3c.dom.Element) this.m_element
// .getOwnerDocument().importNode(element.m_element,
// true);
// }
public void syncDocs() {