Package org.uengine.kernel

Examples of org.uengine.kernel.Serializer


    }

    if(args[1].indexOf(".") == -1) args[1] = "org.uengine.components.serializers." + args[1];
    if(args[2].indexOf(".") == -1) args[2] = "org.uengine.components.serializers." + args[2];
   
    Serializer sourceSerializer = (Serializer)Class.forName(args[1]).newInstance();
    Serializer targetSerializer = (Serializer)Class.forName(args[2]).newInstance();
   
    find(args[0], sourceSerializer, targetSerializer);
  }
View Full Code Here


       
System.out.println( "\nSelected FileType : "+fileType);
      FileOutputStream fo = new FileOutputStream( filePath + System.getProperty("file.separator") + fileName);
       
      Class cls = Class.forName( "org.uengine.components.serializers." + fileType + "Serializer");
      Serializer se = (Serializer)cls.newInstance();
System.out.println( "Use this serializer : " + se);

      //ignore the belonging definition if write to a file
      String temp = def.getBelongingDefinitionId();
      def.setBelongingDefinitionId(null);
     
      se.serialize( def, fo, null);
     
      //TestSVGGen.export2SVG(getProcessDefinitionDesigner(), new FileOutputStream(filePath + System.getProperty("file.separator") + fileName+".svg"));

      //restore the belonging def
      def.setBelongingDefinitionId(temp);
View Full Code Here

 
  public void saveDesignToServer(final ProcessDefinition definition, final SaveDialogInfo saveDialogInfo) throws UEngineException{
    final ProgressDialog progDlg = new ProgressDialog("deploy..."){
     
      public void run() throws Exception{
        Serializer se = GlobalContext.getSerializer("XPD");

        ProcessDefinition def = definition;
       
        def.setName(saveDialogInfo.getName());
        def.setAlias(saveDialogInfo.getAlias());
        def.setVersion(saveDialogInfo.getVersion());
        saveDialogInfo.getAuthor().setVersion(saveDialogInfo.getVersion());
       
        RevisionInfo revInfo = saveDialogInfo.getAuthor();
        def.addRevisionInfo(revInfo);
        setRevisionInfo((RevisionInfo)revInfo.clone());
       
        ByteArrayOutputStream bao = new ByteArrayOutputStream();
        se.serialize(def, bao, null);
 
 
        String strDef = bao.toString("UTF-8");     

        System.out.println("getSavingFolder() : " + getSavingFolder());
View Full Code Here

 
  public void loadDesign(InputStream fi, String fileType, boolean changeSavingTargetInfo){
    // deserialize
    try{
      Class cls = Class.forName( "org.uengine.components.serializers." + fileType + "Serializer");
      Serializer se = (Serializer)cls.newInstance();
System.out.println( "Use this serializer : " + se);

//        ByteArrayOutputStream bao = new ByteArrayOutputStream();
//        UEngineUtil.copyStream(fi, bao);
//        fi = new ByteArrayInputStream(bao.toString("UTF-8").getBytes());
     
//UEngineUtil.copyStream(fi, System.out);
      ProcessDefinition pd = (ProcessDefinition)se.deserialize(fi, null);
     
      loadDesign(pd, changeSavingTargetInfo);
     
    }catch( Exception ex){
      ex.printStackTrace();
View Full Code Here

TOP

Related Classes of org.uengine.kernel.Serializer

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.