Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-1355

AdvancedSearch does not work whit custom type of type d:int with a constraint of type LIST


    • Type: Service Pack Request
    • Status: Closed (View Workflow)
    • Resolution: Fixed
    • Affects Version/s: No Version
    • Fix Version/s: 2.2.8, 3.3.2
    • Component/s: Installer
    • Labels:
    • Environment:
      Alfresco Enterprise 2.1
    • Bug Priority:
      Category 2
    • ACT Numbers:

      3843, 14514


      I have a custom type of type d:int with a constraint of type LIST defined as follows:

      <constraint name="fact:estadosFactura" type="LIST">
      <parameter name="allowedValues">

      <!-- Type and Aspect definitions go here -->
      <type name="fact:facturaproveedor">
      <property name="fact:estadoFactura">
      <title>Estado de la factura</title>
      <constraint ref="fact:estadosFactura"/>

      Next included in the advanced search via web-client-config-custom.xml :

      <config evaluator="string-compare" condition="Advanced Search">
      <type name="fact:facturaproveedor" />

      <meta-data type="fact:facturaproveedor" property="fact:estadoFactura" display-label-id="customModel_fact_estadoFactura" />

      When searching the value asigned to the property is 'true' instead of what it was chose in the select (should be of type int) so the search fails. In the log output for impl.lucene.LuceneQueryParser appears: '+@{fact.model}estadoFactura:"true" '

      I think it's because in the org.alfresco.web.bean.search#search() method it the data type is int th following code is executed

      else if (DataTypeDefinition.INT.equals(typeName) || DataTypeDefinition.LONG.equals(typeName) ||
      DataTypeDefinition.FLOAT.equals(typeName) || DataTypeDefinition.DOUBLE.equals(typeName))
      String strVal = value.toString();
      if (strVal != null && strVal.length() != 0)

      { search.addFixedValueQuery(QName.createQName(qname), strVal); }


      instead of

      else if (value != null)
      Object item = properties.getCustomProperties().get(
      UISearchCustomProperties.PREFIX_LOV_ITEM + qname);
      if (item != null)
      // ListOfValues
      if (((Boolean)value) == true)

      { search.addFixedValueQuery(QName.createQName(qname), item.toString()); }

      // by default use toString() value - this is for text fields and unknown types
      String strVal = value.toString();
      if (strVal != null && strVal.length() != 0)

      { search.addAttributeQuery(QName.createQName(qname), strVal); }



          Issue Links



              • Assignee:
                closedbugs Closed Bugs
                togomez Roberto Gomez
              • Votes:
                2 Vote for this issue
                3 Start watching this issue


                • Created: