Package no.kommune.bergen.soa.svarut.domain

Examples of no.kommune.bergen.soa.svarut.domain.PrintReceipt


    assertEquals("EnKulPlass", f2.getAnsvarsSted());
    assertEquals("kontkode123", f2.getKonteringkode());
  }

  private PrintReceipt newPrintReceipt() {
    PrintReceipt printReceipt = new PrintReceipt();
    printReceipt.setPrintId( "MyPrintId" );
    printReceipt.setPageCount( 123 );
    return printReceipt;
  }
View Full Code Here


    assertFalse("Forsendelsen uten orgnr funnet i readUnsent. Skal ikke være der.", funnet1);
    assertFalse("Forsendelsen uten orgnr funnet i readUnsent. Skal ikke være der.", funnet2);
    assertEquals("Forsendelse ikke funnet i retrieveSentToAltinnButNotPrinted.", 1, forsendelsesArkiv.retrieveSentToAltinnButNotPrinted(shipmentPolicies).size());

    // Sjekk at de ikke blir funnet etter print
    PrintReceipt printReceipt1 = newPrintReceipt();
    forsendelsesArkiv.setPrinted( forsendelseId1, printReceipt1 );
    PrintReceipt printReceipt2 = newPrintReceipt();
    forsendelsesArkiv.setPrinted( forsendelseId2, printReceipt2 );

    unsent = forsendelsesArkiv.readUnsent(shipmentPolicies);
    funnet1 = false;
    funnet2 = false;
View Full Code Here

    }
    assertFalse("Forsendelsen uten orgnr funnet. Skal ikke være der.", funnet1);
    assertTrue("Forsendelsen med orgnr ikke funnet.", funnet2);

    // Sjekk at de ikke blir funnet etter print
    PrintReceipt printReceipt1 = newPrintReceipt();
    forsendelsesArkiv.setPrinted( forsendelseId1, printReceipt1 );
    PrintReceipt printReceipt2 = newPrintReceipt();
    forsendelsesArkiv.setPrinted( forsendelseId2, printReceipt2 );

    unsent = forsendelsesArkiv.readUnsent(shipmentPolicies);
    funnet1 = false;
    funnet2 = false;
View Full Code Here

    this.forsendelsesArkiv = forsendelsesArkiv;
    this.printFacade = printFacade;
  }

  public void send(Forsendelse f) {
    PrintReceipt printReceipt = printFacade.print(f);
    forsendelsesArkiv.setPrinted(f.getId(), printReceipt);
    logger.info("Successfully sent to print. Id= " + f.getId() + ", Name=" + f.getNavn());
  }
View Full Code Here

      sendToPrint( f );
    }
  }

  private void sendToPrint( Forsendelse f ) {
    PrintReceipt printReceipt = printFacade.print( f );
    forsendelsesArkiv.setPrinted( f.getId(), printReceipt );
    logger.info( "Successfully sent to print. Id= " + f.getId() + ", Name=" + f.getNavn() );
  }
View Full Code Here

  public void handleUnread( Forsendelse f ) {
    long sent = f.getSendt().getTime();
    long now = System.currentTimeMillis();

    if (sent + getLeadTimeBeforePrint(f) < now) {
      PrintReceipt printReceipt = printFacade.print( f );
      forsendelsesArkiv.setPrinted( f.getId(), printReceipt );
    }
  }
View Full Code Here

      sendToPrint(f);
    }
  }

  private void sendToPrint(Forsendelse f) {
    PrintReceipt printReceipt = printFacade.print( f );
    forsendelsesArkiv.setPrinted( f.getId(), printReceipt );
  }
View Full Code Here

  /** Sender en gitt forsendelse til PrintServiceProvider */
  @Override
  public void print( String id ) {
    Forsendelse f = forsendelsesArkiv.retrieve( id );
    PrintReceipt printReceipt = printFacade.print( f );
    if (f.getUtskrevet() == null) {
      forsendelsesArkiv.setPrinted( f.getId(), printReceipt );
    }
  }
View Full Code Here

    InputStream frontPagePdf = pdfGenerator.createPdf( model, this.frontPageTemplate );
    try {
      File collatedPdf = pdfGenerator.createTempFile();
      int pageCount = pdfGenerator.formatA4( new FileOutputStream( collatedPdf ), new InputStream[] { frontPagePdf, new FileInputStream( forsendelseDokument ) } );
      String printId = this.printserviceProvider.sendToPrint( new FileInputStream( collatedPdf ), f );
      PrintReceipt printReceipt = new PrintReceipt();
      printReceipt.setPageCount( pageCount );
      printReceipt.setPrintId( printId );
      return printReceipt;
    } catch (IOException e) {
      throw new RuntimeException( String.format( "Could not send file to print for ForsendelsesId=%s", f.getId() ), e );
    }
  }
View Full Code Here

TOP

Related Classes of no.kommune.bergen.soa.svarut.domain.PrintReceipt

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.