Package com.intersys.globals

Examples of com.intersys.globals.NodeReference


                    for (int j=0;j<vList.length()/2;j++) {
                        String nKey = vList.getNextString();
                        // TODO more nesting?
                        String nValue = vList.getNextString();

                        NodeReference tempGlobal = connection.createNodeReference(nKey);
                        if (tempGlobal.exists(nValue)) {
                            // this is a reference
                            read(nDocument,tempGlobal.getList(nValue),(NoSchemaDocument)blueprint.get(key));
                        } else {
                            nDocument.put(nKey,nValue);
                        }
                    }
                    document.put(key,nDocument);
View Full Code Here


    *
    * @param documentType DocumentType to be saved
    *
    */
    public void saveDocumentType(DocumentType documentType) {
        NodeReference global = createNodeReference("Schema");
        ValueList list = createList();
        documentType.store(this,list);
        global.set(list,documentType.name);

        list.clear();
        global = createNodeReference("Indices");
        global.appendSubscript(documentType.name);
        documentType.storeIndices(global,list);
    }
View Full Code Here

    *
    * @param name name of the DocumentType to be deleted
    *
    */
    public void deleteDocumentType(String name) {
        NodeReference global = createNodeReference("Schema");
        global.killNode(name);
        global = createNodeReference("Indices");
        global.killNode(name);
    }
View Full Code Here

    public DocumentType getDocumentType() {
        return documentType;
    }
  
    private void setDocumentType(String name) {
        NodeReference schemaGlobal = connection.createNodeReference("Schema");
        schemaGlobal.appendSubscript(name);
        if (!schemaGlobal.exists()) {
            documentType = null;
            return;
        }
        documentType = DocumentType.createDocumentType(name);
        documentType.load(connection,schemaGlobal.getList());
    }
View Full Code Here

        valueList.append(scratch);
    }

    private Document readReference(String address, String globalName, DocumentType dt) {
        Document reference = new Document();
        NodeReference refGlobal = getReferenceGlobal(globalName);
        refGlobal.appendSubscript(address);
        read(reference,refGlobal.getList(),dt);
        return reference;
    }
View Full Code Here

        }
    }

    private String writeReference(String key, Document document, DocumentType type, String reference, String refKey) {
        String referenceKey = document.get(refKey).toString();
        NodeReference refGlobal = getReferenceGlobal(reference);
        refGlobal.appendSubscript(referenceKey);
        if (refGlobal.exists()) {
            return referenceKey;
        }
        referenceTempList.clear();
        NodeReference oldIndexGlobal = indexGlobal;
        indexGlobal = getIndexGlobal(reference);
        write(key,document,type,referenceTempList);
        //document.setDBID(name,key);
        indexGlobal = oldIndexGlobal;
        refGlobal.set(referenceTempList);
View Full Code Here

        refGlobal.set(referenceTempList);
        return referenceKey; //document.getDBID();
    }

    NodeReference getReferenceGlobal(String name) {
        NodeReference refGlobal = refGlobalMap.get(name);
        if (refGlobal == null) {
            refGlobal = connection.createNodeReference(name);
            refGlobalMap.put(name,refGlobal);
        }
        refGlobal.setSubscriptCount(0);
        return refGlobal;
    }
View Full Code Here

        refGlobal.setSubscriptCount(0);
        return refGlobal;
    }

    NodeReference getIndexGlobal(String name) {
        NodeReference iGlobal = indexGlobalMap.get(name);
        if (iGlobal == null) {
            iGlobal = connection.createNodeReference(name+"I");
            indexGlobalMap.put(name,iGlobal);
        }
        return iGlobal;
View Full Code Here

            } else if ((eType == ElementType.TYPE_REFERENCE) ||
                       (eType == ElementType.TYPE_REFERENCE_ARRAY)) {
                type.reference = list.getNextString();
                type.referenceKey = list.getNextString();
                DocumentType dt = new DocumentType(type.reference);
                NodeReference schemaGlobal = connection.createNodeReference("Schema");

                ValueList ml = schemaGlobal.getList(type.reference);
                dt.load(connection,ml);
                type.nestedType = dt;
            // TODO
            } else if (eType == ElementType.TYPE_BACK_REFERENCE) {
                String refName = list.getNextString();
                String bRef = list.getNextString();
            }
            types.put(eName,type);
        }
        NodeReference indexGlobal = connection.createNodeReference("Indices");
        if (name != null) {
            indexGlobal.appendSubscript(name);
            loadIndices(indexGlobal);
        }
     }
View Full Code Here

TOP

Related Classes of com.intersys.globals.NodeReference

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.