1 17 18 19 20 package org.apache.lenya.cms; 21 22 import java.util.Arrays ; 23 import java.util.List ; 24 25 import org.apache.lenya.cms.publication.Publication; 26 import org.apache.lenya.cms.publication.PublicationException; 27 import org.apache.lenya.cms.publication.PublicationFactory; 28 29 public class PublicationHelper { 30 31 35 protected PublicationHelper() {} 36 37 45 public static String [] extractPublicationArguments(String [] args) { 46 String servletContextPath = args[0]; 47 String publicationId = args[1]; 48 try { 49 publication = 50 PublicationFactory.getPublication( 51 publicationId, 52 servletContextPath); 53 } catch (PublicationException e) { 54 e.printStackTrace(); 55 } 56 57 List subList = Arrays.asList(args).subList(2, args.length); 58 String [] remainder = 59 (String [])subList.toArray(new String [subList.size()]); 60 61 return remainder; 62 } 63 64 private static Publication publication; 65 66 70 public static Publication getPublication() { 71 return publication; 72 } 73 } 74 | Popular Tags |