Examples of JSSnapshot


Examples of org.apache.jetspeed.serializer.objects.JSSnapshot

    protected final  JSSnapshot readFile(String importFileName, XMLBinding binding)
            throws SerializerException
    {
        XMLObjectReader reader = null;
        JSSnapshot snap = null;
        try
        {
            reader = XMLObjectReader.newInstance(new FileInputStream(
                    importFileName));
        } catch (Exception e)
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSSnapshot

    protected final  JSSnapshot readFile(String importFileName, XMLBinding binding)
            throws SerializerException
    {
        XMLObjectReader reader = null;
        JSSnapshot snap = null;
        try
        {
            reader = XMLObjectReader.newInstance(new FileInputStream(
                    importFileName));
        } catch (Exception e)
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSSnapshot

    protected final  JSSnapshot readFile(String importFileName, XMLBinding binding)
            throws SerializerException
    {
        XMLObjectReader reader = null;
        JSSnapshot snap = null;
        try
        {
            reader = XMLObjectReader.newInstance(new FileInputStream(
                    importFileName));
        } catch (Exception e)
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSSnapshot

    protected final  JSSnapshot readFile(String importFileName, XMLBinding binding)
            throws SerializerException
    {
        XMLObjectReader reader = null;
        JSSnapshot snap = null;
        try
        {
            reader = XMLObjectReader.newInstance(new FileInputStream(
                    importFileName));
        } catch (Exception e)
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSSnapshot

    }
   
    public void importData(String filename, Map settings) throws SerializerException
    {
        Map processSettings = getProcessSettings(settings);
        JSSnapshot snapshot = readSnapshot(filename);

        if (snapshot == null)
            throw new SerializerException(SerializerException.FILE_PROCESSING_ERROR.create(new String[] { filename,
                    "Snapshot is NULL" }));

        if (!(snapshot.checkVersion()))
            throw new SerializerException(SerializerException.INCOMPETIBLE_VERSION.create(new String[] { filename,
                    String.valueOf(snapshot.getSoftwareVersion()), String.valueOf(snapshot.getSavedSubversion()) }));
        for (int i = 0, size = serializers.size(); i < size; i++)
        {
            ((JetspeedComponentSerializer) serializers.get(i)).processImport(snapshot, processSettings);
        }
    }
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSSnapshot

    }
   
    public void exportData(String name, String filename, Map settings) throws SerializerException
    {
        Map processSettings = getProcessSettings(settings);
        JSSnapshot snapshot = new JSSnapshot(name);
        snapshot.setDateCreated(new Date(new java.util.Date().getTime()).toString());
        snapshot.setSavedVersion(snapshot.getSoftwareVersion());
        snapshot.setSavedSubversion(snapshot.getSoftwareSubVersion());

        for (int i = 0, size = serializers.size(); i < size; i++)
        {
            ((JetspeedComponentSerializer) serializers.get(i)).processExport(snapshot, processSettings);
        }
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSSnapshot

    }

    protected JSSnapshot readSnapshot(String importFileName) throws SerializerException
    {
        XMLObjectReader reader = null;
        JSSnapshot snap = null;
        try
        {
          File exists = new File(importFileName);
          if (exists.exists())
            reader = XMLObjectReader.newInstance(new FileInputStream(importFileName));
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSSnapshot

    public void testSnapshot() throws Exception
    {
      List<JetspeedComponentSerializer> serializers = new LinkedList<JetspeedComponentSerializer>();
      Map<String,String> settings = new HashMap<String,String>();
      JetspeedSerializerImpl serializer = new JetspeedSerializerImpl(serializers, settings);   
      JSSnapshot snapshot = serializer.readSnapshot("j2-seed.xml");
      assertNotNull(snapshot);
    }
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSSnapshot

    public void testSnapshot() throws Exception
    {
      List<JetspeedComponentSerializer> serializers = new LinkedList<JetspeedComponentSerializer>();
      Map<String,String> settings = new HashMap<String,String>();
      JetspeedSerializerImpl serializer = new JetspeedSerializerImpl(serializers, settings);   
      JSSnapshot snapshot = serializer.readSnapshot("j2-seed.xml", JetspeedSerializer.DEFAULT_TAG_SNAPSHOT_NAME);
      assertNotNull(snapshot);
    }
View Full Code Here

Examples of org.apache.jetspeed.serializer.objects.JSSnapshot

    }
   
    public void importData(String filename, Map settings) throws SerializerException
    {
        Map processSettings = getProcessSettings(settings);
        JSSnapshot snapshot = null;
        SerializerException snapshotException = null;
        for (int i = 0; ((i < TAG_SNAPSHOT_NAMES.length) && (snapshot == null)); i++)
        {
            String snapshotTagName = TAG_SNAPSHOT_NAMES[i];
            try
            {
                snapshot = readSnapshot(filename, snapshotTagName);
            }
            catch (SerializerException se)
            {
                if (snapshotException == null)
                {
                    snapshotException = se;
                }
            }
        }
        if (snapshotException != null)
        {
            throw snapshotException;
        }
        else if (snapshot == null)
        {
            throw new SerializerException(SerializerException.FILE_PROCESSING_ERROR.create(new String[] { filename, "Snapshot is NULL" }));
        }

        if (!(snapshot.checkVersion()))
            throw new SerializerException(SerializerException.INCOMPETIBLE_VERSION.create(new String[] { filename,
                    String.valueOf(snapshot.getSoftwareVersion()), String.valueOf(snapshot.getSavedSubversion()) }));
        for (int i = 0, size = serializers.size(); i < size; i++)
        {
            ((JetspeedComponentSerializer) serializers.get(i)).processImport(snapshot, processSettings);
        }
    }
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.