1 package org.jahia.services.shares; 18 19 import org.jahia.data.JahiaDOMObject; 20 import org.jahia.data.applications.ApplicationBean; 21 import org.jahia.exceptions.JahiaException; 22 import org.jahia.services.sites.JahiaSite; 23 24 import java.util.Enumeration ; 25 import java.util.Vector ; 26 27 32 public class AppsShareBaseService extends AppsShareService { 33 private static org.apache.log4j.Logger logger = 34 org.apache.log4j.Logger.getLogger (AppsShareBaseService.class); 35 36 private static AppsShareBaseService m_Instance = null; 37 38 protected AppsShareBaseService () throws JahiaException { 40 logger.info ("***** Starting the Apps Share Service *****"); 41 } 42 43 44 public static synchronized AppsShareBaseService getInstance () throws JahiaException { 46 47 if (m_Instance == null) { 48 m_Instance = new AppsShareBaseService (); 49 } 50 return m_Instance; 51 } 52 53 61 public Enumeration getSites (ApplicationBean app) throws JahiaException { 62 63 Vector vec = new Vector (); 64 if (app == null) { 65 return vec.elements (); 66 } 67 return AppsSharePersistance.getInstance ().dbGetSites (app.getID ()); 68 } 69 70 71 78 public void addShare (JahiaSite site, ApplicationBean app) throws JahiaException { 79 80 AppsSharePersistance.getInstance ().dbAddShare (app.getID (), site.getID ()); 81 82 } 83 84 85 92 public void removeShare (JahiaSite site, ApplicationBean app) throws JahiaException { 93 94 AppsSharePersistance.getInstance ().dbRemoveShare (app.getID (), site.getID ()); 95 96 } 97 98 99 105 public void removeShares (JahiaSite site) throws JahiaException { 106 107 AppsSharePersistance.getInstance ().dbSiteRemoveShares (site.getID ()); 108 109 } 110 111 112 118 public void removeShares (ApplicationBean app) throws JahiaException { 119 120 AppsSharePersistance.getInstance ().dbAppRemoveShares (app.getID ()); 121 122 } 123 124 125 132 public AppShare getShare (JahiaSite site, ApplicationBean app) throws JahiaException { 133 134 return AppsSharePersistance.getInstance ().dbGetShare (app.getID (), site.getID ()); 135 136 } 137 138 139 149 public JahiaDOMObject getApplicationSharesAsDOM (int siteID) 150 throws JahiaException { 151 return AppsSharePersistance.getInstance ().getApplicationSharesAsDOM (siteID); 152 } 153 154 155 } 156 157 | Popular Tags |