use of com.enonic.xp.site.SiteConfig in project xp by enonic.
the class ControllerMappingsResolverTest method newSite.
private Site newSite() {
final SiteConfig siteConfig = SiteConfig.create().application(getAppKey()).config(new PropertyTree()).build();
final SiteConfig siteConfig2 = SiteConfig.create().application(getAppKey2()).config(new PropertyTree()).build();
final Site.Builder site = Site.create();
site.id(ContentId.from("100123"));
site.siteConfigs(SiteConfigs.from(siteConfig, siteConfig2));
site.name("mysite");
site.parentPath(ContentPath.ROOT);
return site.build();
}
use of com.enonic.xp.site.SiteConfig in project xp by enonic.
the class TestDataFixtures method newSite.
public static Site.Builder newSite() {
final PropertyTree siteConfigConfig = new PropertyTree();
siteConfigConfig.setLong("Field", 42L);
final SiteConfig siteConfig = SiteConfig.create().application(ApplicationKey.from("myapplication")).config(siteConfigConfig).build();
final Site.Builder site = Site.create();
site.id(ContentId.from("100123"));
site.siteConfigs(SiteConfigs.from(siteConfig));
site.name("my-content");
site.parentPath(ContentPath.ROOT);
site.permissions(AccessControlList.of(AccessControlEntry.create().principal(RoleKeys.EVERYONE).allow(Permission.READ).build()));
return site;
}
use of com.enonic.xp.site.SiteConfig in project xp by enonic.
the class MacroInstruction method resolveMacroDescriptorCaseInsensitive.
private MacroDescriptor resolveMacroDescriptorCaseInsensitive(final SiteConfigs siteConfigs, final String macroName) {
for (SiteConfig siteConfig : siteConfigs) {
final MacroDescriptors macroDescriptors = macroDescriptorService.getByApplication(siteConfig.getApplicationKey());
final MacroDescriptor macroDescriptor = macroDescriptors.stream().filter((md) -> md.getName().equalsIgnoreCase(macroName)).findFirst().orElse(null);
if (macroDescriptor != null) {
return macroDescriptor;
}
}
return null;
}
use of com.enonic.xp.site.SiteConfig in project xp by enonic.
the class ProcessorChainResolver method resolve.
public ResponseProcessorDescriptors resolve(PortalRequest request) {
SiteDescriptor siteDescriptor;
List<ResponseProcessorDescriptor> filterChain = new ArrayList<>();
for (SiteConfig siteConfig : request.getSite().getSiteConfigs()) {
siteDescriptor = siteService.getDescriptor(siteConfig.getApplicationKey());
if (siteDescriptor != null) {
for (ResponseProcessorDescriptor filterDescriptor : siteDescriptor.getResponseProcessors()) {
filterChain.add(this.findIndexToInsert(filterDescriptor, filterChain), filterDescriptor);
}
}
}
return ResponseProcessorDescriptors.from(filterChain);
}
use of com.enonic.xp.site.SiteConfig in project xp by enonic.
the class MacroInstructionTest method createSite.
private Site createSite(final String id, final String name, final String contentTypeName) {
PropertyTree rootDataSet = new PropertyTree();
SiteConfig siteConfig = SiteConfig.create().application(ApplicationKey.from("myapp")).config(new PropertyTree()).build();
new SiteConfigsDataSerializer().toProperties(SiteConfigs.from(siteConfig), rootDataSet.getRoot());
return Site.create().id(ContentId.from(id)).path(ContentPath.from(name)).owner(PrincipalKey.from("user:myStore:me")).displayName("My Content").modifier(PrincipalKey.from("user:system:admin")).type(ContentTypeName.from(contentTypeName)).data(rootDataSet).build();
}
Aggregations