Class WysiwygManager

    • Constructor Detail

      • WysiwygManager

        protected WysiwygManager()
    • Method Detail

      • getImages

        public List<SimpleDocument> getImages​(String id,
                                              String componentId)
        Turn over all the images attached according to the parameters id, componentId.
        Parameters:
        id - the id of the object to which this wysiwyg is attached.
        componentId - the id of component.
        Returns:
        List
      • getWebsiteRepository

        public String getWebsiteRepository()
      • getWebsiteImages

        public String[][] getWebsiteImages​(String path,
                                           String componentId)
                                    throws WysiwygException
        Get images of the website.
        Parameters:
        path - type String: for example of the directory
        componentId -
        Returns:
        imagesList a table of string[N] with in logical index [N][0] = path name [N][1] = logical name of the file.
        Throws:
        WysiwygException
      • getWebsitePages

        public String[][] getWebsitePages​(String path,
                                          String componentId)
                                   throws WysiwygException
        Method declaration Get html pages of the website
        Parameters:
        path - type String: for example of the directory
        componentId -
        Returns:
        imagesList a table of string[N][2] with in logical index [N][0] = path name [N][1] = logical name of the file.
        Throws:
        WysiwygException
      • getOldWysiwygFileName

        public String getOldWysiwygFileName​(String objectId)
        Build the name of the file to be attached.
        Parameters:
        objectId - : for example the id of the publication.
        Returns:
        the name of the file
      • getWysiwygFileName

        public String getWysiwygFileName​(String objectId,
                                         String lang)
      • getImagesFileName

        public String getImagesFileName​(String objectId)
        Method declaration built the name of the images to be attached.
        Parameters:
        objectId - : for example the id of the publication.
        Returns:
        fileName String : name of the file
      • deleteFileAndAttachment

        public void deleteFileAndAttachment​(String componentId,
                                            String id)
      • deleteFile

        public void deleteFile​(String componentId,
                               String objectId,
                               String language)
      • deleteByContribution

        public void deleteByContribution​(Contribution contribution)
        Description copied from interface: WysiwygContentRepository
        Deletes all the contents of the specified contribution in the repository. If the contribution has several WYSIWYG contents, that is one per localization for example, then all of those contents will be deleted. Otherwise only the single WYSIWYG content of the contribution, whatever its localization will be deleted.
        Specified by:
        deleteByContribution in interface WysiwygContentRepository
        Parameters:
        contribution - the contribution for which all the WYSIWYG contents will be deleted.
      • createFileAndAttachment

        public void createFileAndAttachment​(WysiwygContent content,
                                            String context)
        Creation of the file and its attachment.
        Parameters:
        content - the WYSIWYG content to create.
        context - the context images/wysiwyg....
      • createFileAndAttachment

        public void createFileAndAttachment​(WysiwygContent content)
        Creation of the file and its attachment.
        Parameters:
        content - the WYSIWYG content to create.
      • createUnindexedFileAndAttachment

        public void createUnindexedFileAndAttachment​(WysiwygContent content)
        Creation of the file and its attachment but without indexing it.
        Parameters:
        content - the WYSIWYG content to create.
      • addToIndex

        public void addToIndex​(FullIndexEntry indexEntry,
                               ResourceReference pk,
                               String language)
        Add all elements attached to object identified by the given index into the given index
        Parameters:
        indexEntry - the index of the related resource.
        pk - the primary key of the container of the wysiwyg.
        language - the language.
      • updateFileAndAttachment

        public void updateFileAndAttachment​(WysiwygContent content)
      • deleteWysiwygAttachments

        public void deleteWysiwygAttachments​(String componentId,
                                             String objectId)
        Method declaration remove the file attached.
        Parameters:
        componentId - String : the id of component.
        objectId - String : for example the id of the publication.
      • deleteWysiwygAttachmentsOnly

        public void deleteWysiwygAttachmentsOnly​(String componentId,
                                                 String objectId)
                                          throws WysiwygException
        La méthode deleteWysiwygAttachments efface tous les attachments de la publication donc pour éviter une éventuelle régression, je crée une nouvelle méthode
        Parameters:
        componentId -
        objectId -
        Throws:
        WysiwygException
      • getEmbeddedAttachmentIds

        public List<String> getEmbeddedAttachmentIds​(String content)
        Get all Silverpeas Files linked by wysiwyg content
        Parameters:
        content -
        Returns:
      • loadFileWebsite

        public String loadFileWebsite​(String path,
                                      String fileName)
                               throws WysiwygException
        Method declaration return the contents of the file.
        Parameters:
        fileName - String : name of the file
        path - String : the path of the file
        Returns:
        text : the contents of the file attached.
        Throws:
        WysiwygException
      • haveGotWysiwygToDisplay

        public boolean haveGotWysiwygToDisplay​(LocalizedContribution contribution)
      • updateWebsite

        public void updateWebsite​(String filePath,
                                  String fileName,
                                  String fileContent)
                           throws WysiwygException
        updateWebsite : creation or update of a file of a website Param = cheminFichier = c:\\j2sdk\\public_html\\WAUploads\\webSite10\\nomSite\\rep1\\rep2 nomFichier = index.html contenuFichier = code du fichier : "...."</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>filePath</code> - </dd> <dd><code>fileContent</code> - </dd> <dd><code>fileName</code> - </dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../WysiwygException.html" title="class in org.silverpeas.core.contribution.content.wysiwyg">WysiwygException</a></code></dd> </dl> </li> </ul> <a id="createFile(java.lang.String,java.lang.String,java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>createFile</h4> <pre class="methodSignature">protected <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/File.html?is-external=true" title="class or interface in java.io" class="externalLink">File</a> createFile​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> filePath, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> fileName, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> fileContent) throws <a href="../WysiwygException.html" title="class in org.silverpeas.core.contribution.content.wysiwyg">WysiwygException</a></pre> <div class="block">Creation or update of a file</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>filePath</code> - the path to the directory containing the file.</dd> <dd><code>fileName</code> - the name of the file.</dd> <dd><code>fileContent</code> - the content of the file.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the created file.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../WysiwygException.html" title="class in org.silverpeas.core.contribution.content.wysiwyg">WysiwygException</a></code></dd> </dl> </li> </ul> <a id="copy(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>copy</h4> <pre class="methodSignature">public <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>,​<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>> copy​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> oldComponentId, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> oldObjectId, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> componentId, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> objectId, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> userId)</pre> </li> </ul> <a id="copyDocumentsBetweenTwoResourcesWithSourceContent(org.silverpeas.core.ResourceReference,org.silverpeas.core.ResourceReference,java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>copyDocumentsBetweenTwoResourcesWithSourceContent</h4> <pre class="methodSignature">public <a href="../../../../util/Pair.html" title="class in org.silverpeas.core.util">Pair</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>,​<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>,​<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>>> copyDocumentsBetweenTwoResourcesWithSourceContent​(<a href="../../../../ResourceReference.html" title="class in org.silverpeas.core">ResourceReference</a> sourceRef, <a href="../../../../ResourceReference.html" title="class in org.silverpeas.core">ResourceReference</a> targetRef, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> sourceContent)</pre> <div class="block">Copies WYSIWYG resources from a source to a target and updating given content with the news resource references.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>sourceRef</code> - the reference of the source.</dd> <dd><code>targetRef</code> - the reference of the target.</dd> <dd><code>sourceContent</code> - the content to update</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>a pair containing on left the updated content and on right a map containing the correspondance between old images and the new ones.</dd> </dl> </li> </ul> <a id="move(java.lang.String,java.lang.String,java.lang.String,java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>move</h4> <pre class="methodSignature">public void move​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> fromComponentId, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> fromObjectId, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> componentId, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> objectId)</pre> </li> </ul> <a id="wysiwygPlaceHaveChanged(java.lang.String,java.lang.String,java.lang.String,java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>wysiwygPlaceHaveChanged</h4> <pre class="methodSignature">public void wysiwygPlaceHaveChanged​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> oldComponentId, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> oldObjectId, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> newComponentId, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> newObjectId)</pre> </li> </ul> <a id="getWysiwygPath(java.lang.String,java.lang.String,java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getWysiwygPath</h4> <pre class="methodSignature">public <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> getWysiwygPath​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> componentId, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> objectId, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> language)</pre> </li> </ul> <a id="getWysiwygPath(java.lang.String,java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getWysiwygPath</h4> <pre class="methodSignature">public <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> getWysiwygPath​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> componentId, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> objectId)</pre> </li> </ul> <a id="getGalleries()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getGalleries</h4> <pre class="methodSignature">public <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="../../../../admin/component/model/ComponentInstLight.html" title="class in org.silverpeas.core.admin.component.model">ComponentInstLight</a>> getGalleries()</pre> </li> </ul> <a id="indexEmbeddedLinkedFiles(org.silverpeas.core.index.indexing.model.FullIndexEntry,java.util.List)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>indexEmbeddedLinkedFiles</h4> <pre class="methodSignature">public void indexEmbeddedLinkedFiles​(<a href="../../../../index/indexing/model/FullIndexEntry.html" title="class in org.silverpeas.core.index.indexing.model">FullIndexEntry</a> indexEntry, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>> embeddedAttachmentIds)</pre> <div class="block">Index given embedded linked files</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>indexEntry</code> - index entry to update</dd> <dd><code>embeddedAttachmentIds</code> - embedded linked files ids</dd> </dl> </li> </ul> <a id="createPath(java.lang.String,java.lang.String)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>createPath</h4> <pre class="methodSignature">public <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> createPath​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> componentId, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> context)</pre> <div class="block">To create path. Warning: the token separating the repertories is ",".</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>componentId</code> - : the name of component</dd> <dd><code>context</code> - : string made up of the repertories separated by token ","</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the path.</dd> </dl> </li> </ul> </li> </ul> </section> </li> </ul> </div> </div> </main> <!-- ========= END OF CLASS DATA ========= --> <footer role="contentinfo"> <nav role="navigation"> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a id="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../index.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/WysiwygManager.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../allclasses.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li><a href="#field.summary">Field</a> | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li><a href="#field.detail">Field</a> | </li> <li><a href="#constructor.detail">Constr</a> | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a id="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </nav> <p class="legalCopy"><small>Copyright © 2022 <a href="https://www.silverpeas.org">Silverpeas</a>. All rights reserved.</small></p> </footer> </body> </html>