* Meine Author Angaben korrigiert

* Sortierung der angehängten Bilder ist nun möglich
* Cursor kann sich nun auch rückwärts bewegen


* wahrscheinlich noch mehr, daß mir gerade nicht einfällt

git-svn-id: https://svn.libreccm.org/ccm/trunk@2418 8810af33-2d31-482b-a856-94f89814c4df
master
quasi 2013-11-07 12:04:11 +00:00
parent 136b1a072d
commit 86beaa1ec7
96 changed files with 3271 additions and 2949 deletions

View File

@ -3,3 +3,5 @@ com.arsdigita.cms.contentassets.image_step_description=Add Images
cms.contentassets.ui.image_step.add_image=Add Image cms.contentassets.ui.image_step.add_image=Add Image
cms.contentassets.ui.image_step.no_image_attached=This item does not have any associated images. cms.contentassets.ui.image_step.no_image_attached=This item does not have any associated images.
cms.contentassets.ui.image_step.remove_attached_image=Remove image attachment cms.contentassets.ui.image_step.remove_attached_image=Remove image attachment
cms.contentassets.ui.image_step.move_attached_image_down=Move down
cms.contentassets.ui.image_step.move_attached_image_up=Move up

View File

@ -3,3 +3,5 @@ com.arsdigita.cms.contentassets.image_step_description=Bild hinzuf\u00fcgen
cms.contentassets.ui.image_step.add_image=Bild hinzuf\u00fcgen cms.contentassets.ui.image_step.add_image=Bild hinzuf\u00fcgen
cms.contentassets.ui.image_step.no_image_attached=Diesem Dokument ist noch kein Bild zugeordnet. cms.contentassets.ui.image_step.no_image_attached=Diesem Dokument ist noch kein Bild zugeordnet.
cms.contentassets.ui.image_step.remove_attached_image=Aus der Liste entfernen cms.contentassets.ui.image_step.remove_attached_image=Aus der Liste entfernen
cms.contentassets.ui.image_step.move_attached_image_down=Nach unten verschieben
cms.contentassets.ui.image_step.move_attached_image_up=Nach oben verschieben

View File

@ -3,3 +3,5 @@ com.arsdigita.cms.contentassets.image_step_description=Add Images
cms.contentassets.ui.image_step.add_image=Add Image cms.contentassets.ui.image_step.add_image=Add Image
cms.contentassets.ui.image_step.no_image_attached=This item does not have any associated images. cms.contentassets.ui.image_step.no_image_attached=This item does not have any associated images.
cms.contentassets.ui.image_step.remove_attached_image=Remove image attachment cms.contentassets.ui.image_step.remove_attached_image=Remove image attachment
cms.contentassets.ui.image_step.move_attached_image_down=Move down
cms.contentassets.ui.image_step.move_attached_image_up=Move up

View File

@ -32,30 +32,38 @@ import com.arsdigita.persistence.OID;
import com.arsdigita.persistence.SessionManager; import com.arsdigita.persistence.SessionManager;
import com.arsdigita.persistence.metadata.Property; import com.arsdigita.persistence.metadata.Property;
import com.arsdigita.util.Assert; import com.arsdigita.util.Assert;
import java.math.BigDecimal;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
/** /**
* @version $Revision: #3 $ $Date: 2004/04/08 $ * @version $Revision: #3 $ $Date: 2004/04/08 $
* @version $Id: $ * @version $Id: $
**/ *
* @author unknown
* @author Sören Bernstein <quasi@quasiweb.de>
*
*/
public class ItemImageAttachment extends ACSObject implements CustomCopy { public class ItemImageAttachment extends ACSObject implements CustomCopy {
/** PDL property name for contact details */ /**
* PDL property name for contact details
*/
public static final String IMAGE = "image"; public static final String IMAGE = "image";
public static final String ITEM = "item"; public static final String ITEM = "item";
public static final String USE_CONTEXT = "useContext"; public static final String USE_CONTEXT = "useContext";
public static final String CAPTION = "caption"; public static final String CAPTION = "caption";
public static final String DESCRIPTION = "description"; public static final String DESCRIPTION = "description";
public static final String TITLE = "title"; public static final String TITLE = "title";
public static final String SORTKEY = "sortKey";
public static final String IMAGE_ATTACHMENTS = "imageAttachments"; public static final String IMAGE_ATTACHMENTS = "imageAttachments";
public static final String ITEM_ATTACHMENTS = "itemAttachments"; public static final String ITEM_ATTACHMENTS = "itemAttachments";
public static final String IMAGE_LINK = "imageLink"; public static final String IMAGE_LINK = "imageLink";
/** Data object type for this domain object */ /**
* Data object type for this domain object
*/
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contentassets.ItemImageAttachment"; public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contentassets.ItemImageAttachment";
private static final Logger s_log = Logger.getLogger(ItemImageAttachment.class); private static final Logger s_log = Logger.getLogger(ItemImageAttachment.class);
private static final ItemImageAttachmentConfig s_config = ItemImageAttachmentConfig.instanceOf();
private static final ItemImageAttachmentConfig
s_config = ItemImageAttachmentConfig.instanceOf();
private ItemImageAttachment() { private ItemImageAttachment() {
this(BASE_DATA_OBJECT_TYPE); this(BASE_DATA_OBJECT_TYPE);
@ -69,6 +77,7 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
super(type); super(type);
} }
@Override
public String getBaseDataObjectType() { public String getBaseDataObjectType() {
return BASE_DATA_OBJECT_TYPE; return BASE_DATA_OBJECT_TYPE;
} }
@ -80,7 +89,18 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
set(IMAGE, image); set(IMAGE, image);
} }
public static ItemImageAttachment retrieve(OID oid) { /**
* Before saving this object, make sure SORTKEY is set
*/
@Override
protected void beforeSave() {
if(isNew() || getSortKey() == null || getSortKey() == 0) {
setSortKey(getNextSortKey(getItem()));
}
super.beforeSave();
}
public static ItemImageAttachment retrieve(OID oid) {
return (ItemImageAttachment) DomainObjectFactory.newInstance(oid); return (ItemImageAttachment) DomainObjectFactory.newInstance(oid);
} }
@ -116,7 +136,9 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
set(ITEM, item); set(ITEM, item);
} }
/** Retrieves links for a content item */ /**
* Retrieves links for a content item
*/
public static DataCollection getImageAttachments(ContentItem item) { public static DataCollection getImageAttachments(ContentItem item) {
Assert.exists(item, ContentItem.class); Assert.exists(item, ContentItem.class);
@ -126,6 +148,8 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
DataCollection attachments = SessionManager.getSession().retrieve(BASE_DATA_OBJECT_TYPE); DataCollection attachments = SessionManager.getSession().retrieve(BASE_DATA_OBJECT_TYPE);
attachments.addEqualsFilter(ITEM + ".id", item.getID()); attachments.addEqualsFilter(ITEM + ".id", item.getID());
// Order by SORTKEY
attachments.addOrder(SORTKEY);
return attachments; return attachments;
} }
@ -162,20 +186,34 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
return (String) get(DESCRIPTION); return (String) get(DESCRIPTION);
} }
public void setSortKey(Integer sortkey) {
set(SORTKEY, new BigDecimal(sortkey));
}
public Integer getSortKey() {
BigDecimal sortkey = ((BigDecimal) get(SORTKEY));
if (sortkey != null) {
return sortkey.intValue();
} else {
return 0;
}
}
/** /**
* Automatically publish an unpublished image * Automatically publish an unpublished image
*/ */
@Override
public boolean copyProperty(final CustomCopy source, public boolean copyProperty(final CustomCopy source,
final Property property, final Property property,
final ItemCopier copier) { final ItemCopier copier) {
String attribute = property.getName(); String attribute = property.getName();
if (ItemCopier.VERSION_COPY == copier.getCopyType() if (ItemCopier.VERSION_COPY == copier.getCopyType()
&& IMAGE.equals(attribute)) { && IMAGE.equals(attribute)) {
ItemImageAttachment attachment = (ItemImageAttachment) source; ItemImageAttachment attachment = (ItemImageAttachment) source;
ReusableImageAsset image = attachment.getImage(); ReusableImageAsset image = attachment.getImage();
ReusableImageAsset liveImage = ReusableImageAsset liveImage =
(ReusableImageAsset) image.getLiveVersion(); (ReusableImageAsset) image.getLiveVersion();
if (null == liveImage) { if (null == liveImage) {
liveImage = (ReusableImageAsset) image.createLiveVersion(); liveImage = (ReusableImageAsset) image.createLiveVersion();
@ -208,10 +246,21 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
// when we delete the link, the image still references it in DB // when we delete the link, the image still references it in DB
// can't make it composite because then image is deleted if we delete // can't make it composite because then image is deleted if we delete
// link. Have to set link to null first (I think) // link. Have to set link to null first (I think)
DomainObject link = DomainObjectFactory.newInstance((DataObject)get(IMAGE_LINK)); DomainObject link = DomainObjectFactory.newInstance((DataObject) get(IMAGE_LINK));
set(IMAGE_LINK, null); set(IMAGE_LINK, null);
save(); save();
link.delete(); link.delete();
} }
/**
* Get the next sort key for the list of {@link ItemImageAttachment}s for an
* item.
*
* @param item The {@link ContentItem} the list of images is looked up for
* @return the next sortkey, basically length of the list + 1
*/
public static Integer getNextSortKey(ContentItem item) {
return new Integer((int) ItemImageAttachment.getImageAttachments(item).size() + 1);
}
} }

View File

@ -53,6 +53,7 @@ public class ItemImageAttachmentInitializer extends ContentAssetInitializer {
DomainObjectFactory.registerInstantiator( DomainObjectFactory.registerInstantiator(
ItemImageAttachment.BASE_DATA_OBJECT_TYPE, ItemImageAttachment.BASE_DATA_OBJECT_TYPE,
new DomainObjectInstantiator() { new DomainObjectInstantiator() {
@Override
protected DomainObject doNewInstance(DataObject obj) { protected DomainObject doNewInstance(DataObject obj) {
return new ItemImageAttachment(obj); return new ItemImageAttachment(obj);
} }
@ -70,6 +71,7 @@ public class ItemImageAttachmentInitializer extends ContentAssetInitializer {
* The base type against which the asset is defined, * The base type against which the asset is defined,
* typically com.arsdigita.cms.ContentPage * typically com.arsdigita.cms.ContentPage
*/ */
@Override
public String getBaseType() { public String getBaseType() {
return ContentPage.BASE_DATA_OBJECT_TYPE; return ContentPage.BASE_DATA_OBJECT_TYPE;
} }
@ -78,6 +80,7 @@ public class ItemImageAttachmentInitializer extends ContentAssetInitializer {
* Returns the path to the XML file defintions for the asset, eg: * Returns the path to the XML file defintions for the asset, eg:
* /WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/FileAttachments.xml * /WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/FileAttachments.xml
*/ */
@Override
public String getTraversalXML() { public String getTraversalXML() {
return "/WEB-INF/traversal-adapters/com/arsdigita/" + return "/WEB-INF/traversal-adapters/com/arsdigita/" +
"cms/contentassets/ItemImageAttachment.xml"; "cms/contentassets/ItemImageAttachment.xml";
@ -87,6 +90,7 @@ public class ItemImageAttachmentInitializer extends ContentAssetInitializer {
* The name of the association between the item * The name of the association between the item
* and the asset, eg 'fileAttachments'. * and the asset, eg 'fileAttachments'.
*/ */
@Override
public String getProperty() { public String getProperty() {
return "imageAttachments"; return "imageAttachments";
} }
@ -94,6 +98,7 @@ public class ItemImageAttachmentInitializer extends ContentAssetInitializer {
/** /**
* The class of the authoring kit step * The class of the authoring kit step
*/ */
@Override
public Class getAuthoringStep() { public Class getAuthoringStep() {
return ImageStep.class; return ImageStep.class;
} }
@ -101,6 +106,7 @@ public class ItemImageAttachmentInitializer extends ContentAssetInitializer {
/** /**
* The label for the authoring step * The label for the authoring step
*/ */
@Override
public GlobalizedMessage getAuthoringStepLabel() { public GlobalizedMessage getAuthoringStepLabel() {
return new GlobalizedMessage("com.arsdigita.cms.contentassets.image_step_label", return new GlobalizedMessage("com.arsdigita.cms.contentassets.image_step_label",
"com.arsdigita.cms.contentassets.ImageStepResources"); "com.arsdigita.cms.contentassets.ImageStepResources");
@ -109,6 +115,7 @@ public class ItemImageAttachmentInitializer extends ContentAssetInitializer {
/** /**
* The description for the authoring step * The description for the authoring step
*/ */
@Override
public GlobalizedMessage getAuthoringStepDescription() { public GlobalizedMessage getAuthoringStepDescription() {
return new GlobalizedMessage("com.arsdigita.cms.contentassets.image_step_description", return new GlobalizedMessage("com.arsdigita.cms.contentassets.image_step_description",
"com.arsdigita.cms.contentassets.ImageStepResources"); "com.arsdigita.cms.contentassets.ImageStepResources");
@ -117,6 +124,7 @@ public class ItemImageAttachmentInitializer extends ContentAssetInitializer {
/** /**
* The sort key for the authoring step * The sort key for the authoring step
*/ */
@Override
public int getAuthoringStepSortKey() { public int getAuthoringStepSortKey() {
return ItemImageAttachmentConfig.instanceOf().getImageStepSortKey(); return ItemImageAttachmentConfig.instanceOf().getImageStepSortKey();
} }

View File

@ -34,7 +34,7 @@ import org.apache.log4j.Logger;
* *
* This listerner is used by {@link ImageStepEdit}. * This listerner is used by {@link ImageStepEdit}.
* *
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class ImageComponentAttachListener extends ImageComponentAbstractListener { public class ImageComponentAttachListener extends ImageComponentAbstractListener {

View File

@ -39,162 +39,163 @@ import java.util.Iterator;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
/** /**
* Pluggable authoring step as the main entry point to add an ImageAsset to a * Pluggable authoring step as the main entry point to add an ImageAsset to a
* content item. * content item.
* *
* @author unknown * @author unknown
* @author Sören Bernstein (quasimodo) <sbernstein@quasiweb.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class ImageStep extends SecurityPropertyEditor { public class ImageStep extends SecurityPropertyEditor {
private static final Logger s_log = Logger.getLogger(ImageStep.class); private static final Logger s_log = Logger.getLogger(ImageStep.class);
private final ItemSelectionModel m_itemSelection; private final ItemSelectionModel m_itemSelection;
private final AttachmentSelectionModel m_attachmentSelection; private final AttachmentSelectionModel m_attachmentSelection;
private final AuthoringKitWizard m_parent; private final AuthoringKitWizard m_parent;
private final ImageStepDisplay m_display; private final ImageStepDisplay m_display;
private final ImageStepEdit m_add; private final ImageStepEdit m_add;
private final OIDParameter m_attachmentOID; private final OIDParameter m_attachmentOID;
/** /**
* Constructor. * Constructor.
* *
* @param itemModel * @param itemModel The {@link ItemSelectionModel} to use with this
* @param parent * instance
*/ * @param parent The parent {@link AuthoringKitWizard}
public ImageStep(ItemSelectionModel itemModel, */
AuthoringKitWizard parent) { public ImageStep(ItemSelectionModel itemModel,
super(); AuthoringKitWizard parent) {
super();
m_itemSelection = itemModel; m_itemSelection = itemModel;
m_parent = parent; m_parent = parent;
m_attachmentOID = new OIDParameter("attachmentID"); m_attachmentOID = new OIDParameter("attachmentID");
m_attachmentSelection = new AttachmentSelectionModel(); m_attachmentSelection = new AttachmentSelectionModel();
/* Create ImageEditStep to add images to the current item */ /* Create ImageEditStep to add images to the current item */
m_add = new ImageStepEdit(this); m_add = new ImageStepEdit(this);
WorkflowLockedComponentAccess addCA = WorkflowLockedComponentAccess addCA =
new WorkflowLockedComponentAccess(m_add, m_itemSelection); new WorkflowLockedComponentAccess(m_add, m_itemSelection);
addComponent("add", addComponent("add",
ImageStepGlobalizationUtil.globalize( ImageStepGlobalizationUtil.globalize(
"cms.contentassets.ui.image_step.add_image"), "cms.contentassets.ui.image_step.add_image"),
addCA); addCA);
/* ImageDisplayStep to display all already attached images */ /* ImageDisplayStep to display all already attached images */
m_display = new ImageStepDisplay(this); // Component to display m_display = new ImageStepDisplay(this); // Component to display
setDisplayComponent(m_display); // all attached images. setDisplayComponent(m_display); // all attached images.
Iterator imageComponents = m_add.getImageComponents(); Iterator imageComponents = m_add.getImageComponents();
while (imageComponents.hasNext()) { while (imageComponents.hasNext()) {
ImageComponent component = ImageComponent component =
(ImageComponent) imageComponents.next(); (ImageComponent) imageComponents.next();
addListeners(component.getForm(), addListeners(component.getForm(),
component.getSaveCancelSection().getCancelButton()); component.getSaveCancelSection().getCancelButton());
} }
m_parent.getList().addActionListener(new ActionListener() { m_parent.getList().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) { @Override
PageState state = event.getPageState(); public void actionPerformed(ActionEvent event) {
showDisplayPane(state); PageState state = event.getPageState();
} showDisplayPane(state);
}
});
}
}); @Override
} public void register(Page p) {
super.register(p);
@Override p.addComponentStateParam(this, m_attachmentOID);
public void register(Page p) { }
super.register(p);
p.addComponentStateParam(this, m_attachmentOID); /**
} * @return the parent wizard
*/
public AuthoringKitWizard getParentWizard() {
return m_parent;
}
/** /**
* @return the parent wizard * @return The item selection model
*/ */
public AuthoringKitWizard getParentWizard() { public ItemSelectionModel getItemSelectionModel() {
return m_parent; return m_itemSelection;
} }
/** /**
* @return The item selection model * @return The currently selected item, null if there isn't one.
*/ */
public ItemSelectionModel getItemSelectionModel() { public ContentItem getItem(PageState ps) {
return m_itemSelection; return m_itemSelection.getSelectedItem(ps);
} }
/** /**
* @return The currently selected item, null if there isn't one. * @return The currently selected item, null if there isn't one.
*/ */
public ContentItem getItem(PageState ps) { public ItemImageAttachment getAttachment(PageState ps) {
return m_itemSelection.getSelectedItem(ps); return (ItemImageAttachment) m_attachmentSelection.getSelectedAttachment(ps);
} }
/** private class AttachmentSelectionModel
* @return The currently selected item, null if there isn't one. extends AbstractSingleSelectionModel {
*/
public ItemImageAttachment getAttachment(PageState ps) {
return (ItemImageAttachment) m_attachmentSelection.getSelectedAttachment(ps);
}
private class AttachmentSelectionModel private final RequestLocal m_attachment = new RequestLocal() {
extends AbstractSingleSelectionModel { @Override
protected Object initialValue(PageState ps) {
OID oid = (OID) getSelectedKey(ps);
if (null == oid) {
return null;
}
private final RequestLocal m_attachment = new RequestLocal() { return DomainObjectFactory.newInstance(oid);
@Override }
protected Object initialValue(PageState ps) { };
OID oid = (OID) getSelectedKey(ps);
if (null == oid) {
return null;
}
return DomainObjectFactory.newInstance(oid); @Override
} public Object getSelectedKey(PageState ps) {
OID oid = (OID) ps.getValue(m_attachmentOID);
if (null == oid) {
return null;
}
}; return oid;
}
public Object getSelectedKey(PageState ps) { @Override
OID oid = (OID) ps.getValue(m_attachmentOID); public void setSelectedKey(PageState ps, Object oid) {
if (null == oid) { m_attachment.set(ps, null);
return null; ps.setValue(m_attachmentOID, oid);
} }
return oid; public ItemImageAttachment getSelectedAttachment(PageState ps) {
} return (ItemImageAttachment) m_attachment.get(ps);
}
public void setSelectedKey(PageState ps, Object oid) { public void setSelectedAttachment(PageState ps,
m_attachment.set(ps, null); ItemImageAttachment attachment) {
ps.setValue(m_attachmentOID, oid); setSelectedKey(ps, attachment);
} m_attachment.set(ps, attachment);
}
public ItemImageAttachment getSelectedAttachment(PageState ps) { @Override
return (ItemImageAttachment) m_attachment.get(ps); public ParameterModel getStateParameter() {
} return m_attachmentOID;
}
public void setSelectedAttachment(PageState ps, }
ItemImageAttachment attachment) {
setSelectedKey(ps, attachment);
m_attachment.set(ps, attachment);
}
public ParameterModel getStateParameter() {
return m_attachmentOID;
}
}
/**
* Show display pane.
*
* Also, reset the forms for reuse.
*
* @param state
*/
@Override
public void showDisplayPane(PageState state) {
super.showDisplayPane(state);
m_add.reset(state);
}
/**
* Show display pane.
*
* Also, reset the forms for reuse.
*
* @param state
*/
@Override
public void showDisplayPane(PageState state) {
super.showDisplayPane(state);
m_add.reset(state);
}
} }

View File

@ -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.cms.contentassets.ui; package com.arsdigita.cms.contentassets.ui;
import com.arsdigita.bebop.BoxPanel; import com.arsdigita.bebop.BoxPanel;
@ -33,248 +32,424 @@ import com.arsdigita.bebop.list.ListModelBuilder;
import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentItem;
import com.arsdigita.cms.ImageAsset; import com.arsdigita.cms.ImageAsset;
import com.arsdigita.cms.ReusableImageAsset; import com.arsdigita.cms.ReusableImageAsset;
import com.arsdigita.cms.Service;
import com.arsdigita.cms.contentassets.ItemImageAttachment; import com.arsdigita.cms.contentassets.ItemImageAttachment;
import com.arsdigita.cms.contentassets.util.ImageStepGlobalizationUtil; import com.arsdigita.cms.contentassets.util.ImageStepGlobalizationUtil;
import com.arsdigita.cms.ui.ImageDisplay; import com.arsdigita.cms.ui.ImageDisplay;
import com.arsdigita.cms.util.GlobalizationUtil;
import com.arsdigita.domain.DomainObject;
import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.DataCollection;
import com.arsdigita.persistence.DataObject;
import com.arsdigita.persistence.OID; import com.arsdigita.persistence.OID;
import com.arsdigita.util.LockableImpl; import com.arsdigita.util.LockableImpl;
import com.arsdigita.web.URL;
import com.arsdigita.xml.Element; import com.arsdigita.xml.Element;
import java.io.IOException;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
/** /**
* Component displays the currently attached images for an content item. It is * Component displays the currently attached images for an content item. It is
* part of the entry point image authoring step {@see ImageStep}. * part of the entry point image authoring step {
* *
* @see ImageStep}.
*
* It creates a list of images including meta information (name, type, width, * It creates a list of images including meta information (name, type, width,
* etc.), a link to remove from the list for each image and at the bottom a * etc.), a link to remove from the list for each image and at the bottom a link
* link to add another image. * to add another image.
* *
* @author unknown * @author unknown
* @author Sören Bernstein (quasimodo) <sbernstein@quasiweb.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class ImageStepDisplay extends SimpleContainer { public class ImageStepDisplay extends SimpleContainer {
private static final Logger S_LOG = Logger.getLogger(ImageStepDisplay.class); private static final Logger S_LOG = Logger.getLogger(ImageStepDisplay.class);
/**
* Represents invoking parent component
*/
private final ImageStep m_imageStep;
private ImageListModelBuilder m_listModelBuilder;
/**
* Name of the delete event
*/
private final static String DELETE = "deleteAttachment";
private final static String MOVEUP = "moveAttachmentUp";
private final static String MOVEDOWN = "moveAttachmentDown";
/** Represents invoking parent component */ /**
private final ImageStep m_imageStep; * Constructor.
*
* @param step
*/
public ImageStepDisplay(ImageStep step) {
super();
/** Name of the delete event */ m_imageStep = step;
private final static String DELETE = "deleteAttachment";
/** /* Message to show in case no image has been attached yet. */
* Constructor. Label mainLabel = new Label(ImageStepGlobalizationUtil.globalize(
* "cms.contentassets.ui.image_step.no_image_attached"));
* @param step mainLabel.setFontWeight(Label.ITALIC);
*/
public ImageStepDisplay( ImageStep step ) {
super();
m_imageStep = step; m_listModelBuilder = new ImageListModelBuilder();
List imageList = new List(m_listModelBuilder) {
@Override
public void respond(PageState ps) throws ServletException {
if (DELETE.equals(ps.getControlEventName())) {
DomainObjectFactory.newInstance(OID.valueOf(ps.getControlEventValue())).delete();
// Regenerate sortkeys
m_listModelBuilder.getModel().regenSortKeys(ps);
} else if (MOVEUP.equals(ps.getControlEventName())) {
m_listModelBuilder.getModel().move(OID.valueOf(ps.getControlEventValue()), -1, ps);
} else if (MOVEDOWN.equals(ps.getControlEventName())) {
m_listModelBuilder.getModel().move(OID.valueOf(ps.getControlEventValue()), 1, ps);
} else {
super.respond(ps);
}
}
};
/* Message to show in case no image has been attached yet. */ imageList.setCellRenderer(new ImageListCellRenderer());
Label mainLabel = new Label(ImageStepGlobalizationUtil.globalize( imageList.setEmptyView(mainLabel);
"cms.contentassets.ui.image_step.no_image_attached"));
mainLabel.setFontWeight(Label.ITALIC);
List imageList = new List( new ImageListModelBuilder() ) { add(imageList); // finally add the component
@Override }
public void respond( PageState ps ) throws ServletException {
if( DELETE.equals( ps.getControlEventName() ) ) {
String attachment = ps.getControlEventValue();
OID oid = OID.valueOf( attachment ); /**
DomainObjectFactory.newInstance( oid ).delete(); * Inner class
} */
private class ImageListModelBuilder extends LockableImpl
implements ListModelBuilder {
else { private ImageListModel m_listModel;
super.respond( ps );
}
}
};
imageList.setCellRenderer( new ImageListCellRenderer() );
imageList.setEmptyView( mainLabel );
add( imageList ); // finally add the component /**
} *
* @param list
* @param ps
* @return
*/
@Override
public ListModel makeModel(List list, PageState ps) {
ContentItem item = m_imageStep.getItem(ps);
/** DataCollection attachments =
* Inner class ItemImageAttachment.getImageAttachments(item);
*/ attachments.addPath(ItemImageAttachment.IMAGE + "."
private class ImageListModelBuilder extends LockableImpl + ReusableImageAsset.ID);
implements ListModelBuilder { attachments.addPath(ItemImageAttachment.IMAGE + "."
/** + ReusableImageAsset.OBJECT_TYPE);
* attachments.addPath(ItemImageAttachment.IMAGE + "."
* @param list + ReusableImageAsset.HEIGHT);
* @param ps attachments.addPath(ItemImageAttachment.IMAGE + "."
* @return + ReusableImageAsset.WIDTH);
*/
public ListModel makeModel( List list, PageState ps ) {
ContentItem item = m_imageStep.getItem( ps );
DataCollection attachments = m_listModel = new ImageListModel(attachments);
ItemImageAttachment.getImageAttachments( item ); return m_listModel;
attachments.addPath( ItemImageAttachment.IMAGE + "." + }
ReusableImageAsset.ID );
attachments.addPath( ItemImageAttachment.IMAGE + "." +
ReusableImageAsset.OBJECT_TYPE );
attachments.addPath( ItemImageAttachment.IMAGE + "." +
ReusableImageAsset.HEIGHT );
attachments.addPath( ItemImageAttachment.IMAGE + "." +
ReusableImageAsset.WIDTH );
protected ImageListModel getModel() {
return m_listModel;
}
}
return new ImageListModel( attachments ); /**
} *
} */
private class ImageListModel implements ListModel {
/** private final DataCollection m_attachments;
*
*/
private class ImageListModel implements ListModel {
private final DataCollection m_attachments; ImageListModel(DataCollection attachments) {
m_attachments = attachments;
}
ImageListModel( DataCollection attachments ) { @Override
m_attachments = attachments; public Object getElement() {
} return DomainObjectFactory.newInstance(m_attachments.getDataObject());
}
public Object getElement() { @Override
return DomainObjectFactory.newInstance public String getKey() {
( m_attachments.getDataObject() ); return m_attachments.getDataObject().getOID().toString();
} }
public String getKey() { @Override
return m_attachments.getDataObject().getOID().toString(); public boolean next() {
} return m_attachments.next();
}
public boolean next() { public boolean isFirst() {
return m_attachments.next(); return m_attachments.isFirst();
} }
}
/** public boolean isLast() {
* return m_attachments.isLast();
*/ }
private class ImageListCellRenderer implements ListCellRenderer {
/** /**
* * Move an image's position inside the list.
* @param list *
* @param state * @param oid {@link OID} of the image to move
* @param value * @param move position steps (positive or negative) to move
* @param key * @param ps Current {@link PageState}
* @param index */
* @param isSelected protected void move(OID oid, int move, PageState ps) {
* @return // Get the current ContentItem
*/ ContentItem item = m_imageStep.getItem(ps);
public Component getComponent( final List list, PageState state, // Get the collection of attached images
Object value, String key, DataCollection attachments = ItemImageAttachment.getImageAttachments(item);
int index, boolean isSelected ) {
final ItemImageAttachment attachment = (ItemImageAttachment) value;
BoxPanel container = new BoxPanel( BoxPanel.VERTICAL ); // Always need an oid of the image to move
container.setBorder( 1 ); if (oid == null) {
throw new IllegalArgumentException("OID must not be null");
}
// Add CMS ImageDisplay element to BoxPanel container an overwrite // No move, nothing to do
// generateImagePropertiesXM to add attachment's meta data. if (move == 0) {
container.add( new ImageDisplay(null) { return;
@Override }
protected void generateImagePropertiesXML( ImageAsset image,
PageState state,
Element element ) {
/* Use CMS ImageDisplay to display the image including *
* metadata as name, type, widht, height etc. */
super.generateImagePropertiesXML(image, state, element);
// We check config here to see whether additional meta data // Find the image in the collection
// as title and description are configured to be displayed. while (attachments.next()) {
// If it is, we display the description and title options if (attachments.getDataObject().getOID().equals(oid)) {
// TODO: Currently without Label, labels for each attribut break;
// are provided by the theme. Has to be refactored to }
// provide labels in Java (including localization). }
// Title and description - if displayed - have to be
// positioned above the image and its metadata. // Throw an {@link IllegalArgumentxception} if the oid was not found
if(ItemImageAttachment.getConfig() if (!attachments.getDataObject().getOID().equals(oid)) {
.getIsImageStepDescriptionAndTitleShown()) { throw new IllegalArgumentException("OID " + oid + " is not in collection");
}
// Get the image to move and test if it is really an ItemImageAttachment
DomainObject sortDomainObject = DomainObjectFactory.newInstance(attachments.getDataObject());
if (sortDomainObject instanceof ItemImageAttachment) {
// Change the sortKey of the ItemImageAttachment to the desired
// value but respect bounds of the current list
int newSortKey = Math.max(1,
Math.min((int) attachments.size(),
((ItemImageAttachment) sortDomainObject).getSortKey() + move));
((ItemImageAttachment) sortDomainObject).setSortKey(newSortKey);
((ItemImageAttachment) sortDomainObject).save();
// Now, move all the object between the original position and the
// new postition one step in the nessecary direction
if (move < 0) {
while (attachments.previous() && move < 0) {
DomainObject domainObject = DomainObjectFactory.newInstance(attachments.getDataObject());
if (domainObject instanceof ItemImageAttachment) {
((ItemImageAttachment) domainObject).setSortKey(
((ItemImageAttachment) domainObject).getSortKey() + 1);
((ItemImageAttachment) domainObject).save();
move++;
}
}
}
if (move > 0) {
while (attachments.next() && move > 0) {
DomainObject domainObject = DomainObjectFactory.newInstance(attachments.getDataObject());
if (domainObject instanceof ItemImageAttachment) {
((ItemImageAttachment) domainObject).setSortKey(
((ItemImageAttachment) domainObject).getSortKey() - 1);
((ItemImageAttachment) domainObject).save();
move--;
}
}
}
}
// close the collection manually to avoid warnings because the list
// will not be closed automatically
attachments.close();
}
/**
* Reorganize the sortKeys after removing an item.
*
* @param ps The current {@link PageState}
*/
protected void regenSortKeys(PageState ps) {
// Get the current ContentItem
ContentItem item = m_imageStep.getItem(ps);
// Get the collection of attached images
DataCollection attachments = ItemImageAttachment.getImageAttachments(item);
// Current Position
int pos = 0;
// Iterate through all items and set item sortKey to pos
while (attachments.next()) {
pos++;
DomainObject domainObject = DomainObjectFactory.newInstance(attachments.getDataObject());
if (domainObject instanceof ItemImageAttachment) {
int sortKey = ((ItemImageAttachment) domainObject).getSortKey();
if (sortKey != pos) {
((ItemImageAttachment) domainObject).setSortKey(pos);
domainObject.save();
}
}
}
}
}
/**
*
*/
private class ImageListCellRenderer implements ListCellRenderer {
/**
*
* @param list
* @param state
* @param value
* @param key
* @param index
* @param isSelected
* @return
*/
@Override
public Component getComponent(final List list, PageState state,
Object value, String key,
int index, boolean isSelected) {
final ItemImageAttachment attachment = (ItemImageAttachment) value;
BoxPanel container = new BoxPanel(BoxPanel.VERTICAL);
container.setBorder(1);
// Add CMS ImageDisplay element to BoxPanel container an overwrite
// generateImagePropertiesXM to add attachment's meta data.
container.add(new ImageDisplay(null) {
@Override
protected void generateImagePropertiesXML(ImageAsset image,
PageState state,
Element element) {
/* Use CMS ImageDisplay to display the image including *
* metadata as name, type, widht, height etc. */
super.generateImagePropertiesXML(image, state, element);
// We check config here to see whether additional meta data
// as title and description are configured to be displayed.
// If it is, we display the description and title options
// TODO: Currently without Label, labels for each attribut
// are provided by the theme. Has to be refactored to
// provide labels in Java (including localization).
// Title and description - if displayed - have to be
// positioned above the image and its metadata.
if (ItemImageAttachment.getConfig()
.getIsImageStepDescriptionAndTitleShown()) {
String description = attachment.getDescription(); String description = attachment.getDescription();
if (description != null) { if (description != null) {
element.addAttribute("description", description); element.addAttribute("description", description);
} }
String title = attachment.getTitle(); String title = attachment.getTitle();
if (title!= null) { if (title != null) {
element.addAttribute("title", title); element.addAttribute("title", title);
} }
} }
element.addAttribute("caption_label", (String) GlobalizationUtil.globalize(
"cms.contentasset.image.ui.caption")
.localize());
element.addAttribute("caption", attachment.getCaption());
} element.addAttribute("context_label", (String) GlobalizationUtil.globalize(
"cms.contentasset.image.ui.use_context")
.localize());
String useContext = attachment.getUseContext();
if (null == useContext) {
element.addAttribute("context", (String) GlobalizationUtil.globalize(
"cms.ui.unknown")
.localize());
} else {
element.addAttribute("context", useContext);
}
@Override }
protected ImageAsset getImageAsset( PageState ps ) {
return attachment.getImage();
}
} );
/* Create a box panel beloy the image to display the caption */ @Override
BoxPanel captionPanel = new BoxPanel( BoxPanel.HORIZONTAL ); protected ImageAsset getImageAsset(PageState ps) {
return attachment.getImage();
captionPanel.add(new Label(ImageStepGlobalizationUtil.globalize( }
"cms.contentasset.image.ui.caption"))); });
Label captionText = new Label( new PrintListener() {
public void prepare( PrintEvent ev ) {
Label l = (Label) ev.getTarget();
String caption = attachment.getCaption();
if( null == caption ) {
l.setLabel( ImageStepGlobalizationUtil.globalize(
"cms.ui.unknown") );
} else {
l.setLabel( caption );
}
}
} );
captionText.setOutputEscaping( false );
captionPanel.add( captionText );
container.add( captionPanel );
/* Create a box panel beloy the image to display use context*/ /* Adds links to move and remove the image in a separate container element */
BoxPanel useContextPanel = new BoxPanel( BoxPanel.HORIZONTAL ); if (!((ImageListModel) list.getModel(state)).isFirst()) {
ControlLink moveUpLink = new ControlLink(new Label(
useContextPanel.add(new Label( ImageStepGlobalizationUtil.globalize( ImageStepGlobalizationUtil.globalize(
"cms.contentasset.image.ui.use_context") ) ); "cms.contentassets.ui.image_step.move_attached_image_up"))) {
Label useContextLabel = new Label( new PrintListener() { @Override
public void prepare( PrintEvent ev ) { public void setControlEvent(PageState ps) {
Label l = (Label) ev.getTarget(); String oid = ps.getControlEventValue();
String useContext = attachment.getUseContext(); ps.setControlEvent(list, MOVEUP, oid);
if( null == useContext ) { }
l.setLabel( ImageStepGlobalizationUtil.globalize(
"cms.ui.unknown") );
} else {
l.setLabel( useContext );
}
}
} );
useContextLabel.setOutputEscaping( false );
useContextPanel.add( useContextLabel );
container.add( useContextPanel );
/* Add a link to remove the image in a separate container elemet */ // Override generateURL to prevent deleting of the page state
ControlLink deleteLink = new ControlLink(new Label( @Override
ImageStepGlobalizationUtil.globalize( protected void generateURL(PageState state, Element parent) {
"cms.contentassets.ui.image_step.remove_attached_image") )) { setControlEvent(state);
@Override try {
public void setControlEvent( PageState ps ) { parent.addAttribute("href", state.stateAsURL());
String oid = ps.getControlEventValue(); } catch (IOException e) {
ps.setControlEvent( list, DELETE, oid ); parent.addAttribute("href", "");
} }
}; exportAttributes(parent);
container.add( deleteLink ); }
};
container.add(moveUpLink);
}
return container; if (!((ImageListModel) list.getModel(state)).isLast()) {
} ControlLink moveDownLink = new ControlLink(new Label(
} ImageStepGlobalizationUtil.globalize(
"cms.contentassets.ui.image_step.move_attached_image_down"))) {
@Override
public void setControlEvent(PageState ps) {
String oid = ps.getControlEventValue();
ps.setControlEvent(list, MOVEDOWN, oid);
}
// Override generateURL to prevent deleting of the page state
@Override
protected void generateURL(PageState state, Element parent) {
setControlEvent(state);
try {
parent.addAttribute("href", state.stateAsURL());
} catch (IOException e) {
parent.addAttribute("href", "");
}
exportAttributes(parent);
}
};
container.add(moveDownLink);
}
ControlLink deleteLink = new ControlLink(new Label(
ImageStepGlobalizationUtil.globalize(
"cms.contentassets.ui.image_step.remove_attached_image"))) {
@Override
public void setControlEvent(PageState ps) {
String oid = ps.getControlEventValue();
ps.setControlEvent(list, DELETE, oid);
}
// Override generateURL to prevent deleting of the page state
@Override
protected void generateURL(PageState state, Element parent) {
setControlEvent(state);
try {
parent.addAttribute("href", state.stateAsURL());
} catch (IOException e) {
parent.addAttribute("href", "");
}
exportAttributes(parent);
}
};
container.add(deleteLink);
return container;
}
}
} }

View File

@ -53,7 +53,7 @@ import org.apache.log4j.Logger;
* It doesn't engage a lot of its own logik but uses CMS default image classes. * It doesn't engage a lot of its own logik but uses CMS default image classes.
* *
* @author unknown * @author unknown
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class ImageStepEdit extends SimpleContainer public class ImageStepEdit extends SimpleContainer
implements Resettable { implements Resettable {

View File

@ -1062,3 +1062,4 @@ cms.ui.images=Images
cms.ui.folder.additionalInfo=Info cms.ui.folder.additionalInfo=Info
cms.ui.section.new_section_root_category=Root category of the new Content Section cms.ui.section.new_section_root_category=Root category of the new Content Section
cms.ui.admin_center=Admin Center cms.ui.admin_center=Admin Center
cms.contentasset.image.ui.display.dimensions=Dimensions (width x height):

View File

@ -1042,7 +1042,7 @@ 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.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.table.header_action_delete=Aus dem System l\u00f6schen
cms.contentasset.image.ui.display.name=Name: cms.contentasset.image.ui.display.name=Name:
cms.contentasset.image.ui.display.type=Bild Typ: cms.contentasset.image.ui.display.type=Bild-Typ:
cms.contentasset.image.ui.display.width=Breite: cms.contentasset.image.ui.display.width=Breite:
cms.contentasset.image.ui.display.height=H\u00f6he: 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.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.
@ -1056,3 +1056,4 @@ cms.ui.images=Bilder
cms.ui.folder.additionalInfo=Info cms.ui.folder.additionalInfo=Info
cms.ui.section.new_section_root_category=Kategoriensystem der neuen Content Section cms.ui.section.new_section_root_category=Kategoriensystem der neuen Content Section
cms.ui.admin_center=Admin Center cms.ui.admin_center=Admin Center
cms.contentasset.image.ui.display.dimensions=Ma\u00dfe (Breite x H\u00f6he):

View File

@ -110,3 +110,4 @@ cms.ui.images=Images
cms.ui.folder.additionalInfo= cms.ui.folder.additionalInfo=
cms.ui.section.new_section_root_category= cms.ui.section.new_section_root_category=
cms.ui.admin_center=Admin Center cms.ui.admin_center=Admin Center
cms.contentasset.image.ui.display.dimensions=Dimensions (width x height):

View File

@ -584,3 +584,4 @@ cms.ui.images=Images
cms.ui.folder.additionalInfo= cms.ui.folder.additionalInfo=
cms.ui.section.new_section_root_category= cms.ui.section.new_section_root_category=
cms.ui.admin_center=Admin Center cms.ui.admin_center=Admin Center
cms.contentasset.image.ui.display.dimensions=Dimensions (width x height):

View File

@ -22,7 +22,7 @@ import org.imgscalr.Scalr;
* cache of {@link BaseImage}. Also, this class is able to create server-side * cache of {@link BaseImage}. Also, this class is able to create server-side
* resized versions of ImageAssets. * resized versions of ImageAssets.
* *
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class CachedImage { public class CachedImage {

View File

@ -90,7 +90,7 @@ import org.apache.log4j.Logger;
* *
* @author <a href="mailto:pihman@arsdigita.com">Michael Pih</a> * @author <a href="mailto:pihman@arsdigita.com">Michael Pih</a>
* @author <a href="mailto:flattop@arsdigita.com">Jack Chung</a> * @author <a href="mailto:flattop@arsdigita.com">Jack Chung</a>
* @author Sören Bernstein (quasi@barkhof.uni-bremen.de) * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Revision: #37 $ $DateTime: 2004/08/17 23:15:09 $ * @version $Revision: #37 $ $DateTime: 2004/08/17 23:15:09 $
* @version $Id: ContentSection.java 2305 2012-05-01 12:26:33Z pboy $ * @version $Id: ContentSection.java 2305 2012-05-01 12:26:33Z pboy $
*/ */

View File

@ -97,7 +97,7 @@ import org.apache.log4j.Logger;
* folders to jsp templates. * folders to jsp templates.
* *
* @author unknown * @author unknown
* @author Sören Bernstein <sbernstein@quasiweb.de> * @author Sören Bernstein <quasi@quasiweb.de>
* @author Peter Boy <pboy@barkhof.uni-bremen.de> * @author Peter Boy <pboy@barkhof.uni-bremen.de>
*/ */
public class ContentSectionServlet extends BaseApplicationServlet { public class ContentSectionServlet extends BaseApplicationServlet {

View File

@ -52,7 +52,7 @@ import org.apache.log4j.Logger;
* *
* @author Jack Chung * @author Jack Chung
* @author Stanislav Freidin * @author Stanislav Freidin
* @author Sören Bernstein <sbernstein@quasiweb.de> * @author Sören Bernstein <quasi@quasiweb.de>
* *
* @version $Id: ImageAsset.java 2225 2011-08-02 18:53:56Z pboy $ * @version $Id: ImageAsset.java 2225 2011-08-02 18:53:56Z pboy $
*/ */

View File

@ -9,7 +9,7 @@ package com.arsdigita.cms;
* Content Items implementing this interface are be language invariant, if * Content Items implementing this interface are be language invariant, if
* isLanguageInvariant returns true * isLanguageInvariant returns true
* *
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public interface LanguageInvariantContentItem { public interface LanguageInvariantContentItem {

View File

@ -40,7 +40,7 @@ import org.apache.log4j.Logger;
* to be modifiable must be included in Loader class itself! * to be modifiable must be included in Loader class itself!
* *
* @author pb * @author pb
* @author Sören Bernstein (quasi@barkhof.uni-bremen.de) * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Id: LoaderConfig.java $ * @version $Id: LoaderConfig.java $
*/ */
public final class LoaderConfig extends AbstractConfig { public final class LoaderConfig extends AbstractConfig {

View File

@ -33,7 +33,7 @@ import org.apache.log4j.Logger;
* Configures parameter which are not persisted in the database and may be * Configures parameter which are not persisted in the database and may be
* changes during each startup of the system. * changes during each startup of the system.
* @author pb * @author pb
* @author Sören Bernstein (quasi@barkhof.uni-bremen.de) * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public final class ContentSectionConfig extends AbstractConfig { public final class ContentSectionConfig extends AbstractConfig {

View File

@ -63,7 +63,7 @@ import org.xml.sax.helpers.DefaultHandler;
* into the database. * into the database.
* *
* @author Peter Boy (pboy@barkhof.uni-bremen.de) * @author Peter Boy (pboy@barkhof.uni-bremen.de)
* @author Sören Bernstein (quasi@barkhof.uni-bremen.de) * @author Sören Bernstein <quasi@quasiweb.de>
* @author Jon Orris (jorris@redhat.com) * @author Jon Orris (jorris@redhat.com)
* @version $Id: $ * @version $Id: $
*/ */

View File

@ -61,7 +61,7 @@ import org.apache.log4j.Logger;
* registry object (file). * registry object (file).
* *
* @author Rafael H. Schloming &lt;rhs@mit.edu&gt; * @author Rafael H. Schloming &lt;rhs@mit.edu&gt;
* @authro Sören Bernstein (quasi@barkhof.uni-bremen.de) * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Revision: #754 $ $Date: 2005/09/02 $ $Author: pboy $ * @version $Revision: #754 $ $Date: 2005/09/02 $ $Author: pboy $
**/ **/
public abstract class AbstractContentTypeLoader extends PackageLoader { public abstract class AbstractContentTypeLoader extends PackageLoader {

View File

@ -40,7 +40,7 @@ import org.apache.log4j.Logger;
* <p>This class extends {@link com.arsdigita.cms.ContentItem content item} and * <p>This class extends {@link com.arsdigita.cms.ContentItem content item} and
* adds extended attributes specific for an not country specific address:</p> * adds extended attributes specific for an not country specific address:</p>
* *
* @author Sören Bernstein * @author Sören Bernstein <quasi@quasiweb.de>
**/ **/
public class GenericAddress extends ContentPage { public class GenericAddress extends ContentPage {

View File

@ -11,7 +11,7 @@ import org.apache.log4j.Logger;
/** /**
* Stores the configuration record for the generic contact. * Stores the configuration record for the generic contact.
* *
* @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public final class GenericContactConfig extends AbstractConfig { public final class GenericContactConfig extends AbstractConfig {

View File

@ -10,7 +10,7 @@ import com.arsdigita.persistence.DataCollection;
/** /**
* *
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class GenericContactEntryKeys extends RelationAttributeCollection { public class GenericContactEntryKeys extends RelationAttributeCollection {

View File

@ -37,7 +37,7 @@ import java.util.StringTokenizer;
/** /**
* Basic GenericPerson Contenttype for OpenCCM. * Basic GenericPerson Contenttype for OpenCCM.
* *
* @author Sören Bernstein * @author Sören Bernstein <quasi@quasiweb.de>
* @author Jens Pelzetter * @author Jens Pelzetter
*/ */
public class GenericPerson extends ContentPage implements public class GenericPerson extends ContentPage implements

View File

@ -50,7 +50,7 @@ import org.apache.log4j.Logger;
* *
* @version $Revision: #7 $ $Date: 2004/08/17 $ * @version $Revision: #7 $ $Date: 2004/08/17 $
* @author Nobuko Asakai (nasakai@redhat.com) * @author Nobuko Asakai (nasakai@redhat.com)
* @author Sören Bernstein (Quasimodo) * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class Link extends ACSObject { public class Link extends ACSObject {

View File

@ -32,7 +32,7 @@ import com.arsdigita.globalization.GlobalizationHelper;
* This is a modified copy of ContentItemTraversalAdapter to make the * This is a modified copy of ContentItemTraversalAdapter to make the
* Link-Objects aware of multilingual items (ContentBundle) * Link-Objects aware of multilingual items (ContentBundle)
* *
* @author Sören Bernstein (Quasimodo) * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class LinkTraversalAdapter public class LinkTraversalAdapter
extends ContentItemTraversalAdapter { extends ContentItemTraversalAdapter {

View File

@ -49,7 +49,7 @@ import org.apache.log4j.Logger;
* Form to edit the properties of a address. * Form to edit the properties of a address.
* *
* @author: Jens Pelzetter * @author: Jens Pelzetter
* @author: Sören Bernstein * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class GenericAddressPropertyForm extends BasicPageForm public class GenericAddressPropertyForm extends BasicPageForm
implements FormProcessListener, implements FormProcessListener,

View File

@ -46,7 +46,7 @@ import java.math.BigDecimal;
/** /**
* Lists all existing contact entries for a selected contact. * Lists all existing contact entries for a selected contact.
* *
* @author Sören Bernstein (quasimodo) quasi@barkhof.uni-bremen.de * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class GenericContactEntriesTable extends Table implements TableActionListener { public class GenericContactEntriesTable extends Table implements TableActionListener {

View File

@ -40,7 +40,7 @@ import com.arsdigita.globalization.GlobalizationHelper;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
/** /**
* @author Sören Bernstein (quasimodo) quasi@barkhof.uni-bremen.de * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class GenericContactEntryAddForm extends BasicItemForm { public class GenericContactEntryAddForm extends BasicItemForm {
private static final Logger s_log = Logger.getLogger(GenericContactEntryAddForm.class); private static final Logger s_log = Logger.getLogger(GenericContactEntryAddForm.class);

View File

@ -47,7 +47,7 @@ import org.apache.log4j.Logger;
* - Address * - Address
* - Various contact entries. * - Various contact entries.
* *
* @author quasi <quasi@barkhof.uni-bremen.de> * @author quasi <quasi@quasiweb.de>
*/ */
public class GenericContactPropertiesStep extends SimpleEditStep { public class GenericContactPropertiesStep extends SimpleEditStep {

View File

@ -48,7 +48,7 @@ import org.apache.log4j.Logger;
* This class is part of the admin GUI of CCM and extends the standard form * This class is part of the admin GUI of CCM and extends the standard form
* in order to present forms for managing the multi-language categories. * in order to present forms for managing the multi-language categories.
* *
* @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class GenericContactTypeAddForm extends BasicItemForm { public class GenericContactTypeAddForm extends BasicItemForm {

View File

@ -26,7 +26,7 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
/** /**
* @author Sören Bernstein * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class GenericContactTypePropertiesStep extends SimpleEditStep { public class GenericContactTypePropertiesStep extends SimpleEditStep {

View File

@ -43,7 +43,7 @@ import java.math.BigDecimal;
/** /**
* *
* *
* @author Sören Bernstein (quasimodo) quasi@barkhof.uni-bremen.de * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class GenericContactTypeTable extends Table implements TableActionListener { public class GenericContactTypeTable extends Table implements TableActionListener {

View File

@ -52,7 +52,7 @@ import org.apache.log4j.Logger;
* This class is part of the admin GUI of CCM and extends the standard form * This class is part of the admin GUI of CCM and extends the standard form
* in order to present forms for managing the multi-language categories. * in order to present forms for managing the multi-language categories.
* *
* @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class GenericPersonContactAddForm extends BasicItemForm { public class GenericPersonContactAddForm extends BasicItemForm {

View File

@ -26,7 +26,7 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
/** /**
* @author Sören Bernstein * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class GenericPersonContactPropertiesStep extends SimpleEditStep { public class GenericPersonContactPropertiesStep extends SimpleEditStep {

View File

@ -52,7 +52,7 @@ import org.apache.log4j.Logger;
/** /**
* Lists all existing contact entries for a selected contact. * Lists all existing contact entries for a selected contact.
* *
* @author Sören Bernstein (quasimodo) quasi@barkhof.uni-bremen.de * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class GenericPersonContactTable extends Table implements public class GenericPersonContactTable extends Table implements
TableActionListener { TableActionListener {

View File

@ -43,7 +43,7 @@ import java.util.Date;
/** /**
* *
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class GenericPersonCreate extends PageCreate { public class GenericPersonCreate extends PageCreate {

View File

@ -63,7 +63,7 @@ import org.apache.log4j.Logger;
* *
* @version $Revision: #5 $ $Date: 2004/08/17 $ * @version $Revision: #5 $ $Date: 2004/08/17 $
* @author Nobuko Asakai (nasakai@redhat.com) * @author Nobuko Asakai (nasakai@redhat.com)
* @author Sören Bernstein (sbernstein@zes.uni-bremen.de) * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class LinkPropertyForm extends FormSection public class LinkPropertyForm extends FormSection
implements FormInitListener, FormProcessListener, implements FormInitListener, FormProcessListener,

View File

@ -48,7 +48,7 @@ import org.apache.log4j.Logger;
* *
* @author Stanislav Freidin (sfreidin@arsdigita.com) * @author Stanislav Freidin (sfreidin@arsdigita.com)
* @author Michael Pih (pihman@arsdigita.com) * @author Michael Pih (pihman@arsdigita.com)
* @author Sören Bernstein <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Revision: #20 $ $DateTime: 2004/08/17 23:15:09 $ * @version $Revision: #20 $ $DateTime: 2004/08/17 23:15:09 $
* @version $Id: BaseImage.java 1571 2007-04-20 15:57:54Z apevec $ * @version $Id: BaseImage.java 1571 2007-04-20 15:57:54Z apevec $
*/ */

View File

@ -7,7 +7,7 @@ package com.arsdigita.cms.dispatcher;
/** /**
* *
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class DownloadImage extends BaseImage { public class DownloadImage extends BaseImage {

View File

@ -6,7 +6,7 @@ package com.arsdigita.cms.dispatcher;
/** /**
* *
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class StreamImage extends BaseImage { public class StreamImage extends BaseImage {

View File

@ -51,7 +51,7 @@ import javax.servlet.http.HttpServletResponse;
* The Item Search page. * The Item Search page.
* *
* @author Scott Seago (scott@arsdigita.com) * @author Scott Seago (scott@arsdigita.com)
* @author Sören Bernstein (sbernstein@quasiweb.de) * @author Sören Bernstein <quasi@quasiweb.de>
* @author Jens Pelzetter (jens@jp-digital.de) * @author Jens Pelzetter (jens@jp-digital.de)
*/ */
public class CMSItemSearchPage extends CMSApplicationPage { public class CMSItemSearchPage extends CMSApplicationPage {

View File

@ -69,7 +69,7 @@ import org.apache.log4j.Logger;
* @author Michael Pih * @author Michael Pih
* @author Stanislav Freidin &lt;sfreidin@redhat.com&gt; * @author Stanislav Freidin &lt;sfreidin@redhat.com&gt;
* @author Jack Chung * @author Jack Chung
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
* *
* @version $Id: ContentItemPage.java 2245 2011-11-15 08:03:57Z pboy $ * @version $Id: ContentItemPage.java 2245 2011-11-15 08:03:57Z pboy $
*/ */
@ -339,7 +339,7 @@ public class ContentItemPage extends CMSPage implements ActionListener {
getConfig().getHideTemplatesTab()); getConfig().getHideTemplatesTab());
} }
// Added by: Sören Bernstein <sbernstein@zes.uni-bremen.de> // Added by: Sören Bernstein <quasi@quasiweb.de>
// If the content item is a language invariant content item, don't show // If the content item is a language invariant content item, don't show
// the language pane // the language pane
if (item instanceof LanguageInvariantContentItem) { if (item instanceof LanguageInvariantContentItem) {

View File

@ -37,7 +37,7 @@ import com.arsdigita.util.LockableImpl;
* builder will return an {@link EmptyImageBrowserModel} * builder will return an {@link EmptyImageBrowserModel}
* *
* @author Stanislav Freidin (sfreidin@arsdigita.com) * @author Stanislav Freidin (sfreidin@arsdigita.com)
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Id: DefaultImageBrowserModelBuilder.java 1940 2009-05-29 07:15:05Z * @version $Id: DefaultImageBrowserModelBuilder.java 1940 2009-05-29 07:15:05Z
* terry $ * terry $
*/ */

View File

@ -63,7 +63,7 @@ import org.apache.log4j.Logger;
* </code></pre></blockquote> * </code></pre></blockquote>
* *
* @author Stanislav Freidin * @author Stanislav Freidin
* @author Sören Bernstein (quasimodo) <sbernstein@quasiweb.de> * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Id: ImageBrowser.java 1940 2009-05-29 07:15:05Z terry $ * @version $Id: ImageBrowser.java 1940 2009-05-29 07:15:05Z terry $
*/ */
public class ImageBrowser extends Table { public class ImageBrowser extends Table {

View File

@ -45,7 +45,7 @@ import com.arsdigita.cms.util.GlobalizationUtil;
* by keyword * by keyword
* *
* @author Stanislav Freidin (sfreidin@arsdigita.com) * @author Stanislav Freidin (sfreidin@arsdigita.com)
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Id: ImageChooser.java 1940 2009-05-29 07:15:05Z terry $ * @version $Id: ImageChooser.java 1940 2009-05-29 07:15:05Z terry $
*/ */
public class ImageChooser extends BoxPanel { public class ImageChooser extends BoxPanel {

View File

@ -15,7 +15,7 @@ import com.arsdigita.cms.ReusableImageAsset;
* All components for image handling (like {@link ImageLibraryComponent} or * All components for image handling (like {@link ImageLibraryComponent} or
* {@link ImageUploadComponent}) should implement this interface. * {@link ImageUploadComponent}) should implement this interface.
* *
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public interface ImageComponent { public interface ImageComponent {

View File

@ -19,80 +19,85 @@ import org.apache.log4j.Logger;
/** /**
* An abstract listener for {@link ImageComponent}. * An abstract listener for {@link ImageComponent}.
* *
* This listener provides the base implementation which is shared between all * This listener provides the base implementation which is shared between all
* listeners of this kind. * listeners of this kind.
* *
* This listerner is used by {@link ImageSelectPage}. * This listerner is used by {@link ImageSelectPage}.
* *
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public abstract class ImageComponentAbstractListener implements FormInitListener, public abstract class ImageComponentAbstractListener implements FormInitListener,
FormProcessListener, FormProcessListener,
FormSubmissionListener { FormSubmissionListener {
private static final Logger s_log = Logger.getLogger( private static final Logger s_log = Logger.getLogger(
ImageComponentSelectListener.class); ImageComponentSelectListener.class);
MapComponentSelectionModel m_imageComponent; MapComponentSelectionModel m_imageComponent;
public ImageComponentAbstractListener(MapComponentSelectionModel imageComponent) { public ImageComponentAbstractListener(MapComponentSelectionModel imageComponent) {
super(); super();
m_imageComponent = imageComponent; m_imageComponent = imageComponent;
} }
public void init(FormSectionEvent event) @Override
throws FormProcessException { public void init(FormSectionEvent event)
PageState ps = event.getPageState(); throws FormProcessException {
if (!m_imageComponent.isSelected(ps)) { PageState ps = event.getPageState();
setImageComponent(ps, ImageComponent.LIBRARY); if (!m_imageComponent.isSelected(ps)) {
} setImageComponent(ps, ImageComponent.LIBRARY);
} }
}
/** /**
* Call {@link #cancelled(com.arsdigita.bebop.PageState)} if the cancel button * Call {@link #cancelled(com.arsdigita.bebop.PageState)} if the cancel
* was pressed. * button was pressed.
* *
* @param event the {@link FormSectionEvent} * @param event the {@link FormSectionEvent}
* @throws FormProcessException * @throws FormProcessException
*/ */
public void submitted(FormSectionEvent event) throws FormProcessException { @Override
PageState ps = event.getPageState(); public void submitted(FormSectionEvent event) throws FormProcessException {
ImageComponent component = getImageComponent(ps); PageState ps = event.getPageState();
ImageComponent component = getImageComponent(ps);
if(component.getSaveCancelSection().getCancelButton().isSelected(ps)) { if (component.getSaveCancelSection().getCancelButton().isSelected(ps)) {
cancelled(ps); cancelled(ps);
} }
} }
/** /**
* Call {@link #processImage(com.arsdigita.bebop.event.FormSectionEvent, * Call {@link #processImage(com.arsdigita.bebop.event.FormSectionEvent,
* com.arsdigita.bebop.PageState, com.arsdigita.cms.ui.ImageComponent, * com.arsdigita.bebop.PageState, com.arsdigita.cms.ui.ImageComponent,
* com.arsdigita.cms.ReusableImageAsset) } * com.arsdigita.cms.ReusableImageAsset) }
* if the save button was pressed. * if the save button was pressed.
* *
* @param event the {@link FormSectionEvent} * @param event the {@link FormSectionEvent}
* @throws FormProcessException * @throws FormProcessException
*/ */
public void process(FormSectionEvent event) throws FormProcessException { @Override
PageState ps = event.getPageState(); public void process(FormSectionEvent event) throws FormProcessException {
ImageComponent component = getImageComponent(ps); PageState ps = event.getPageState();
ImageComponent component = getImageComponent(ps);
if (!component.getSaveCancelSection().getSaveButton().isSelected(ps)) { if (!component.getSaveCancelSection().getSaveButton().isSelected(ps)) {
return; return;
} }
ReusableImageAsset image = component.getImage(event); ReusableImageAsset image = component.getImage(event);
processImage(event, ps, component, image); processImage(event, ps, component, image);
} }
/**
* To be overridden by child if neccessary.
*
* @param ps
*/
protected void cancelled(PageState ps) {
}
/** ;
* To be overridden by child if neccessary.
*
* @param ps
*/
protected void cancelled(PageState ps) {};
/** /**
* Process the input. * Process the input.
@ -104,45 +109,45 @@ public abstract class ImageComponentAbstractListener implements FormInitListener
*/ */
protected abstract void processImage(FormSectionEvent event, PageState ps, ImageComponent component, ReusableImageAsset image); protected abstract void processImage(FormSectionEvent event, PageState ps, ImageComponent component, ReusableImageAsset image);
protected ImageComponent getImageComponent(PageState ps) { protected ImageComponent getImageComponent(PageState ps) {
if (!m_imageComponent.isSelected(ps)) { if (!m_imageComponent.isSelected(ps)) {
if (s_log.isDebugEnabled()) { if (s_log.isDebugEnabled()) {
s_log.debug("No component selected"); s_log.debug("No component selected");
s_log.debug("Selected: " + m_imageComponent.getComponent(ps)); s_log.debug("Selected: " + m_imageComponent.getComponent(ps));
} }
m_imageComponent.setSelectedKey(ps, ImageComponent.UPLOAD); m_imageComponent.setSelectedKey(ps, ImageComponent.UPLOAD);
} }
return (ImageComponent) m_imageComponent.getComponent(ps); return (ImageComponent) m_imageComponent.getComponent(ps);
} }
/** /**
* Sets the active component * Sets the active component
* *
* @param ps Page state * @param ps Page state
* @param activeKey the key of the active component * @param activeKey the key of the active component
*/ */
protected void setImageComponent(PageState ps, final String activeKey) { protected void setImageComponent(PageState ps, final String activeKey) {
if (s_log.isDebugEnabled()) { if (s_log.isDebugEnabled()) {
s_log.debug("Selected component: " + activeKey); s_log.debug("Selected component: " + activeKey);
} }
Map componentsMap = m_imageComponent.getComponentsMap(); Map componentsMap = m_imageComponent.getComponentsMap();
Iterator i = componentsMap.keySet().iterator(); Iterator i = componentsMap.keySet().iterator();
while (i.hasNext()) { while (i.hasNext()) {
Object key = i.next(); Object key = i.next();
Component component = (Component) componentsMap.get(key); Component component = (Component) componentsMap.get(key);
boolean isVisible = activeKey.equals(key); boolean isVisible = activeKey.equals(key);
if (s_log.isDebugEnabled()) { if (s_log.isDebugEnabled()) {
s_log.debug("Key: " + key + "; Visibility: " + isVisible); s_log.debug("Key: " + key + "; Visibility: " + isVisible);
} }
ps.setVisible(component, isVisible); ps.setVisible(component, isVisible);
} }
} }
} }

View File

@ -17,7 +17,7 @@ import com.arsdigita.toolbox.ui.ComponentMap;
* *
* This listerner is used by {@link ImagesPane}. * This listerner is used by {@link ImagesPane}.
* *
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
class ImageComponentAdminListener extends ImageComponentAbstractListener implements ActionListener { class ImageComponentAdminListener extends ImageComponentAbstractListener implements ActionListener {

View File

@ -15,7 +15,7 @@ import org.apache.log4j.Logger;
* *
* This listerner is used by {@link ImageSelectPage}. * This listerner is used by {@link ImageSelectPage}.
* *
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class ImageComponentSelectListener extends ImageComponentAbstractListener { public class ImageComponentSelectListener extends ImageComponentAbstractListener {

View File

@ -31,10 +31,9 @@ import com.arsdigita.web.URL;
import com.arsdigita.xml.Element; import com.arsdigita.xml.Element;
import java.math.BigDecimal; import java.math.BigDecimal;
/** /**
* Displays a single ImageAsset, showing its image, width, height, * Displays a single ImageAsset, showing its image, width, height, name and
* name and mime-type. * mime-type.
* *
* @author Michael Pih (pihman@arsdigita.com) * @author Michael Pih (pihman@arsdigita.com)
* @author Stanislav Freidin (sfreidin@arsdigita.com) * @author Stanislav Freidin (sfreidin@arsdigita.com)
@ -42,113 +41,117 @@ import java.math.BigDecimal;
*/ */
public class ImageDisplay extends SimpleComponent { public class ImageDisplay extends SimpleComponent {
private final ItemSelectionModel m_item; private final ItemSelectionModel m_item;
/** /**
* Construct a new ImageDisplay * Construct a new ImageDisplay
* *
* @param m The {@link ItemSelectionModel} which will supply * @param m The {@link ItemSelectionModel} which will supply this component
* this component with the {@link ImageAsset} * with the {@link ImageAsset}
*/ */
public ImageDisplay(ItemSelectionModel m) { public ImageDisplay(ItemSelectionModel m) {
super(); super();
m_item = m; m_item = m;
} }
/** /**
* @return the {@link ItemSelectionModel} which supplies this * @return the {@link ItemSelectionModel} which supplies this component with
* component with the {@link ImageAsset} * the {@link ImageAsset}
*/ */
public final ItemSelectionModel getImageSelectionModel() { public final ItemSelectionModel getImageSelectionModel() {
return m_item; return m_item;
} }
/** /**
* *
* @param state * @param state
* @param parent * @param parent
*/ */
@Override @Override
public void generateXML(PageState state, Element parent) { public void generateXML(PageState state, Element parent) {
if ( isVisible(state) ) { if (isVisible(state)) {
ImageAsset image = getImageAsset(state); ImageAsset image = getImageAsset(state);
if (image == null) { if (image == null) {
return; return;
} }
Element element = new Element("cms:imageDisplay", CMS.CMS_XML_NS); Element element = new Element("cms:imageDisplay", CMS.CMS_XML_NS);
if (image != null) { if (image != null) {
generateImagePropertiesXML(image, state, element); generateImagePropertiesXML(image, state, element);
} }
exportAttributes(element); exportAttributes(element);
parent.addContent(element); parent.addContent(element);
} }
} }
/** /**
* Generates the property xml. * Generates the property xml.
* *
* @param image * @param image
* @param state * @param state
* @param element * @param element
*/ */
protected void generateImagePropertiesXML(ImageAsset image, protected void generateImagePropertiesXML(ImageAsset image,
PageState state, PageState state,
Element element) { Element element) {
element.addAttribute("name_label", (String)GlobalizationUtil.globalize( element.addAttribute("name_label", (String) GlobalizationUtil.globalize(
"cms.contentasset.image.ui.display.name") "cms.contentasset.image.ui.display.name")
.localize()); .localize());
element.addAttribute("name", image.getName()); element.addAttribute("name", image.getName());
element.addAttribute("src", URL.getDispatcherPath() + element.addAttribute("src", URL.getDispatcherPath()
Service.getImageURL(image)); + Service.getImageURL(image));
element.addAttribute("mime_type_label", (String)GlobalizationUtil.globalize( element.addAttribute("mime_type_label", (String) GlobalizationUtil.globalize(
"cms.contentasset.image.ui.display.type") "cms.contentasset.image.ui.display.type")
.localize()); .localize());
MimeType mimeType = image.getMimeType(); MimeType mimeType = image.getMimeType();
if ( mimeType != null ) { if (mimeType != null) {
element.addAttribute("mime_type", mimeType.getLabel()); element.addAttribute("mime_type", mimeType.getLabel());
} }
element.addAttribute("width_label", (String)GlobalizationUtil.globalize( element.addAttribute("width_label", (String) GlobalizationUtil.globalize(
"cms.contentasset.image.ui.display.width") "cms.contentasset.image.ui.display.width")
.localize()); .localize());
BigDecimal width = image.getWidth(); BigDecimal width = image.getWidth();
if ( width != null ) { if (width != null) {
element.addAttribute("width", width.toString()); element.addAttribute("width", width.toString());
} else { } else {
element.addAttribute("width", (String)GlobalizationUtil.globalize( element.addAttribute("width", (String) GlobalizationUtil.globalize(
"cms.ui.unknown") "cms.ui.unknown")
.localize()); .localize());
} }
element.addAttribute("height_label", (String)GlobalizationUtil.globalize( element.addAttribute("height_label", (String) GlobalizationUtil.globalize(
"cms.contentasset.image.ui.display.height") "cms.contentasset.image.ui.display.height")
.localize()); .localize());
BigDecimal height = image.getHeight(); BigDecimal height = image.getHeight();
if ( height != null ) { if (height != null) {
element.addAttribute("height", height.toString()); element.addAttribute("height", height.toString());
} else { } else {
element.addAttribute("height", (String)GlobalizationUtil.globalize( element.addAttribute("height", (String) GlobalizationUtil.globalize(
"cms.ui.unknown") "cms.ui.unknown")
.localize()); .localize());
} }
}
/** element.addAttribute("dimension_label", (String) GlobalizationUtil.globalize(
* "cms.contentasset.image.ui.display.dimensions")
* @param state .localize());
* @return
*/
protected ImageAsset getImageAsset(PageState state) {
ImageAsset image = (ImageAsset) m_item.getSelectedObject(state);
Assert.exists(image, "Image asset");
return image;
}
}
/**
*
* @param state
* @return
*/
protected ImageAsset getImageAsset(PageState state) {
ImageAsset image = (ImageAsset) m_item.getSelectedObject(state);
Assert.exists(image, "Image asset");
return image;
}
} }

View File

@ -34,7 +34,7 @@ import java.math.BigDecimal;
* extended from {@link ImageComponentAbstractListener}. * extended from {@link ImageComponentAbstractListener}.
* *
* @author unknown * @author unknown
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class ImageLibraryComponent extends SimpleContainer public class ImageLibraryComponent extends SimpleContainer
implements ImageComponent, Resettable { implements ImageComponent, Resettable {

View File

@ -22,149 +22,149 @@ import org.apache.log4j.Logger;
/** /**
* A {@link CMSPage} to select and upload images. * A {@link CMSPage} to select and upload images.
* *
* This page is used by /web/templates/ccm-cms/content-section/admin/image_select.jsp * This page is used by
* which is used by the OpenCCM plugin for Xihna editor. * /web/templates/ccm-cms/content-section/admin/image_select.jsp which is used
* * by the OpenCCM plugin for Xinha editor.
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> *
* @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class ImageSelectPage extends CMSPage { public class ImageSelectPage extends CMSPage {
private static final Logger S_LOG = Logger.getLogger(ImagesPane.class); private static final Logger S_LOG = Logger.getLogger(ImagesPane.class);
private final static String XSL_CLASS = "CMS Admin";
private final static String XSL_CLASS = "CMS Admin"; private TabbedPane m_tabbedPane;
private TabbedPane m_tabbedPane; private ImageLibraryComponent m_imageLibrary;
private ImageLibraryComponent m_imageLibrary; private ImageUploadComponent m_imageUpload;
private ImageUploadComponent m_imageUpload; private ImageSelectResultComponent m_result;
private ImageSelectResultComponent m_result; private BigDecimalParameter m_sectionId;
private BigDecimalParameter m_sectionId; private final StringParameter m_imageComponentKey;
private final StringParameter m_imageComponentKey; private final MapComponentSelectionModel m_imageComponent;
private final MapComponentSelectionModel m_imageComponent; private final ImageComponentSelectListener m_selectListener;
private final ImageComponentSelectListener m_selectListener; private static final CMSConfig s_conf = CMSConfig.getInstance();
private static final CMSConfig s_conf = CMSConfig.getInstance(); public static final String CONTENT_SECTION = "section_id";
public static final String CONTENT_SECTION = "section_id"; public static final String RESULT = "result";
public static final String RESULT = "result";
public ImageSelectPage() { public ImageSelectPage() {
super(GlobalizationUtil.globalize( super(GlobalizationUtil.globalize(
"cms.ui.image_select.page_title") "cms.ui.image_select.page_title")
.localize().toString(), .localize().toString(),
new SimpleContainer()); new SimpleContainer());
setClassAttr("cms-admin"); setClassAttr("cms-admin");
m_sectionId = new BigDecimalParameter(CONTENT_SECTION); m_sectionId = new BigDecimalParameter(CONTENT_SECTION);
addGlobalStateParam(m_sectionId); addGlobalStateParam(m_sectionId);
m_imageComponentKey = new StringParameter("imageComponent"); m_imageComponentKey = new StringParameter("imageComponent");
ParameterSingleSelectionModel componentModel = ParameterSingleSelectionModel componentModel =
new ParameterSingleSelectionModel(m_imageComponentKey); new ParameterSingleSelectionModel(m_imageComponentKey);
m_imageComponent = m_imageComponent =
new MapComponentSelectionModel(componentModel, new HashMap()); new MapComponentSelectionModel(componentModel, new HashMap());
m_selectListener = new ImageComponentSelectListener(m_imageComponent,
getResultComponent());
m_tabbedPane = createTabbedPane(); m_selectListener = new ImageComponentSelectListener(m_imageComponent,
m_tabbedPane.setIdAttr("page-body"); getResultComponent());
add(m_tabbedPane); m_tabbedPane = createTabbedPane();
// ActionListener to change the image component state param to the m_tabbedPane.setIdAttr("page-body");
// right value
addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) { add(m_tabbedPane);
final PageState ps = event.getPageState(); // ActionListener to change the image component state param to the
// right value
addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
final PageState ps = event.getPageState();
if (m_tabbedPane.getCurrentPane(ps).equals(m_imageLibrary)) { if (m_tabbedPane.getCurrentPane(ps).equals(m_imageLibrary)) {
m_imageComponent.setSelectedKey(ps, ImageComponent.LIBRARY); m_imageComponent.setSelectedKey(ps, ImageComponent.LIBRARY);
} }
if (m_tabbedPane.getCurrentPane(ps).equals(m_imageUpload)) { if (m_tabbedPane.getCurrentPane(ps).equals(m_imageUpload)) {
m_imageComponent.setSelectedKey(ps, ImageComponent.UPLOAD); m_imageComponent.setSelectedKey(ps, ImageComponent.UPLOAD);
} }
} }
}); });
add(m_result);
addGlobalStateParam(m_imageComponentKey);
}
/** add(m_result);
* Create the image library pane
*
* @return m_imageLibrary
*/
protected ImageLibraryComponent getImageLibraryPane() {
if (m_imageLibrary == null) {
m_imageLibrary = new ImageLibraryComponent(ImageComponent.SELECT_IMAGE,
this);
m_imageLibrary.getForm().addInitListener(m_selectListener);
m_imageLibrary.getForm().addProcessListener(m_selectListener);
m_imageComponent.getComponentsMap().put(ImageComponent.LIBRARY,
m_imageLibrary);
}
return m_imageLibrary;
}
/** addGlobalStateParam(m_imageComponentKey);
* Create the image upload pane }
*
* @return m_imageUpload
*/
protected ImageUploadComponent getImageUploadPane() {
if (m_imageUpload == null) { /**
m_imageUpload = new ImageUploadComponent(ImageComponent.SELECT_IMAGE); * Create the image library pane
m_imageUpload.getForm().addInitListener(m_selectListener); *
m_imageUpload.getForm().addProcessListener(m_selectListener); * @return m_imageLibrary
m_imageComponent.getComponentsMap().put(ImageComponent.UPLOAD, */
m_imageUpload); protected ImageLibraryComponent getImageLibraryPane() {
} if (m_imageLibrary == null) {
return m_imageUpload; m_imageLibrary = new ImageLibraryComponent(ImageComponent.SELECT_IMAGE,
} this);
m_imageLibrary.getForm().addInitListener(m_selectListener);
m_imageLibrary.getForm().addProcessListener(m_selectListener);
m_imageComponent.getComponentsMap().put(ImageComponent.LIBRARY,
m_imageLibrary);
}
return m_imageLibrary;
}
/** /**
* Creates an {@link ImageSelectResultComponent} * Create the image upload pane
* *
* @return m_resultPane * @return m_imageUpload
*/ */
protected ImageSelectResultComponent getResultComponent() { protected ImageUploadComponent getImageUploadPane() {
if (m_result == null) {
m_result = new ImageSelectResultComponent();
}
return m_result;
}
/** if (m_imageUpload == null) {
* Create the tabbed pane m_imageUpload = new ImageUploadComponent(ImageComponent.SELECT_IMAGE);
*/ m_imageUpload.getForm().addInitListener(m_selectListener);
protected TabbedPane createTabbedPane() { m_imageUpload.getForm().addProcessListener(m_selectListener);
TabbedPane pane = new TabbedPane(); m_imageComponent.getComponentsMap().put(ImageComponent.UPLOAD,
pane.setClassAttr(XSL_CLASS); m_imageUpload);
}
return m_imageUpload;
}
addToPane(pane, ImageComponent.LIBRARY, getImageLibraryPane()); /**
addToPane(pane, ImageComponent.UPLOAD, getImageUploadPane()); * Creates an {@link ImageSelectResultComponent}
pane.setDefaultPane(m_imageLibrary); *
* @return m_resultPane
*/
protected ImageSelectResultComponent getResultComponent() {
if (m_result == null) {
m_result = new ImageSelectResultComponent();
}
return m_result;
}
return pane; /**
} * Create the tabbed pane
*/
protected TabbedPane createTabbedPane() {
TabbedPane pane = new TabbedPane();
pane.setClassAttr(XSL_CLASS);
/** addToPane(pane, ImageComponent.LIBRARY, getImageLibraryPane());
* Adds the specified component, with the specified tab name, to the tabbed addToPane(pane, ImageComponent.UPLOAD, getImageUploadPane());
* pane only if it is not null. pane.setDefaultPane(m_imageLibrary);
*
* @param pane The pane to which to add the tab return pane;
* @param tabName The name of the tab if it's added }
* @param comp The component to add to the pane
*/ /**
protected void addToPane(final TabbedPane pane, * Adds the specified component, with the specified tab name, to the
final String tabName, * tabbed pane only if it is not null.
final Component comp) { *
if (comp != null) { * @param pane The pane to which to add the tab
pane.addTab(GlobalizationUtil.globalize("cms.ui.image_" + tabName) * @param tabName The name of the tab if it's added
.localize().toString(), comp); * @param comp The component to add to the pane
} */
} protected void addToPane(final TabbedPane pane,
final String tabName,
final Component comp) {
if (comp != null) {
pane.addTab(GlobalizationUtil.globalize("cms.ui.image_" + tabName)
.localize().toString(), comp);
}
}
} }

View File

@ -16,91 +16,99 @@ import com.arsdigita.xml.Element;
* A component which will insert a javascript to the xml output with the image * A component which will insert a javascript to the xml output with the image
* information for the OpenCCM plugin for Xinha editor. * information for the OpenCCM plugin for Xinha editor.
* *
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class ImageSelectResultComponent extends SimpleContainer public class ImageSelectResultComponent extends SimpleContainer
implements Resettable { implements Resettable {
boolean m_valid = false; boolean m_valid = false;
ImageAsset m_image; ImageAsset m_image;
String m_lastImageComponent; String m_lastImageComponent;
public ImageSelectResultComponent() { public ImageSelectResultComponent() {
super(); super();
} }
/** /**
* Save image imformation * Save image imformation
* *
* @param image an {@link ImageAsset} * @param image an {@link ImageAsset}
*/ */
public void setResult(final ImageAsset image, final String lastComponent) { public void setResult(final ImageAsset image, final String lastComponent) {
m_image = image; m_image = image;
m_lastImageComponent = lastComponent; m_lastImageComponent = lastComponent;
m_valid = (m_image != null); m_valid = (m_image != null);
} }
@Override /**
public void generateXML(PageState state, Element parent) { * Insert a script tag to the xml output with a JavaScript function to
* send the image information back to the Xinha plugin.
*
* @param state The current {@link PageState}
* @param parent The parent {@link Element}
*/
@Override
public void generateXML(PageState state, Element parent) {
Element scriptElem = parent.newChildElement("script"); Element scriptElem = parent.newChildElement("script");
scriptElem.addAttribute("type", "text/javascript"); scriptElem.addAttribute("type", "text/javascript");
StringBuilder script = new StringBuilder(1000); StringBuilder script = new StringBuilder(1000);
// Create funtion // Create function
script.append("function selectImage(button) {"); script.append("function selectImage(button) {");
// If there is a valid image // If there is a valid image
if (m_valid) { if (m_valid) {
// If in library mode, only listen to save button // If in library mode, only listen to save button
if (m_lastImageComponent.equals(ImageComponent.LIBRARY)) { if (m_lastImageComponent.equals(ImageComponent.LIBRARY)) {
script.append("if(button.id != \"save\" ) { return false; } "); script.append("if(button.id != \"save\" ) { return false; } ");
} }
// Send image parameters to xinha plugin // Send image parameters to xinha plugin
script.append("window.opener.openCCM.imageSet({"); script.append("window.opener.openCCM.imageSet({");
script.append(" src : \""); script.append(" src : \"");
script.append(URL.getDispatcherPath()); script.append(URL.getDispatcherPath());
script.append(Service.getImageURL(m_image)); script.append(Service.getImageURL(m_image));
script.append("\", "); script.append("\", ");
script.append(" name : \""); script.append(" name : \"");
script.append(m_image.getDisplayName()); script.append(m_image.getDisplayName());
script.append("\", "); script.append("\", ");
script.append(" width : \""); script.append(" width : \"");
script.append(m_image.getWidth()); script.append(m_image.getWidth());
script.append("\", "); script.append("\", ");
script.append(" height : \""); script.append(" height : \"");
script.append(m_image.getHeight()); script.append(m_image.getHeight());
script.append("\""); script.append("\"");
script.append("});"); script.append("});");
// Close window // Close window
script.append("self.close();"); script.append("self.close();");
} }
script.append("return false;"); script.append("return false;");
script.append("}"); script.append("}");
// If in upload mode and if there is a valid image, execute the // If in upload mode and if there is a valid image, execute the
// javascript function // javascript function
if (m_valid && ImageComponent.UPLOAD.equals(m_lastImageComponent)) { if (m_valid && ImageComponent.UPLOAD.equals(m_lastImageComponent)) {
script.append("selectImage();"); script.append("selectImage();");
} }
scriptElem.setText(script.toString()); scriptElem.setText(script.toString());
// Reset ImageSelectResultComponent // Reset ImageSelectResultComponent
reset(state); reset(state);
} }
/** /**
* Reset this component. * Reset this component.
* *
* @param state Page state * @param state Page state
*/ */
public void reset(PageState state) { @Override
setResult(null, null); public void reset(PageState state) {
} setResult(null, null);
}
} }

View File

@ -25,64 +25,64 @@ import java.io.IOException;
/** /**
* An image upload component. * An image upload component.
* *
* This component can be used in different places to add image upload capabilities * This component can be used in different places to add image upload
* in a convinient way. This class uses a listener class which should be extended * capabilities in a convinient way. This class uses a listener class which
* from {@link ImageComponentAbstractListener}. * should be extended from {@link ImageComponentAbstractListener}.
* *
* @author unknown * @author unknown
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class ImageUploadComponent extends Form implements ImageComponent { public class ImageUploadComponent extends Form implements ImageComponent {
private final FileUploadSection m_imageFile; private final FileUploadSection m_imageFile;
private final TextField m_caption; private final TextField m_caption;
private final TextField m_title; private final TextField m_title;
private final TextArea m_description; private final TextArea m_description;
private final TextField m_useContext; private final TextField m_useContext;
private final SaveCancelSection m_saveCancel; private final SaveCancelSection m_saveCancel;
private int m_mode; private int m_mode;
/** /**
* Creates an ImageUploadComponent in attach mode. * Creates an ImageUploadComponent in attach mode.
*/ */
public ImageUploadComponent() { public ImageUploadComponent() {
this(ImageComponent.ATTACH_IMAGE); this(ImageComponent.ATTACH_IMAGE);
} }
/** /**
* Creates an ImageUploadComponent with the selected mode. * Creates an ImageUploadComponent with the selected mode.
* *
* @param mode The operation mode (see {@link ImageComponent) * @param mode The operation mode (see {@link ImageComponent)
*/ */
public ImageUploadComponent(int mode) { public ImageUploadComponent(int mode) {
super("imageUploadComponent", new ColumnPanel(2)); super("imageUploadComponent", new ColumnPanel(2));
m_mode = mode; m_mode = mode;
setEncType("multipart/form-data"); setEncType("multipart/form-data");
m_imageFile = new FileUploadSection(GlobalizationUtil.globalize( m_imageFile = new FileUploadSection(GlobalizationUtil.globalize(
"cms.contentasset.image.ui.type"), "cms.contentasset.image.ui.type"),
"image", "image",
ImageAsset.MIME_JPEG); ImageAsset.MIME_JPEG);
m_imageFile.getFileUploadWidget() m_imageFile.getFileUploadWidget()
.addValidationListener(new NotNullValidationListener()); .addValidationListener(new NotNullValidationListener());
add(m_imageFile, ColumnPanel.FULL_WIDTH); add(m_imageFile, ColumnPanel.FULL_WIDTH);
// Initialize all widgets // Initialize all widgets
m_caption = new TextField("caption"); m_caption = new TextField("caption");
m_title = new TextField("title"); m_title = new TextField("title");
m_description = new TextArea("description"); m_description = new TextArea("description");
m_useContext = new TextField("useContext"); m_useContext = new TextField("useContext");
// add widget only if we are in attach mode // add widget only if we are in attach mode
if (m_mode == ImageComponent.ATTACH_IMAGE) { if (m_mode == ImageComponent.ATTACH_IMAGE) {
add(new Label(GlobalizationUtil add(new Label(GlobalizationUtil
.globalize("cms.contentasset.image.ui.caption"))); .globalize("cms.contentasset.image.ui.caption")));
m_caption.addValidationListener(new NotNullValidationListener()); m_caption.addValidationListener(new NotNullValidationListener());
m_caption.addValidationListener(new StringLengthValidationListener(40)); m_caption.addValidationListener(new StringLengthValidationListener(40));
m_caption.setSize(40); m_caption.setSize(40);
add(m_caption); add(m_caption);
// We only show the title and description fields in the case where // We only show the title and description fields in the case where
// getIsImageStepDescriptionAndTitleShown is false. // getIsImageStepDescriptionAndTitleShown is false.
// if (ItemImageAttachment.getConfig().getIsImageStepDescriptionAndTitleShown()) { // if (ItemImageAttachment.getConfig().getIsImageStepDescriptionAndTitleShown()) {
// add(new Label("Title")); // add(new Label("Title"));
@ -100,68 +100,78 @@ public class ImageUploadComponent extends Form implements ImageComponent {
// //
// } // }
add(new Label(GlobalizationUtil add(new Label(GlobalizationUtil
.globalize("cms.contentasset.image.ui.use_context"))); .globalize("cms.contentasset.image.ui.use_context")));
m_useContext.setSize(40); m_useContext.setSize(40);
add(m_useContext); add(m_useContext);
} }
m_saveCancel = new SaveCancelSection(); m_saveCancel = new SaveCancelSection();
add(m_saveCancel); add(m_saveCancel);
/* /*
* Removed by Quasimodo: Changed editing workflow, so that library comes * Removed by Quasimodo: Changed editing workflow, so that library comes
* first Also, library mode has now a link to upload images which will * first Also, library mode has now a link to upload images which will
* link to this form. Consequently, this link will create a loop, which * link to this form. Consequently, this link will create a loop, which
* isn't fatal but confusing. ActionLink library = new ActionLink( * isn't fatal but confusing.
* "Select an existing image" ); library.addActionListener( new *
* ActionListener() { public void actionPerformed( ActionEvent ev ) { * ActionLink library = new ActionLink("Select an existing image" );
* setImageComponent( ev.getPageState(), LIBRARY ); } } ); add( library, * library.addActionListener( new ActionListener() {
* ColumnPanel.FULL_WIDTH ); * public void actionPerformed( ActionEvent ev ) {
*/ * setImageComponent( ev.getPageState(), LIBRARY );
} * }
* } );
* add( library, ColumnPanel.FULL_WIDTH );
*/
}
public SaveCancelSection getSaveCancelSection() { @Override
return m_saveCancel; public SaveCancelSection getSaveCancelSection() {
} return m_saveCancel;
}
public ReusableImageAsset getImage(FormSectionEvent event) @Override
throws FormProcessException { public ReusableImageAsset getImage(FormSectionEvent event)
PageState ps = event.getPageState(); throws FormProcessException {
String filename = (String) m_imageFile.getFileName(event); PageState ps = event.getPageState();
File imageFile = m_imageFile.getFile(event); String filename = (String) m_imageFile.getFileName(event);
try { File imageFile = m_imageFile.getFile(event);
ReusableImageAsset image = new ReusableImageAsset(); try {
image.loadFromFile(filename, imageFile, ImageAsset.MIME_JPEG); ReusableImageAsset image = new ReusableImageAsset();
image.loadFromFile(filename, imageFile, ImageAsset.MIME_JPEG);
// image.setDescription((String) m_caption.getValue(ps)); // image.setDescription((String) m_caption.getValue(ps));
return image; return image;
} catch (IOException ex) { } catch (IOException ex) {
ImagesPane.S_LOG.error("Error loading image from file", ex); ImagesPane.S_LOG.error("Error loading image from file", ex);
throw new FormProcessException(ex.getMessage()); throw new FormProcessException(ex.getMessage());
} }
} }
public String getCaption(FormSectionEvent event) { @Override
PageState ps = event.getPageState(); public String getCaption(FormSectionEvent event) {
return (String) m_caption.getValue(ps); PageState ps = event.getPageState();
} return (String) m_caption.getValue(ps);
}
public String getDescription(FormSectionEvent event) { @Override
PageState ps = event.getPageState(); public String getDescription(FormSectionEvent event) {
return (String) m_description.getValue(ps); PageState ps = event.getPageState();
} return (String) m_description.getValue(ps);
}
public String getTitle(FormSectionEvent event) { @Override
PageState ps = event.getPageState(); public String getTitle(FormSectionEvent event) {
return (String) m_title.getValue(ps); PageState ps = event.getPageState();
} return (String) m_title.getValue(ps);
}
public String getUseContext(FormSectionEvent event) { @Override
PageState ps = event.getPageState(); public String getUseContext(FormSectionEvent event) {
return (String) m_useContext.getValue(ps); PageState ps = event.getPageState();
} return (String) m_useContext.getValue(ps);
}
public Form getForm() {
return this;
}
@Override
public Form getForm() {
return this;
}
} }

View File

@ -37,7 +37,7 @@ import org.apache.log4j.Logger;
/** /**
* A {@link LayoutPanel} to insert into {@link ContentSectionPage}. * A {@link LayoutPanel} to insert into {@link ContentSectionPage}.
* *
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class ImagesPane extends LayoutPanel implements Resettable { public class ImagesPane extends LayoutPanel implements Resettable {

View File

@ -53,7 +53,7 @@ import java.math.BigDecimal;
/** /**
* *
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
* @author Jens Pelzetter <jens@jp-digital.de> * @author Jens Pelzetter <jens@jp-digital.de>
*/ */
class ItemSearchCreateItemPane extends CMSContainer class ItemSearchCreateItemPane extends CMSContainer

View File

@ -51,7 +51,7 @@ import javax.servlet.http.HttpServletResponse;
* <p>The Item Search page.</p> * <p>The Item Search page.</p>
* *
* @author Scott Seago (scott@arsdigita.com) * @author Scott Seago (scott@arsdigita.com)
* @author Sören Bernstein (sbernstein@quasiweb.de) * @author Sören Bernstein <quasi@quasiweb.de>
* @author Jens Pelzetter (jens@jp-digital.de) * @author Jens Pelzetter (jens@jp-digital.de)
*/ */
public class ItemSearchPage extends CMSPage { public class ItemSearchPage extends CMSPage {

View File

@ -75,7 +75,7 @@ import org.apache.log4j.Logger;
* Edits a single category. * Edits a single category.
* *
* @author Justin Ross &lt;jross@redhat.com&gt; * @author Justin Ross &lt;jross@redhat.com&gt;
* @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Id: CategoryItemPane.java 1967 2009-08-29 21:05:51Z pboy $ * @version $Id: CategoryItemPane.java 1967 2009-08-29 21:05:51Z pboy $
*/ */
class CategoryItemPane extends BaseItemPane { class CategoryItemPane extends BaseItemPane {

View File

@ -41,7 +41,7 @@ import org.apache.log4j.Logger;
* This class is part of the admin GUI of CCM and extends the standard form * This class is part of the admin GUI of CCM and extends the standard form
* in order to present forms for managing the multi-language categories. * in order to present forms for managing the multi-language categories.
* *
* @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Id: CategoryLocalizationAddForm.java 287 2005-02-22 00:29:02Z sskracic $ * @version $Id: CategoryLocalizationAddForm.java 287 2005-02-22 00:29:02Z sskracic $
*/ */
public class CategoryLocalizationAddForm extends CategoryLocalizationForm { public class CategoryLocalizationAddForm extends CategoryLocalizationForm {

View File

@ -37,7 +37,7 @@ import org.apache.log4j.Logger;
* This class is part of the admin GUI of CCM and extends the standard form * This class is part of the admin GUI of CCM and extends the standard form
* in order to present forms for managing the multi-language categories. * in order to present forms for managing the multi-language categories.
* *
* @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Id: CategoryLocalizationEditForm.java $ * @version $Id: CategoryLocalizationEditForm.java $
*/ */
public class CategoryLocalizationEditForm extends CategoryLocalizationForm { public class CategoryLocalizationEditForm extends CategoryLocalizationForm {

View File

@ -48,7 +48,7 @@ import com.arsdigita.xml.Element;
* This class is part of the admin GUI of CCM and extends the standard form * This class is part of the admin GUI of CCM and extends the standard form
* in order to present forms for managing the multi-language categories. * in order to present forms for managing the multi-language categories.
* *
* @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Id: $ * @version $Id: $
*/ */
public class CategoryLocalizationForm extends BaseForm { public class CategoryLocalizationForm extends BaseForm {

View File

@ -45,7 +45,7 @@ import java.util.Locale;
* This class is part of the admin GUI of CCM and extends the standard form in * This class is part of the admin GUI of CCM and extends the standard form in
* order to present forms for managing the multi-language categories. * order to present forms for managing the multi-language categories.
* *
* @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class CategoryLocalizationTable extends Table implements TableActionListener { public class CategoryLocalizationTable extends Table implements TableActionListener {

View File

@ -16,7 +16,7 @@ import java.util.TooManyListenersException;
/** /**
* *
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public abstract class AbstractFolderPicker extends SingleSelect { public abstract class AbstractFolderPicker extends SingleSelect {

View File

@ -14,7 +14,7 @@ import com.arsdigita.cms.ItemCollection;
/** /**
* *
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
* @author Jens Pelzetter <jens@jp-digital.de> * @author Jens Pelzetter <jens@jp-digital.de>
* @version $Id$ * @version $Id$
*/ */

View File

@ -70,7 +70,7 @@ import javax.servlet.ServletException;
* 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 <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Id: FolderBrowser.java 2017 2009-10-04 09:03:45Z pboy $ * @version $Id: FolderBrowser.java 2017 2009-10-04 09:03:45Z pboy $
*/ */
public class FolderBrowser extends Table { public class FolderBrowser extends Table {
@ -509,7 +509,7 @@ public class FolderBrowser extends Table {
} }
/** /**
* Added by: Sören Bernstein <sbernstein@zes.uni-bremen.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 and the live status in the folder browser. * existing language version and the live status in the folder browser.

View File

@ -82,6 +82,7 @@ public class BaseRoleForm extends BaseForm {
} }
private class PrivilegePrinter implements PrintListener { private class PrivilegePrinter implements PrintListener {
@Override
public final void prepare(final PrintEvent e) { public final void prepare(final PrintEvent e) {
final CheckboxGroup target = (CheckboxGroup) e.getTarget(); final CheckboxGroup target = (CheckboxGroup) e.getTarget();
final PageState state = e.getPageState(); final PageState state = e.getPageState();
@ -107,6 +108,7 @@ public class BaseRoleForm extends BaseForm {
m_role = role; m_role = role;
} }
@Override
public final void validate(final ParameterEvent e) public final void validate(final ParameterEvent e)
throws FormProcessException { throws FormProcessException {
final PageState state = e.getPageState(); final PageState state = e.getPageState();

View File

@ -48,7 +48,7 @@ import java.util.List;
* search query engine. * search query engine.
* *
* @author unknown * @author unknown
* @author Sören Bernstein (sbernstein@quasiweb.de) * @author Sören Bernstein <quasi@quasiweb.de>
* @author Jens Pelzetter (jens@jp-digital.de) * @author Jens Pelzetter (jens@jp-digital.de)
*/ */
public class ItemQueryComponent extends BaseQueryComponent { public class ItemQueryComponent extends BaseQueryComponent {

View File

@ -41,7 +41,7 @@ import org.apache.log4j.Logger;
/** /**
* @author unknown * @author unknown
* @author Sören Bernstein * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Id: AssignedTaskSection.java 1280 2006-07-27 09:12:09Z cgyg9330 $ * @version $Id: AssignedTaskSection.java 1280 2006-07-27 09:12:09Z cgyg9330 $
*/ */
public final class AssignedTaskSection extends Section { public final class AssignedTaskSection extends Section {

View File

@ -38,7 +38,7 @@ import java.util.StringTokenizer;
* Utility methods for dealing with the multilingual items. * Utility methods for dealing with the multilingual items.
* *
* @author Shashin Shinde (sshinde@redhat.com) * @author Shashin Shinde (sshinde@redhat.com)
* @author Sören Bernstein * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class LanguageUtil { public class LanguageUtil {

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,7 @@ import com.arsdigita.bebop.util.GlobalizationUtil;
* the right. * the right.
* *
* @author Stanislav Freidin * @author Stanislav Freidin
* @author Sören Bernstein (sbernstein@quasiweb.de) * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Id: SaveCancelSection.java 287 2005-02-22 00:29:02Z sskracic $ * @version $Id: SaveCancelSection.java 287 2005-02-22 00:29:02Z sskracic $
*/ */
public class SaveCancelSection extends FormSection { public class SaveCancelSection extends FormSection {

View File

@ -48,7 +48,7 @@ import java.util.Locale;
* @author Karl Goldstein * @author Karl Goldstein
* @author Uday Mathur * @author Uday Mathur
* @author Michael Pih * @author Michael Pih
* @author Sören Bernstein * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Id: Date.java 288 2010-02-20 07:29:00Z sbernstein $ * @version $Id: Date.java 288 2010-02-20 07:29:00Z sbernstein $
*/ */
public class Date extends Widget implements BebopConstants { public class Date extends Widget implements BebopConstants {

View File

@ -30,7 +30,7 @@ import com.arsdigita.xml.Element;
* A class representing a date and time field in an HTML form. * A class representing a date and time field in an HTML form.
* (based on the code in Date.java) * (based on the code in Date.java)
* *
* @author Sören Bernstein * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Id: DateTime.java 288 2010-02-20 07:29:00Z ssbernstein $ * @version $Id: DateTime.java 288 2010-02-20 07:29:00Z ssbernstein $
*/ */
public class DateTime extends Widget implements BebopConstants { public class DateTime extends Widget implements BebopConstants {

View File

@ -38,7 +38,7 @@ import java.util.Locale;
* *
* @see com.arsdigita.bebop.form.DateTime * @see com.arsdigita.bebop.form.DateTime
* @author Dave Turner * @author Dave Turner
* @author Sören Bernstein * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Id: Time.java 288 2010-02-20 07:29:00Z sbernstein $ * @version $Id: Time.java 288 2010-02-20 07:29:00Z sbernstein $
*/ */
public class Time extends Widget implements BebopConstants { public class Time extends Widget implements BebopConstants {

View File

@ -28,7 +28,7 @@ import javax.servlet.http.HttpServletRequest;
* combination with an additional Boolean DB field to keep track * combination with an additional Boolean DB field to keep track
* of the incomplete entry. * of the incomplete entry.
* *
* @author Sören Bernstein * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class IncompleteDateParameter extends DateParameter { public class IncompleteDateParameter extends DateParameter {

View File

@ -27,7 +27,7 @@ import org.apache.log4j.Logger;
/** /**
* Stores the configuration record for the Categorization functionality. * Stores the configuration record for the Categorization functionality.
* *
* @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de * @author Sören Bernstein <quasi@quasiweb.de>
* @version $Id: CategorizationConfig.java 1169 2008-06-05 16:08:25Z quasimodo $ * @version $Id: CategorizationConfig.java 1169 2008-06-05 16:08:25Z quasimodo $
*/ */
public final class CategorizationConfig extends AbstractConfig { public final class CategorizationConfig extends AbstractConfig {

View File

@ -27,7 +27,7 @@ import java.math.BigDecimal;
/** /**
* *
* @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class CategoryLocalization extends ACSObject { public class CategoryLocalization extends ACSObject {

View File

@ -29,7 +29,7 @@ import com.arsdigita.persistence.DataCollection;
* Category} and other classes. See, for example, {@link Category#getChildren()} * Category} and other classes. See, for example, {@link Category#getChildren()}
* or {@link Category#getDescendants()}.</p> * or {@link Category#getDescendants()}.</p>
* *
* @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de * @author Sören Bernstein <quasi@quasiweb.de>
**/ **/
public class CategoryLocalizationCollection extends ACSObjectCollection { public class CategoryLocalizationCollection extends ACSObjectCollection {

View File

@ -16,7 +16,7 @@ import javax.servlet.http.HttpSession;
/** /**
* *
* @author Sören Bernstein * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class GlobalizationHelper { public class GlobalizationHelper {

View File

@ -193,6 +193,7 @@ public class PermissionManager {
// to know that there is an assertion in the save() method in // to know that there is an assertion in the save() method in
// the Permission class. // the Permission class.
new KernelExcursion() { new KernelExcursion() {
@Override
public void excurse() { public void excurse() {
setEffectiveParty(Kernel.getSystemParty()); setEffectiveParty(Kernel.getSystemParty());
p.save(); p.save();

File diff suppressed because it is too large Load Diff

View File

@ -42,7 +42,7 @@ import java.util.Locale;
* Effect will be visible in Mandalay beginning with r163. * Effect will be visible in Mandalay beginning with r163.
* *
* @author unknown... * @author unknown...
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class DateRangeFilterWidget extends FilterWidget { public class DateRangeFilterWidget extends FilterWidget {

View File

@ -56,15 +56,15 @@ interface AdminConstants {
/** Administration main tab names. */ /** Administration main tab names. */
Label USER_TAB_TITLE = new Label Label USER_TAB_TITLE = new Label
(new GlobalizedMessage("ui.admin.tab.user.title", (new GlobalizedMessage("ui.admin.tab.user",
BUNDLE_NAME)); BUNDLE_NAME));
Label GROUP_TAB_TITLE = new Label Label GROUP_TAB_TITLE = new Label
(new GlobalizedMessage("ui.admin.tab.group.title", (new GlobalizedMessage("ui.admin.tab.group",
BUNDLE_NAME)); BUNDLE_NAME));
Label APPLICATIONS_TAB_TITLE = new Label Label APPLICATIONS_TAB_TITLE = new Label
(new GlobalizedMessage("ui.admin.tab.applications.title", (new GlobalizedMessage("ui.admin.tab.applications",
BUNDLE_NAME)); BUNDLE_NAME));
Label INFO_TAB_TITLE = new Label(new GlobalizedMessage("ui.admin.tab.info.title", BUNDLE_NAME)); Label INFO_TAB_TITLE = new Label(new GlobalizedMessage("ui.admin.tab.info.title", BUNDLE_NAME));

View File

@ -34,13 +34,13 @@ ui.admin.nav.logout=Log out
ui.admin.nav.workspace=Workspace ui.admin.nav.workspace=Workspace
ui.admin.searchAndList.submit=Search ui.admin.searchAndList.submit=Search
ui.admin.searchAndList.submitAgain=Search Again ui.admin.searchAndList.submitAgain=Search Again
ui.admin.tab.group.title=Groups ui.admin.tab.group=Groups
ui.admin.tab.user.browse=Browse ui.admin.tab.user.browse=Browse
ui.admin.tab.user.createuser=Create new user ui.admin.tab.user.createuser=Create new user
ui.admin.tab.user.navbartitle=User Administration ui.admin.tab.user.navbartitle=User Administration
ui.admin.tab.user.search=Search ui.admin.tab.user.search=Search
ui.admin.tab.user.summary=Summary ui.admin.tab.user.summary=Summary
ui.admin.tab.user.title=Users ui.admin.tab.user=Users
ui.admin.user.action.continue=Continue ui.admin.user.action.continue=Continue
ui.admin.user.action.delete.failed.header=Unable to delete user ui.admin.user.action.delete.failed.header=Unable to delete user
ui.admin.user.action.header=Actions ui.admin.user.action.header=Actions
@ -90,7 +90,7 @@ ui.admin.user.userpasswordform.confirmpasswordlabel=Confirm password:
ui.admin.user.userpasswordform.passwordlabel=Password: ui.admin.user.userpasswordform.passwordlabel=Password:
ui.admin.user.userpasswordform.question=Question: ui.admin.user.userpasswordform.question=Question:
ui.admin.user.userpasswordform.submit=Change ui.admin.user.userpasswordform.submit=Change
ui.admin.tab.applications.title=Applications ui.admin.tab.applications=Applications
ui.admin.applications.tree.heading=Applications ui.admin.applications.tree.heading=Applications
ui.admin.applications.url.validation.not_blank=The URL of an application instance can is mandatory. ui.admin.applications.url.validation.not_blank=The URL of an application instance can is mandatory.
ui.admin.applications.url.valiation.minmaxlength=The length of an URL of an application instance must be between 1 and 100 characters. ui.admin.applications.url.valiation.minmaxlength=The length of an URL of an application instance must be between 1 and 100 characters.

View File

@ -34,13 +34,13 @@ ui.admin.nav.logout=Abmelden
ui.admin.nav.workspace=Workspace ui.admin.nav.workspace=Workspace
ui.admin.searchAndList.submit=Suchen ui.admin.searchAndList.submit=Suchen
ui.admin.searchAndList.submitAgain=Erneut suchen ui.admin.searchAndList.submitAgain=Erneut suchen
ui.admin.tab.group.title=Gruppen ui.admin.tab.group=Gruppen
ui.admin.tab.user.browse=Bl\u00e4ttern ui.admin.tab.user.browse=Bl\u00e4ttern
ui.admin.tab.user.createuser=Neuen Benutzer erstellen ui.admin.tab.user.createuser=Neuen Benutzer erstellen
ui.admin.tab.user.navbartitle=Benutzerverwaltung ui.admin.tab.user.navbartitle=Benutzerverwaltung
ui.admin.tab.user.search=Suche ui.admin.tab.user.search=Suche
ui.admin.tab.user.summary=Zusammenfassung ui.admin.tab.user.summary=Zusammenfassung
ui.admin.tab.user.title=Benutzer ui.admin.tab.user=Benutzer
ui.admin.user.action.continue=Fortfahren ui.admin.user.action.continue=Fortfahren
ui.admin.user.action.delete.failed.header=Benutzer kann nicht gel\u00f6scht werden ui.admin.user.action.delete.failed.header=Benutzer kann nicht gel\u00f6scht werden
ui.admin.user.action.header=Aktionen ui.admin.user.action.header=Aktionen
@ -90,7 +90,7 @@ ui.admin.user.userpasswordform.confirmpasswordlabel=Passwort best\u00e4tigen\:
ui.admin.user.userpasswordform.passwordlabel=Passwort\: ui.admin.user.userpasswordform.passwordlabel=Passwort\:
ui.admin.user.userpasswordform.question=Frage\: ui.admin.user.userpasswordform.question=Frage\:
ui.admin.user.userpasswordform.submit=\u00c4ndern ui.admin.user.userpasswordform.submit=\u00c4ndern
ui.admin.tab.applications.title=Applikationen ui.admin.tab.applications=Applikationen
ui.admin.applications.tree.heading=Applikationen ui.admin.applications.tree.heading=Applikationen
ui.admin.applications.url.validation.not_blank=Die Angabe einer URL ist erforderlich ui.admin.applications.url.validation.not_blank=Die Angabe einer URL ist erforderlich
ui.admin.applications.url.valiation.minmaxlength=Die URL einer Applikations-Instanz muss zwischen einem und 100 Zeichen lang sein ui.admin.applications.url.valiation.minmaxlength=Die URL einer Applikations-Instanz muss zwischen einem und 100 Zeichen lang sein

View File

@ -34,13 +34,13 @@ ui.admin.nav.logout=Log out
ui.admin.nav.workspace=Workspace ui.admin.nav.workspace=Workspace
ui.admin.searchAndList.submit=Search ui.admin.searchAndList.submit=Search
ui.admin.searchAndList.submitAgain=Search Again ui.admin.searchAndList.submitAgain=Search Again
ui.admin.tab.group.title=Groups ui.admin.tab.group=Groups
ui.admin.tab.user.browse=Browse ui.admin.tab.user.browse=Browse
ui.admin.tab.user.createuser=Create new user ui.admin.tab.user.createuser=Create new user
ui.admin.tab.user.navbartitle=User Administration ui.admin.tab.user.navbartitle=User Administration
ui.admin.tab.user.search=Search ui.admin.tab.user.search=Search
ui.admin.tab.user.summary=Summary ui.admin.tab.user.summary=Summary
ui.admin.tab.user.title=Users ui.admin.tab.user=Users
ui.admin.user.action.continue=Continue ui.admin.user.action.continue=Continue
ui.admin.user.action.delete.failed.header=Unable to delete user ui.admin.user.action.delete.failed.header=Unable to delete user
ui.admin.user.action.header=Actions ui.admin.user.action.header=Actions
@ -90,7 +90,7 @@ ui.admin.user.userpasswordform.confirmpasswordlabel=Confirm password:
ui.admin.user.userpasswordform.passwordlabel=Password: ui.admin.user.userpasswordform.passwordlabel=Password:
ui.admin.user.userpasswordform.question=Question: ui.admin.user.userpasswordform.question=Question:
ui.admin.user.userpasswordform.submit=Change ui.admin.user.userpasswordform.submit=Change
ui.admin.tab.applications.title=Applications ui.admin.tab.applications=Applications
ui.admin.applications.tree.heading=Applications ui.admin.applications.tree.heading=Applications
ui.admin.applications.url.validation.not_blank= ui.admin.applications.url.validation.not_blank=
ui.admin.applications.url.valiation.minmaxlength= ui.admin.applications.url.valiation.minmaxlength=

View File

@ -25,13 +25,13 @@ ui.admin.nav.logout=D\u00e9connexion
ui.admin.nav.workspace=Espace de travail ui.admin.nav.workspace=Espace de travail
ui.admin.searchAndList.submit=Rechercher ui.admin.searchAndList.submit=Rechercher
ui.admin.searchAndList.submitAgain=Rechercher suivant ui.admin.searchAndList.submitAgain=Rechercher suivant
ui.admin.tab.group.title=Groupe ui.admin.tab.group=Groupe
ui.admin.tab.user.browse=Parcourir ui.admin.tab.user.browse=Parcourir
ui.admin.tab.user.createuser=Cr\u00e9er un nouvel utilisateur ui.admin.tab.user.createuser=Cr\u00e9er un nouvel utilisateur
ui.admin.tab.user.navbartitle=Gestion de l'utilisateur ui.admin.tab.user.navbartitle=Gestion de l'utilisateur
ui.admin.tab.user.search=Rechercher ui.admin.tab.user.search=Rechercher
ui.admin.tab.user.summary=Table des mati\u00e8res ui.admin.tab.user.summary=Table des mati\u00e8res
ui.admin.tab.user.title=Utilisateurs ui.admin.tab.user=Utilisateurs
ui.admin.user.action.continue=Continuer ui.admin.user.action.continue=Continuer
ui.admin.user.action.delete.failed.header=Impossible de supprimer l'utiisateur ui.admin.user.action.delete.failed.header=Impossible de supprimer l'utiisateur
ui.admin.user.action.header=Actions ui.admin.user.action.header=Actions
@ -76,7 +76,7 @@ ui.admin.user.userpasswordform.confirmpasswordlabel=Confirmer le mot de passe:
ui.admin.user.userpasswordform.passwordlabel=Mot de passe: ui.admin.user.userpasswordform.passwordlabel=Mot de passe:
ui.admin.user.userpasswordform.question=Question: ui.admin.user.userpasswordform.question=Question:
ui.admin.user.userpasswordform.submit=Changer ui.admin.user.userpasswordform.submit=Changer
ui.admin.tab.applications.title= ui.admin.tab.applications=
ui.admin.applications.tree.heading= ui.admin.applications.tree.heading=
ui.admin.applications.url.validation.not_blank= ui.admin.applications.url.validation.not_blank=
ui.admin.applications.url.valiation.minmaxlength= ui.admin.applications.url.valiation.minmaxlength=

View File

@ -11,7 +11,7 @@ import java.util.Set;
/** /**
* *
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de> * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class SystemInformation implements Lockable { public class SystemInformation implements Lockable {

View File

@ -56,6 +56,7 @@ public class ConfigParameterList extends SimpleContainer {
XML_NS); XML_NS);
} }
@Override
public void generateXML(PageState state, public void generateXML(PageState state,
Element parent) { Element parent) {
Element content = generateParent(parent); Element content = generateParent(parent);
@ -117,6 +118,7 @@ public class ConfigParameterList extends SimpleContainer {
p.addAttribute("isRequired", XML.format(new Boolean(param.isRequired()))); p.addAttribute("isRequired", XML.format(new Boolean(param.isRequired())));
param.write(new ParameterWriter() { param.write(new ParameterWriter() {
@Override
public void write(Parameter param, String value) { public void write(Parameter param, String value) {
if (value != null) { if (value != null) {
p.addAttribute("value", value); p.addAttribute("value", value);
@ -152,6 +154,7 @@ public class ConfigParameterList extends SimpleContainer {
m_contexts = contexts; m_contexts = contexts;
} }
@Override
public void startElement(String uri, String localName, String qn, public void startElement(String uri, String localName, String qn,
Attributes attrs) { Attributes attrs) {
if (localName.equals("config")) { if (localName.equals("config")) {

View File

@ -30,7 +30,7 @@ import java.text.DateFormat;
* is ommitted. * is ommitted.
* *
* @author unkknown * @author unkknown
* @author Sören Bernstein * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class DateFormatter implements Formatter { public class DateFormatter implements Formatter {

View File

@ -29,7 +29,7 @@ import java.text.DateFormat;
* 'medium' format and the time in 'short' format. * 'medium' format and the time in 'short' format.
* *
* @author unknown * @author unknown
* @author Sören Bernstein * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class DateTimeFormatter implements Formatter { public class DateTimeFormatter implements Formatter {

View File

@ -30,7 +30,7 @@ import java.text.DateFormat;
* is ommitted. * is ommitted.
* *
* @author unknown * @author unknown
* @author Sören Bernstein * @author Sören Bernstein <quasi@quasiweb.de>
*/ */
public class TimeFormatter implements Formatter { public class TimeFormatter implements Formatter {

View File

@ -27,172 +27,213 @@ import org.apache.log4j.Logger;
* Cursor * Cursor
* *
* @author <a href="mailto:rhs@mit.edu">rhs@mit.edu</a> * @author <a href="mailto:rhs@mit.edu">rhs@mit.edu</a>
* @author Sören Bernstein <quasi@quasiweb.de>
* @version $Id: Cursor.java 1393 2006-11-28 09:12:32Z sskracic $ * @version $Id: Cursor.java 1393 2006-11-28 09:12:32Z sskracic $
**/ *
*/
public class Cursor { public class Cursor {
private static final Logger s_log = Logger.getLogger(Cursor.class); private static final Logger s_log = Logger.getLogger(Cursor.class);
final private DataSet m_ds;
private RecordSet m_rs = null;
private Map m_values = null;
private long m_position = 0;
private boolean m_closed = false;
private Map m_options = new HashMap();
final private DataSet m_ds; protected Cursor(DataSet ds) {
m_ds = ds;
}
private RecordSet m_rs = null; public void setOptions(Map options) {
private Map m_values = null; m_options.clear();
private long m_position = 0; m_options.putAll(options);
private boolean m_closed = false; }
private Map m_options = new HashMap();
protected Cursor(DataSet ds) { public DataSet getDataSet() {
m_ds = ds; return m_ds;
} }
public void setOptions(Map options) { public Session getSession() {
m_options.clear(); return m_ds.getSession();
m_options.putAll(options); }
}
public DataSet getDataSet() { public boolean isClosed() {
return m_ds; return m_closed;
} }
public Session getSession() { private Object getInternal(Path path) {
return m_ds.getSession(); if (m_values.containsKey(path)) {
} return m_values.get(path);
} else {
Object o = getInternal(path.getParent());
if (o == null) {
return null;
}
return getSession().get(o, Path.get(path.getName()));
}
}
public boolean isClosed() { public Object get(Path path) {
return m_closed; if (m_closed) {
} throw new ClosedException(this);
}
private Object getInternal(Path path) { if (m_position <= 0) {
if (m_values.containsKey(path)) { throw new NoRowException(this);
return m_values.get(path); }
} else {
Object o = getInternal(path.getParent());
if (o == null) { return null; }
return getSession().get(o, Path.get(path.getName()));
}
}
public Object get(Path path) { if (!m_rs.isFetched(path)) {
if (m_closed) { if (s_log.isDebugEnabled()) {
throw new ClosedException(this); s_log.debug("path " + path + " is not fetched"
} + " in signature " + m_ds.getSignature());
}
throw new NotFetchedException(this, path);
}
if (m_position <= 0) { return getInternal(path);
throw new NoRowException(this); }
}
if (!m_rs.isFetched(path)) { public Object get(String path) {
if (s_log.isDebugEnabled()) { if (m_closed) {
s_log.debug("path " + path + " is not fetched" throw new ClosedException(this);
+ " in signature " + m_ds.getSignature()); }
}
throw new NotFetchedException(this, path);
}
return getInternal(path); return get(Path.get(path));
} }
public Object get(String path) { public Object get() {
if (m_closed) { if (m_closed) {
throw new ClosedException(this); throw new ClosedException(this);
} }
return get(Path.get(path)); return m_values.get(null);
} }
public Object get() { public boolean next() {
if (m_closed) { if (m_closed) {
throw new ClosedException(this); throw new ClosedException(this);
} }
return m_values.get(null); if (m_position == -1) {
} return false;
}
public boolean next() { if (m_rs == null) {
if (m_closed) { getSession().flush();
throw new ClosedException(this); m_rs = execute();
} }
if (m_position == -1) { if (m_rs.next()) {
return false; m_values = m_rs.load(getSession());
}
if (m_rs == null) { m_position++;
getSession().flush(); return true;
m_rs = execute(); } else {
} m_position = -1;
free();
return false;
}
}
if (m_rs.next()) { protected RecordSet execute() {
m_values = m_rs.load(getSession()); return getSession().getEngine().execute(m_ds.getSignature(),
m_ds.getExpression(),
m_options);
}
m_position++; public boolean isBeforeFirst() {
return true; if (m_closed) {
} else { throw new ClosedException(this);
m_position = -1; }
free();
return false;
}
}
protected RecordSet execute() { return m_position == 0;
return getSession().getEngine().execute(m_ds.getSignature(), }
m_ds.getExpression(),
m_options);
}
public boolean isBeforeFirst() { public boolean isFirst() {
if (m_closed) { if (m_closed) {
throw new ClosedException(this); throw new ClosedException(this);
} }
return m_position == 0; return m_position == 1;
} }
public boolean isFirst() { public boolean isAfterLast() {
if (m_closed) { if (m_closed) {
throw new ClosedException(this); throw new ClosedException(this);
} }
return m_position == 1; return m_position == -1;
} }
public boolean isAfterLast() { public long getPosition() {
if (m_closed) { if (m_closed) {
throw new ClosedException(this); throw new ClosedException(this);
} }
return m_position == -1; if (m_position > 0) {
} return m_position;
} else {
return 0;
}
}
public long getPosition() { public void rewind() {
if (m_closed) { close();
throw new ClosedException(this); m_position = 0;
} m_closed = false;
}
if (m_position > 0) { private void free() {
return m_position; if (m_rs != null) {
} else { m_rs.close();
return 0; m_rs = null;
} }
} }
public void rewind() { public void close() {
close(); free();
m_position = 0; m_closed = true;
m_closed = false; }
}
private void free() { /**
if (m_rs != null) { * An expensive previous method, which will iterate the list from the
m_rs.close(); * beginning to the previous to current position. Sadly, the more efficient
m_rs = null; * way is not possible with this persistent layer because it will only work
} * with ResultSets in FORWARD_ONLY mode.
} *
* @return boolean true, if there is a previous element, false otherwise
*/
public boolean previous() {
if (m_closed) {
throw new ClosedException(this);
}
public void close() { // Make sure, we don't go before the first entry (position == 1)
free(); if (m_position <= 1) {
m_closed = true; return false;
} }
// If there isn't a result set, get a new one
if (m_rs == null) {
getSession().flush();
m_rs = execute();
}
// Have to go the long way because the persistent layer can only operate
// with ResultSet in FORWARD_ONLY mode
long newPosition = getPosition() - 1;
// Reset the list, aka rewind and get a new resultset
rewind();
getSession().flush();
m_rs = execute();
// Iterate to new position
while (m_position < newPosition) {
next();
}
return true;
}
} }