Examples of RealCIXFile


Examples of realcix20.classes.plugins.RealCIXFile

           
        }
       
        public static RealCIXFile exportCorrespondenceCIXFile(Row correspondenceRow) {
           
                RealCIXFile realCIXFile = null;
                String type = "Correspondence";
                Vector datas = new Vector();
                Vector notEncryedDatas = new Vector();
                datas.add(correspondenceRow);
                String ns = ObjectUtil.findNewCell(correspondenceRow, "T", "NS").getColumnValue().toString();
                String p = ObjectUtil.findNewCell(correspondenceRow, "T", "P").getColumnValue().toString();
                String pa = ObjectUtil.findNewCell(correspondenceRow, "T", "PA").getColumnValue().toString();
                PartnerClass partner = (PartnerClass)ClassManager.createClass(250);
                Row partnerAccountRow = null;             
                partnerAccountRow = PartnerClass.findPartnerAccountRow(partner, ns, p, pa);
                Row mePartnerAccountRow = null;
                if (partnerAccountRow != null)
                    mePartnerAccountRow = PartnerClass.getMePartnerAccount(partnerAccountRow);
                PrivateKey privateKey = null;
                if (mePartnerAccountRow != null) {
                    privateKey = (PrivateKey)ObjectUtil.findNewCell(mePartnerAccountRow, "PA", "PRIKEY").getColumnValue();
                }
                if (privateKey != null) {
                    String urns = ObjectUtil.findNewCell(partnerAccountRow, "PA", "URNS").getColumnValue().toString();
                    String urp = ObjectUtil.findNewCell(partnerAccountRow, "PA", "URP").getColumnValue().toString();
                    String urpa = ObjectUtil.findNewCell(partnerAccountRow, "PA", "URPA").getColumnValue().toString();
                    notEncryedDatas.add(urns);
                    notEncryedDatas.add(urp);
                    notEncryedDatas.add(urpa);
                    realCIXFile = new RealCIXFile(type, privateKey, notEncryedDatas, datas);
                }
                return realCIXFile;
           
        }
View Full Code Here

Examples of realcix20.classes.plugins.RealCIXFile

       
            if (container.getObject() instanceof PartnerClass) {               
                String defaultFileName = "partner";
                boolean selected = initFileChooser("Export", defaultFileName);
                if (selected) {                   
                    RealCIXFile realCIXFile = PartnerClass.exportPartnerCIXFile(container.getCurrentRow(), container.banks, container.address);                   
                    String fileName = fileChooser.getSelectedFile().getAbsolutePath();
                    File file = realCIXFile.exportFile(fileName);
                    StringBuffer sb = new StringBuffer(TxtManager.getTxt("INFORMATION.EXPORTPART1"));
                    String ns = ObjectUtil.findNewCell(container.getCurrentRow(), "P", "NS").getColumnValue().toString();
                    String p = ObjectUtil.findNewCell(container.getCurrentRow(), "P", "P").getColumnValue().toString();
                    sb.append(ns + ":" + p);
                    sb.append(TxtManager.getTxt("INFORMATION.EXPORTPART2"));
                    sb.append(file.getAbsolutePath() + " . ");
                    DialogManager.showMessageDialog(container, sb.toString());
                    saveObjectToDB();
                    container.getContainer().updateTable();
                    container.getContainer().setEnabled(true);
                    container.dispose();
                }               
            } else if (container.getObject() instanceof CorrespondenceClass) {
                String defaultFileName = "corr";
                boolean selected = initFileChooser("Export", defaultFileName);
                if (selected) {
                    RealCIXFile realCIXFile = CorrespondenceClass.exportCorrespondenceCIXFile(container.getCurrentRow());
                    //String fileName = fileChooser.getSelectedFile().getName();
                    String fileName = fileChooser.getSelectedFile().getAbsolutePath();
                    File file = realCIXFile.exportFile(fileName);
                    StringBuffer sb = new StringBuffer(TxtManager.getTxt("INFORMATION.EXPORT.CORRESONDENCE1"));
                    sb.append(file.getAbsolutePath() + " ");
                    sb.append(TxtManager.getTxt("INFORMATION.EXPORT.CORRESONDENCE2"));
                    String ns = ObjectUtil.findNewCell(container.getCurrentRow(), "T", "NS").getColumnValue().toString();
                    String p = ObjectUtil.findNewCell(container.getCurrentRow(), "T", "P").getColumnValue().toString();
View Full Code Here

Examples of realcix20.classes.plugins.RealCIXFile

    private void importFile() {
       
            boolean selected = initFileChooser();
            if (selected) {
                File file = fileChooser.getSelectedFile();
                RealCIXFile realCIXFile = RealCIXFile.importFile(file);
                if (realCIXFile == null) {
                    DialogManager.showMessageDialog(getContainer(), TxtManager.getTxt("INFORMATION.CIXFILEFORMATERROR"));
                } else {
                    String type = realCIXFile.getType();
                    if (type.equals("Partner")) {
                        Vector datas = realCIXFile.getDatas(realCIXFile.getPublicKey());
                        PartnerClass.analyPartnerCIXFile(datas, this);
                    } else if (type.equals("Correspondence")) {
                        CorrespondenceClass.analyCorrespondenceCIXFile(realCIXFile, this);
                    }
                }
View Full Code Here

Examples of realcix20.classes.plugins.RealCIXFile

           
        }
               
        public static RealCIXFile exportPartnerCIXFile(Row partnerRow, Vector banks, Vector addresses) {
           
                RealCIXFile realCIXFile = null;
                String type = "Partner";
                Vector datas = new Vector();
                datas.add(partnerRow);
                Vector partnerAccountRows = new Vector();
                Vector mePartnerAccountRows = new Vector();
                Vector publicKeys = new Vector();
                Iterator partnerAccountRowsIter = partnerRow.getRowSet().getRows().iterator();
                while (partnerAccountRowsIter.hasNext()) {
                    Row partnerAccountRow = (Row)partnerAccountRowsIter.next();
                    if ( ( (partnerRow.isAdd()) && (partnerAccountRow != partnerRow) ) || (!partnerRow.isAdd()) ) {
                        PublicKey publicKey = getPublicKey(partnerAccountRow);
                        publicKeys.add(publicKey);
                        Row mePartnerAccountRow = getMePartnerAccount(partnerAccountRow);
                        mePartnerAccountRows.add(mePartnerAccountRow);
                        partnerAccountRows.add(partnerAccountRow);                    
                    }
                }
                datas.add(partnerAccountRows);
                datas.add(publicKeys);
                datas.add(banks);
                datas.add(addresses);
                FamilyClass family = (FamilyClass)ClassManager.createClass(110);
                Row familyRow = (Row)family.getRows().get(0);
                datas.add(familyRow);
                datas.add(mePartnerAccountRows);
                Row firstPartnerAccountRow = (Row)partnerAccountRows.get(0);
                PublicKey publicKey = getPublicKey(firstPartnerAccountRow);
                PrivateKey privateKey = getPrivateKey(firstPartnerAccountRow);
               
                realCIXFile = new RealCIXFile(type, privateKey, publicKey, datas);
                return realCIXFile;
           
        }
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.