Package net.datacrow.core.objects

Examples of net.datacrow.core.objects.DcObject


        DcReferences references = (DcReferences) vr.resolveVariable(fc, "references");
       
        String[] keys = references.getKeys();
       
        DcWebObject wod = getParentObject();
        DcObject dco = wod.getDcObject();
        dco.setValue(references.getFieldIdx(), null);

        int referenceModIdx = dco.getField(references.getFieldIdx()).getReferenceIdx();
        for (String key : keys) {
            DcObject reference = DataManager.getItem(referenceModIdx, key);
            DataManager.createReference(dco, references.getFieldIdx(), reference);
        }
       
        try {
            dco.saveUpdate(false);
View Full Code Here


       
        DcWebImage wi = (DcWebImage) vr.resolveVariable(fc, "image");
        byte[] b = uploadedFile.getBytes();
       
        DcWebObject wo = (DcWebObject) vr.resolveVariable(fc, "webObject");
        DcObject dco = wo.getDcObject();
        dco.setValue(wi.getFieldIdx(), new DcImageIcon(b));
       
        try {
            dco.saveUpdate(false);
            wi.setPicture((Picture) dco.getValue(wi.getFieldIdx()));
            wo.load();
       
            DcWebObjects objects = (DcWebObjects) vr.resolveVariable(fc, "webObjects");
            objects.update(wo);
           
View Full Code Here

    public void add(DcWebObject wod) {
        DataModel model = getData();
        List<List<Object>> list = (List) model.getWrappedData();
        List<DcWebField> fields = (List<DcWebField>) getColumnHeaders().getWrappedData();
       
        DcObject dco = wod.getDcObject();
        List<Object> row = new ArrayList<Object>();
        for (DcWebField wfs : fields) {
            for (DcField field : dco.getFields()) {
                if (wfs.getIndex() == field.getIndex() && field.getIndex() != DcObject._ID)
                    row.add(WebUtilities.getValue(dco, wfs, dco.getValue(wfs.getIndex())));
            }
        }  
       
        row.add(wod.getID());
        list.add(0, row);
View Full Code Here

        List<List<Object>> list = (List) model.getWrappedData();
        List<Object> row = list.get(wod.getRowIdx());
        List<DcWebField> fields = (List<DcWebField>) getColumnHeaders().getWrappedData();
       
        int idx = 0;
        DcObject dco = wod.getDcObject();
        for (DcWebField wfs : fields) {
            for (DcField field : dco.getFields()) {
                if (wfs.getIndex() == field.getIndex() && field.getIndex() != DcObject._ID)
                    row.set(idx++, WebUtilities.getValue(dco, wfs, dco.getValue(wfs.getIndex())));
            }
        }    
       
        model.setRowIndex(wod.getRowIdx());
    }
View Full Code Here

            }
        }
    }
   
    private void addTab() {
        DcObject tab = DcModules.get(DcModules._TAB).getItem();
        tab.setValue(Tab._D_MODULE, Long.valueOf(dlg.getModule()));
        tab.addRequest(new UpdateItemFormSettingsWindow(dlg, false));
        ItemForm frm = new ItemForm(null, false, false, tab, true);
        frm.setVisible(true);
    }
View Full Code Here

            return;
        }
       
        int[] rows = tblTabs.getSelectedIndices();
        for (int i = rows.length - 1; i > -1; i--) {
            DcObject dco = tblTabs.getItemAt(rows[i]);
            dco.addRequest(new UpdateItemFormSettingsWindow(dlg, true));
            try {
                dco.delete(false);
            } catch (ValidationException e) {}
        }
    }
View Full Code Here

        build();
        loadItems();
    }
   
    public void open() {
        DcObject dco = table.getSelectedItem();
        if (dco != null) {
            dco.load(null);
            dco.markAsUnchanged();
            DcMinimalisticItemForm itemForm = new DcMinimalisticItemForm(false, true, dco, this);
            itemForm.setVisible(true);
        }
    }
View Full Code Here

        List<DcObject> items = new ArrayList<DcObject>();
        for (DcObject loan : DataManager.get(df)) {
            String ID = (String) loan.getValue(Loan._D_OBJECTID);
            for (DcModule module : DcModules.getModules()) {
                if (module.canBeLend() && !module.isAbstract()) {
                    DcObject dco = DataManager.getItem(module.getIndex(), ID);
                    if (dco != null && !items.contains(dco))
                        items.add(dco);
                }
            }
        }
View Full Code Here

        super(DcModules._CONTACTPERSON);
    }
   
    @Override
    public void delete(boolean validate) {
        DcObject loan = DcModules.get(DcModules._LOAN).getItem();
        loan.setValue(Loan._C_CONTACTPERSONID, getID());
       
        DataFilter filter = new DataFilter(loan);
        List<String> loans = DataManager.getKeyList(filter);
       
        if (loans.size() == 0) {
            try {
                super.delete(false);
            } catch (ValidationException e) {}
        } else {
            if (DcSwingUtilities.displayQuestion("msgDeletePersonLendItems")) {
                try {
                    DatabaseManager.executeSQL("DELETE FROM " + loan.getModule().getTableName() + " WHERE " +
                                               loan.getField(Loan._C_CONTACTPERSONID).getDatabaseFieldName() + " = '" + getID() + "'");
                    try {
                        super.delete(false);
                    } catch (ValidationException e) {}
                } catch (SQLException se) {
                    logger.error(se, se);
View Full Code Here

        // already using a very specific search mode or the online service does not support
        // search modes.
        if (task.getMode() == null || task.getMode().singleIsPerfect()) return;
       
        // check whether an ISBN is available.
        DcObject dco = task.getClient();
       
        if (dco == null) return;
       
        String isbn;
        if (    dco.getModule().getIndex() == DcModules._BOOK &&
                (dco.isFilled(Book._N_ISBN13) || dco.isFilled(Book._J_ISBN10))) {
           
            isbn = (String) dco.getValue(Book._N_ISBN13);
            isbn = isbn == null ? (String) dco.getValue(Book._J_ISBN10) : isbn;
           
        } else {
           
            isbn = String.valueOf(StringUtils.getContainedNumber(task.getQuery()));
        }
View Full Code Here

TOP

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

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.