use of org.webpieces.ctx.api.extension.HtmlTagCreator in project webpieces by deanhiller.
the class HtmlTagLookup method install.
public void install(Set<HtmlTagCreator> htmlCreators) {
for (HtmlTagCreator c : htmlCreators) {
List<Tag> tags = c.createTags();
addTags(c, tags);
}
}
use of org.webpieces.ctx.api.extension.HtmlTagCreator in project webpieces by deanhiller.
the class GuiceModule method configure.
// This is where you would put the guice bindings you need though generally if done
// right, you won't have much in this file.
// If you need more Guice Modules as you want to scale, just modify ServerMeta which returns
// the list of all the Guice Modules in your application
@SuppressWarnings("rawtypes")
@Override
public void configure(Binder binder) {
log.info("running module");
// all modules have access to adding their own Startable objects to be run on server startup
Multibinder<Startable> uriBinder = Multibinder.newSetBinder(binder, Startable.class);
uriBinder.addBinding().to(PopulateDatabase.class);
Multibinder<ObjectStringConverter> conversionBinder = Multibinder.newSetBinder(binder, ObjectStringConverter.class);
conversionBinder.addBinding().to(EducationEnum.WebConverter.class);
conversionBinder.addBinding().to(RoleEnum.WebConverter.class);
Multibinder<HtmlTagCreator> htmlTagCreators = Multibinder.newSetBinder(binder, HtmlTagCreator.class);
htmlTagCreators.addBinding().to(MyHtmlTagCreator.class);
binder.bind(SomeLibrary.class).to(SomeLibraryImpl.class);
// Must bind a SimpleStorage for plugins to read/save data and render their html pages
binder.bind(SimpleStorage.class).to(SimpleStorageImpl.class).asEagerSingleton();
// Must bind a BackendLogin for the backend plugin(or remove the backend plugin)
binder.bind(BackendLogin.class).to(BackendLoginImpl.class).asEagerSingleton();
// since GlobalAppContext is a singleton, ApplicationContext will be to and will be the same
binder.bind(ApplicationContext.class).to(GlobalAppContext.class).asEagerSingleton();
binder.bind(HttpsConfig.class).toInstance(new HttpsConfig(true));
binder.bind(ClientAssertions.class).to(ClientAssertionsImpl.class).asEagerSingleton();
}
use of org.webpieces.ctx.api.extension.HtmlTagCreator in project webpieces by deanhiller.
the class PluginSetup method wireInPluginPoints.
/**
* This is where we wire in all plugin points EXCEPT the Startup one
* we can't inject them :(
*/
@SuppressWarnings("rawtypes")
public void wireInPluginPoints(Injector appInjector) {
Key<Set<EntityLookup>> key = Key.get(new TypeLiteral<Set<EntityLookup>>() {
});
Set<EntityLookup> lookupHooks = appInjector.getInstance(key);
translator.install(lookupHooks);
Key<Set<ObjectStringConverter>> key3 = Key.get(new TypeLiteral<Set<ObjectStringConverter>>() {
});
Set<ObjectStringConverter> converters = appInjector.getInstance(key3);
translation.install(converters);
Key<Set<BodyContentBinder>> key2 = Key.get(new TypeLiteral<Set<BodyContentBinder>>() {
});
Set<BodyContentBinder> bodyBinders = appInjector.getInstance(key2);
bodyContentChecker.install(bodyBinders);
Key<Set<HtmlTagCreator>> key4 = Key.get(new TypeLiteral<Set<HtmlTagCreator>>() {
});
Set<HtmlTagCreator> htmlTagCreators = appInjector.getInstance(key4);
// Guice circular dependency we could not work around quite yet. figure out later maybe
TemplateApi api = templateApi.get();
api.installCustomTags(htmlTagCreators);
}
Aggregations