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;
|
|
|
|
|
|
|
|
}
|