📄 appssharebaseservice.java
字号:
//// ____.// __/\ ______| |__/\. _______// __ .____| | \ | +----+ \// _______| /--| | | - \ _ | : - \_________// \\______: :---| : : | : | \________>// |__\---\_____________:______: :____|____:_____\// /_____|//// . . . i n j a h i a w e t r u s t . . .////// AppsShareBaseService//// NK 31.04.2001// package org.jahia.services.shares;import java.util.*;import org.jahia.services.JahiaService;import org.jahia.services.sites.*;import org.jahia.data.applications.*;import org.jahia.services.applications.*;import org.jahia.settings.JahiaPrivateSettings;import org.jahia.exceptions.JahiaException;import org.jahia.exceptions.JahiaInitializationException;import org.jahia.utils.*;import org.jahia.data.JahiaDOMObject;/** * Application Share Service * * @author Khue ng */public class AppsShareBaseService extends AppsShareService{ private static AppsShareBaseService m_Instance = null; //-------------------------------------------------------------------------- protected AppsShareBaseService() throws JahiaException { JahiaConsole.println( "AppsShareBaseService", "***** Starting the Apps Share Service *****" ); setServiceName ("AppsShareBaseService"); } //-------------------------------------------------------------------------- public static synchronized AppsShareBaseService getInstance() throws JahiaException { if ( m_Instance == null ){ m_Instance = new AppsShareBaseService(); } return m_Instance; } //-------------------------------------------------------------------------- /** * return an enumeration of sites' key having access to a gived app * * @param ApplicationBean, the app * @return Enumeration, an enumeration of sites' keys */ public Enumeration getSites( ApplicationBean app ) throws JahiaException{ Vector vec = new Vector(); if ( app == null ){ return vec.elements(); } return AppsSharePersistance.getInstance().dbGetSites(app.getID()); } //-------------------------------------------------------------------------- /** * add a share between a site and an application * * @param JahiaSite, the site * @param ApplicationBean, the app */ public void addShare( JahiaSite site, ApplicationBean app ) throws JahiaException{ AppsSharePersistance.getInstance().dbAddShare(app.getID(),site.getID()); } //-------------------------------------------------------------------------- /** * remove a share between a site and an application * * @param JahiaSite, the site * @param ApplicationBean, the app */ public void removeShare( JahiaSite site, ApplicationBean app ) throws JahiaException{ AppsSharePersistance.getInstance().dbRemoveShare(app.getID(),site.getID()); } //-------------------------------------------------------------------------- /** * remove all share referencing a site * * @param JahiaSite, the site */ public void removeShares( JahiaSite site ) throws JahiaException{ AppsSharePersistance.getInstance().dbSiteRemoveShares(site.getID()); } //-------------------------------------------------------------------------- /** * remove all share referencing an app * * @param ApplicationBean, the app */ public void removeShares( ApplicationBean app ) throws JahiaException{ AppsSharePersistance.getInstance().dbAppRemoveShares(app.getID()); } //-------------------------------------------------------------------------- /** * Return a share between a site and an application * * @param JahiaSite, the site * @param ApplicationBean, the app */ public AppShare getShare( JahiaSite site, ApplicationBean app ) throws JahiaException{ return AppsSharePersistance.getInstance().dbGetShare(app.getID(),site.getID()); } //-------------------------------------------------------------------------- /** * return a DOM document of application shares content * * @param int the site id * * @return JahiaDOMObject a DOM representation of this object * * @author NK */ public JahiaDOMObject getApplicationSharesAsDOM( int siteID ) throws JahiaException{ return AppsSharePersistance.getInstance().getApplicationSharesAsDOM(siteID); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -