@Component(property = { "webconsole.configurationFactory.nameHint" + "=" + "Expires Daily at: {expires.time} for Patterns: [{filter.pattern}]", }, factory = "com.adobe.acs.commons.http.headers.impl.DailyExpiresHeaderFilter", configurationPolicy = ConfigurationPolicy.REQUIRE) @Designate(ocd = DailyExpiresHeaderFilter.Config.class, factory=true) // @formatter:on public class DailyExpiresHeaderFilter extends AbstractExpiresHeaderFilter { @ObjectClassDefinition(name = "ACS AEM Commons - Dispatcher Expires Header - Daily", description = "Adds an Expires header to content to enable Dispatcher TTL support.") public @interface Config { @AttributeDefinition(name = "Filter Patterns", description = "Patterns on which to apply this Expires rule.", cardinality = Integer.MAX_VALUE) String[] filter_pattern(); @AttributeDefinition(name = "Expires Time", description = "Time each day at which resources will expire. Must match SimpleDateFormat of 'HH:mm'.") String expires_time(); } @Override protected void adjustExpires(Calendar next) { if (next.before(Calendar.getInstance())) { next.add(Calendar.DAY_OF_MONTH, 1); } } }
@Designate(ocd=Not.Config.class, factory=true) @Component(service=IC.class, name="osgi.enroute.iot.toolkit.not") public class Not extends ICAdapter<Digital, Digital> implements Digital { @ObjectClassDefinition @interface Config { String name(); } @Override public void set(boolean value) throws Exception { out().set(!value); } @Reference protected void setCircuitBoard(CircuitBoard board) { super.setCircuitBoard(board); } }
@Component(service = ReportConfigurationManager.class) @Designate(ocd = ReportConfigurationManagerConf.class) public class ReportConfigurationManager { private static final String REPORT_DOMAIN_ENV = "REPORT_DOMAIN"; private String reportDomain; @Activate public void activate(ReportConfigurationManagerConf config) { reportDomain = Optional.ofNullable(config.reportDomain()) .filter(StringUtils::isNotBlank) .orElseGet(() -> Optional.ofNullable(System.getenv(REPORT_DOMAIN_ENV)) .orElse(ReportConfigurationManagerConf.DEFAULT_REPORT_DOMAIN)); } public String getReportDomain() { return reportDomain; } }
private static final String[] DEFAULT_CATEGORIES = new String[] { CATEGORY_LIMIT, CATEGORY_PLACEHOLDER }; @ObjectClassDefinition(name = "ACS AEM Commons - Dynamic Touch UI Client Library Loader", description = "Allows for dynamic loading of optional Touch UI Client Libraries") public @interface Config { @AttributeDefinition(description = "Exclude all client library categories") boolean exclude_all(); @AttributeDefinition(description = "Client Library Categories", defaultValue = {CATEGORY_LIMIT, CATEGORY_PLACEHOLDER}) String[] categories() default {CATEGORY_LIMIT, CATEGORY_PLACEHOLDER};
private void doAD(ADDef ad, Pair pair) throws Exception { AttributeDefinition a = pair.getAd(); Annotation annotation = pair.getA(); if (a.name() != null) { ad.name = a.name(); } ad.description = a.description(); if (a.type() != null) { ad.type = a.type().toString(); } ad.cardinality = a.cardinality(); ad.max = a.max(); ad.min = a.min(); ad.defaults = a.defaultValue(); if (annotation.get("required") != null) { ad.required = a.required(); } if (annotation.get("options") != null) { ad.options.clear(); for (Object o : (Object[])annotation.get("options")) { Option opt = ((Annotation)o).getAnnotation(); ad.options.add(new OptionDef(opt.label(), opt.value())); } } }
/** * Editor configuration */ @Component(service = EditorConfig.class) @Designate(ocd = EditorConfig.Config.class) public class EditorConfig { @ObjectClassDefinition(name = "wcm.io Context-Aware Configuration Editor", description = "Configure the Editor for Apache Sling Context-Aware Configuration.") @interface Config { @AttributeDefinition(description = "Enable the Configuration Editor and HTTP APIs.") boolean enabled() default true; } private boolean enabled; @Activate private void activate(Config config) { this.enabled = config.enabled(); } public boolean isEnabled() { return this.enabled; } }
@Designate(ocd=FlipConfig.class, factory=true) @Component(service=IC.class, name="osgi.enroute.iot.toolkit.toggle") public class Toggle extends ICAdapter<Digital, Digital> implements Digital { @ObjectClassDefinition @interface FlipConfig { String name();
/** * RequestParameterHttpCacheConfigExtension * <p> * This extension on the HTTP cache allows for specific request parameter combinations to create separated cache entries. * </p> * */ @Component(configurationPolicy = ConfigurationPolicy.REQUIRE, service = {HttpCacheConfigExtension.class, CacheKeyFactory.class}) @Designate(ocd = KeyValueConfig.class, factory = true) public class RequestParameterHttpCacheConfigExtension extends AbstractKeyValueExtension implements CacheKeyFactory, HttpCacheConfigExtension { public static final String KEY_TOSTRING_REPRESENTATION = "RequestParameters"; @Override protected String getKeyToStringRepresentation() { return KEY_TOSTRING_REPRESENTATION; } @Override protected KeyValueMapWrapperBuilder getBuilder(SlingHttpServletRequest request, Set<String> allowedKeys, Map<String, String> allowedValues) { return new RequestParameterKeyValueWrapperBuilder(allowedKeys, allowedValues, request.getParameterMap()); } @Activate public void activate(KeyValueConfig config){ this.init(config); } }
@Component(service=EvolutionAnalyser.class) @Designate(ocd=EvolutionAnalyserImpl.Config.class) public class EvolutionAnalyserImpl implements EvolutionAnalyser { @ObjectClassDefinition(name = "ACS AEM Commons - Resource Evolution Analyser", description = "Have a look at the evolution of a resource on a property/resource level.") public @interface Config { @AttributeDefinition(name = "Ignored property names", description = "Property names (regex possible) listed here will be excluded from the version compare feature.", defaultValue = { "(.*/)?jcr:uuid", "(.*/)?(cq|jcr):lastModified", "(.*/)?(cq|jcr):lastModifiedBy", "(.*/)?jcr:frozenUuid", "(.*/)?jcr:primaryType", "(.*/)?jcr:frozenPrimaryType" }, cardinality = Integer.MAX_VALUE) String[] properties_ignore() default {"(.*/)?jcr:uuid", "(.*/)?(cq|jcr):lastModified", "(.*/)?(cq|jcr):lastModifiedBy", "(.*/)?jcr:frozenUuid", "(.*/)?jcr:primaryType", "(.*/)?jcr:frozenPrimaryType"}; @AttributeDefinition(name = "Ignored resource names", description = "Resource names (regex possible) listed here will be excluded from the version compare feature.", cardinality = Integer.MAX_VALUE)
@Designate(ocd=AndConfig.class, factory=true) @Component(service=IC.class, name="osgi.enroute.iot.toolkit.and") public class And extends ICAdapter<Binary, Digital> implements Binary { boolean a, b; @ObjectClassDefinition @interface AndConfig { String name();
@Component(configurationPid = "com.adobe.acs.commons.twitter.impl.TwitterAdapterFactory") @Designate(ocd=TwitterAdapterFactoryRegisterer.Config.class) public class TwitterAdapterFactoryRegisterer { @ObjectClassDefinition(name = "ACS AEM Commons - Twitter Client Adapter Factory", description = "Adapter Factory to generate TwitterClient objects.") public @interface Config { @AttributeDefinition(name = "HTTP Proxy Host", description = "HTTP Proxy Host, leave blank for none") String http_proxy_host(); @AttributeDefinition(name = "HTTP Proxy Port", description = "HTTP Proxy Port, leave 0 for none", defaultValue = "0") int http_proxy_port(); @AttributeDefinition(name = "Use SSL", description = "Use SSL Connections", defaultValue = ""+DEFAULT_USE_SSL) boolean use_ssl();
@Designate(ocd=AndConfig.class, factory=true) @Component(service=IC.class) public class Or extends ICAdapter<Binary, Digital> implements Binary { boolean a, b; @ObjectClassDefinition @interface AndConfig { String name();
service = {}, name = "org.apache.jackrabbit.oak.plugins.blob.datastore.DataStoreTextProviderService") @Designate(ocd = DataStoreTextProviderService.Configuration.class) public class DataStoreTextProviderService { @ObjectClassDefinition( name = "Apache Jackrabbit Oak DataStore PreExtractedTextProvider", description = "Configures a PreExtractedTextProvider based on extracted text stored on FileSystem" @AttributeDefinition( name = "Path", description = "Local file system path where extracted text is stored in files."
service = {}, name = "org.apache.jackrabbit.oak.plugins.blob.datastore.DataStoreTextProviderService") @Designate(ocd = DataStoreTextProviderService.Configuration.class) public class DataStoreTextProviderService { @ObjectClassDefinition( name = "Apache Jackrabbit Oak DataStore PreExtractedTextProvider", description = "Configures a PreExtractedTextProvider based on extracted text stored on FileSystem" @AttributeDefinition( name = "Path", description = "Local file system path where extracted text is stored in files."
service = {}, name = "org.apache.jackrabbit.oak.plugins.blob.datastore.DataStoreTextProviderService") @Designate(ocd = DataStoreTextProviderService.Configuration.class) public class DataStoreTextProviderService { @ObjectClassDefinition( name = "Apache Jackrabbit Oak DataStore PreExtractedTextProvider", description = "Configures a PreExtractedTextProvider based on extracted text stored on FileSystem" @AttributeDefinition( name = "Path", description = "Local file system path where extracted text is stored in files."
"webconsole.configurationFactory.nameHint" + "=" + "Max Age: {max.age} for Patterns: [{filter.pattern}]" }) @Designate(ocd = DispatcherMaxAgeHeaderFilter.Config.class, factory = true) @ObjectClassDefinition(name = "ACS AEM Commons - Dispacher Cache Control Header - Max Age", description = "Adds a Cache-Control max-age header to content to enable Dispatcher TTL support.") public @interface Config { @AttributeDefinition(name = "Cache-Control Max Age", description = "Max age value (in seconds) to put in Cache Control header.") int max_age(); @AttributeDefinition(name = "Filter Patterns", description = "Patterns on which to apply this Max Age cache-control rule.", cardinality = Integer.MAX_VALUE)
SLING_SERVLET_PATHS + "=" + "/bin/acs-commons/dam/custom-components.json" }) @Designate(ocd=CustomComponentActivatorListServlet.Config.class) public class CustomComponentActivatorListServlet extends SlingSafeMethodsServlet { @ObjectClassDefinition(name="ACS AEM Commons - Custom Component Activator List Servlet") public @interface Config { @AttributeDefinition(defaultValue= {HISTORY, FONTS, COLORANTS, LOCATION },name="Components", description="Map in the form <propertyName>=<replacement path>") String[] components() default { HISTORY, FONTS, COLORANTS, LOCATION };
@Designate(ocd = Configuration.class) public class SegmentNodeStoreMonitorService { @ObjectClassDefinition( name = "Oak Segment Tar Monitoring service", description = "This service is responsible for different configurations related to " + @AttributeDefinition( name = "Writer groups", description = "Writer groups for which commits are tracked individually"
SLING_SERVLET_PATHS + "=/bin/acs-commons/dynamic-classicui-clientlibs.json" }) @Designate(ocd = DynamicClassicUiClientLibraryServlet.Config.class) public class DynamicClassicUiClientLibraryServlet extends AbstractDynamicClientLibraryServlet { static final String CATEGORY_PLACEHOLDER = "acs-commons.cq-widgets.add-ons.classicui-parsys-placeholder"; @ObjectClassDefinition( name = "ACS AEM Commons - Dynamic Classic UI Client Library Loader", description = "Allows for dynamic loading of optional Classic UI Client Libraries" @AttributeDefinition(description = "Exclude all client library categories") boolean exclude_all(); @AttributeDefinition(description = "Client Library Categories", defaultValue = {CATEGORY_LIMIT, CATEGORY_PLACEHOLDER}) String[] categories();
configurationPolicy=ConfigurationPolicy.REQUIRE @Designate(ocd=PermissionSensitiveCacheServlet.Config.class) public class PermissionSensitiveCacheServlet extends SlingSafeMethodsServlet { @ObjectClassDefinition( name = "ACS AEM Commons - Permission Sensitive Cache Servlet" @AttributeDefinition( name="Sling Servlet Paths", description="Paths that this servlet will resolve to"