Package org.geomajas.configuration

Examples of org.geomajas.configuration.FeatureInfo


      throws LayerException {
    if (entity == null) {
      return null;
    }
    PrimitiveAttributeInfo idInfo = associationAttributeInfo.getFeature().getIdentifier();
    FeatureInfo childInfo = associationAttributeInfo.getFeature();
    PrimitiveAttribute<?> id;
    try {
      id = (PrimitiveAttribute) dtoConverterService.toDto(entity.getId(idInfo.getName()), idInfo);
    } catch (GeomajasException e) {
      throw new LayerException(e, ExceptionCode.CONVERSION_PROBLEM);
    }
    Map<String, Attribute<?>> attributes = new HashMap<String, Attribute<?>>();
    for (AttributeInfo attributeInfo : childInfo.getAttributes()) {
      attributes.put(attributeInfo.getName(),
          getRecursiveAttribute(entity, childInfo, new String[] { attributeInfo.getName() }));
    }
    AssociationValue value = new AssociationValue(id, attributes, false);
    return value;
View Full Code Here


    many.setEditable(true);
    many.setLabel("manyInMany");
    many.setName("manyInMany");

    PrimitiveAttributeInfo textAttr = new PrimitiveAttributeInfo("text", "text", PrimitiveType.STRING);
    FeatureInfo featureInfo = new FeatureInfo();
    featureInfo.setIdentifier(new PrimitiveAttributeInfo("id", "id", PrimitiveType.LONG));
    featureInfo.setAttributes(Collections.singletonList((AttributeInfo) textAttr));
    many.setFeature(featureInfo);
    Attribute<?> attr = converter.toDto(new Bean[] { new Bean("t1",1L), new Bean("t2",2L) }, many);
    Assert.assertTrue(attr instanceof AssociationAttribute);
    AssociationAttribute assoc = (AssociationAttribute)attr;
    List<AssociationValue> value = (List<AssociationValue>)assoc.getValue();
View Full Code Here

        // set statuses
        vectorLayer.setCreatable(securityContext.isLayerCreateAuthorized(layerId));
        vectorLayer.setUpdatable(securityContext.isLayerUpdateAuthorized(layerId));
        vectorLayer.setDeletable(securityContext.isLayerDeleteAuthorized(layerId));
        // filter feature info
        FeatureInfo featureInfo = vectorLayer.getFeatureInfo();
        List<AttributeInfo> originalAttr = featureInfo.getAttributes();
        List<AttributeInfo> filteredAttr = new ArrayList<AttributeInfo>();
        featureInfo.setAttributes(filteredAttr);
        for (AttributeInfo ai : originalAttr) {
          if (securityContext.isAttributeReadable(layerId, null, ai.getName())) {
            filteredAttr.add(ai);
          }
        }
View Full Code Here

TOP

Related Classes of org.geomajas.configuration.FeatureInfo

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.