Package org.jasig.portal.xml.stream

Examples of org.jasig.portal.xml.stream.BufferedXMLEventReader.reset()


        //If no PortalDataKey was passed build it from the source
        if (portalDataKey == null) {
            final StartElement rootElement = StaxUtils.getRootElement(bufferedXmlEventReader);
            portalDataKey = new PortalDataKey(rootElement);
            bufferedXmlEventReader.reset();
        }

        final String systemId = source.getSystemId();

        //Post Process the PortalDataKey to see if more complex import operations are needed
View Full Code Here


        final IPortalDataType portalDataType = this.dataKeyTypes.get(portalDataKey);
        if (portalDataType == null) {
            throw new RuntimeException("No IPortalDataType configured for " + portalDataKey + ", the resource will be ignored: " + getPartialSystemId(systemId));
        }
        final Set<PortalDataKey> postProcessedPortalDataKeys = portalDataType.postProcessPortalDataKey(systemId, portalDataKey, bufferedXmlEventReader);
        bufferedXmlEventReader.reset();

        //If only a single result from post processing import
        if (postProcessedPortalDataKeys.size() == 1) {
            this.importOrUpgradeData(systemId, DataAccessUtils.singleResult(postProcessedPortalDataKeys), bufferedXmlEventReader);
        }
View Full Code Here

        else {
            //Iterate over the data key order list to run the imports in the correct order
            for (final PortalDataKey orderedPortalDataKey : this.dataKeyImportOrder) {
                if (postProcessedPortalDataKeys.contains(orderedPortalDataKey)) {
                    //Reset the to start of the XML document for each import/upgrade call
                    bufferedXmlEventReader.reset();
                    this.importOrUpgradeData(systemId, orderedPortalDataKey, bufferedXmlEventReader);
                }
            }
        }
    }
View Full Code Here

            final StAXSource staxSource = (StAXSource)source;
            XMLEventReader xmlEventReader = staxSource.getXMLEventReader();
            if (xmlEventReader != null) {
                if (xmlEventReader instanceof BufferedXMLEventReader) {
                    final BufferedXMLEventReader bufferedXMLEventReader = (BufferedXMLEventReader)xmlEventReader;
                    bufferedXMLEventReader.reset();
                    bufferedXMLEventReader.mark(-1);
                    return bufferedXMLEventReader;
                }
               
                return new BufferedXMLEventReader(xmlEventReader, -1);
View Full Code Here

            return null;
        }
        finally {
            IOUtils.closeQuietly(fis);
        }
        xmlEventReader.reset();
       
        final IPortalDataType portalDataType = this.dataKeyTypes.get(portalDataKey);
        if (portalDataType == null) {
            Iterator<PortalDataKey> iter = dataKeyTypes.keySet().iterator();
            StringBuffer potentialKeys = new StringBuffer();
View Full Code Here

        }
       
        //Allow the PortalDataType to do any necessary post-processing of the input, needed as some types require extra work
        final String resourceUri = ResourceUtils.getResourceUri(input);
        final Set<PortalDataKey> processedPortalDataKeys = portalDataType.postProcessPortalDataKey(resourceUri, portalDataKey, xmlEventReader);
        xmlEventReader.reset();
       
        for (final PortalDataKey processedPortalDataKey : processedPortalDataKeys) {
            //Add the PortalDataKey and File into the map
            Queue<Resource> queue = this.dataToImport.get(processedPortalDataKey);
            if (queue == null) {
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.