Package net.datacrow.core.modules

Examples of net.datacrow.core.modules.DcModule


        if (getSelectedModule() == -1) {
            DcSwingUtilities.displayMessage("msgSelectModuleFirst");
            return null;
        }
       
        DcModule module = DcModules.get(getSelectedModule());
        return module == null ? DcModules.getPropertyBaseModule(getSelectedModule()) : module;
    }
View Full Code Here


        new PieChartBuilder(field.getIndex()).start();
    }
   
    private Map<String, Integer> getDataMap(DcField field) {
        DcModule mainModule = DcModules.get(field.getModule());
        DcModule referenceModule = DcModules.get(field.getReferenceIdx());
        DcModule mappingModule = DcModules.get(DcModules.getMappingModIdx(module, field.getReferenceIdx(), field.getIndex()));
       
        String sql;
        if (field.getValueType() == DcRepository.ValueTypes._DCOBJECTREFERENCE) {
          sql = "select sub." + referenceModule.getField(referenceModule.getDisplayFieldIdx()).getDatabaseFieldName() +
                ", count(parent.id) from " + mainModule.getTableName() +
                " parent inner join " + referenceModule.getTableName() + " sub on " +
                " parent. " + field.getDatabaseFieldName() + " = sub.ID " +
                " group by sub." + referenceModule.getField(referenceModule.getDisplayFieldIdx()).getDatabaseFieldName() +
                " order by 1";
        } else if (field.getValueType() == DcRepository.ValueTypes._DCOBJECTCOLLECTION) {
          sql = "select sub." + referenceModule.getField(referenceModule.getDisplayFieldIdx()).getDatabaseFieldName() +
                ", count(parent.id) from " + mainModule.getTableName() + " parent " +
              " inner join " + mappingModule.getTableName() + " mapping on " +
              " parent. ID = mapping." + mappingModule.getField(DcMapping._A_PARENT_ID).getDatabaseFieldName() +
              " inner join " + referenceModule.getTableName() + " sub on " +
              " mapping." + mappingModule.getField(DcMapping._B_REFERENCED_ID).getDatabaseFieldName() + " = sub.ID " +
              " group by sub." + referenceModule.getField(referenceModule.getDisplayFieldIdx()).getDatabaseFieldName() +
              " order by 1";
        } else {
          sql = "select " + field.getDatabaseFieldName() + ", count(ID) from " + mainModule.getTableName() +
                " group by " + field.getDatabaseFieldName() +
View Full Code Here

         * MAIN PANEL
         **********************************************************************/

        JTabbedPane tp = ComponentFactory.getTabbedPane();

        DcModule module = DcModules.get(DcSettings.getInt(DcRepository.Settings.stModule));
        panelDefinitionsParent = new DefinitionPanel(module);

        tp.addTab(DcResources.getText("lblXFields", module.getLabel()),
                panelDefinitionsParent);

        if (module.getChild() != null) {
            panelDefinitionsChild = new DefinitionPanel(module.getChild());
            tp.addTab(DcResources.getText("lblXFields", module.getChild()
                    .getLabel()), panelDefinitionsChild);
        }

        getContentPane().add(tp, Layout.getGBC(0, 0, 1, 1, 10.0, 10.0,
                        GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
View Full Code Here

            insert(text, getCaretPosition());
        }
    }
   
    private void insertField(int field) {
        DcModule m = DcModules.get(module);
        if (field == m.getParentReferenceFieldIndex()) {
            insert('[' + m.getParent().getObjectName() + ']', getCaretPosition());
        } else {
            insert('[' + m.getField(field).getSystemName() + ']', getCaretPosition());
        }
    }
View Full Code Here

            ModuleJar mj = new ModuleJar(module);
            mj.save();
           
            for (XmlField field : module.getFields()) {
                if (field.getModuleReference() != module.getIndex() && field.getModuleReference() != 0) {
                    DcModule m = DcModules.get(field.getModuleReference()) == null ?
                                 DcModules.get(field.getModuleReference() + module.getIndex()) :
                                 DcModules.get(field.getModuleReference());
                   
                    if (m != null && m.getXmlModule() != null)
                        new ModuleJar(m.getXmlModule()).save();
                }
            }

            close();
           
View Full Code Here

    public void next() {
        try {
           
            ExportDefinition definition;
            if (getCurrent() instanceof PanelSelectModuleToExport) {
                DcModule module = (DcModule) getCurrent().apply();
               
                if (module == null) return;
               
                definition = new ExportDefinition();
                definition.setModule(module);
View Full Code Here

        object = template.getObjectClass();
        moduleClass = template.getModuleClass();
       
        // make sure we are using a transparent module class:
        if (DcModules.get(template.getIndex()) != null) {
            DcModule module = DcModules.get(template.getIndex());

            if (module.getType() == DcModule._TYPE_ASSOCIATE_MODULE) {
                object = DcAssociate.class;
                moduleClass = DcAssociateModule.class;
            } else if (module.getType() == DcModule._TYPE_MEDIA_MODULE) {
                object = DcMediaObject.class;
                moduleClass = DcMediaModule.class;
            } else if (module.getType() == DcModule._TYPE_PROPERTY_MODULE) {
                object = DcProperty.class;
                moduleClass = DcPropertyModule.class;
            } else {
                object = DcObject.class;
                moduleClass = DcModule.class;
View Full Code Here

   
    private void build() {
        setLayout(Layout.getGBL());
       
        Tool tool = getTool();
        DcModule module = DcModules.get(tool.getModule());
       
        if (module == null) return;
       
        int y = 0;
        int x = 0;

        Collection<Plugin> plugins = new ArrayList<Plugin>();
        addPlugin(plugins, "NewItemWizard");
        addPlugin(plugins, "CreateNew");
       
        if (module.getImporterClass() != null)
            addPlugin(plugins, "FileImport");
       
        if (module.deliversOnlineService()) {
            addPlugin(plugins, "OnlineSearch");
            addPlugin(plugins, "MassUpdate");
        }
       
        for (Plugin plugin : plugins) {
View Full Code Here

        if (value instanceof DcObject) {
            DcObject o = (DcObject) value;
            setIcon(o.getIcon());
            setText(o.toString());
        } else if (value instanceof DcModule) {
          DcModule module = (DcModule) value;
            setIcon(module.getIcon16());
            setText(module.getLabel());
        } else if (value instanceof String) {
            setIcon(null);
            setText((String) value);
        } else if (value != null){
            setIcon(null);
View Full Code Here

                    Collection<DcMapping> c = (Collection<DcMapping>) dco.getValue(field.getIndex());
                   
                    if (c != null) references.add(c);
                   
                    if (dco.isChanged(field.getIndex())) {
                        DcModule mappingMod = DcModules.get(DcModules.getMappingModIdx(field.getModule(), field.getReferenceIdx(), field.getIndex()));
                        String sql = "DELETE FROM " + mappingMod.getTableName() + " WHERE "
                                     mappingMod.getField(DcMapping._A_PARENT_ID).getDatabaseFieldName() + " = '" + dco.getID() + "'";
                        stmt.execute(sql);
                    }
                } else if (dco.isChanged(field.getIndex()) && !field.isUiOnly()) {
                    if (sbValues.length() > 0)
                        sbValues.append(", ");
View Full Code Here

TOP

Related Classes of net.datacrow.core.modules.DcModule

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.