Änderungen an ImageEditStep zur Unterstützung von Bildgallerien
git-svn-id: https://svn.libreccm.org/ccm/trunk@1701 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
fa56786e53
commit
9e5e1a7e20
|
|
@ -21,6 +21,8 @@ package com.arsdigita.cms.contentassets.ui;
|
|||
import com.arsdigita.cms.contentassets.ItemImageAttachment;
|
||||
|
||||
import com.arsdigita.bebop.AbstractSingleSelectionModel;
|
||||
import com.arsdigita.bebop.ActionLink;
|
||||
import com.arsdigita.bebop.ColumnPanel;
|
||||
import com.arsdigita.bebop.Page;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.RequestLocal;
|
||||
|
|
@ -29,6 +31,7 @@ import com.arsdigita.bebop.event.ActionListener;
|
|||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.ImageChooser;
|
||||
import com.arsdigita.cms.ui.SecurityPropertyEditor;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
|
|
@ -68,11 +71,13 @@ public class ImageStep extends SecurityPropertyEditor {
|
|||
m_attachmentOID = new OIDParameter( "attachmentID" );
|
||||
m_attachmentSelection = new AttachmentSelectionModel();
|
||||
|
||||
|
||||
m_add = new ImageStepEdit( this );
|
||||
WorkflowLockedComponentAccess addCA =
|
||||
new WorkflowLockedComponentAccess( m_add, m_itemSelection );
|
||||
addComponent( "add", "Add Image", addCA );
|
||||
|
||||
|
||||
m_display = new ImageStepDisplay( this );
|
||||
setDisplayComponent(m_display);
|
||||
|
||||
|
|
@ -93,6 +98,7 @@ public class ImageStep extends SecurityPropertyEditor {
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register( Page p ) {
|
||||
super.register( p );
|
||||
|
||||
|
|
@ -132,9 +138,12 @@ public class ImageStep extends SecurityPropertyEditor {
|
|||
extends AbstractSingleSelectionModel
|
||||
{
|
||||
private final RequestLocal m_attachment = new RequestLocal() {
|
||||
@Override
|
||||
protected Object initialValue( PageState ps ) {
|
||||
OID oid = (OID) getSelectedKey( ps );
|
||||
if( null == oid ) return null;
|
||||
if( null == oid ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return DomainObjectFactory.newInstance( oid );
|
||||
}
|
||||
|
|
@ -142,7 +151,9 @@ public class ImageStep extends SecurityPropertyEditor {
|
|||
|
||||
public Object getSelectedKey( PageState ps ) {
|
||||
OID oid = (OID) ps.getValue( m_attachmentOID );
|
||||
if( null == oid ) return null;
|
||||
if( null == oid ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return oid;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
|
||||
package com.arsdigita.cms.contentassets.ui;
|
||||
|
||||
import com.arsdigita.cms.contentassets.ItemImageAttachment;
|
||||
|
||||
import com.arsdigita.bebop.ActionLink;
|
||||
import com.arsdigita.bebop.ColumnPanel;
|
||||
import com.arsdigita.bebop.Component;
|
||||
|
|
@ -39,33 +37,31 @@ import com.arsdigita.bebop.event.FormProcessListener;
|
|||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.event.ParameterEvent;
|
||||
import com.arsdigita.bebop.event.ParameterListener;
|
||||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.bebop.form.TextArea;
|
||||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||
import com.arsdigita.bebop.parameters.StringLengthValidationListener;
|
||||
import com.arsdigita.bebop.parameters.ParameterData;
|
||||
import com.arsdigita.bebop.parameters.StringLengthValidationListener;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.util.Assert;
|
||||
import com.arsdigita.util.StringUtils;
|
||||
|
||||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.ImageAsset;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ReusableImageAsset;
|
||||
import com.arsdigita.cms.contentassets.ItemImageAttachment;
|
||||
import com.arsdigita.cms.ui.FileUploadSection;
|
||||
import com.arsdigita.cms.ui.ImageBrowser;
|
||||
import com.arsdigita.cms.ui.ImageChooser;
|
||||
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.util.Assert;
|
||||
import com.arsdigita.util.StringUtils;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
public class ImageStepEdit extends SimpleContainer
|
||||
|
|
@ -143,8 +139,9 @@ public class ImageStepEdit extends SimpleContainer
|
|||
private void setImageComponent( PageState ps, final String activeKey ) {
|
||||
m_imageComponent.setSelectedKey( ps, activeKey );
|
||||
|
||||
if( s_log.isDebugEnabled() )
|
||||
if( s_log.isDebugEnabled() ) {
|
||||
s_log.debug( "Selected component: " + activeKey );
|
||||
}
|
||||
|
||||
Map componentsMap = m_imageComponent.getComponentsMap();
|
||||
Iterator i = componentsMap.keySet().iterator();
|
||||
|
|
@ -167,17 +164,18 @@ public class ImageStepEdit extends SimpleContainer
|
|||
PageState ps = event.getPageState();
|
||||
|
||||
ItemImageAttachment attachment = m_imageStep.getAttachment( ps );
|
||||
if( null == attachment ) return;
|
||||
|
||||
// XXX: Do something
|
||||
if( null == attachment ) {
|
||||
// XXX: Do something
|
||||
}
|
||||
}
|
||||
|
||||
public void process( FormSectionEvent event ) throws FormProcessException {
|
||||
PageState ps = event.getPageState();
|
||||
ImageComponent component = getImageComponent( ps );
|
||||
|
||||
if( !component.getSaveCancelSection().getSaveButton().isSelected( ps ) )
|
||||
if( !component.getSaveCancelSection().getSaveButton().isSelected( ps ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
ContentItem item = m_imageStep.getItem( ps );
|
||||
if( null == item ) {
|
||||
|
|
@ -270,7 +268,8 @@ public class ImageStepEdit extends SimpleContainer
|
|||
add(new Label("Use Context"));
|
||||
m_useContext = new TextField("useContext");
|
||||
m_useContext.setSize(40);
|
||||
m_useContext.addValidationListener( new UniqueUseContextListener() );
|
||||
// Removed to use multiple images with fancyBox
|
||||
// m_useContext.addValidationListener( new UniqueUseContextListener() );
|
||||
add(m_useContext);
|
||||
|
||||
m_saveCancel = new SaveCancelSection();
|
||||
|
|
@ -417,7 +416,8 @@ public class ImageStepEdit extends SimpleContainer
|
|||
m_form.add(new Label("Use Context"));
|
||||
m_useContext = new TextField("useContext");
|
||||
m_useContext.setSize(40);
|
||||
m_useContext.addValidationListener( new UniqueUseContextListener() );
|
||||
// Removed to use multiple images with fancyBox
|
||||
// m_useContext.addValidationListener( new UniqueUseContextListener() );
|
||||
m_form.add(m_useContext);
|
||||
|
||||
m_saveCancel = new SaveCancelSection();
|
||||
|
|
|
|||
|
|
@ -530,7 +530,7 @@ cms.ui.item.invalid_end_date_please_try_again=Ung\u00fcltiges Enddatum, bitte er
|
|||
cms.ui.item.invalid_start_date_please_try_again=Un\u00fcltiges Anfangsdatum, bitte erneut versuchen
|
||||
cms.ui.item.language.add=Sprache hinzuf\u00fcgen
|
||||
cms.ui.item.language.change=Sprache \u00e4ndern
|
||||
cms.ui.item.languages=Sprachen
|
||||
cms.ui.item.languages=Sprachen
|
||||
|
||||
cms.ui.item.lifecycle.apply=Anzuwendenden Lebenszyklus ausw\u00e4hlen
|
||||
cms.ui.item.lifecycle.end_date=Enddatum
|
||||
|
|
|
|||
Loading…
Reference in New Issue