View Javadoc
1   package fr.paris.lutece.plugins.extend.modules.extendablecomment.service;
2   
3   import fr.paris.lutece.plugins.extend.modules.comment.service.ICommentListener;
4   import fr.paris.lutece.plugins.extend.modules.extendablecomment.business.ExtendableComment;
5   import fr.paris.lutece.portal.service.resource.ExtendableResourceRemovalListenerService;
6   import fr.paris.lutece.portal.service.security.LuteceUser;
7   
8   import java.util.List;
9   
10  import javax.servlet.http.HttpServletRequest;
11  
12  
13  /**
14   * Class to remove extensions of comments when they are removed.
15   */
16  public class ExtendableResourceCommentRemovalListener implements ICommentListener
17  {
18  
19      /**
20       * {@inheritDoc}
21       */
22      @Override
23      public void createComment( String strIdExtendableResource, boolean bPublished )
24      {
25          // We do nothing
26      }
27  
28      /**
29       * {@inheritDoc}
30       */
31      @Override
32      public void publishComment( String strIdExtendableResource, boolean bPublished )
33      {
34          // We do nothing
35      }
36  
37      /**
38       * {@inheritDoc}
39       */
40      @Override
41      public void deleteComment( String strIdExtendableResource, List<Integer> listIdRemovedComment )
42      {
43          // We remove extensions of the removed comment if any
44          for ( int nIdComment : listIdRemovedComment )
45          {
46              ExtendableResourceRemovalListenerService.doRemoveResourceExtentions( ExtendableComment.RESOURCE_TYPE,
47                      Integer.toString( nIdComment ) );
48          }
49      }
50  
51  	@Override
52  	public void createComment(String arg0, boolean arg1, HttpServletRequest arg2) {
53  		// TODO Auto-generated method stub
54  		
55  	}
56  
57      @Override
58      public String checkComment( String comment, String uidUser )
59      {
60          // TODO Auto-generated method stub
61          return null;
62      }
63  
64      @Override
65      public String checkComment( String comment, String uidUser, String strResourceType, String strResourceId )
66      {
67          // TODO Auto-generated method stub
68          return null;
69      }
70  
71      @Override
72      public boolean canComment( LuteceUser user, String strIdExtendableResource, String strExtendableResourceType )
73      {
74          return true;
75      }
76  
77  }