Class TextBlockService

java.lang.Object
org.imixs.workflow.office.config.TextBlockService

@DeclareRoles({"org.imixs.ACCESSLEVEL.NOACCESS","org.imixs.ACCESSLEVEL.READERACCESS","org.imixs.ACCESSLEVEL.AUTHORACCESS","org.imixs.ACCESSLEVEL.EDITORACCESS","org.imixs.ACCESSLEVEL.MANAGERACCESS"}) @RolesAllowed({"org.imixs.ACCESSLEVEL.NOACCESS","org.imixs.ACCESSLEVEL.READERACCESS","org.imixs.ACCESSLEVEL.AUTHORACCESS","org.imixs.ACCESSLEVEL.EDITORACCESS","org.imixs.ACCESSLEVEL.MANAGERACCESS"}) public class TextBlockService extends Object
The TextBlockService is an EJB handling documents containing textual information. A text-block document is identified by its ID (txtname) and holds a HTML or PlainText information. A text-block document holds the following items
  • txtmode - html/text
  • txtcontent - textual information
The type of a textBlock document is 'textblock' A text-block can only be edited by a MANAGER. A text-block has no read restriction. The TextBlockService ejb is implemented as a sigelton and uses an internal cache to cache config entities. The Method onEvent is a CDI observer method reacting on events from the type TextEvent. See the WorkflowService.adaptText() method for details.
Author:
rsoika
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    deleteTextBlock(org.imixs.workflow.ItemCollection aconfig)
    This method deletes an existing text-block.
    org.imixs.workflow.ItemCollection
    This method returns a text-block ItemCollection for a specified name or ID.
    org.imixs.workflow.ItemCollection
    loadTextBlock(String name, boolean discardCache)
    This method returns a text-block ItemCollection for a specified name or id.
    void
    onDocumentEvent(org.imixs.workflow.engine.DocumentEvent event)
    This method refreshes the cache if a textblock was saved.
    void
    onTextEvent(org.imixs.workflow.engine.TextEvent event)
    This method reacts on CDI events of the type TextEvent and parses a string for xml tag .
    org.imixs.workflow.ItemCollection
    save(org.imixs.workflow.ItemCollection textBlockItemCollection)
    SavesO the text-block entity

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TextBlockService

      public TextBlockService()
  • Method Details

    • deleteTextBlock

      public void deleteTextBlock(org.imixs.workflow.ItemCollection aconfig) throws org.imixs.workflow.exceptions.AccessDeniedException
      This method deletes an existing text-block.
      Parameters:
      aconfig -
      Throws:
      org.imixs.workflow.exceptions.AccessDeniedException
    • loadTextBlock

      public org.imixs.workflow.ItemCollection loadTextBlock(String name)
      This method returns a text-block ItemCollection for a specified name or ID. If no text-block is found for this name the Method creates an empty text-block object. The text-block entity is cached internally and read from the cache
      Parameters:
      name - in attribute txtname
    • loadTextBlock

      public org.imixs.workflow.ItemCollection loadTextBlock(String name, boolean discardCache)
      This method returns a text-block ItemCollection for a specified name or id. If no text-block is found for this name the Method creates an empty text-block object. The text-block entity is cached internally.
      Parameters:
      name - in attribute txtname
      discardCache - - indicates if the internal cache should be discarded.
    • save

      public org.imixs.workflow.ItemCollection save(org.imixs.workflow.ItemCollection textBlockItemCollection) throws org.imixs.workflow.exceptions.AccessDeniedException
      SavesO the text-block entity
      Returns:
      Throws:
      org.imixs.workflow.exceptions.AccessDeniedException
    • onTextEvent

      public void onTextEvent(@Observes @Priority(2600) org.imixs.workflow.engine.TextEvent event)
      This method reacts on CDI events of the type TextEvent and parses a string for xml tag . Those tags will be replaced with the corresponding system property value.

      The priority of the CDI event is set to (APPLICATION+10) to ensure that the textblock adapter is triggered after the TextItemValueAdapter

    • onDocumentEvent

      public void onDocumentEvent(@Observes org.imixs.workflow.engine.DocumentEvent event)
      This method refreshes the cache if a textblock was saved.
      Parameters:
      event -