Class ProductsAdapter

java.lang.Object
net.tangly.erp.products.ports.ProductsAdapter
All Implemented Interfaces:
net.tangly.core.domain.Port<ProductsRealm>, ProductsPort

public class ProductsAdapter extends Object implements ProductsPort
  • Field Details

  • Constructor Details

  • Method Details

    • realm

      public ProductsRealm realm()
      Specified by:
      realm in interface net.tangly.core.domain.Port<ProductsRealm>
    • logic

      public ProductsBusinessLogic logic()
      Specified by:
      logic in interface ProductsPort
    • importEntities

      public void importEntities(@NotNull @NotNull net.tangly.core.domain.DomainAudit audit)
      Specified by:
      importEntities in interface net.tangly.core.domain.Port<ProductsRealm>
    • exportEntities

      public void exportEntities(@NotNull @NotNull net.tangly.core.domain.DomainAudit audit)
      Specified by:
      exportEntities in interface net.tangly.core.domain.Port<ProductsRealm>
    • clearEntities

      public void clearEntities(@NotNull @NotNull net.tangly.core.domain.DomainAudit audit)
      Specified by:
      clearEntities in interface net.tangly.core.domain.Port<ProductsRealm>
    • importEfforts

      public void importEfforts(@NotNull @NotNull net.tangly.core.domain.DomainAudit audit, @NotNull @NotNull Reader stream, @NotNull @NotNull String source, boolean replace) throws org.eclipse.serializer.exceptions.IORuntimeException
      Description copied from interface: ProductsPort
      Imports all efforts defined in the YAML file located at the given uri. An effort is identified by the combination of the assignment identifier and the date of the effort. The assignment identifies uniquely the collaborator working on the effort.
      Specified by:
      importEfforts in interface ProductsPort
      Parameters:
      stream - reader containing the efforts to import
      source - source of the efforts used to audit the import operation
      replace - if true, the imported ones replace the existing efforts, otherwise the imported efforts are only imported if not present
      Throws:
      org.eclipse.serializer.exceptions.IORuntimeException
    • exportEfforts

      public void exportEfforts(@NotNull @NotNull net.tangly.core.domain.DomainAudit audit, @NotNull @NotNull Path path)
      Exports all efforts in a hierarchy of folders. The files are grouped in folders by years. The efforts are grouped by assignment, contract, collaborator, and year-month and written in a yaml file. The name of the file is the year and month of the efforts, the name of the collaborator, and the identifier of the contract.
      Parameters:
      path - the uri of the root folder where the efforts are exported
    • exportEfforts

      public void exportEfforts(@NotNull @NotNull List<Effort> efforts, @NotNull @NotNull Path folder)
    • yamlScalar

      public String yamlScalar(@NotNull @NotNull String key, @NotNull @NotNull String value, int indent)
    • yamlLiteralBlockScalar

      public List<String> yamlLiteralBlockScalar(@NotNull @NotNull String text, int indent)
    • exportEffortsDocument

      public void exportEffortsDocument(@NotNull @NotNull net.tangly.core.domain.DomainAudit audit, @NotNull @NotNull Assignment assignment, LocalDate from, LocalDate to, @NotNull @NotNull String filename, @NotNull @NotNull ChronoUnit unit)
      Description copied from interface: ProductsPort
      Exports all efforts of the assignment in the given period of time. The export shall be an asciidoc document. The document name should contain the contract identifier, the collaborator identifier, and the period of time. The prefix should be the year and month of the period end. The prefix is used to sort the documents.
      Specified by:
      exportEffortsDocument in interface ProductsPort
      Parameters:
      assignment - assignment which efforts are of interest
      from - start of the considered time interval
      to - end of the considered time interval
      filename - name of the file to create
      unit - unit of the time interval (minutes, hours, and days)
    • exportEffortsDocumentsSplitPerMonth

      public void exportEffortsDocumentsSplitPerMonth(@NotNull @NotNull net.tangly.core.domain.DomainAudit audit, @NotNull @NotNull Assignment assignment, @NotNull @NotNull YearMonth from, @NotNull @NotNull YearMonth to, @NotNull @NotNull ChronoUnit unit)
      Description copied from interface: ProductsPort
      Exports all efforts of the assignment in the given period of time. The export shall create an asciidoc document per month. The document name should contain the contract identifier, the collaborator identifier, and the period of time. The prefix should be the year and month of the period end. The prefix is used to sort the documents.
      Specified by:
      exportEffortsDocumentsSplitPerMonth in interface ProductsPort
      Parameters:
      assignment - assignment which efforts are of interest
      from - first month to consider
      to - last month to consider
      unit - unit of the time interval (minutes, hours, and days)