1 package fr.paris.lutece.plugins.newsletter.modules.htmldocs.business; 2 3 import fr.paris.lutece.plugins.htmldocs.business.HtmlDoc; 4 import fr.paris.lutece.portal.service.plugin.Plugin; 5 import fr.paris.lutece.util.ReferenceList; 6 7 import java.sql.Timestamp; 8 import java.util.Collection; 9 import java.util.Date; 10 import java.util.List; 11 12 /** 13 * Interface for INewsletterHtmlDocDAO 14 */ 15 public interface INewsletterHtmlDocDAO 16 { 17 18 /** 19 * Get a newsletter htmldocs topic from its id 20 * 21 * @param nIdTopic 22 * the id of the topic to get 23 * @param plugin 24 * The plugin 25 * @return The topic, or null if no topic was found 26 */ 27 NewsletterHtmlDoc findByPrimaryKey( int nIdTopic, Plugin plugin ); 28 29 /** 30 * Update a newsletter htmldocs topic 31 * 32 * @param topic 33 * The topic to update 34 * @param plugin 35 * The plugin 36 */ 37 void updateDocumentTopic( NewsletterHtmlDoc topic, Plugin plugin ); 38 39 /** 40 * Remove a newsletter htmldocs topic from the database 41 * 42 * @param nIdTopic 43 * The id of the newsletter htmldocs topic to remove 44 * @param plugin 45 * The plugin 46 */ 47 void deleteDocumentTopic( int nIdTopic, Plugin plugin ); 48 49 /** 50 * Insert a new newsletter htmldocs topic into the database 51 * 52 * @param topic 53 * The newsletter htmldocs topic to insert 54 * @param plugin 55 * the plugin 56 */ 57 void createDocumentTopic( NewsletterHtmlDoc topic, Plugin plugin ); 58 59 60 61 /** 62 * Associate a new category to a newsletter topic 63 * 64 * @param nTopicId 65 * the topic id 66 * @param nDocumentCategoryId 67 * the htmldocs tag identifier 68 * @param plugin 69 * the newsletter htmldocs plugin 70 */ 71 void associateNewsLetterDocumentTag( int nTopicId, int nTagId, Plugin plugin ); 72 73 /** 74 * Remove the relationship between a topic and the list of htmldocs 75 * 76 * @param nTopicId 77 * the topic id 78 * @param plugin 79 * the newsletter htmldocs plugin 80 */ 81 void deleteNewsLetterDocumentTags( int nTopicId, Plugin plugin ); 82 83 /** 84 * loads the list of tags linked to the newsletter 85 * 86 * @param nTopicId 87 * the topic id 88 * @param plugin 89 * the newsletter htmldocs plugin 90 * @return the array of tag id 91 */ 92 int [ ] selectNewsletterTagIds( int nTopicId, Plugin plugin ); 93 94 /** 95 * Associate a new portlet to a newsletter topic 96 * 97 * @param nTopicId 98 * the topic id 99 * @param nPortletId 100 * the portlet identifier 101 * @param plugin 102 * the newsletter htmldocs plugin 103 */ 104 void associateNewsLetterDocumentPortlet( int nTopicId, int nPortletId, Plugin plugin ); 105 106 /** 107 * Remove the relationship between a topic and the list of portlets 108 * 109 * @param nTopicId 110 * the topic id 111 * @param plugin 112 * the newsletter htmldocs plugin 113 */ 114 void deleteNewsLetterDocumentPortlet( int nTopicId, Plugin plugin ); 115 116 /** 117 * loads the list of htmldocs list portlets linked to the newsletter 118 * 119 * @param nTopicId 120 * the topic id 121 * @param plugin 122 * the newsletter htmldocs plugin 123 * @return the array of categories id 124 */ 125 int [ ] selectNewsletterPortletsIds( int nTopicId, Plugin plugin ); 126 127 /** 128 * Check if a template is used by a topic 129 * 130 * @param nIdNewsletterTemplate 131 * The id of the template 132 * @param plugin 133 * The newsletter plugin 134 * @return True if the template is used by a topic, false otherwise 135 */ 136 boolean findTemplate( int nIdNewsletterTemplate, Plugin plugin ); 137 }