View Javadoc
1   /*
2    * Licensed to The Apereo Foundation under one or more contributor license
3    * agreements. See the NOTICE file distributed with this work for additional
4    * information regarding copyright ownership.
5    *
6    *
7    * The Apereo Foundation licenses this file to you under the Educational
8    * Community License, Version 2.0 (the "License"); you may not use this file
9    * except in compliance with the License. You may obtain a copy of the License
10   * at:
11   *
12   *   http://opensource.org/licenses/ecl2.txt
13   *
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
17   * License for the specific language governing permissions and limitations under
18   * the License.
19   *
20   */
21  
22  package org.opencastproject.security.api;
23  
24  import java.util.Collections;
25  import java.util.HashMap;
26  import java.util.Map;
27  
28  /**
29   * The default organization.
30   */
31  public class DefaultOrganization extends JaxbOrganization {
32  
33    /** The default organization properties */
34    public static final Map<String, String> DEFAULT_PROPERTIES;
35  
36    /** Servername - port mappings */
37    public static final Map<String, Integer> DEFAULT_SERVERS;
38  
39    static {
40      Map<String, String> properties = new HashMap<String, String>();
41      properties.put("logo_large", "/admin/img/logo/opencast.svg");
42      properties.put("logo_small", "/admin/img/logo/opencast-icon.svg");
43      DEFAULT_PROPERTIES = Collections.unmodifiableMap(properties);
44  
45      Map<String, Integer> servers = new HashMap<String, Integer>();
46      servers.put("http://localhost", 80);
47      DEFAULT_SERVERS = Collections.unmodifiableMap(servers);
48    }
49  
50    /** The default organization identifier */
51    public static final String DEFAULT_ORGANIZATION_ID = "mh_default_org";
52  
53    /** The default organization name */
54    public static final String DEFAULT_ORGANIZATION_NAME = "Opencast Project";
55  
56    /** Name of the default organization's local admin role */
57    public static final String DEFAULT_ORGANIZATION_ADMIN = "ROLE_ADMIN";
58  
59    /** Name of the default organization's local anonymous role */
60    public static final String DEFAULT_ORGANIZATION_ANONYMOUS = "ROLE_ANONYMOUS";
61  
62    /**
63     * No-arg constructor needed by JAXB
64     */
65    public DefaultOrganization() {
66      super(DefaultOrganization.DEFAULT_ORGANIZATION_ID, DefaultOrganization.DEFAULT_ORGANIZATION_NAME, DEFAULT_SERVERS,
67              DefaultOrganization.DEFAULT_ORGANIZATION_ADMIN, DefaultOrganization.DEFAULT_ORGANIZATION_ANONYMOUS,
68              DEFAULT_PROPERTIES);
69    }
70  
71    public DefaultOrganization(Map<String, Integer> override) {
72      super(DefaultOrganization.DEFAULT_ORGANIZATION_ID, DefaultOrganization.DEFAULT_ORGANIZATION_NAME,
73          null != override ? override : DEFAULT_SERVERS,
74          DefaultOrganization.DEFAULT_ORGANIZATION_ADMIN, DefaultOrganization.DEFAULT_ORGANIZATION_ANONYMOUS,
75          DEFAULT_PROPERTIES);
76    }
77  
78  }