reorg freemarker
This commit is contained in:
1 parent
65521864d4
commit
46634b386e
90 files changed
+97
-526
No files matched your search
+55
@@ -0,0 +1,55 @@
|
||||
package org.keycloak.theme;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.util.Locale;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:sthorger@redhat.com">Stian Thorgersen</a>
|
||||
*/
|
||||
public interface Theme {
|
||||
|
||||
public enum Type { LOGIN, ACCOUNT, ADMIN, EMAIL, WELCOME, COMMON };
|
||||
|
||||
public String getName();
|
||||
|
||||
public String getParentName();
|
||||
|
||||
public String getImportName();
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public Properties getMessages(Locale locale) throws IOException;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
public Properties getProperties() throws IOException;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.keycloak.theme;
|
||||
|
||||
import org.keycloak.provider.Provider;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:sthorger@redhat.com">Stian Thorgersen</a>
|
||||
*/
|
||||
public interface ThemeProvider extends Provider {
|
||||
|
||||
public int getProviderPriority();
|
||||
|
||||
public Theme getTheme(String name, Theme.Type type) throws IOException;
|
||||
|
||||
public Set<String> nameSet(Theme.Type type);
|
||||
|
||||
public boolean hasTheme(String name, Theme.Type type);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.keycloak.theme;
|
||||
|
||||
import org.keycloak.provider.ProviderFactory;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:sthorger@redhat.com">Stian Thorgersen</a>
|
||||
*/
|
||||
public interface ThemeProviderFactory extends ProviderFactory<ThemeProvider> {
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package org.keycloak.theme;
|
||||
|
||||
import org.keycloak.provider.Provider;
|
||||
import org.keycloak.provider.ProviderFactory;
|
||||
import org.keycloak.provider.Spi;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:sthorger@redhat.com">Stian Thorgersen</a>
|
||||
*/
|
||||
public class ThemeSpi implements Spi {
|
||||
|
||||
@Override
|
||||
public boolean isInternal() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "theme";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Provider> getProviderClass() {
|
||||
return ThemeProvider.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends ProviderFactory> getProviderFactoryClass() {
|
||||
return ThemeProviderFactory.class;
|
||||
}
|
||||
}
|
||||
@@ -22,4 +22,5 @@ org.keycloak.forms.account.AccountSpi
|
||||
org.keycloak.forms.login.LoginFormsSpi
|
||||
org.keycloak.email.EmailSenderSpi
|
||||
org.keycloak.email.EmailTemplateSpi
|
||||
org.keycloak.theme.ThemeSpi
|
||||
|
||||
Reference in new issue
Block a user