Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMElement.serialize()


    public String subscribe(Subscription subscription) throws EventException {
        try {
            Resource resource = registry.newResource();
            ByteArrayOutputStream outStream = new ByteArrayOutputStream();
            OMElement subElem = subscriptionToRegStorage(subscription, resource, true);
            subElem.serialize(outStream);
            resource.setContent(outStream.toByteArray());
            resource.setMediaType(EPR_TYPE);
            String topic = subscription.getFilterValue();
            if (!topic.startsWith("/")) {
                topic = "/" + topic;
View Full Code Here


                Resource resource = registry.get(regPath);
                subscriptionOrig.setExpires(subscription.getExpires());
                // set the new content
                OMElement subElem = subscriptionToRegStorage(subscriptionOrig, resource, false);
                ByteArrayOutputStream outStream = new ByteArrayOutputStream();
                subElem.serialize(outStream);
                resource.setContent(outStream.toByteArray());
                resource.setMediaType(EPR_TYPE);
                registry.put(regPath, resource);
            } catch (RegistryException e) {
                log.error("Unable to update the registry", e);
View Full Code Here

        // set creator
        String creator = resource.getAuthorUserName();
        child = factory.createOMElement(new QName(DumpConstants.CREATOR));
        child.setText(creator);
        child.serialize(xmlWriter);

        // set createdTime
        Date createdTime = resource.getCreatedTime();
        child = factory.createOMElement(new QName(DumpConstants.CREATED_TIME));
        child.setText(Long.toString(createdTime.getTime()));
View Full Code Here

        // set createdTime
        Date createdTime = resource.getCreatedTime();
        child = factory.createOMElement(new QName(DumpConstants.CREATED_TIME));
        child.setText(Long.toString(createdTime.getTime()));
        child.serialize(xmlWriter);

        // set updater
        String updater = resource.getLastUpdaterUserName();
        child = factory.createOMElement(new QName(DumpConstants.LAST_UPDATER));
        child.setText(updater);
View Full Code Here

        // set updater
        String updater = resource.getLastUpdaterUserName();
        child = factory.createOMElement(new QName(DumpConstants.LAST_UPDATER));
        child.setText(updater);
        child.serialize(xmlWriter);

        // set LastModified
        Date lastModified = resource.getLastModified();
        child = factory.createOMElement(new QName(DumpConstants.LAST_MODIFIED));
        child.setText(Long.toString(lastModified.getTime()));
View Full Code Here

        // set LastModified
        Date lastModified = resource.getLastModified();
        child = factory.createOMElement(new QName(DumpConstants.LAST_MODIFIED));
        child.setText(Long.toString(lastModified.getTime()));
        child.serialize(xmlWriter);

        // set Description
        String description = resource.getDescription();
        child = factory.createOMElement(new QName(DumpConstants.DESCRIPTION));
        child.setText(description);
View Full Code Here

        // set Description
        String description = resource.getDescription();
        child = factory.createOMElement(new QName(DumpConstants.DESCRIPTION));
        child.setText(description);
        child.serialize(xmlWriter);

        // fill properties
        resourceDAO.fillResourceProperties(resource);
        Properties properties = resource.getProperties();
        if (properties != null && properties.size() > 0) {
View Full Code Here

                    childName.equals("comments") ||
                    childName.equals("taggings") ||
                    childName.equals("ratings") ||
                    childName.equals("version") ||
                    childName.equals("associations")) {
                childElement.serialize(xmlWriter);
            }
        }
    }

    /**
 
View Full Code Here

        // set media type
        String mediaType = resource.getMediaType();
        OMFactory factory = OMAbstractFactory.getOMFactory();
        child = factory.createOMElement(new QName(DumpConstants.MEDIA_TYPE));
        child.setText(mediaType);
        child.serialize(xmlWriter);

        // set version
        long version = resource.getVersionNumber();
        child = factory.createOMElement(new QName(DumpConstants.VERSION));
        child.setText(version + "");
View Full Code Here

        // set version
        long version = resource.getVersionNumber();
        child = factory.createOMElement(new QName(DumpConstants.VERSION));
        child.setText(version + "");
        child.serialize(xmlWriter);

        // set creator
        String creator = resource.getAuthorUserName();
        child = factory.createOMElement(new QName(DumpConstants.CREATOR));
        child.setText(creator);
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.