Package com.agiletec.aps.system.common.entity.model.attribute

Examples of com.agiletec.aps.system.common.entity.model.attribute.AttributeInterface


  @Override
  protected AttributeInterface getLinkAttribute(AttributeInterface attribute, HttpServletRequest request) {
    HttpSession session = request.getSession();
    if (attribute instanceof CompositeAttribute) {
      String includedAttributeName = (String) session.getAttribute(INCLUDED_ELEMENT_NAME_SESSION_PARAM);
      AttributeInterface includedAttribute = ((CompositeAttribute) attribute).getAttribute(includedAttributeName);
      return getLinkAttribute(includedAttribute, request);
    } else if (attribute instanceof MonoListAttribute) {
      Integer elementIndex = (Integer) session.getAttribute(LIST_ELEMENT_INDEX_SESSION_PARAM);
      AttributeInterface attributeElement = ((MonoListAttribute) attribute).getAttribute(elementIndex.intValue());
      return getLinkAttribute(attributeElement, request);
    } else if (attribute instanceof ImageMapAttribute) {
      AttributeInterface attributeElement = this.getImageMapAttribute(attribute, session);
      return attributeElement;
    } else if (attribute instanceof LinkAttribute) {
      return attribute;
    } else {
      throw new RuntimeException("Caso non gestito : Atttributo tipo " + attribute.getClass());
View Full Code Here


  @Override
  protected void joinLink(AttributeInterface attribute, String[] destinations, int destType, HttpServletRequest request) {
    HttpSession session = request.getSession();
    if (attribute instanceof CompositeAttribute) {
      String includedAttributeName = (String) session.getAttribute(INCLUDED_ELEMENT_NAME_SESSION_PARAM);
      AttributeInterface includedAttribute = ((CompositeAttribute) attribute).getAttribute(includedAttributeName);
      updateLink(includedAttribute, destinations, destType);
    } else if (attribute instanceof MonoListAttribute) {
      Integer elementIndex = (Integer) session.getAttribute(LIST_ELEMENT_INDEX_SESSION_PARAM);
      AttributeInterface attributeElement = ((MonoListAttribute) attribute).getAttribute(elementIndex.intValue());
      joinLink(attributeElement, destinations, destType, request);
    } else if (attribute instanceof ImageMapAttribute) {
      AttributeInterface attributeElement = this.getImageMapAttribute(attribute, session);
      updateLink(attributeElement, destinations, destType);
    } else if (attribute instanceof LinkAttribute) {
      updateLink(attribute, destinations, destType);
    }
  }
View Full Code Here

  @Override
  protected void removeLink(AttributeInterface attribute, HttpServletRequest request) {
    HttpSession session = request.getSession();
    if (attribute instanceof CompositeAttribute) {
      String includedAttributeName = (String) session.getAttribute(INCLUDED_ELEMENT_NAME_SESSION_PARAM);
      AttributeInterface includedAttribute = ((CompositeAttribute) attribute).getAttribute(includedAttributeName);
      removeLink(includedAttribute, request);
    } else if (attribute instanceof LinkAttribute) {
      ((LinkAttribute) attribute).setSymbolicLink(null);
      ((LinkAttribute) attribute).getTextMap().clear();
    } else if (attribute instanceof ImageMapAttribute) {
      AttributeInterface attributeElement = this.getImageMapAttribute(attribute, session);
      removeLink(attributeElement, request);
    } else if (attribute instanceof MonoListAttribute) {
      Integer elementIndex = (Integer) session.getAttribute(LIST_ELEMENT_INDEX_SESSION_PARAM);
      AttributeInterface attributeElement = ((MonoListAttribute) attribute).getAttribute(elementIndex.intValue());
      removeLink(attributeElement, request);
    }
  }
View Full Code Here

    }
  }
 
  protected AttributeInterface getImageMapAttribute(AttributeInterface attribute, HttpSession session) {
    Integer elementIndex = (Integer) session.getAttribute(LIST_ELEMENT_INDEX_SESSION_PARAM);
    AttributeInterface attributeElement = ((ImageMapAttribute) attribute).getArea(elementIndex).getLink();
    return attributeElement;
  }
View Full Code Here

    List<AttributeInterface> searcheableAttributes = new ArrayList<AttributeInterface>();
    IUserProfile defaultProfile = this.getUserProfileManager().getDefaultProfileType();
    defaultProfile.disableAttributes(JpaddressbookSystemConstants.ATTRIBUTE_DISABLING_CODE_ON_MANAGE_CONTACT);
    List<AttributeInterface> contentAttributes = defaultProfile.getAttributeList();
    for (int i=0; i<contentAttributes.size(); i++) {
      AttributeInterface attribute = contentAttributes.get(i);
      if (attribute.isActive() && attribute.isSearcheable()) {
        searcheableAttributes.add(attribute);
      }
    }
    return searcheableAttributes;
  }
View Full Code Here

    List<AttributeInterface> entityFields = new ArrayList<AttributeInterface>();
    IApsEntity apsEntity = this.getUserProfileManager().getDefaultProfileType();
    List<AttributeInterface>  attributeInterfaces = apsEntity.getAttributeList();
    if(attributeInterfaces != null){
      for (int i = 0; i < attributeInterfaces.size(); i++) {
        AttributeInterface attribute = attributeInterfaces.get(i);
        if(JpaddressbookSystemConstants.ATTRIBUTE_TYPE_DATE.equals(attribute.getType().trim())
            || JpaddressbookSystemConstants.ATTRIBUTE_TYPE_ENUMERATOR.equals(attribute.getType().trim())
            || JpaddressbookSystemConstants.ATTRIBUTE_TYPE_HYPERTEXT.equals(attribute.getType().trim())
            || JpaddressbookSystemConstants.ATTRIBUTE_TYPE_LONGTEXT.equals(attribute.getType().trim())
            || JpaddressbookSystemConstants.ATTRIBUTE_TYPE_MONOTEXT.equals(attribute.getType().trim())
            || JpaddressbookSystemConstants.ATTRIBUTE_TYPE_NUMBER.equals(attribute.getType().trim())
            || JpaddressbookSystemConstants.ATTRIBUTE_TYPE_TEXT.equals(attribute.getType().trim())){
          entityFields.add(attribute);
        }
      }
    }
    return entityFields;
View Full Code Here

      return;
    }
    try {
      List<AttributeInterface> attributes = contact.getAttributes();
      for (int i = 0; i < attributes.size(); i++) {
        AttributeInterface attribute = attributes.get(i);
        String attributeLabelKey = "jpaddressbook_ATTR" + attribute.getName();
        if (null == this.getI18nManager().getLabelGroup(attributeLabelKey)) {
          String attributeDescription = attribute.getDescription();
          String value = (null != attributeDescription && attributeDescription.trim().length() > 0) ?
              attributeDescription :
              attribute.getName();
          this.addLabelGroups(attributeLabelKey, value);
        }
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "checkTypeLables");
View Full Code Here

      types.add(new SelectItem(UserFilterOptionBean.KEY_CATEGORY, this.getText("label.category")));
      String contentType = this.getWidget().getConfig().getProperty(IContentListWidgetHelper.WIDGET_PARAM_CONTENT_TYPE);
      Content prototype = this.getContentManager().createContentType(contentType);
      List<AttributeInterface> contentAttributes = prototype.getAttributeList();
      for (int i=0; i<contentAttributes.size(); i++) {
        AttributeInterface attribute = contentAttributes.get(i);
        if (attribute.isSearcheable()) {
                                    // Escludo filtro per tipo Coordinate
                                    if(!ContentListViewerWidgetAction.ATTRIBUTE_TYPE_COORD.equals(attribute.getType()))
          types.add(new SelectItem(UserFilterOptionBean.TYPE_ATTRIBUTE + "_" + attribute.getName(), this.getText("label.attribute", new String[]{attribute.getName()})));
        }
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "getAllowedUserFilterTypes");
      throw new ApsSystemException("Error extracting allowed user filter types", t);
View Full Code Here

      types.add(new SelectItem(IContentListFilterAction.METADATA_KEY_PREFIX + IContentManager.CONTENT_MODIFY_DATE_FILTER_KEY, this.getText("label.lastModifyDate")));
      String contentType = this.getWidget().getConfig().getProperty(IContentListWidgetHelper.WIDGET_PARAM_CONTENT_TYPE);
      Content prototype = this.getContentManager().createContentType(contentType);
      List<AttributeInterface> contentAttributes = prototype.getAttributeList();
      for (int i=0; i<contentAttributes.size(); i++) {
        AttributeInterface attribute = contentAttributes.get(i);
        if (attribute.isSearcheable()) {
                                    // Escludo filtro per tipo Coordinate
                                    if(!ContentListViewerWidgetAction.ATTRIBUTE_TYPE_COORD.equals(attribute.getType()))
          types.add(new SelectItem(attribute.getName(), this.getText("label.attribute", new String[]{attribute.getName()})));
        }
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "getAllowedFilterTypes");
      throw new ApsSystemException("Error extracting allowed filter types", t);
View Full Code Here

    String source = element.getAttributeValue("source");
    String dest = element.getAttributeValue("dest");
    String rawFeedvalue = this.extractValue(source, target);
    HtmlHandler htmlHandler = new HtmlHandler();
    String feedvalue = htmlHandler.getParsedText(rawFeedvalue);
    AttributeInterface attr =  (AttributeInterface) content.getAttribute(dest);
    if (attr instanceof LinkAttribute) {
      ((LinkAttribute)attr).setText(feedvalue, this.getDefaultLangCode());
      SymbolicLink link = new SymbolicLink();
      link.setDestinationToUrl(feedvalue);
      ((LinkAttribute)attr).setSymbolicLink(link);
View Full Code Here

TOP

Related Classes of com.agiletec.aps.system.common.entity.model.attribute.AttributeInterface

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.