Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * #%L
   * Wikitty :: api
   * %%
   * Copyright (C) 2009 - 2010 CodeLutin, Benjamin Poussin
   * %%
   * This program is free software: you can redistribute it and/or modify
   * it under the terms of the GNU Lesser General Public License as 
   * published by the Free Software Foundation, either version 3 of the 
  * License, or (at your option) any later version.
  * 
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Lesser Public License for more details.
  * 
  * You should have received a copy of the GNU General Lesser Public 
  * License along with this program.  If not, see
  * <http://www.gnu.org/licenses/lgpl-3.0.html>.
  * #L%
  */
 package org.nuiton.wikitty.services;
 
 import java.util.List;
Same as delegator but with some helpfull method for developer. This new methods are methods with less arguments or simple argument and not collection

Author(s):
poussin
Version:
$Revision$ Last update: $Date$ by : $Author$
 
 public class WikittyServiceEnhanced extends WikittyServiceDelegator {

    
to use log facility, just put in your code: log.info(\"...\");
 
     static private Log log = LogFactory.getLog(WikittyServiceEnhanced.class);
 
     public WikittyServiceEnhanced(WikittyService service) {
         super(service);
     }
 
     public WikittyEvent store(String securityTokenWikitty wikitty) {
         return store(securityToken, Collections.singleton(wikitty), false);
     }
 
     public WikittyEvent store(String securityTokenWikitty w1Wikitty w2Wikitty ... wN) {
         List<Wikittyws = new ArrayList<Wikitty>(wN.length + 2);
         Collections.addAll(wsw1w2);
         Collections.addAll(wswN);
 
         return store(securityTokenwsfalse);
     }
 
     public WikittyEvent store(String securityToken,
             Collection<Wikittywikitties) {
         return store(securityTokenwikittiesfalse);
     }
 
     public WikittyEvent storeExtension(String securityToken,
             WikittyExtension ext) {
         return storeExtension(securityToken, Collections.singleton(ext));
     }

    

Parameters:
securityToken security token
id object id to restore
Returns:
the corresponding object, or null if object doesn't exist, is deleted or you don't have authorisation (you can check authorisation before call restore with WikittyServiceDelegator.canRead(java.lang.String,java.lang.String)
 
     public Wikitty restore(String securityTokenString id) {
         Wikitty result = restore(thissecurityTokenid);
         return result;
     }
 
     public WikittyEvent delete(String securityTokenString id) {
         return delete(securityToken, Collections.singleton(id));
     }
 
     public WikittyEvent deleteExtension(String securityTokenString extName) {
         return deleteExtension(securityToken, Collections.singleton(extName));
     }

    
Conveniant static method usefull in other WikittyService implementation where we don't wan't instanciate WikittyServiceEnhanced

Parameters:
securityToken security token
id object id to restore
Returns:
the corresponding object, or null if object doesn't exist, is deleted or you don't have authorisation (you can check authorisation before call restore with WikittyServiceDelegator.canRead(java.lang.String,java.lang.String)
    static public Wikitty restore(WikittyService wsString securityTokenString id) {
        Wikitty result = null;
        List<WikittyresultList =
                ws.restore(securityToken, Collections.singletonList(id));
        if (resultList != null && resultList.size() > 0) {
            result = resultList.get(0);
        }
        return result;
    }
New to GrepCode? Check out our FAQ X