Examples of AValue


Examples of it.cilea.osd.jdyna.model.AValue

                        List<AValue> values = new ArrayList<AValue>();
                        if (proprieties != null)
                        {
                            for (P prop : proprieties)
                            {
                                AValue val = prop.getValue();
                                if (StringUtils.isNotEmpty(md[2])
                                        && val instanceof PointerValue
                                        && prop.getObject() instanceof ACrisObject)
                                {
                                    List pointProps = (List) ((ACrisObject) prop.getObject())
                                            .getAnagrafica4view().get(md[2]);
                                    if (pointProps != null
                                            && pointProps.size() > 0)
                                    {
                                        for (Object pprop : pointProps)
                                        {
                                            values.add(((Property) pprop)
                                                    .getValue());
                                        }
                                    }
                                }
                                else
                                {
                                    values.add(val);
                                }
                            }
                        }

                        // if we have values to index on, then do so
                        for (AValue val : values)
                        {
                            if (val == null)
                            {
                                continue;
                            }
                            String authority = null;
                            String sval = val.toString();
                            if (val instanceof PointerValue
                                    && val.getObject() instanceof ACrisObject)
                            {
                                authority = ((ACrisObject) val.getObject()).getId()
                                        .toString();
                            }                           

                            if (bi.isAuthorityIndex()
                                    && StringUtils.isNotEmpty(authority))
                            {
                                // if we have an authority index only
                                // authored metadata will go here!
                                log.debug("Skipping cris=" + item.getUuid()
                                        + ", field=" + md[0] + "." + md[1]
                                        + "." + md[2] + ", value=" + sval
                                        + ", authority=" + authority
                                        + " (BAD AUTHORITY)");
                                continue;
                            }

                            // is there any valid (with appropriate
                            // confidence) authority key?
                            if ((ignoreAuthority && !bi.isAuthorityIndex())
                                    || StringUtils.isNotEmpty(authority))
                            {
                                String nLabel = OrderFormat.makeSortString(
                                        sval, null, bi.getDataType());

                                distFValues.add(nLabel
                                        + SolrServiceImpl.FILTER_SEPARATOR
                                        + sval
                                        + SolrServiceImpl.AUTHORITY_SEPARATOR
                                        + authority);
                                distFAuths.add(authority);
                                distValuesForAC.add(sval);
                            }
                            else
                            // put it in the browse index as if it
                            // hasn't have an authority key
                            {
                                // get the normalised version of the
                                // value
                                String nVal = OrderFormat.makeSortString(sval,
                                        null, bi.getDataType());
                                distFValues.add(nVal
                                        + SolrServiceImpl.FILTER_SEPARATOR
                                        + sval);
                                distFVal.add(sval);
                                distValuesForAC.add(sval);
                            }
                        }
                    }
                }

                for (String facet : distFValues)
                {
                    doc.addField(bi.getDistinctTableName() + "_filter", facet);
                }
                for (String facet : distFAuths)
                {
                    doc.addField(bi.getDistinctTableName()
                            + "_authority_filter", facet);
                }
                for (String facet : distValuesForAC)
                {
                    doc.addField(bi.getDistinctTableName() + "_partial", facet);
                }
                for (String facet : distFVal)
                {
                    doc.addField(bi.getDistinctTableName() + "_value_filter",
                            facet);
                }
            }
        }

        // Add sorting options as configurated for the browse system
        try
        {
            for (SortOption so : SortOption.getSortOptions())
            {
                String[] md = so.getMdBits();
                if (!md[0].equalsIgnoreCase("cris" + item.getPublicPath()))
                {
                    continue;
                }

                List<P> proprieties = item.getAnagrafica4view().get(md[1]);
                Object val = null;
                if (proprieties != null && proprieties.size() > 0)
                {
                    val = proprieties.get(0).getObject();
                }

                if (StringUtils.isNotEmpty(md[2]) && val instanceof ACrisObject)
                {
                    List pointProps = (List) ((ACrisObject) val)
                            .getAnagrafica4view().get(md[2]);
                    if (pointProps != null && pointProps.size() > 0)
                    {
                        val = ((Property) pointProps.get(0)).getObject();
                    }
                }
                if (val != null)
                {
                    String sval = val.toString();
                    String nValue = OrderFormat.makeSortString(sval, null,
                            so.getType());
                    doc.addField("bi_sort_" + so.getNumber() + "_sort", nValue);
                }
            }
View Full Code Here

Examples of it.cilea.osd.jdyna.model.AValue

            List<String> toProjectionFields,
            Map<String, DiscoverySortFieldConfiguration> sortFields,
            List<String> sortFieldsAdded, Set<String> hitHighlightingFields,
            Set<String> moreLikeThisFields)
    {
        AValue value = meta.getValue();

        if (value == null || meta.getVisibility() != VisibilityConstants.PUBLIC)
        {
            return;
        }

        String svalue = meta.toString();
        String authority = null;
        if (value instanceof PointerValue
                && value.getObject() instanceof ACrisObject)
        {
            authority = ResearcherPageUtils
                    .getPersistentIdentifier((ACrisObject) value.getObject());
        }

        if (value instanceof DateValue)
        {
            // TODO: make this date format configurable !
View Full Code Here

Examples of org.geppetto.core.model.values.AValue

                    {
                      value = hdfVariable.read(start, lenght);
                      Type type = Type.fromValue(hdfVariable.getDataType().toString());

                      PhysicalQuantity quantity = new PhysicalQuantity();
                      AValue readValue = null;
                      switch(type)
                      {
                        case DOUBLE:
                          readValue = ValuesFactory.getDoubleValue(value.getDouble(0));
                          break;
View Full Code Here

Examples of org.geppetto.core.model.values.AValue

    String commonProperties = this.commonProperties(node);

    PhysicalQuantity quantity = node.consumeFirstValue();

    if (quantity != null) {
      AValue value = quantity.getValue();
      String unit = null, scale = null;

      if (quantity.getUnit() != null) {
        unit = "\"" + quantity.getUnit() + "\"";
      }
View Full Code Here

Examples of org.geppetto.core.model.values.AValue

    FunctionNode functionNode = node.getDynamics();

    String specs = "", function = "";

    if (quantity != null) {
      AValue value = quantity.getValue();
      String unit = null, scale = null;

      if (quantity.getUnit() != null) {
        unit = quantity.getUnit();
      }
View Full Code Here

Examples of org.geppetto.core.model.values.AValue

    String commonProperties = this.commonProperties(node);

    PhysicalQuantity quantity = node.getValue();

    if (quantity != null) {
      AValue value = quantity.getValue();
      String unit = null, scale = null;

      if (quantity.getUnit() != null) {
        unit = "\"" + quantity.getUnit() + "\"";
      }
View Full Code Here

Examples of org.geppetto.core.model.values.AValue

  @Override
  public boolean visitTextMetadataNode(TextMetadataNode node) {
    String commonProperties = this.commonProperties(node);
    String valueString = "";
    if (node.getValue() != null){
      AValue value = node.getValue();
      valueString = "\"value\":" + "\"" + value + "\",";
    }
   
    _serialized.append("\"" + node.getId() + "\":{" + valueString.replaceAll("[\n\r]", "") + commonProperties+ "},");
View Full Code Here

Examples of org.geppetto.core.model.values.AValue

      {
        value = v.read(start, lenght);
        Type type = Type.fromValue(v.getDataType().toString());

        PhysicalQuantity quantity = new PhysicalQuantity();
        AValue readValue = null;
        switch(type)
        {
          case DOUBLE:
            readValue = ValuesFactory.getDoubleValue(value.getDouble(0));
            break;
View Full Code Here

Examples of org.geppetto.core.model.values.AValue

    AspectNode aspect_A = new AspectNode("Aspect_A");

    AspectSubTreeNode simulation = new AspectSubTreeNode(
        AspectTreeType.WATCH_TREE);

    AValue val = ValuesFactory.getDoubleValue(50d);
    AValue val2 = ValuesFactory.getDoubleValue(100d);

    PhysicalQuantity quantity = new PhysicalQuantity();
    quantity.setValue(val);
    quantity.setUnit("V");
    quantity.setScalingFactor("1.E3");

    PhysicalQuantity quantity2 = new PhysicalQuantity();
    quantity2.setValue(val2);
    quantity2.setScalingFactor("1.E3");
    quantity2.setUnit("V");

    VariableNode dummyNode = new VariableNode("dummyFloat");
    dummyNode.addPhysicalQuantity(quantity);
    dummyNode.addPhysicalQuantity(quantity2);

    VariableNode anotherDummyNode = new VariableNode("dummyDouble");

    AValue val3 = ValuesFactory.getDoubleValue(50d);
    AValue val4 = ValuesFactory.getDoubleValue(100d);

    PhysicalQuantity quantity3 = new PhysicalQuantity();
    quantity3.setValue(val3);
    quantity3.setUnit("mV");
    quantity3.setScalingFactor("1.E3");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.