Examples of DCModule


Examples of net.datacrow.core.modules.DcModule

    private void handle(DcObject dco, Collection<String> handled) throws IOException {
        for (int fieldIdx : fields) {
            DcField field = dco.getField(fieldIdx);
            if (field != null && field.getValueType() == DcRepository.ValueTypes._DCOBJECTCOLLECTION) {
                DcModule sm = DcModules.get(field.getReferenceIdx());
                DcObject so = sm.getItem();

                if (!handled.contains(so.getModule().getSystemObjectName())) {
                    writeDco(so);
                    newLine();
                }
View Full Code Here

Examples of net.datacrow.core.modules.DcModule

   
    private void writeField(DcField field) throws IOException {
        String label = getValidTag(field.getSystemName());

        if (field.getValueType() == DcRepository.ValueTypes._DCOBJECTCOLLECTION) {
            DcModule sm = DcModules.get(field.getReferenceIdx());
            String name = getValidTag(field.getSystemName());
            String reference = getValidTag(sm.getSystemObjectName());

            writeLine("<xsd:element name=\"" + name + "\"/>", 3);
            addReference(name, reference);
        } else {
            String type;
View Full Code Here

Examples of net.datacrow.core.modules.DcModule

 
    @Override
  public void addModules() {
        if (elements != null) elements.clear();
       
        DcModule referencedMod;
        DcModule referencedMod2;
        Collection<DcModule> managedModules = SecurityCentre.getInstance().getManagedModules();
        for (DcModule module : managedModules) {
            try {
              if (module.isSelectableInUI() || module.isChildModule()) {

                  List<ModulePanel> c = new ArrayList<ModulePanel>();
                  c.add(new ModulePanel(module, ModulePanel._ICON32));
                 
                  for (DcField field : module.getFields()) {
                      referencedMod = DcModules.getReferencedModule(field);
                      if (    managedModules.contains(referencedMod) &&
                          referencedMod.isEnabled() &&
                            referencedMod.getIndex() != module.getIndex() &&
                                referencedMod.getIndex() != DcModules._CONTACTPERSON &&
                                referencedMod.getIndex() != DcModules._CONTAINER) {
                       
                          c.add(new ModulePanel(referencedMod, ModulePanel._ICON16));
                         
                          // elegant? no..
                          for (DcField field2 : referencedMod.getFields()) {
                              referencedMod2 = DcModules.getReferencedModule(field2);
                              if (    managedModules.contains(referencedMod2) &&
                                      referencedMod2.isEnabled() &&
                                      referencedMod2.getIndex() != referencedMod.getIndex() &&
                                      referencedMod2.getIndex() != DcModules._CONTACTPERSON &&
                                      referencedMod2.getIndex() != DcModules._CONTAINER) {
                                 
                                  c.add(new ModulePanel(referencedMod2, ModulePanel._ICON16));
                              }
                          }
                      }
View Full Code Here

Examples of net.datacrow.core.modules.DcModule

    public int getModule(int idx) {
        return getModuleForRow(idx).getIndex();
    }

    public DcModule getModuleForRow(int row) {
        DcModule result = module;

        if (module.isAbstract()) {
            int col = getColumnIndexForField(Media._SYS_MODULE);
            Object value = getValueAt(row, col, true);
            if (value instanceof DcModule) {
View Full Code Here

Examples of net.datacrow.core.modules.DcModule

               
                Element eField = (Element) nlField.item(0);
               
                if (field.getValueType() == DcRepository.ValueTypes._DCOBJECTCOLLECTION) {
                    // retrieve the items by their module name
                    DcModule referenceMod = DcModules.get(field.getReferenceIdx());
                    String referenceName = Converter.getValidXmlTag(referenceMod.getSystemObjectName());
                    NodeList elReferences = eField.getElementsByTagName(referenceName);
                    for (int j = 0; elReferences != null && j < elReferences.getLength(); j++) {
                        // retrieve the values by the display field index (the system display field index)
                        Element eReference = (Element) elReferences.item(j);
                        DcObject reference = referenceMod.getItem();
                        String referenceField = Converter.getValidXmlTag(reference.getField(reference.getSystemDisplayFieldIdx()).getSystemName());
                        NodeList nlRefField = eReference.getElementsByTagName(referenceField);
                        if (nlRefField != null && nlRefField.getLength() > 0) {
                            Node eRefField = nlRefField.item(0);
                            setValue(dco, field.getIndex(), eRefField.getTextContent(), listener);
View Full Code Here

Examples of net.datacrow.core.modules.DcModule

                      if (eItem.getParentNode() != eTop)
                          continue;
                     
                      DcObject dco = parseItem(module, eItem);
                     
                      DcModule cm = module.getChild();
                      if (cm != null) {
                          String childName = Converter.getValidXmlTag(cm.getSystemObjectName());
                            NodeList nlChildren = eItem.getElementsByTagName(childName);
                           
                            for (int j = 0; nlChildren != null && j < nlChildren.getLength(); j++) {
                                Element eChild = (Element) nlChildren.item(j);
                                dco.addChild(parseItem(cm, eChild));
View Full Code Here

Examples of net.datacrow.core.modules.DcModule

     * Tries to find the corresponding module fields.
     * @param moduleIdx
     * @param fields
     */
    public void setFields(int moduleIdx, Collection<String> fields) {
        DcModule module = DcModules.get(moduleIdx);
        for (String fieldName : fields) {
            DcField target = null;
            for (DcField field : module.getFields()) {
                if (field.getDatabaseFieldName().equals(fieldName) ||
                    field.getLabel().equals(fieldName) ||
                    field.getOriginalLabel().equals(fieldName)) {
                    target = field;
                    break;
View Full Code Here

Examples of net.datacrow.core.modules.DcModule

        return DcModules.get(importer.getModule());
    }

    @Override
    public DcObject getStorageMedium() {
        DcModule module = DcModules.get(importer.getModule());
        DcObject medium = null;
        if (module.getPropertyModule(DcModules._STORAGEMEDIA) != null) {
            Object sm =  fldStorageMedium.getValue();
            medium = sm instanceof DcObject ? (DcObject) sm : null;
        }
           
        return medium;
View Full Code Here

Examples of net.datacrow.core.modules.DcModule

       
        return panel;
    }
   
    private JPanel getSettingsPanel() {
        DcModule module = DcModules.get(importer.getModule());
       
        //**********************************************************
        //Input panel
        //**********************************************************
        JPanel panel = new JPanel();
        panel.setLayout(Layout.getGBL());
       
        JPanel panelMediaInfo = new JPanel();
        panelMediaInfo.setLayout(Layout.getGBL());
       
        JLabel lblContainer = ComponentFactory.getLabel(DcResources.getText("lblContainer"));
        fldContainer = ComponentFactory.getReferenceField(DcModules._CONTAINER);
       
        String ID = settings.getString(DcRepository.ModuleSettings.stImportCDContainer);
        DcObject item = DataManager.getItem(DcModules._CONTAINER, ID);
        if (item != null)
            fldContainer.setValue(item);
       
        int idx = DcModules.get(importer.getModule()).getPropertyModule(DcModules._STORAGEMEDIA).getIndex();
        JLabel labelMedium = ComponentFactory.getLabel(DcResources.getText("lblStorageMedium"));
        fldStorageMedium = ComponentFactory.getReferenceField(idx);
       
        ID = settings.getString(DcRepository.ModuleSettings.stImportCDStorageMedium);
        item = DataManager.getItem(idx, ID);
        if (item != null)
            fldStorageMedium.setValue(item);
       
        panelMediaInfo.add(lblContainer,  Layout.getGBC( 0, 0, 1, 1, 1.0, 1.0
                ,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                 new Insets(0, 5, 5, 5), 0, 0));
        panelMediaInfo.add(fldContainer, Layout.getGBC( 1, 0, 2, 1, 1.0, 1.0
                ,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                 new Insets(0, 5, 5, 5), 0, 0));

        if (module.getPropertyModule(DcModules._STORAGEMEDIA) != null) {
            panelMediaInfo.add(labelMedium,    Layout.getGBC( 0, 1, 1, 1, 1.0, 1.0
                    ,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                     new Insets(0, 5, 5, 5), 0, 0));
            panelMediaInfo.add(fldStorageMedium,    Layout.getGBC( 1, 1, 1, 1, 20.0, 20.0
                    ,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
View Full Code Here

Examples of net.datacrow.core.modules.DcModule

    protected void build() {
        //**********************************************************
        //Online search panel
        //**********************************************************
        DcModule module = DcModules.get(importer.getModule());
        JPanel panelOs = new JPanel();
        panelOs.setLayout(Layout.getGBL());
       
        if (module.deliversOnlineService()) {
            panelServer = new OnlineServicePanel(module.getOnlineServices().getServers(), true, true);
            panelServerSettings = new OnlineServiceSettingsPanel(null, false, false, false, false, module.getIndex());
           
            panelOs.add(panelServer,     Layout.getGBC( 0, 3, 3, 1, 1.0, 1.0
                    ,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                     new Insets(15, 5, 0, 5), 0, 0));
            panelOs.add(panelServerSettings,     Layout.getGBC( 0, 4, 3, 1, 1.0, 1.0
                    ,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                     new Insets(15, 5, 0, 5), 0, 0));
           
            panelServer.setUseOnlineService(settings.getBoolean(DcRepository.ModuleSettings.stFileImportUseOnlineService));
            panelServer.setServer(settings.getString(DcRepository.ModuleSettings.stFileImportOnlineService));
            panelServer.setMode(settings.getString(DcRepository.ModuleSettings.stFileImportOnlineServiceMode));
            panelServer.setRegion(settings.getString(DcRepository.ModuleSettings.stFileImportOnlineServiceRegion));
        }

        //**********************************************************
        //Actions Panel
        //**********************************************************
        JPanel panelActions = new JPanel();
        panelActions.setLayout(Layout.getGBL());

        buttonRun.addActionListener(this);
        buttonRun.setActionCommand("import");
       
        buttonStop.addActionListener(this);
        buttonStop.setActionCommand("cancel");
       
        buttonClose.addActionListener(this);
        buttonClose.setActionCommand("close");

        panelActions.add(buttonRun,  Layout.getGBC( 0, 0, 1, 1, 1.0, 1.0
                    ,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
                     new Insets( 5, 5, 5, 5), 0, 0));
        panelActions.add(buttonStop,    Layout.getGBC( 1, 0, 1, 1, 1.0, 1.0
                    ,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
                     new Insets( 5, 5, 5, 5), 0, 0));
        panelActions.add(buttonClose,     Layout.getGBC( 2, 0, 1, 1, 1.0, 1.0
                    ,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
                     new Insets( 5, 5, 5, 5), 0, 0));

       
        //**********************************************************
        //Progress panel
        //**********************************************************
        JPanel panelProgress = new JPanel();
        panelProgress.setLayout(Layout.getGBL());
        panelProgress.add(progressBar, Layout.getGBC( 0, 1, 1, 1, 1.0, 1.0
                         ,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                          new Insets(5, 5, 5, 5), 0, 0));
       
       
        //**********************************************************
        //Log Panel
        //**********************************************************
        JPanel panelLog = new JPanel();
        panelLog.setLayout(Layout.getGBL());

        textLog.setEditable(false);
        JScrollPane scroller = new JScrollPane(textLog);
        scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        panelLog.setBorder(ComponentFactory.getTitleBorder(DcResources.getText("lblLog")));
        panelLog.add(scroller, Layout.getGBC( 0, 1, 1, 1, 1.0, 1.0
                    ,GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
                     new Insets(5, 5, 5, 5), 0, 0));
       
       
        //**********************************************************
        //Local Art
        //**********************************************************
        panelLocalArt = new LocalArtSettingsPanel(importer.getModule());

        FileNameFilter filter =
            importer.getSupportedFileTypes() != null &&
            importer.getSupportedFileTypes().length > 0 ?
            new FileNameFilter(importer.getSupportedFileTypes(), true) : null;
                
           
        //**********************************************************
        //Files / Directories
        //**********************************************************           
        panelFs = new FileImportFileSelectPanelSimple(this, filter, module.getIndex());
       
        //**********************************************************
        //Tabs Panel
        //**********************************************************
        JTabbedPane tp = ComponentFactory.getTabbedPane();
        tp.addTab(DcResources.getText("lblDirectoriesFiles"), IconLibrary._icoOpen , panelFs);
        tp.addTab(DcResources.getText("lblSettings"), IconLibrary._icoSettings16, getSettingsPanel());
        tp.addTab(DcResources.getText("lblTitleCleanup"),  IconLibrary._icoSettings16, getTitleCleanupPanel());
       
        if (module.deliversOnlineService())
            tp.addTab(DcResources.getText("lblOnlineSearch"), IconLibrary._icoSearchOnline16, panelOs);
       
        if (importer.canImportArt())
            tp.addTab(DcResources.getText("lblLocalArt"), IconLibrary._icoPicture, panelLocalArt);
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.