c6a86a167f
pages for doing so
65 lines
2.8 KiB
JavaScript
65 lines
2.8 KiB
JavaScript
// The contents of this file are subject to the Mozilla Public License Version 1.1
|
|
// (the "License"); you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
|
|
//
|
|
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
|
|
// WARRANTY OF ANY KIND, either express or implied. See the License for the specific
|
|
// language governing rights and limitations under the License.
|
|
//
|
|
// The Original Code is the Venice Web Communities System.
|
|
//
|
|
// The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
|
|
// for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
|
|
// Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
|
|
//
|
|
// Contributor(s):
|
|
|
|
importPackage(java.lang);
|
|
importClass(Packages.com.silverwrist.dynamo.Namespaces);
|
|
importPackage(Packages.com.silverwrist.dynamo.except);
|
|
importPackage(Packages.com.silverwrist.dynamo.iface);
|
|
importPackage(Packages.com.silverwrist.dynamo.security);
|
|
importPackage(Packages.com.silverwrist.dynamo.util);
|
|
importClass(Packages.com.silverwrist.venice.VeniceNamespaces);
|
|
importPackage(Packages.com.silverwrist.venice.community);
|
|
importPackage(Packages.com.silverwrist.venice.content);
|
|
importPackage(Packages.com.silverwrist.venice.frame);
|
|
importPackage(Packages.com.silverwrist.venice.iface);
|
|
|
|
req = bsf.lookupBean("request");
|
|
req_help = bsf.lookupBean("request_help");
|
|
user = vlib.getUser(req);
|
|
comm = vlib.getCommunity(req);
|
|
|
|
// Make sure we are permitted to be here.
|
|
acl = comm.getAcl();
|
|
if (!(acl.testPermission(user,VeniceNamespaces.COMMUNITY_PERMS_NAMESPACE,"manage.services")))
|
|
dynamo.scriptReturn(vlib.stdErrorBox(req,"Security Error",
|
|
"You are not permitted to modify this community's services."));
|
|
|
|
// Get the community service object.
|
|
commsvc = vcast.queryCommunityService(rhelp.getRequestObject(Namespaces.DYNAMO_OBJECT_NAMESPACE,"communities"));
|
|
|
|
// Get the currently-defined list of community services.
|
|
svclist = commsvc.getAvailableServices();
|
|
|
|
// Use that to create a list of which services we have and which services we don't.
|
|
mainlist = new ArrayList();
|
|
it = svclist.iterator();
|
|
while (it.hasNext())
|
|
{ // create list entries and add them
|
|
csd = vcast.toCommunityServiceDescriptor(it.next());
|
|
tmp = new HashMap();
|
|
tmp.put("id",cast.toIntegerObject(csd.index));
|
|
tmp.put("descr",csd.description);
|
|
tmp.put("using",cast.toBooleanObject(comm.isUsingService(csd.name.namespace,csd.name.name)));
|
|
mainlist.add(tmp);
|
|
|
|
} // end while
|
|
|
|
// Create and return the view.
|
|
rc = new VelocityView(comm.name + ": Community Services","comm/admin/services.vm");
|
|
rc.setParameter("community",comm);
|
|
rc.setParameter("services",mainlist);
|
|
dynamo.scriptOutput(rc);
|