use of com.enonic.xp.app.ApplicationKeys in project xp by enonic.
the class ApplicationServiceImplTest method get_application_keys.
@Test
public void get_application_keys() throws Exception {
final Bundle bundle1 = deployAppBundle("app1");
final Bundle bundle2 = deployAppBundle("app2");
deployAppBundle("noapp");
applicationRegistry.installApplication(bundle1);
applicationRegistry.installApplication(bundle2);
final ApplicationKeys result = this.service.getInstalledApplicationKeys();
assertNotNull(result);
assertEquals(2, result.getSize());
assertTrue(result.contains(ApplicationKey.from("app1")));
assertTrue(result.contains(ApplicationKey.from("app2")));
}
use of com.enonic.xp.app.ApplicationKeys in project xp by enonic.
the class StyleDescriptorServiceImplTest method getByApplications.
@Test
public void getByApplications() {
final ApplicationKeys appKeys = ApplicationKeys.from("myapp1", "myapp2");
final StyleDescriptors descriptors = this.service.getByApplications(appKeys);
assertNotNull(descriptors);
assertEquals(2, descriptors.getSize());
}
use of com.enonic.xp.app.ApplicationKeys in project xp by enonic.
the class HtmlLinkProcessor method getStyleDescriptors.
private StyleDescriptors getStyleDescriptors(final PortalRequest portalRequest) {
final ImmutableList.Builder<ApplicationKey> applicationKeyList = new ImmutableList.Builder<ApplicationKey>().add(SYSTEM_APPLICATION_KEY);
if (portalRequest != null) {
final Site site = portalRequest.getSite();
if (site != null) {
final ImmutableSet<ApplicationKey> siteApplicationKeySet = site.getSiteConfigs().getApplicationKeys();
applicationKeyList.addAll(siteApplicationKeySet);
}
}
final ApplicationKeys applicationKeys = ApplicationKeys.from(applicationKeyList.build());
return styleDescriptorService.getByApplications(applicationKeys);
}
Aggregations