Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleDodanie dokumentu
linenumberstrue
  		InputStream inputStream = ...
 		DocumentClassService documentClassService=ServiceFactory.getDocumentClassService();
        DocumentService documentService=ServiceFactory.getDocumentService();        
		DocumentClass documentClass = documentClassService.getDocumentClass( "klasa" );
        
        Map<Long, Object> idx = new HashMap<Long, Object>();
        idx.put( 1L, "wartość tekstowa" );
        idx.put( 2L, 555 );
        idx.put( 3L, new Date() );
         DocumentDefinition fddefinition = new DocumentDefinition();
        fddefinition.setDocumentClassId( dcdocumentClass.getId() );
        fddefinition.setFileName( "nazwa.pdf" );
        fddefinition.setDescription( "opis" );
        fddefinition.setUserName( "admin" );
        fddefinition.setIndexes( idx );
        fddefinition.setInputStream( inputStream );
        WfDocument file = dsdefinition.setActivityId( "103_proces1_zadanie1" );//parametry opcjonalne jeżeli nie zostaną podane dokument zostanie dodany tylko do archiwum
        definition.setProcessId( "103_proces1" );// nie będzie dołączony do żadnego procesu
        WfDocument document = documentService.addDocument( fddefinition );
Code Block
languagejava
titleDołączanie dokumentu z archiwum do procesu
linenumberstrue
documentService.attachDocumentToProcess( documentId, documentClassId, "admin", "103_proces1", "103_proces1_zadanie1" );


Wyszukiwanie dokumentów

Do wyszukiwania dokumentów należy używać klasy.

...