Package net.datacrow.core.objects

Examples of net.datacrow.core.objects.DcField


    /**
     * Initializes the default fields.
     */
    protected void initializeFields() {
        try {
            addField(new DcField(DcObject._ID, getIndex(), "ID",
                                 false, true, true, false,
                                 36, ComponentFactory._SHORTTEXTFIELD, getIndex(), DcRepository.ValueTypes._STRING,
                                 "ID"));
            addField(new DcField(DcObject._SYS_CREATED, getIndex(), "Created",
                                 false, true, true, true,
                                 10, ComponentFactory._DATEFIELD, getIndex(), DcRepository.ValueTypes._DATE,
                                 "Created"));
            addField(new DcField(DcObject._SYS_MODIFIED, getIndex(), "Modified",
                                 false, true, true, true,
                                 10, ComponentFactory._DATEFIELD, getIndex(), DcRepository.ValueTypes._DATE,
                                 "Modified"));
           
            if ((isTopModule() || isChildModule()) && isCustomFieldsAllowed()) {
                addField(new DcField(DcMediaObject._U1_USER_LONGTEXT, getIndex(), "User Long Text Field",
                        false, false, false, true, 
                        4000, ComponentFactory._LONGTEXTFIELD, getIndex(), DcRepository.ValueTypes._STRING,
                        "UserLongText1"));        
                addField(new DcField(DcMediaObject._U2_USER_SHORTTEXT1, getIndex(), "User Short Text Field 1"
                        false, false, false, true, 
                        255, ComponentFactory._SHORTTEXTFIELD, getIndex(), DcRepository.ValueTypes._STRING,
                        "UserShortText1"));
                addField(new DcField(DcMediaObject._U3_USER_SHORTTEXT2, getIndex(), "User Short Text Field 2"
                        false, false, false, true, 
                        255, ComponentFactory._SHORTTEXTFIELD, getIndex(), DcRepository.ValueTypes._STRING,
                        "UserShortText2"));
                addField(new DcField(DcMediaObject._U4_USER_NUMERIC1, getIndex(), "User Numeric Field 1"
                        false, false, false, true, 
                        255, ComponentFactory._NUMBERFIELD, getIndex(), DcRepository.ValueTypes._LONG,
                        "UserInteger1"));
                addField(new DcField(DcMediaObject._U5_USER_NUMERIC2, getIndex(), "User Numeric Field 2"
                        false, false, false, true, 
                        255, ComponentFactory._NUMBERFIELD, getIndex(), DcRepository.ValueTypes._LONG,
                        "UserInteger2"));           
            }
           
            if (isTopModule() && !hasDependingModules()) {
                addField(new DcField(DcMediaObject._VALUE, getIndex(), "Item Value"
                        false, true, false, true, 
                        255, ComponentFactory._DECIMALFIELD, getIndex(), DcRepository.ValueTypes._DOUBLE,
                        "CurrencyValue"));           
            }
           
            if (    isTopModule() && !isAbstract() &&
                    getIndex() != DcModules._CONTAINER && getIndex() != DcModules._USER &&
                    getIndex() != DcModules._EXTERNALREFERENCE && getIndex() != DcModules._LOAN &&
                    getIndex() != DcModules._MAPPING && getIndex() != DcModules._PERMISSION &&
                    getIndex() != DcModules._TAB && getIndex() != DcModules._CONTACTPERSON) {
               
                addField(new DcField(DcObject._SYS_EXTERNAL_REFERENCES, getIndex(), "External References"
                        true, true, false, true, 
                        4, ComponentFactory._SIMPLEREFERENCESFIELD, DcModules._EXTERNALREFERENCE, DcRepository.ValueTypes._DCOBJECTCOLLECTION,
                        "externalreferences"));      
            }
   
View Full Code Here


    /**
     * Initializes the system fields.
     */
    protected void initializeSystemFields() {
        systemFields.put(DcObject._SYS_MODULE,
                new DcField(DcObject._SYS_MODULE, getIndex(), "Item",
                            true, true, true, true,
                            255, ComponentFactory._SHORTTEXTFIELD, getIndex(), DcRepository.ValueTypes._STRING,
                            "Item"));
        systemFields.put(DcObject._SYS_AVAILABLE,
                new DcField(DcObject._SYS_AVAILABLE, getIndex(), "Available",
                            true, true, true, true,
                            4, ComponentFactory._AVAILABILITYCOMBO, getIndex(), DcRepository.ValueTypes._BOOLEAN,
                            "Available"));
        systemFields.put(DcObject._SYS_LENDBY,
                new DcField(DcObject._SYS_LENDBY, getIndex(), "Lend By",
                            true, true, true, true,
                            255, ComponentFactory._REFERENCEFIELD, DcModules._CONTACTPERSON, DcRepository.ValueTypes._DCOBJECTREFERENCE,
                            "LendBy"));
        systemFields.put(DcObject._SYS_LOANDURATION,
                new DcField(DcObject._SYS_LOANDURATION, getIndex(), "Days Loaned",
                            true, true, true, true,
                            10, ComponentFactory._NUMBERFIELD, getIndex(), DcRepository.ValueTypes._LONG,
                            "DaysLoaned"));
        systemFields.put(DcObject._SYS_LOANDUEDATE,
                new DcField(DcObject._SYS_LOANDUEDATE, getIndex(), "Due Date",
                            true, true, true, true,
                            10, ComponentFactory._DATEFIELD, getIndex(), DcRepository.ValueTypes._DATE,
                            "DueDate"));
        systemFields.put(DcObject._SYS_LOANDAYSTILLOVERDUE,
                new DcField(DcObject._SYS_LOANDAYSTILLOVERDUE, getIndex(), "Days till overdue",
                            true, true, true, true,
                            10, ComponentFactory._NUMBERFIELD, getIndex(), DcRepository.ValueTypes._LONG,
                            "DaysTillOverDue"));               
       
        if (isTopModule() && deliversOnlineService()) {
            systemFields.put(Integer.valueOf(DcObject._SYS_SERVICE),
                             new DcField(DcObject._SYS_SERVICE, getIndex(), "Service",
                                         false, true, true, false,
                                         255, ComponentFactory._SHORTTEXTFIELD, getIndex(), DcRepository.ValueTypes._STRING,
                                         "service"));
            systemFields.put(Integer.valueOf(DcObject._SYS_SERVICEURL),
                             new DcField(DcObject._SYS_SERVICEURL, getIndex(), "Service URL",
                                         false, true, true, false,
                                         255, ComponentFactory._URLFIELD, getIndex(), DcRepository.ValueTypes._STRING,
                                         "serviceurl"));       
        }
       
        if (isContainerManaged()) {
            systemFields.put(Integer.valueOf(DcObject._SYS_CONTAINER),
                    new DcField(DcObject._SYS_CONTAINER, getIndex(), "Container",
                                true, true, false, true, 
                                10, ComponentFactory._REFERENCESFIELD, DcModules._CONTAINER, DcRepository.ValueTypes._DCOBJECTCOLLECTION,
                                "Container"));
        }
       
        systemFields.put(Integer.valueOf(DcObject._SYS_DISPLAYVALUE),
                new DcField(Item._SYS_DISPLAYVALUE, getIndex(), "Label",
                            true, true, true, false,
                            255, ComponentFactory._SHORTTEXTFIELD, getIndex(), DcRepository.ValueTypes._STRING,
                            "Label"));
       
        if (isFileBacked) {
            systemFields.put(Integer.valueOf(DcObject._SYS_FILENAME),
                    new DcField(DcObject._SYS_FILENAME, getIndex(), "Filename",
                                false, true, false, true,
                                500, ComponentFactory._FILELAUNCHFIELD, getIndex(), DcRepository.ValueTypes._STRING,
                                "Filename"));
            systemFields.put(Integer.valueOf(DcObject._SYS_FILEHASH),
                    new DcField(DcObject._SYS_FILEHASH, getIndex(), "Filehash",
                                false, false, true, false,
                                32, ComponentFactory._SHORTTEXTFIELD, getIndex(), DcRepository.ValueTypes._STRING,
                                "Filehash"));
            systemFields.put(Integer.valueOf(DcObject._SYS_FILESIZE),
                    new DcField(DcObject._SYS_FILESIZE, getIndex(), "Filesize",
                                false, true, true, true,
                                10, ComponentFactory._FILESIZEFIELD, getIndex(), DcRepository.ValueTypes._LONG,
                                "Filesize"));
            systemFields.put(Integer.valueOf(DcObject._SYS_FILEHASHTYPE),
                    new DcField(DcObject._SYS_FILEHASHTYPE, getIndex(), "Filehash Type",
                                false, false, true, false,
                                10, ComponentFactory._SHORTTEXTFIELD, getIndex(), DcRepository.ValueTypes._STRING,
                                "FilehashType"));
        }
    }   
View Full Code Here

        toFront();
        setModal(true);
    }

    public void setImage() {
        DcField field = (DcField) cbFields.getSelectedItem();
        dco.setValue(field.getIndex(), image);
    }
View Full Code Here

     * Initializes the default fields.
     */
    @Override
    protected void initializeFields() {
        super.initializeFields();
        addField(new DcField(DcProperty._A_NAME, getIndex(), "Name",
                false, true, false, true,
                255, ComponentFactory._SHORTTEXTFIELD, getIndex(), DcRepository.ValueTypes._STRING,
                "Name"));
        addField(new DcField(DcProperty._B_ICON, getIndex(), "Icon",
                false, true, false, false,
                255, ComponentFactory._PICTUREFIELD, getIndex(), DcRepository.ValueTypes._ICON,
                "Icon"));
        addField(new DcField(DcProperty._C_ALTERNATIVE_NAMES, getIndex(), "Alternative Names",
                false, true, false, false,
                4000, ComponentFactory._LONGTEXTFIELD, getIndex(), DcRepository.ValueTypes._STRING,
                "alternative_names"));       
        getField(DcObject._ID).setEnabled(false);
   
View Full Code Here

           
            if (module.getXmlModule() == null)
                continue;
           
            for (XmlField xmlField : module.getXmlModule().getFields()) {
                DcField field = module.getField(xmlField.getIndex());
               
                if (field != null && field.getIndex() != DcObject._ID && field.getFieldType() != xmlField.getFieldType()) {
                    Conversion conversion = new Conversion(module.getIndex());
                    conversion.setColumnName(field.getDatabaseFieldName());
                    conversion.setOldFieldType(field.getFieldType());
                    conversion.setNewFieldType(xmlField.getFieldType());
                    conversion.setReferencingModuleIdx(xmlField.getModuleReference());
                    conversions.add(conversion);
                }
            }
View Full Code Here

                    ((Number) table.getValueAt(row, 2, true)).intValue() :
                    Integer.valueOf((String) table.getValueAt(row, 2, true));
            boolean enabled = ((Boolean) table.getValueAt(row, 3, true)).booleanValue();
            boolean link = ((Boolean) table.getValueAt(row, 4, true)).booleanValue();
            boolean quickSearch = ((Boolean) table.getValueAt(row, 5, true)).booleanValue();
            DcField field = (DcField) table.getValueAt(row, 6, true);

            return new WebFieldDefinition(field.getIndex(), width, maxText, enabled, link, quickSearch);
        }
View Full Code Here

        comboTypes.setEnabled(b);
        btnAccept.setEnabled(b);
    }
   
    private void buildChart() {
        DcField field = (DcField) comboFields.getSelectedItem();
       
        if (field == null) return;
       
        if (comboTypes.getSelectedIndex() == 1)
            buildBar(field);
View Full Code Here

    }

    public Collection<AutoIncrementer> getEnhancers() {
        Collection<AutoIncrementer> enhancers = new ArrayList<AutoIncrementer>();
        for (int i = 0; i < table.getRowCount(); i++) {
            DcField field = (DcField) table.getValueAt(i, 0, true);
            if (field != null) {
                boolean enabled = ((Boolean) table.getValueAt(i, 1, true)).booleanValue();
                boolean fillGaps = ((Boolean) table.getValueAt(i, 2, true)).booleanValue();
                int step = ((Integer) table.getValueAt(i, 3, true)).intValue();
               
                enhancers.add(new AutoIncrementer(field.getIndex(), enabled, fillGaps, step));
            }
        }
        return enhancers;
    }
View Full Code Here

        }
       
        @Override
        public void run() {
           
            DcField field = DcModules.get(module).getField(fieldIdx);
           
            cancelOthers();
           
            Map<String, Integer> dataMap = getDataMap(field);
           
View Full Code Here

           
            Map<String, Integer> dataMap = getDataMap(DcModules.get(module).getField(fieldIdx));
           
            if (dataMap == null) return;
           
            DcField field = DcModules.get(module).getField(fieldIdx);
            DefaultCategoryDataset dataset = new DefaultCategoryDataset();
            int total = 0;
            int value;
            for (String key : dataMap.keySet()) {
              value = dataMap.get(key).intValue();
              key = key == null ? DcResources.getText("lblEmpty") : key;
                 dataset.addValue(value, key, field.getLabel());
                 total += value;
            }
           
            int all = DataManager.getCount(module, -1, null);
            if (total < all)
              dataset.addValue(all - total, DcResources.getText("lblEmpty"), field.getLabel());
           
            if (!isCanceled()) {
                JFreeChart chart = ChartFactory.createBarChart(
                    null, null, null, dataset, PlotOrientation.VERTICAL, true, true, false);
              chartPanel = new org.jfree.chart.ChartPanel(chart);
View Full Code Here

TOP

Related Classes of net.datacrow.core.objects.DcField

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.