Changeset 17817

Show
Ignore:
Timestamp:
08/02/08 19:05:48 (1 month ago)
Author:
vivana
Message:

Fixed problem with missing filter value in form export/import
added missing property for list calculated filed

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/core/src/net/project/form/soa/FormServiceImpl.java

    r17816 r17817  
    5454 
    5555                HashMap<BigInteger, String> fieldIds = new HashMap<BigInteger, String>(); 
     56                HashMap<String, String> domainValueIds = new HashMap<String, String>(); 
    5657                 
    57                 java.sql.Timestamp newCrc = new java.sql.Timestamp(new java.util.Date() 
    58                                .getTime()); 
     58                 
     59                java.sql.Timestamp newCrc = new java.sql.Timestamp(new java.util.Date().getTime()); 
    5960                // get new id and register in the pn_object table. 
    6061                String classId = ObjectManager.dbCreateObjectWithPermissions(ObjectType.FORM, "A", spaceId, userId); 
     
    106107                                        for (DomainValue domainValue : field.getDomainValues().getDomainValue()) { 
    107108                                                String domainValueId = ObjectManager.dbCreateObject(ObjectType.FORM_DOMAIN_VALUE, "A"); 
    108  
     109                                                 
     110                                                domainValueIds.put(domainValue.getId().toString(), domainValueId); 
     111                                                 
    109112                                                // update the FieldDomain properties 
    110113                                                sql = "insert into pn_class_domain_values (domain_id, domain_value_id, domain_value_name, domain_value_seq, is_default, record_status) values (" 
     
    155158                                        db.release();                        
    156159                                        } 
    157                                 } 
    158                                  
     160                                }                                
    159161                        } 
    160162                         
     
    189191                    (listField.getSortOrder() != null ? listField.getSortOrder().toString() : null ) + "," + 
    190192                    DBFormat.bool(listField.isSortAscending()) + "," + 
    191                     DBFormat.bool(false) + ")";                                        
     193                    DBFormat.bool(listField.isIsCalculateTotal()) + ")";                                       
    192194 
    193195                                db.executeQuery(sql); 
     
    197199                                FieldFilter filter =  listField.getFieldFilter(); 
    198200                                for (String filterValue : filter.getFilterValue()){ 
     201                                         
     202                                        if (domainValueIds.get(filterValue) != null){ 
     203                                                filterValue = domainValueIds.get(filterValue); 
     204                                        } 
    199205                                         
    200206                                        String valueId = ObjectManager.dbCreateObjectWithPermissions(ObjectType.FORM_FILTER_VALUE, "A", spaceId, userId); 
  • trunk/core/src/net/project/form/soa/binding/ListField.java

    r17787 r17817  
    66import javax.xml.bind.annotation.XmlElement; 
    77import javax.xml.bind.annotation.XmlRootElement; 
    8 import javax.xml.bind.annotation.XmlSchemaType; 
    98import javax.xml.bind.annotation.XmlType; 
    10 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; 
    11 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; 
     9 
    1210 
    1311 
     
    2927 *         &lt;element ref="{}is_list_field"/> 
    3028 *         &lt;element ref="{}is_sort_field"/> 
     29 *         &lt;element ref="{}is_calculate_total"/> 
    3130 *         &lt;element ref="{}sort_order"/> 
    3231 *         &lt;element ref="{}sort_ascending"/> 
     
    4746    "wrapMode", 
    4847    "isSubfield", 
    49     "isListField", 
     48    "isListField",     
    5049    "isSortField", 
     50    "isCalculateTotal", 
    5151    "sortOrder", 
    5252    "sortAscending", 
     
    7070    @XmlElement(name = "is_sort_field") 
    7171    protected boolean isSortField; 
     72    @XmlElement(name = "is_calculate_total") 
     73    protected boolean isCalculateTotal;     
    7274    @XmlElement(name = "sort_order", required = true) 
    7375    protected Integer sortOrder; 
     
    212214        this.isSortField = value; 
    213215    } 
     216     
     217    /** 
     218     * Gets the value of the isCalculateTotal property. 
     219     *  
     220     */ 
     221    public boolean isIsCalculateTotal() { 
     222        return isCalculateTotal; 
     223    } 
     224 
     225    /** 
     226     * Sets the value of the isCalculateTotal property. 
     227     *  
     228     */ 
     229    public void setIsCalculateTotal(boolean value) { 
     230        this.isCalculateTotal = value; 
     231    }     
     232     
    214233 
    215234    /** 
  • trunk/core/src/net/project/form/soa/binding/ObjectFactory.java

    r17816 r17817  
    3939    private final static QName _UseDefault_QNAME = new QName("", "use_default"); 
    4040    private final static QName _WrapMode_QNAME = new QName("", "wrap_mode"); 
     41    private final static QName _IsCalculateTotal_QNAME = new QName("", "is_calculate_total");     
    4142    private final static QName _ClassTypeId_QNAME = new QName("", "class_type_id"); 
    4243    private final static QName _Datatype_QNAME = new QName("", "datatype"); 
     
    228229 
    229230    /** 
     231     * Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >}} 
     232     *  
     233     */ 
     234    @XmlElementDecl(namespace = "", name = "is_calculate_total") 
     235    public JAXBElement<Boolean> createIsCalculateTotal(Boolean value) { 
     236        return new JAXBElement<Boolean>(_IsCalculateTotal_QNAME, Boolean.class, null, value); 
     237    } 
     238     
     239     
     240    /** 
    230241     * Create an instance of {@link JAXBElement }{@code <}{@link BigInteger }{@code >}} 
    231242     *  
  • trunk/core/src/net/project/soa/forms/FormExportServiceImpl.java

    r17816 r17817  
    166166                                        listField.setIsSubfield(listFieldProp.isSubfield()); 
    167167                                        listField.setSortOrder(listFieldProp.getSortOrder()); 
    168                                          
     168                                        listField.setIsCalculateTotal(listFieldProp.isCalculateTotal()); 
    169169                                         
    170170                                        net.project.form.soa.binding.FieldFilter filter = factory.createFieldFilter();