1 package org.jahia.taglibs.url; 2 3 import org.jahia.exceptions.JahiaException; 4 5 6 public class PagePropertiesURLTag extends AbstractURLTag { 7 8 private static org.apache.log4j.Logger logger = 9 org.apache.log4j.Logger.getLogger(PagePropertiesURLTag.class); 10 11 protected void init () { 12 } 14 15 protected Object getIdObject () { 16 String resultURL = null; 17 if (isWithJSPopup()) { 18 resultURL = getJSPopupURL(); 19 } else { 20 resultURL = getURL(); 21 } 22 if ( (resultURL != null) && 23 (resultURL.length() > 0)) { 24 return resultURL; 25 } 26 return null; 27 } 28 29 protected String getURL () { 30 try { 31 return getJahiaData().gui().drawPagePropertiesUrl(); 32 } catch (JahiaException je) { 33 logger.error("Error during URL generation:", je); 34 } 35 return null; 36 } 37 38 protected String getJSPopupURL () { 39 try { 40 String popupURL = getJahiaData().gui().html(). 41 drawPagePropertiesLauncher(); 42 if ((popupURL != null) && (!"".equals(popupURL))) { 43 return "javascript:" + popupURL; 44 } else { 45 return null; 46 } 47 } catch (JahiaException je) { 48 logger.error("Error while generating URL : ", je); 49 } 50 return null; 51 } 52 53 } 54 | Popular Tags |