Skip to content

Instantly share code, notes, and snippets.

@rah003
rah003 / content
Last active October 7, 2015 06:39
Script to generate nice confluence image-like tables showing config tree from magnolia
import static info.magnolia.jcr.util.NodeUtil.isNodeType;
import static org.apache.commons.lang3.StringUtils.substringBeforeLast;
exportPath = "/modules/ui-admincentral/commands"
filterJCR = true
filterMGNL = true
session = MgnlContext.getJCRSession('config')
node = session.getNode(exportPath);
zeroDepth = node.getDepth()
@rah003
rah003 / content
Last active November 16, 2015 09:50
List all components used in specified page and all it's subpages
import info.magnolia.repository.RepositoryConstants
import javax.jcr.Node
import info.magnolia.jcr.util.NodeUtil
import org.apache.commons.lang.StringUtils
import info.magnolia.cms.util.QueryUtil
website = ctx.getJCRSession("website")
listComponents(website.getNode("/some-path"))
'chooseDialog':
'class': 'info.magnolia.ui.dialog.definition.ConfiguredChooseDialogDefinition'
'field':
'class': 'info.magnolia.ui.contentapp.field.WorkbenchFieldDefinition'
'workbench':
'extends': '/modules/security-app/apps/security/subApps/roles/workbench'
'contentConnector':
'extends': '/modules/security-app/apps/security/subApps/roles/contentConnector'
'actions':
'commit':
@rah003
rah003 / content
Created September 26, 2017 15:52
2017-09-26 17:50:05,742 ERROR .magnolia.ui.admincentral.AdmincentralErrorHandler: AdmincentralUI has encountered an unhandled exception.
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error in custom provider, java.lang.IllegalStateException: Not in a view scope, cannot resolve the corresponding bean store!
at info.magnolia.ui.framework.ioc.UiBaseModule.lambda$bindEventBuses$8(UiBaseModule.java:211) (via modules: com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> com.google.inject.util.Modules$CombinedModule -> info.magnolia.ui.framework.ioc.UiBaseModule)
while locating info.magnolia.event.EventBus annotated with @com.google.inject.name.Named(value=choosedialog)
1 error
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025)
at info.magnolia.objectfactory.guice.GuiceParameterResolver.resolveParameter(GuiceParameterResolver.java:74)
2017-10-09 14:53:57,540 ERROR .magnolia.ui.admincentral.AdmincentralErrorHandler: AdmincentralUI has encountered an unhandled exception.
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error in custom provider, java.lang.NullPointerException
at info.magnolia.ui.framework.ioc.UiBaseModule.lambda$bindUiContext$2(UiBaseModule.java:191) (via modules: com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> com.google.inject.util.Modules$CombinedModule -> info.magnolia.ui.framework.ioc.UiBaseModule)
while locating info.magnolia.ui.api.context.UiContext annotated with info.magnolia.ui.framework.ioc.ViewImpl@0
at info.magnolia.ui.framework.ioc.UiBaseModule.bindUiContext(UiBaseModule.java:201) (via modules: com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> com.google.inject.util.Modules$CombinedModule -> info.magnolia.ui.framework.ioc.UiBaseMod
2017-10-09 15:30:49,598 ERROR .magnolia.ui.admincentral.AdmincentralErrorHandler: AdmincentralUI has encountered an unhandled exception.
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error in custom provider, java.lang.IllegalStateException: Not in view context, cannot resolve view UiContext
at info.magnolia.ui.framework.ioc.UiBaseModule.lambda$bindUiContext$2(UiBaseModule.java:191) (via modules: com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> com.google.inject.util.Modules$CombinedModule -> info.magnolia.ui.framework.ioc.UiBaseModule)
while locating info.magnolia.ui.api.context.UiContext annotated with info.magnolia.ui.framework.ioc.ViewImpl@0
at info.magnolia.ui.framework.ioc.UiBaseModule.bindUiContext(UiBaseModule.java:201) (via modules: com.google.inject.util.Modules$OverrideModule -> info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1 -> com.google.inject.util.Modules$Combi
2017-10-09 16:31:35,414 ERROR .magnolia.ui.admincentral.AdmincentralErrorHandler: AdmincentralUI has encountered an unhandled exception.
info.magnolia.objectfactory.MgnlInstantiationException: Unable to resolve parameters for constructor public info.magnolia.ui.workbench.WorkbenchPresenter(info.magnolia.ui.workbench.WorkbenchView,info.magnolia.objectfactory.ComponentProvider,info.magnolia.ui.workbench.WorkbenchStatusBarPresenter,info.magnolia.ui.vaadin.integration.contentconnector.ContentConnector). Unresolved parameter(s) are: 3rd parameter which is of type info.magnolia.ui.workbench.WorkbenchStatusBarPresenter
at info.magnolia.objectfactory.ObjectManufacturer.newInstance(ObjectManufacturer.java:97)
at info.magnolia.objectfactory.guice.GuiceComponentProvider.newInstanceWithParameterResolvers(GuiceComponentProvider.java:132)
at info.magnolia.ui.framework.ioc.UiContextBoundComponentProvider.lambda$newInstanceWithParameterResolvers$4(UiContextBoundComponentProvider.java:113)
at info.magnolia.ui.framework.io
@rah003
rah003 / content
Last active October 17, 2017 00:55
Example of simple embedded app for Magnolia using LoadRunner JS game
'loadRunner':
'class': 'info.magnolia.ui.framework.app.BaseApp'
'icon': 'app-icon'
'label': 'Lode Runner'
'subApps':
'main':
'class': 'info.magnolia.ui.framework.app.embedded.EmbeddedPageSubAppDescriptor'
'subAppClass': 'info.magnolia.ui.framework.app.embedded.EmbeddedPageSubApp'
'url': 'http://torinak.com/qaop#!loderunner'
2017-11-03 09:44:32,548 INFO fig.source.yaml.decoration.YamlDefinitionDecorator: Applied YAML file based decorator from [/personalization-components/decorations/pages/apps/pages/pages.subApps.detail.actions.chooseComponentAudience.yaml] to definition provider [[app] definition [pages] with reference id: [pages] from module [pages] at [pages]]
2017-11-03 09:44:32,573 INFO fig.source.yaml.decoration.YamlDefinitionDecorator: Applied YAML file based decorator from [/personalization-components/decorations/pages/apps/pages/pages.subApps.detail.actions.deleteAllComponentVariants.yaml] to definition provider [[app] definition [pages] with reference id: [pages] from module [pages] at [pages]]
2017-11-03 09:44:32,599 INFO fig.source.yaml.decoration.YamlDefinitionDecorator: Applied YAML file based decorator from [/personalization-components/decorations/pages/apps/pages/pages.subApps.detail.actions.createVariant.yaml] to definition provider [[app] definition [pages] with reference id: [pages] from module [pages] at [p
@rah003
rah003 / content
Last active November 10, 2017 03:45
2017-11-10 04:44:46,735 ERROR .magnolia.ui.admincentral.AdmincentralErrorHandler: AdmincentralUI has encountered an unhandled exception.
java.lang.RuntimeException: javax.jcr.RepositoryException: This session has been closed. See the chained exception for a trace of where the session was closed.
at info.magnolia.periscope.result.suppliers.PagesSupplier.lambda$createResult$5(PagesSupplier.java:98)
at info.magnolia.vaadin.periscope.Periscope.lambda$null$2(Periscope.java:102)
at java.util.Optional.ifPresent(Optional.java:159)
at info.magnolia.vaadin.periscope.Periscope.lambda$new$3(Periscope.java:102)
at info.magnolia.vaadin.periscope.Periscope$1.handleAction(Periscope.java:166)
at com.vaadin.event.ActionManager.handleAction(ActionManager.java:238)
at com.vaadin.event.ConnectorActionManager.handleAction(ConnectorActionManager.java:81)
at com.vaadin.event.ActionManager.handleAction(ActionManager.java:233)