private void addProfileSets(List<ProfileSet> profileSets) { if(profileSets == null) { return; } // TODO Sort out the other app context impls such that we can get the profile store from them too if(applicationContext instanceof ApplicationContext) { ProfileStore profileStore = applicationContext.getProfileStore(); for(ProfileSet profileSet : profileSets) { profileStore.addProfileSet(profileSet); } } }
@SuppressWarnings("ConstantConditions") private void addProfileSets(List<ProfileSet> profileSets) { if(profileSets == null) { return; } // TODO Sort out the other app context impls such that we can get the profile store from them too if(applicationContext instanceof ApplicationContext) { ProfileStore profileStore = applicationContext.getProfileStore(); for(ProfileSet profileSet : profileSets) { profileStore.addProfileSet(profileSet); } } }
@SuppressWarnings("ConstantConditions") private void addProfileSets(List<ProfileSet> profileSets) { if(profileSets == null) { return; } // TODO Sort out the other app context impls such that we can get the profile store from them too if(applicationContext instanceof ApplicationContext) { ProfileStore profileStore = applicationContext.getProfileStore(); for(ProfileSet profileSet : profileSets) { profileStore.addProfileSet(profileSet); } } }
@SuppressWarnings("ConstantConditions") private void addProfileSets(List<ProfileSet> profileSets) { if(profileSets == null) { return; } // TODO Sort out the other app context impls such that we can get the profile store from them too if(applicationContext instanceof ApplicationContext) { ProfileStore profileStore = applicationContext.getProfileStore(); for(ProfileSet profileSet : profileSets) { profileStore.addProfileSet(profileSet); } } }
/** * Public Constructor. * <p/> * The execution context is constructed within the context of a target profile and * application context. * @param targetProfile The target profile (base profile) for this context. * These parameters are not appended to the supplied requestURI. This arg must be supplied, even if it's empty. * @param context The application context. * @param contentEncoding Character encoding to be used when parsing content. Null * defaults to "UTF-8". * @param extendedVisitorConfigMap Preconfigured/extended Visitor Configuration Map. * @throws UnknownProfileMemberException Unknown target profile. */ public StandaloneExecutionContext(String targetProfile, ApplicationContext context, String contentEncoding, VisitorConfigMap extendedVisitorConfigMap) throws UnknownProfileMemberException { if(targetProfile == null) { throw new IllegalArgumentException("null 'targetProfile' arg in constructor call."); } if(context == null) { throw new IllegalArgumentException("null 'context' arg in constructor call."); } this.context = context; setContentEncoding(contentEncoding); targetProfileSet = context.getProfileStore().getProfileSet(targetProfile); deliveryConfig = ContentDeliveryConfigBuilder.getConfig(targetProfileSet, context, extendedVisitorConfigMap); isDefaultSerializationOn = ParameterAccessor.getBoolParameter(Filter.DEFAULT_SERIALIZATION_ON, true, deliveryConfig); }
/** * Public Constructor. * <p/> * The execution context is constructed within the context of a target profile and * application context. * @param targetProfile The target profile (base profile) for this context. * These parameters are not appended to the supplied requestURI. This arg must be supplied, even if it's empty. * @param context The application context. * @param contentEncoding Character encoding to be used when parsing content. Null * defaults to "UTF-8". * @param extendedVisitorConfigMap Preconfigured/extended Visitor Configuration Map. * @throws UnknownProfileMemberException Unknown target profile. */ public StandaloneExecutionContext(String targetProfile, ApplicationContext context, String contentEncoding, VisitorConfigMap extendedVisitorConfigMap) throws UnknownProfileMemberException { if(targetProfile == null) { throw new IllegalArgumentException("null 'targetProfile' arg in constructor call."); } if(context == null) { throw new IllegalArgumentException("null 'context' arg in constructor call."); } this.context = context; setContentEncoding(contentEncoding); targetProfileSet = context.getProfileStore().getProfileSet(targetProfile); deliveryConfig = ContentDeliveryConfigBuilder.getConfig(targetProfileSet, context, extendedVisitorConfigMap); isDefaultSerializationOn = ParameterAccessor.getBoolParameter(Filter.DEFAULT_SERIALIZATION_ON, true, deliveryConfig); }
/** * Public Constructor. * <p/> * The execution context is constructed within the context of a target profile and * application context. * @param targetProfile The target profile (base profile) for this context. * These parameters are not appended to the supplied requestURI. This arg must be supplied, even if it's empty. * @param context The application context. * @param contentEncoding Character encoding to be used when parsing content. Null * defaults to "UTF-8". * @param extendedVisitorConfigMap Preconfigured/extended Visitor Configuration Map. * @throws UnknownProfileMemberException Unknown target profile. */ public StandaloneExecutionContext(String targetProfile, ApplicationContext context, String contentEncoding, VisitorConfigMap extendedVisitorConfigMap) throws UnknownProfileMemberException { if(targetProfile == null) { throw new IllegalArgumentException("null 'targetProfile' arg in constructor call."); } if(context == null) { throw new IllegalArgumentException("null 'context' arg in constructor call."); } this.context = context; setContentEncoding(contentEncoding); targetProfileSet = context.getProfileStore().getProfileSet(targetProfile); deliveryConfig = ContentDeliveryConfigBuilder.getConfig(targetProfileSet, context, extendedVisitorConfigMap); isDefaultSerializationOn = ParameterAccessor.getBoolParameter(Filter.DEFAULT_SERIALIZATION_ON, true, deliveryConfig); }
/** * Public Constructor. * * The execution context is constructed within the context of a target profile and * application context. * @param targetProfile The target profile (base profile) for this context. * These parameters are not appended to the supplied requestURI. This arg must be supplied, even if it's empty. * @param context The application context. * @param contentEncoding Character encoding to be used when parsing content. Null * defaults to "UTF-8". * @param extendedVisitorConfigMap Preconfigured/extended Visitor Configuration Map. * @throws UnknownProfileMemberException Unknown target profile. */ public StandaloneExecutionContext(String targetProfile, ApplicationContext context, String contentEncoding, VisitorConfigMap extendedVisitorConfigMap) throws UnknownProfileMemberException { if(targetProfile == null) { throw new IllegalArgumentException("null 'targetProfile' arg in constructor call."); } if(context == null) { throw new IllegalArgumentException("null 'context' arg in constructor call."); } this.context = context; setContentEncoding(contentEncoding); targetProfileSet = context.getProfileStore().getProfileSet(targetProfile); deliveryConfig = ContentDeliveryConfigBuilder.getConfig(targetProfileSet, context, extendedVisitorConfigMap); isDefaultSerializationOn = ParameterAccessor.getBoolParameter(Filter.DEFAULT_SERIALIZATION_ON, true, deliveryConfig); }
/** * Manually register a set of profiles with the profile store associated with the supplied {@link org.milyn.Smooks} instance. * <p/> * ProfileSets will typically be registered via the config, but it is useful * to be able to perform this task manually. * * @param profileSet The profile set to be registered. * @param smooks The {@link org.milyn.Smooks} instance on which to perform the configuration operation. */ public static void registerProfileSet(ProfileSet profileSet, Smooks smooks) { AssertArgument.isNotNull(profileSet, "profileSet"); ProfileStore profileStore = smooks.getApplicationContext().getProfileStore(); try { profileStore.getProfileSet(profileSet.getBaseProfile()); logger.debug("ProfileSet [" + profileSet.getBaseProfile() + "] already registered. Not registering new profile set."); } catch (UnknownProfileMemberException e) { // It's an unregistered profileset... profileStore.addProfileSet(profileSet); } }
/** * Manually register a set of profiles with the profile store associated with the supplied {@link org.milyn.Smooks} instance. * <p/> * ProfileSets will typically be registered via the config, but it is useful * to be able to perform this task manually. * * @param profileSet The profile set to be registered. * @param smooks The {@link org.milyn.Smooks} instance on which to perform the configuration operation. */ public static void registerProfileSet(ProfileSet profileSet, Smooks smooks) { AssertArgument.isNotNull(profileSet, "profileSet"); ProfileStore profileStore = smooks.getApplicationContext().getProfileStore(); try { profileStore.getProfileSet(profileSet.getBaseProfile()); logger.debug("ProfileSet [" + profileSet.getBaseProfile() + "] already registered. Not registering new profile set."); } catch (UnknownProfileMemberException e) { // It's an unregistered profileset... profileStore.addProfileSet(profileSet); } }
/** * Manually register a set of profiles with the profile store associated with the supplied {@link org.milyn.Smooks} instance. * * ProfileSets will typically be registered via the config, but it is useful * to be able to perform this task manually. * * @param profileSet The profile set to be registered. * @param smooks The {@link org.milyn.Smooks} instance on which to perform the configuration operation. */ public static void registerProfileSet(ProfileSet profileSet, Smooks smooks) { AssertArgument.isNotNull(profileSet, "profileSet"); ProfileStore profileStore = smooks.getApplicationContext().getProfileStore(); try { profileStore.getProfileSet(profileSet.getBaseProfile()); logger.debug("ProfileSet [" + profileSet.getBaseProfile() + "] already registered. Not registering new profile set."); } catch (UnknownProfileMemberException e) { // It's an unregistered profileset... profileStore.addProfileSet(profileSet); } }
/** * Manually register a set of profiles with the profile store associated with the supplied {@link org.milyn.Smooks} instance. * <p/> * ProfileSets will typically be registered via the config, but it is useful * to be able to perform this task manually. * * @param profileSet The profile set to be registered. * @param smooks The {@link org.milyn.Smooks} instance on which to perform the configuration operation. */ public static void registerProfileSet(ProfileSet profileSet, Smooks smooks) { AssertArgument.isNotNull(profileSet, "profileSet"); ProfileStore profileStore = smooks.getApplicationContext().getProfileStore(); try { profileStore.getProfileSet(profileSet.getBaseProfile()); logger.debug("ProfileSet [" + profileSet.getBaseProfile() + "] already registered. Not registering new profile set."); } catch (UnknownProfileMemberException e) { // It's an unregistered profileset... profileStore.addProfileSet(profileSet); } }