ImageSelectPage und ImagePane
Weitere Korrekturen für das EventHandling endlich die image_search.jsp eingecheckt... git-svn-id: https://svn.libreccm.org/ccm/trunk@1773 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
b988c2de2b
commit
4a543c0f5d
|
|
@ -20,12 +20,12 @@ import org.apache.log4j.Logger;
|
||||||
*
|
*
|
||||||
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de>
|
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de>
|
||||||
*/
|
*/
|
||||||
public class ImageComponentAttachListener implements FormInitListener, FormProcessListener {
|
public abstract class ImageComponentAbstractListener implements FormInitListener, FormProcessListener {
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(ImageComponentSelectListener.class);
|
private static final Logger s_log = Logger.getLogger(ImageComponentSelectListener.class);
|
||||||
MapComponentSelectionModel m_imageComponent;
|
MapComponentSelectionModel m_imageComponent;
|
||||||
|
|
||||||
public ImageComponentAttachListener(MapComponentSelectionModel imageComponent) {
|
public ImageComponentAbstractListener(MapComponentSelectionModel imageComponent) {
|
||||||
super();
|
super();
|
||||||
m_imageComponent = imageComponent;
|
m_imageComponent = imageComponent;
|
||||||
}
|
}
|
||||||
|
|
@ -33,12 +33,9 @@ public class ImageComponentAttachListener implements FormInitListener, FormProce
|
||||||
public void init(FormSectionEvent event)
|
public void init(FormSectionEvent event)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
PageState ps = event.getPageState();
|
PageState ps = event.getPageState();
|
||||||
setImageComponent(ps, ImageComponent.LIBRARY);
|
if (!m_imageComponent.isSelected(ps)) {
|
||||||
|
setImageComponent(ps, ImageComponent.LIBRARY);
|
||||||
// ItemImageAttachment attachment = m_imageStep.getAttachment(ps);
|
}
|
||||||
// if (null == attachment) {
|
|
||||||
// XXX: Do something
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void process(FormSectionEvent event) throws FormProcessException {
|
public void process(FormSectionEvent event) throws FormProcessException {
|
||||||
|
|
@ -51,33 +48,12 @@ public class ImageComponentAttachListener implements FormInitListener, FormProce
|
||||||
|
|
||||||
ReusableImageAsset image = component.getImage(event);
|
ReusableImageAsset image = component.getImage(event);
|
||||||
|
|
||||||
|
processImage(event, ps, component, image);
|
||||||
// ContentItem item = m_imageStep.getItem(ps);
|
|
||||||
// if (null == item) {
|
|
||||||
// s_log.error("No item selected in ImageStepEdit",
|
|
||||||
// new RuntimeException());
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// ItemImageAttachment attachment = m_imageStep.getAttachment(ps);
|
|
||||||
// if (null == attachment) {
|
|
||||||
// attachment = new ItemImageAttachment(item, image);
|
|
||||||
// }
|
|
||||||
// attachment.setCaption(component.getCaption(event));
|
|
||||||
|
|
||||||
// We only set the description and title based on the UI in
|
|
||||||
// the case where getIsImageStepDescriptionAndTitleShown is true.
|
|
||||||
// Otherwise, we leave this as the default value. This means
|
|
||||||
// existing values are not overwritten if the image is edited when
|
|
||||||
// isImageStepDescriptionAndTitleShown is false.
|
|
||||||
// if (ItemImageAttachment.getConfig().getIsImageStepDescriptionAndTitleShown()) {
|
|
||||||
// attachment.setDescription(component.getDescription(event));
|
|
||||||
// attachment.setTitle(component.getTitle(event));
|
|
||||||
// }
|
|
||||||
// attachment.setUseContext(component.getUseContext(event));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ImageComponent getImageComponent(PageState ps) {
|
protected abstract void processImage(FormSectionEvent event, PageState ps, ImageComponent component, ReusableImageAsset image);
|
||||||
|
|
||||||
|
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");
|
||||||
|
|
@ -91,7 +67,7 @@ public class ImageComponentAttachListener implements FormInitListener, FormProce
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setImageComponent(PageState ps, final String activeKey) {
|
protected void setImageComponent(PageState ps, final String activeKey) {
|
||||||
m_imageComponent.setSelectedKey(ps, activeKey);
|
m_imageComponent.setSelectedKey(ps, activeKey);
|
||||||
|
|
||||||
if (s_log.isDebugEnabled()) {
|
if (s_log.isDebugEnabled()) {
|
||||||
|
|
@ -4,51 +4,26 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.ui;
|
package com.arsdigita.cms.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.Component;
|
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
|
||||||
import com.arsdigita.bebop.MapComponentSelectionModel;
|
import com.arsdigita.bebop.MapComponentSelectionModel;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.event.FormInitListener;
|
|
||||||
import com.arsdigita.bebop.event.FormProcessListener;
|
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.cms.ReusableImageAsset;
|
import com.arsdigita.cms.ReusableImageAsset;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.Map;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de>
|
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de>
|
||||||
*/
|
*/
|
||||||
public class ImageComponentSelectListener implements FormInitListener, FormProcessListener {
|
public class ImageComponentSelectListener extends ImageComponentAbstractListener {
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(ImageComponentSelectListener.class);
|
private static final Logger s_log = Logger.getLogger(ImageComponentSelectListener.class);
|
||||||
MapComponentSelectionModel m_imageComponent;
|
|
||||||
|
|
||||||
public ImageComponentSelectListener(MapComponentSelectionModel imageComponent) {
|
public ImageComponentSelectListener(MapComponentSelectionModel imageComponent) {
|
||||||
super();
|
super(imageComponent);
|
||||||
m_imageComponent = imageComponent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init(FormSectionEvent event)
|
protected void processImage(FormSectionEvent event, PageState ps, ImageComponent component, ReusableImageAsset image) {
|
||||||
throws FormProcessException {
|
|
||||||
PageState ps = event.getPageState();
|
|
||||||
|
|
||||||
this.m_imageComponent.getComponent(ps);
|
|
||||||
setImageComponent(ps, ImageComponent.LIBRARY);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void process(FormSectionEvent event) throws FormProcessException {
|
|
||||||
PageState ps = event.getPageState();
|
|
||||||
ImageComponent component = getImageComponent(ps);
|
|
||||||
|
|
||||||
if (!component.getSaveCancelSection().getSaveButton().isSelected(ps)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ReusableImageAsset image = component.getImage(event);
|
|
||||||
|
|
||||||
// SELECT {
|
// SELECT {
|
||||||
String name = image.getDisplayName();
|
String name = image.getDisplayName();
|
||||||
BigDecimal id = image.getID();
|
BigDecimal id = image.getID();
|
||||||
|
|
@ -56,41 +31,4 @@ public class ImageComponentSelectListener implements FormInitListener, FormProce
|
||||||
BigDecimal height = image.getHeight();
|
BigDecimal height = image.getHeight();
|
||||||
// SELECT }
|
// SELECT }
|
||||||
}
|
}
|
||||||
|
|
||||||
private ImageComponent getImageComponent(PageState ps) {
|
|
||||||
if (!m_imageComponent.isSelected(ps)) {
|
|
||||||
if (s_log.isDebugEnabled()) {
|
|
||||||
s_log.debug("No component selected");
|
|
||||||
s_log.debug("Selected: " + m_imageComponent.getComponent(ps));
|
|
||||||
}
|
|
||||||
|
|
||||||
m_imageComponent.setSelectedKey(ps, ImageComponent.UPLOAD);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (ImageComponent) m_imageComponent.getComponent(ps);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setImageComponent(PageState ps, final String activeKey) {
|
|
||||||
m_imageComponent.setSelectedKey(ps, activeKey);
|
|
||||||
|
|
||||||
if (s_log.isDebugEnabled()) {
|
|
||||||
s_log.debug("Selected component: " + activeKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
Map componentsMap = m_imageComponent.getComponentsMap();
|
|
||||||
Iterator i = componentsMap.keySet().iterator();
|
|
||||||
while (i.hasNext()) {
|
|
||||||
Object key = i.next();
|
|
||||||
Component component = (Component) componentsMap.get(key);
|
|
||||||
|
|
||||||
boolean isVisible = activeKey.equals(key);
|
|
||||||
|
|
||||||
if (s_log.isDebugEnabled()) {
|
|
||||||
s_log.debug("Key: " + key + "; Visibility: " + isVisible);
|
|
||||||
}
|
|
||||||
|
|
||||||
ps.setVisible(component, isVisible);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import com.arsdigita.bebop.Form;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
import com.arsdigita.bebop.Page;
|
import com.arsdigita.bebop.Page;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
|
import com.arsdigita.bebop.Resettable;
|
||||||
import com.arsdigita.bebop.SaveCancelSection;
|
import com.arsdigita.bebop.SaveCancelSection;
|
||||||
import com.arsdigita.bebop.SimpleContainer;
|
import com.arsdigita.bebop.SimpleContainer;
|
||||||
import com.arsdigita.bebop.event.ActionListener;
|
import com.arsdigita.bebop.event.ActionListener;
|
||||||
|
|
@ -27,7 +28,7 @@ import java.math.BigDecimal;
|
||||||
*
|
*
|
||||||
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de>
|
* @author Sören Bernstein (quasimodo) <sbernstein@zes.uni-bremen.de>
|
||||||
*/
|
*/
|
||||||
public class ImageLibraryComponent extends SimpleContainer implements ImageComponent {
|
public class ImageLibraryComponent extends SimpleContainer implements ImageComponent, Resettable {
|
||||||
|
|
||||||
private final ImageChooser m_chooser;
|
private final ImageChooser m_chooser;
|
||||||
private final ItemSelectionModel m_imageModel;
|
private final ItemSelectionModel m_imageModel;
|
||||||
|
|
@ -158,4 +159,11 @@ public class ImageLibraryComponent extends SimpleContainer implements ImageCompo
|
||||||
add(upload, ColumnPanel.FULL_WIDTH);
|
add(upload, ColumnPanel.FULL_WIDTH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset this component
|
||||||
|
public void reset(PageState ps) {
|
||||||
|
// clear selection
|
||||||
|
m_imageModel.clearSelection(ps);
|
||||||
|
m_chooser.clearKeyword(ps);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,14 @@ package com.arsdigita.cms.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.bebop.MapComponentSelectionModel;
|
import com.arsdigita.bebop.MapComponentSelectionModel;
|
||||||
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.ParameterSingleSelectionModel;
|
import com.arsdigita.bebop.ParameterSingleSelectionModel;
|
||||||
import com.arsdigita.bebop.SimpleContainer;
|
import com.arsdigita.bebop.SimpleContainer;
|
||||||
import com.arsdigita.bebop.TabbedPane;
|
import com.arsdigita.bebop.TabbedPane;
|
||||||
|
import com.arsdigita.bebop.event.ActionEvent;
|
||||||
|
import com.arsdigita.bebop.event.ActionListener;
|
||||||
|
import com.arsdigita.bebop.event.RequestEvent;
|
||||||
|
import com.arsdigita.bebop.event.RequestListener;
|
||||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.CMSConfig;
|
import com.arsdigita.cms.CMSConfig;
|
||||||
|
|
@ -31,6 +36,7 @@ public class ImageSelectPage extends CMSPage {
|
||||||
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 static final CMSConfig s_conf = CMSConfig.getInstance();
|
private static final CMSConfig s_conf = CMSConfig.getInstance();
|
||||||
private static final boolean LIMIT_TO_CONTENT_SECTION = false;
|
private static final boolean LIMIT_TO_CONTENT_SECTION = false;
|
||||||
public static final String CONTENT_SECTION = "section_id";
|
public static final String CONTENT_SECTION = "section_id";
|
||||||
|
|
@ -49,20 +55,35 @@ public class ImageSelectPage extends CMSPage {
|
||||||
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);
|
||||||
|
|
||||||
m_tabbedPane = createTabbedPane();
|
m_tabbedPane = createTabbedPane();
|
||||||
m_tabbedPane.setIdAttr("page-body");
|
m_tabbedPane.setIdAttr("page-body");
|
||||||
|
|
||||||
add(m_tabbedPane);
|
add(m_tabbedPane);
|
||||||
|
// ActionListener to change the image component state param to the right value
|
||||||
|
addActionListener(new ActionListener() {
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent event) {
|
||||||
|
final PageState ps = event.getPageState();
|
||||||
|
|
||||||
|
if (m_tabbedPane.getCurrentPane(ps).equals(m_imageLibrary)) {
|
||||||
|
m_imageComponent.setSelectedKey(ps, ImageComponent.LIBRARY);
|
||||||
|
}
|
||||||
|
if (m_tabbedPane.getCurrentPane(ps).equals(m_imageUpload)) {
|
||||||
|
m_imageComponent.setSelectedKey(ps, ImageComponent.UPLOAD);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
addGlobalStateParam(m_imageComponentKey);
|
addGlobalStateParam(m_imageComponentKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ImageLibraryComponent getImageLibraryPane() {
|
protected ImageLibraryComponent getImageLibraryPane() {
|
||||||
if (m_imageLibrary == null) {
|
if (m_imageLibrary == null) {
|
||||||
m_imageLibrary = new ImageLibraryComponent(ImageComponent.SELECT_IMAGE);
|
m_imageLibrary = new ImageLibraryComponent(ImageComponent.SELECT_IMAGE);
|
||||||
m_imageLibrary.getForm().addInitListener(new ImageComponentSelectListener(m_imageComponent));
|
m_imageLibrary.getForm().addInitListener(m_selectListener);
|
||||||
m_imageLibrary.getForm().addProcessListener(new ImageComponentSelectListener(m_imageComponent));
|
m_imageLibrary.getForm().addProcessListener(m_selectListener);
|
||||||
m_imageComponent.getComponentsMap().put(ImageComponent.LIBRARY, m_imageLibrary);
|
m_imageComponent.getComponentsMap().put(ImageComponent.LIBRARY, m_imageLibrary);
|
||||||
}
|
}
|
||||||
return m_imageLibrary;
|
return m_imageLibrary;
|
||||||
|
|
@ -72,8 +93,8 @@ public class ImageSelectPage extends CMSPage {
|
||||||
|
|
||||||
if (m_imageUpload == null) {
|
if (m_imageUpload == null) {
|
||||||
m_imageUpload = new ImageUploadComponent(ImageComponent.SELECT_IMAGE);
|
m_imageUpload = new ImageUploadComponent(ImageComponent.SELECT_IMAGE);
|
||||||
m_imageUpload.getForm().addInitListener(new ImageComponentSelectListener(m_imageComponent));
|
m_imageUpload.getForm().addInitListener(m_selectListener);
|
||||||
m_imageUpload.getForm().addProcessListener(new ImageComponentSelectListener(m_imageComponent));
|
m_imageUpload.getForm().addProcessListener(m_selectListener);
|
||||||
m_imageComponent.getComponentsMap().put(ImageComponent.UPLOAD, m_imageUpload);
|
m_imageComponent.getComponentsMap().put(ImageComponent.UPLOAD, m_imageUpload);
|
||||||
}
|
}
|
||||||
return m_imageUpload;
|
return m_imageUpload;
|
||||||
|
|
@ -83,8 +104,8 @@ public class ImageSelectPage extends CMSPage {
|
||||||
TabbedPane pane = new TabbedPane();
|
TabbedPane pane = new TabbedPane();
|
||||||
pane.setClassAttr(XSL_CLASS);
|
pane.setClassAttr(XSL_CLASS);
|
||||||
|
|
||||||
addToPane(pane, "library", getImageLibraryPane());
|
addToPane(pane, ImageComponent.LIBRARY, getImageLibraryPane());
|
||||||
addToPane(pane, "upload", getImageUploadPane());
|
addToPane(pane, ImageComponent.UPLOAD, getImageUploadPane());
|
||||||
pane.setDefaultPane(m_imageLibrary);
|
pane.setDefaultPane(m_imageLibrary);
|
||||||
|
|
||||||
return pane;
|
return pane;
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ public class ImagesPane extends LayoutPanel implements Resettable {
|
||||||
//private ImageChooser imageChooser;
|
//private ImageChooser imageChooser;
|
||||||
private final StringParameter m_imageComponentKey;
|
private final StringParameter m_imageComponentKey;
|
||||||
private final MapComponentSelectionModel m_imageComponent;
|
private final MapComponentSelectionModel m_imageComponent;
|
||||||
|
// private final ImageComponentAdminListener m_adminListener;
|
||||||
|
|
||||||
public ImagesPane() {
|
public ImagesPane() {
|
||||||
// Left column is empty, this is only to provide the same layout for all
|
// Left column is empty, this is only to provide the same layout for all
|
||||||
|
|
@ -47,20 +48,21 @@ public class ImagesPane extends LayoutPanel implements Resettable {
|
||||||
m_imageComponent = new MapComponentSelectionModel(componentModel, new HashMap());
|
m_imageComponent = new MapComponentSelectionModel(componentModel, new HashMap());
|
||||||
|
|
||||||
Map selectors = m_imageComponent.getComponentsMap();
|
Map selectors = m_imageComponent.getComponentsMap();
|
||||||
|
// m_adminListener = new ImageComponentAdminListener(m_imageComponent);
|
||||||
|
|
||||||
ImageUploadComponent upload = new ImageUploadComponent(ImageComponent.ADMIN_IMAGES);
|
ImageUploadComponent upload = new ImageUploadComponent(ImageComponent.ADMIN_IMAGES);
|
||||||
//upload.getForm().addInitListener(new ImageComponentAdminListener(m_imageComponent));
|
|
||||||
// For future use
|
// For future use
|
||||||
// upload.addProcessListener(new ImageComponentAdminListener(m_imageComponent));
|
//upload.getForm().addInitListener(m_adminListener);
|
||||||
|
// upload.addProcessListener(m_adminListener);
|
||||||
selectors.put(ImageComponent.UPLOAD, upload);
|
selectors.put(ImageComponent.UPLOAD, upload);
|
||||||
body.addSegment(
|
body.addSegment(
|
||||||
new Label(GlobalizationUtil.globalize("cms.ui.image_upload")),
|
new Label(GlobalizationUtil.globalize("cms.ui.image_upload")),
|
||||||
upload);
|
upload);
|
||||||
|
|
||||||
ImageLibraryComponent library = new ImageLibraryComponent(ImageComponent.ADMIN_IMAGES);
|
ImageLibraryComponent library = new ImageLibraryComponent(ImageComponent.ADMIN_IMAGES);
|
||||||
//library.getForm().addInitListener(new ImageComponentAdminListener(m_imageComponent));
|
|
||||||
// For future use
|
// For future use
|
||||||
// library.getForm().addProcessListener(new ImageComponentAdminListener);
|
//library.getForm().addInitListener(m_adminListener);
|
||||||
|
// library.getForm().addProcessListener(m_adminListener);
|
||||||
// library.addUploadLink(new ActionListener() {
|
// library.addUploadLink(new ActionListener() {
|
||||||
//
|
//
|
||||||
// public void actionPerformed(ActionEvent ev) {
|
// public void actionPerformed(ActionEvent ev) {
|
||||||
|
|
|
||||||
|
|
@ -225,6 +225,7 @@ public class SecurityPropertyEditor extends PropertyEditor {
|
||||||
* @param form The form
|
* @param form The form
|
||||||
* @param cancelButton the "Cancel" button on the form
|
* @param cancelButton the "Cancel" button on the form
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void addListeners(FormSection form, Submit cancelButton) {
|
public void addListeners(FormSection form, Submit cancelButton) {
|
||||||
addSecurityListener(form);
|
addSecurityListener(form);
|
||||||
super.addListeners(form, cancelButton);
|
super.addListeners(form, cancelButton);
|
||||||
|
|
@ -247,6 +248,7 @@ public class SecurityPropertyEditor extends PropertyEditor {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public PropertyEditorModel makeModel(PropertyEditor p, PageState s) {
|
public PropertyEditorModel makeModel(PropertyEditor p, PageState s) {
|
||||||
return new AccessListModel (
|
return new AccessListModel (
|
||||||
getProperties(p),
|
getProperties(p),
|
||||||
|
|
@ -273,16 +275,19 @@ public class SecurityPropertyEditor extends PropertyEditor {
|
||||||
m_manager = Utilities.getSecurityManager(m_state);
|
m_manager = Utilities.getSecurityManager(m_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean next() {
|
public boolean next() {
|
||||||
while(super.next()) {
|
while(super.next()) {
|
||||||
Object key = getKey();
|
Object key = getKey();
|
||||||
ComponentAccess ca = (ComponentAccess)m_access.get(key);
|
ComponentAccess ca = (ComponentAccess)m_access.get(key);
|
||||||
|
|
||||||
if(ca == null) // No access restricitons
|
if(ca == null) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if ( ca.canAccess(m_state, m_manager) ) // Access checks out
|
if ( ca.canAccess(m_state, m_manager) ) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Otherwise, skip the property
|
// Otherwise, skip the property
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue