started filling in conferencing resources and some of the init/shutdown/
install/uninstall operations for Conferencing
This commit is contained in:
@@ -23,6 +23,7 @@ import com.silverwrist.dynamo.except.*;
|
||||
import com.silverwrist.dynamo.iface.*;
|
||||
import com.silverwrist.dynamo.util.*;
|
||||
import com.silverwrist.venice.community.CommunityServiceInstall;
|
||||
import com.silverwrist.venice.util.*;
|
||||
import com.silverwrist.venice.conf.ConfNamespaces;
|
||||
import com.silverwrist.venice.conf.iface.UseCount;
|
||||
|
||||
@@ -39,6 +40,7 @@ public class ModuleMain implements ModuleFunctions, UseCount
|
||||
|
||||
private static final QualifiedNameKey NAME =
|
||||
new QualifiedNameKey(ConfNamespaces.CONFERENCING_NAMESPACE,"Venice.conferencing");
|
||||
private static final String RESOURCES = "com.silverwrist.venice.conf.module.ModuleMessages";
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Attributes
|
||||
@@ -48,6 +50,8 @@ public class ModuleMain implements ModuleFunctions, UseCount
|
||||
private int m_usecount = 0;
|
||||
private ModuleSite m_site = null;
|
||||
private Controller m_controller = null;
|
||||
private ComponentShutdown m_res1;
|
||||
private ComponentShutdown m_res2;
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Constructor
|
||||
@@ -71,7 +75,7 @@ public class ModuleMain implements ModuleFunctions, UseCount
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
ResourceBundle b = ResourceBundle.getBundle("com.silverwrist.venice.conf.module.ModuleMessages");
|
||||
ResourceBundle b = ResourceBundle.getBundle(RESOURCES);
|
||||
return b.getString("description");
|
||||
|
||||
} // end getDescription
|
||||
@@ -80,10 +84,28 @@ public class ModuleMain implements ModuleFunctions, UseCount
|
||||
{
|
||||
m_site = site;
|
||||
|
||||
try
|
||||
{ // Mount the resource provider into the resource tree.
|
||||
ResourceProvider module_res = site.getResourceProvider();
|
||||
ResourceProviderManager resmgr = (ResourceProviderManager)(services.queryService(ResourceProviderManager.class));
|
||||
m_res1 = resmgr.mountResourceProvider("/scripts/conf",new PrefixResourceProvider(module_res,"/scripts"));
|
||||
m_res2 = resmgr.mountResourceProvider("/velocity/conf",new PrefixResourceProvider(module_res,"/velocity"));
|
||||
|
||||
} // end try
|
||||
catch (ConfigException e)
|
||||
{ // translate the ConfigException into a ModuleException
|
||||
throw new ModuleException(e);
|
||||
|
||||
} // end catch
|
||||
|
||||
} // end initialize
|
||||
|
||||
public void shutdown()
|
||||
{
|
||||
m_res1.shutdown();
|
||||
m_res1 = null;
|
||||
m_res2.shutdown();
|
||||
m_res2 = null;
|
||||
m_site = null;
|
||||
m_controller = null;
|
||||
m_usecount = 0;
|
||||
@@ -111,6 +133,33 @@ public class ModuleMain implements ModuleFunctions, UseCount
|
||||
|
||||
} // end synchronized block
|
||||
|
||||
ResourceBundle bun = ResourceBundle.getBundle(RESOURCES);
|
||||
|
||||
try
|
||||
{ // Install our community menu options.
|
||||
CommunityMenuInstaller comm_menu = new CommunityMenuInstaller(services);
|
||||
comm_menu.installCommunityServiceEntry((DynamoUser)installer,bun.getString("comm.menu.prompt"),"SERVLET",
|
||||
"conf/conferences.js.vs?cc=${cid}",SHORTVAR);
|
||||
log.info("Installed conferencing option to community left menu");
|
||||
|
||||
} // end try
|
||||
catch (DatabaseException de)
|
||||
{ // database error
|
||||
log.error("Caught database error while installing menus",de);
|
||||
ModuleException me = new ModuleException(ModuleMain.class,"ModuleMessages","install.cmenu.fail",de);
|
||||
me.setParameter(0,de.getMessage());
|
||||
throw me;
|
||||
|
||||
} // end catch
|
||||
catch (DynamoSecurityException dse)
|
||||
{ // security error
|
||||
log.error("Caught security error while installing menus",dse);
|
||||
ModuleException me = new ModuleException(ModuleMain.class,"ModuleMessages","install.cmenu.fail",dse);
|
||||
me.setParameter(0,dse.getMessage());
|
||||
throw me;
|
||||
|
||||
} // end catch
|
||||
|
||||
try
|
||||
{ // Install our community service.
|
||||
CommunityServiceInstall csi = (CommunityServiceInstall)(services.queryService(CommunityServiceInstall.class));
|
||||
@@ -149,6 +198,30 @@ public class ModuleMain implements ModuleFunctions, UseCount
|
||||
|
||||
} // end catch
|
||||
|
||||
try
|
||||
{ // uninstall the community menus
|
||||
CommunityMenuInstaller comm_menu = new CommunityMenuInstaller(services);
|
||||
comm_menu.removeCommunityServiceEntry((DynamoUser)uninstaller,"conf/conferences.js.vs",SHORTVAR);
|
||||
log.info("Removed conferencing option from community left menu");
|
||||
|
||||
} // end try
|
||||
catch (DatabaseException de)
|
||||
{ // database error
|
||||
log.error("Caught database error while uninstalling menus",de);
|
||||
ModuleException me = new ModuleException(ModuleMain.class,"ModuleMessages","uninstall.cmenu.fail",de);
|
||||
me.setParameter(0,de.getMessage());
|
||||
throw me;
|
||||
|
||||
} // end catch
|
||||
catch (DynamoSecurityException dse)
|
||||
{ // security error
|
||||
log.error("Caught security error while uninstalling menus",dse);
|
||||
ModuleException me = new ModuleException(ModuleMain.class,"ModuleMessages","uninstall.cmenu.fail",dse);
|
||||
me.setParameter(0,dse.getMessage());
|
||||
throw me;
|
||||
|
||||
} // end catch
|
||||
|
||||
} // end uninstall
|
||||
|
||||
public DynamicObject getProvidedObject(String namespace, String name) throws ModuleException
|
||||
|
||||
@@ -16,5 +16,8 @@
|
||||
# ---------------------------------------------------------------------------------
|
||||
# This file has been localized for the en_US locale
|
||||
description=Venice Conferencing System
|
||||
comm.menu.prompt=Conferences
|
||||
install.service.fail=Failed to install community service object: {0}
|
||||
uninstall.service.fail=Failed to uninstall community service object: {0}
|
||||
install.cmenu.fail=Failed to install community menu items: {0}
|
||||
uninstall.cmenu.fail=Failed to uninstall community menu items: {0}
|
||||
|
||||
Reference in New Issue
Block a user