Interface DocumentSource.Creator

All Superinterfaces:
DocumentSource.Saver
Enclosing interface:
DocumentSource

public static interface DocumentSource.Creator extends DocumentSource.Saver
  • Method Details

    • create

      Document create(String kindId)
      Creates a new document by calling Document.createUnsaved(DocumentSource, Collection) with all the necessary meta data. The returned document may be displayed for editing after which this creator's DocumentSource.Saver.save(Collection) method is called.
      Parameters:
      kindId - An id stating which kind of document to create, or null if getKinds() returns null or an empty list.
      Returns:
      A new document containing all metadata necessary to create a document in the source.
    • create

      default Document create()
      Creates a new default document by calling create(String) with the first element returned from getKinds() or null if the result from getKinds() is null or empty.
      Returns:
      a new default document by calling create(String) with the first element returned from getKinds() or null if the result from getKinds() is null or empty.
    • getKinds

      default List<DocumentSource.DocumentKind> getKinds()
      Returns a list of document kinds that will be used to create the different kinds of documents. Different document kinds can be useful to model documents that need different sets of meta data, for example a template might require different meta data types than the documents created from the template.
      Returns:
      a list of document kinds that will be used to create the different kinds of documents.