Package org.silverpeas.components.infoletter.model

## Class InfoLetterPublication

- java.lang.Object
- - org.silverpeas.core.persistence.jdbc.bean.SilverpeasBean
  - - org.silverpeas.components.infoletter.model.InfoLetterPublication

- All Implemented Interfaces:
    `Serializable`, `Comparable<InfoLetter>`, `org.silverpeas.core.persistence.jdbc.bean.SilverpeasBeanIntf`
  Direct Known Subclasses:
    `InfoLetterPublicationPdC`

      public class InfoLetterPublication
      extends org.silverpeas.core.persistence.jdbc.bean.SilverpeasBean
      implements Comparable<InfoLetter>

  Author:
    frageade
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `PUBLICATION_EN_REDACTION` |
    `static int` | `PUBLICATION_VALIDEE` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `InfoLetterPublication()` | Default constructor
    `InfoLetterPublication​(org.silverpeas.core.WAPrimaryKey pk, String instanceId, String title, String description, String parutionDate, int publicationState, int letterId)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `_getConnectionType()` |
    `String` | `_getPermalink()` |
    `String` | `_getTableName()` |
    `boolean` | `_isValid()` |
    `int` | `compareTo​(InfoLetter obj)` |
    `void` | `deleteContent()` | Deletes contents linked to the publication (WYSIWYG and DDWE ones).
    `boolean` | `equals​(Object o)` |
    `String` | `getDescription()` |
    `org.silverpeas.core.contribution.model.ContributionIdentifier` | `getIdentifier()` |
    `String` | `getInstanceId()` |
    `int` | `getLetterId()` |
    `String` | `getParutionDate()` |
    `int` | `getPublicationState()` |
    `String` | `getTitle()` |
    `Optional<org.silverpeas.core.contribution.model.WysiwygContent>` | `getWysiwygContent()` |
    `int` | `hashCode()` |
    `String` | `initFrom​(InfoLetter infoLetter)` | Initializing the content from the given template.
    `void` | `saveContent​(String manualContent)` | Saves given content.
    `void` | `setDescription​(String description)` |
    `void` | `setInstanceId​(String instanceId)` |
    `void` | `setLetterId​(int letterId)` |
    `void` | `setLetterId​(String letterId)` |
    `void` | `setParutionDate​(String parutionDate)` |
    `void` | `setPublicationState​(int publicationState)` |
    `void` | `setTitle​(String title)` |

    - ### Methods inherited from class org.silverpeas.core.persistence.jdbc.bean.SilverpeasBean

      `_getDatasourceName, _getJdbcData, getPK, getSureString, setPK`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PUBLICATION_EN_REDACTION

          public static final int PUBLICATION_EN_REDACTION

      See Also:
        Constant Field Values

    - #### PUBLICATION_VALIDEE

          public static final int PUBLICATION_VALIDEE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### InfoLetterPublication

          public InfoLetterPublication()

      Default constructor

    - #### InfoLetterPublication

          public InfoLetterPublication​(org.silverpeas.core.WAPrimaryKey pk,
                                       String instanceId,
                                       String title,
                                       String description,
                                       String parutionDate,
                                       int publicationState,
                                       int letterId)

      Parameters:
        `pk` -
        `instanceId` -
        `title` -
        `description` -
        `parutionDate` -
        `publicationState` -
        `letterId` -

  - ### Method Detail

    - #### getIdentifier

          public org.silverpeas.core.contribution.model.ContributionIdentifier getIdentifier()

    - #### getInstanceId

          public String getInstanceId()

    - #### setInstanceId

          public void setInstanceId​(String instanceId)

    - #### getTitle

          public String getTitle()

    - #### setTitle

          public void setTitle​(String title)

    - #### getDescription

          public String getDescription()

    - #### setDescription

          public void setDescription​(String description)

    - #### getParutionDate

          public String getParutionDate()

    - #### setParutionDate

          public void setParutionDate​(String parutionDate)

    - #### getPublicationState

          public int getPublicationState()

    - #### setPublicationState

          public void setPublicationState​(int publicationState)

    - #### getLetterId

          public int getLetterId()

    - #### setLetterId

          public void setLetterId​(int letterId)

    - #### setLetterId

          public void setLetterId​(String letterId)

    - #### _getPermalink

          public String _getPermalink()

    - #### _getConnectionType

          public int _getConnectionType()

      Specified by:
        `_getConnectionType` in interface `org.silverpeas.core.persistence.jdbc.bean.SilverpeasBeanIntf`
      Overrides:
        `_getConnectionType` in class `org.silverpeas.core.persistence.jdbc.bean.SilverpeasBean`

    - #### compareTo

          public int compareTo​(InfoLetter obj)

      Specified by:
        `compareTo` in interface `Comparable<InfoLetter>`

    - #### equals

          public boolean equals​(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### _getTableName

          public String _getTableName()

      Specified by:
        `_getTableName` in interface `org.silverpeas.core.persistence.jdbc.bean.SilverpeasBeanIntf`
      Overrides:
        `_getTableName` in class `org.silverpeas.core.persistence.jdbc.bean.SilverpeasBean`

    - #### _isValid

          public boolean _isValid()

    - #### initFrom

          public String initFrom​(InfoLetter infoLetter)

      Initializing the content from the given template.

      The initialization is using WYSIWYG services and `InfoLetterPublication` storing in order to handle properly document copying.

      Parameters:
        `infoLetter` - the template.
      Returns:
        the inlined HTML content of the parution.

    - #### getWysiwygContent

          public Optional<org.silverpeas.core.contribution.model.WysiwygContent> getWysiwygContent()

    - #### saveContent

          public void saveContent​(String manualContent)

      Saves given content.

      The given content MAY be directly a WYSIWYG content, in a such case the content has been edited by a WYSIWYG editor.

      The given content is not defined, in a such case the content has been MAYBE edited by a Drag And Drop Web Editor. Then the temporary content is saved into final one and the Inlined HTML is saved into WYSIWYG repository.

      Parameters:
        `manualContent` - a manual content. The content is specified when it comes directly from a WYSIWYG editing.

    - #### deleteContent

          public void deleteContent()

      Deletes contents linked to the publication (WYSIWYG and DDWE ones).