<%@ include file="adminHeaders.jsp" %> <% /* $Id$ */ /** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (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.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // The contract of this edit page is as follows. It is either called directly, in which case it is expected to be creating // a connection or beginning the process of editing an existing connection, or it is called via redirection from execute.jsp, in which case // the connection object being edited will be placed in the thread context under the name "GroupObject". try { // Get the group manager IAuthorityGroupManager authGroupManager = AuthorityGroupManagerFactory.make(threadContext); // Figure out what the current tab name is. String tabName = variableContext.getParameter("tabname"); if (tabName == null || tabName.length() == 0) tabName = Messages.getString(pageContext.getRequest().getLocale(),"editgroup.Name"); String groupName = null; IAuthorityGroup group = (IAuthorityGroup)threadContext.get("GroupObject"); if (group == null) { // We did not go through execute.jsp // We might have received an argument specifying the connection name. groupName = variableContext.getParameter("groupname"); // If the groupname is not null, load the connection description and prepopulate everything with what comes from it. if (groupName != null && groupName.length() > 0) { group = authGroupManager.load(groupName); } } // Setup default fields boolean isNew = true; String description = ""; if (group != null) { // Set up values isNew = group.getIsNew(); groupName = group.getName(); description = group.getDescription(); } else groupName = null; if (groupName == null) groupName = ""; // Initialize tabs array ArrayList tabsArray = new ArrayList(); // Set up the predefined tabs tabsArray.add(Messages.getString(pageContext.getRequest().getLocale(),"editgroup.Name")); %> <%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editgroup.ApacheManifoldCFEditAuthorityGroup")%>
<% int tabNum = 0; while (tabNum < tabsArray.size()) { String tab = (String)tabsArray.get(tabNum++); if (tab.equals(tabName)) { %> <% } else { %> <% } } %>
<% if (description.length() > 0) { %> <%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editgroup.EditGroup")%> '<%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(description)%>' <% } else { %> <%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editgroup.EditAGroup")%> <% } %>
<%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(tab)%><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(tab)%>
<% // Name tab if (tabName.equals(Messages.getString(pageContext.getRequest().getLocale(),"editgroup.Name"))) { %>

<%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editgroup.NameColon")%> <% // If the group doesn't exist yet, we are allowed to change the name. if (isNew) { %> <% } else { %> <%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(groupName)%> <% } %>
<%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editgroup.DescriptionColon")%>
<% } else { // Hiddens for the Name tab %> <% } %>

" onClick="javascript:Save()" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"editgroup.SaveThisAuthorityGroup")%>"/>  " onClick="javascript:Cancel()" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"editgroup.CancelAuthorityGroupEditing")%>"/>
<% } catch (ManifoldCFException e) { e.printStackTrace(); variableContext.setParameter("text",e.getMessage()); variableContext.setParameter("target","listauthorities.jsp"); %> <% } %>