2016-02-03 10:20:22 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Red Hat, Inc. and/or its affiliates
|
|
|
|
* and other contributors as indicated by the @author tags.
|
|
|
|
*
|
|
|
|
* Licensed 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.
|
|
|
|
*/
|
|
|
|
|
2016-01-19 16:33:59 +00:00
|
|
|
package org.keycloak.theme;
|
2014-01-28 11:52:18 +00:00
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.net.URL;
|
2015-02-21 16:36:47 +00:00
|
|
|
import java.util.Locale;
|
2014-01-28 11:52:18 +00:00
|
|
|
import java.util.Properties;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author <a href="mailto:sthorger@redhat.com">Stian Thorgersen</a>
|
|
|
|
*/
|
|
|
|
public interface Theme {
|
|
|
|
|
2014-09-11 13:58:29 +00:00
|
|
|
public enum Type { LOGIN, ACCOUNT, ADMIN, EMAIL, WELCOME, COMMON };
|
2014-01-28 11:52:18 +00:00
|
|
|
|
|
|
|
public String getName();
|
|
|
|
|
|
|
|
public String getParentName();
|
|
|
|
|
2014-04-24 08:25:50 +00:00
|
|
|
public String getImportName();
|
|
|
|
|
2014-01-28 11:52:18 +00:00
|
|
|
public Type getType();
|
|
|
|
|
|
|
|
public URL getTemplate(String name) throws IOException;
|
|
|
|
|
|
|
|
public InputStream getTemplateAsStream(String name) throws IOException;
|
|
|
|
|
|
|
|
public URL getResource(String path) throws IOException;
|
|
|
|
|
|
|
|
public InputStream getResourceAsStream(String path) throws IOException;
|
|
|
|
|
2015-09-08 17:28:17 +00:00
|
|
|
/**
|
|
|
|
* Same as getMessages(baseBundlename, locale), but uses a default baseBundlename
|
|
|
|
* such as "messages".
|
|
|
|
*
|
|
|
|
* @param locale The locale of the desired message bundle.
|
|
|
|
* @return The localized messages from the bundle.
|
|
|
|
* @throws IOException If bundle can not be read.
|
|
|
|
*/
|
2015-02-21 16:36:47 +00:00
|
|
|
public Properties getMessages(Locale locale) throws IOException;
|
2014-01-28 11:52:18 +00:00
|
|
|
|
2015-09-08 17:28:17 +00:00
|
|
|
/**
|
|
|
|
* Retrieve localized messages from a message bundle.
|
|
|
|
*
|
|
|
|
* @param baseBundlename The base name of the bundle, such as "messages" in
|
|
|
|
* messages_en.properties.
|
|
|
|
* @param locale The locale of the desired message bundle.
|
|
|
|
* @return The localized messages from the bundle.
|
|
|
|
* @throws IOException If bundle can not be read.
|
|
|
|
*/
|
|
|
|
public Properties getMessages(String baseBundlename, Locale locale) throws IOException;
|
|
|
|
|
2014-01-28 11:52:18 +00:00
|
|
|
public Properties getProperties() throws IOException;
|
|
|
|
|
|
|
|
}
|