Package com.agiletec.plugins.jpimagemap.aps.system.services.content.model.attribute

Examples of com.agiletec.plugins.jpimagemap.aps.system.services.content.model.attribute.ImageMapAttribute


  @Override
  public String removeImage() {
    this.getContentActionHelper().updateEntity(this.getContent(), this.getRequest());
    Logger log = ApsSystemUtils.getLogger();
    try {
      ImageMapAttribute currentAttribute = this.getAttribute();
      currentAttribute.getImage().getResources().clear();
      currentAttribute.getImage().getTextMap().clear();
      currentAttribute.getAreas().clear();
      log.trace("Removed Image element from ImageMap " + currentAttribute.getName());
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "removeImage");
      return FAILURE;
    }
    return SUCCESS;
View Full Code Here


  @Override
  public String addArea() {
    this.getContentActionHelper().updateEntity(this.getContent(), this.getRequest());
    Logger log = ApsSystemUtils.getLogger();
    try {
      ImageMapAttribute currentAttribute = this.getAttribute();
      currentAttribute.addArea();
      log.trace("Added LinkedArea element to ImageMap " + currentAttribute.getName());
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "addArea");
      return FAILURE;
    }
    return SUCCESS;
View Full Code Here

  public String removeArea() {
    this.getContentActionHelper().updateEntity(this.getContent(), this.getRequest());
    Logger log = ApsSystemUtils.getLogger();
    try {
      int elementIndex = this.getElementIndex();
      ImageMapAttribute currentAttribute = this.getAttribute();
      if (elementIndex>=0 && elementIndex<currentAttribute.getAreas().size()) {
        currentAttribute.removeArea(elementIndex);
        log.trace("Removed LinkedArea element from ImageMap " + currentAttribute.getName());
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "removeArea");
      return FAILURE;
    }
View Full Code Here

  @Override
  public String saveArea() {
    Logger log = ApsSystemUtils.getLogger();
    try {
      ImageMapAttribute currentAttribute = this.getAttribute();
      LinkedArea area = currentAttribute.getArea(this.getElementIndex());
      area.setCoords(this.concatCoords());
      log.trace("SAVED Area " + this.getElementIndex() + " for ImageMap " + currentAttribute.getName());
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "saveArea");
      return FAILURE;
    }
    return SUCCESS;
View Full Code Here

    this.manageImageMapAttribute(attribute, tracer, request);
  }
 
  private void manageImageMapAttribute(AttributeInterface attribute,
      AttributeTracer tracer, HttpServletRequest request) {
    ImageMapAttribute imageMapAttribute = (ImageMapAttribute) attribute;
    ImageAttribute imageAttr = imageMapAttribute.getImage();   
    AttributeTracer imageTracer = (AttributeTracer) tracer.clone();
    ResourceAttributeManager imageManager = (ResourceAttributeManager) this.getManager(imageAttr);
    imageManager.updateAttribute(imageAttr, imageTracer, request);
    List<LinkedArea> areas = imageMapAttribute.getAreas();
    for (int i = 0; i < areas.size(); i++) {
      LinkedArea area = (LinkedArea) areas.get(i);
      AttributeTracer areaTracer = (AttributeTracer) tracer.clone();
      areaTracer.setMonoListElement(true);
      areaTracer.setListIndex(i);
      LinkAttribute link = area.getLink();
      LinkAttributeManager linkManager = (LinkAttributeManager) this.getManager(link);
      String coords = request.getParameter(imageMapAttribute.getName() + "_coords_" + areaTracer.getListIndex());
      linkManager.updateAttribute(link, areaTracer, request);
      area.setCoords(coords);
    }
  }
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpimagemap.aps.system.services.content.model.attribute.ImageMapAttribute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.