since ‎09-10-2017
‎10-12-2019
tim-schwalbe-NZ
Level 3
Re: Trigger scheduler once after deployment
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
Yes that what i thought, but then it will block all other components on startup because its maybe running for 30 minutes. So no chance to do it this way. I have to create a new Service and trigger it by a custom scheduler. Thanks for all replies.

Views

964

Likes

0

Replies

0
Re: Trigger scheduler once after deployment
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
If want to achieve that the scheduler runs directly on statup/after deployment but it seems it just starting after 4 hours for the first time and after that every 4 hours. The problem is the scheduler pulls data into AEM and otherwise I have to wait 4 hours for the very first execution.So the component shows nothing for the first 4 hours.

Views

967

Likes

0

Replies

0
Re: Trigger scheduler once after deployment
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
@Component(enabled = true, immediate = true, metatype = true, label = "cron job", description = "cron job ")@Service(value = Runnable.class)@Properties({ @Property(name = "scheduler.expression", value = "0 0/15 * * * ?", description = "Cron-job expression Ex: '0 0/15 * * * ?' for 15 Mins"), @Property(name = "scheduler.concurrent", boolValue = false)})@Slf4jpublic class TestScheduler implements Runnable {...}

Views

972

Likes

0

Replies

0
Re: Trigger scheduler once after deployment
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
I have an actual scheduler but it runs not on startup only after the 4 hours of waiting and I want it the be run immediately.What's that: tireDesignsFetchJobFactory.createJob()

Views

964

Likes

0

Replies

0
Re: Trigger scheduler once after deployment
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
Can you point me to an example?

Views

970

Likes

0

Replies

0
Trigger scheduler once after deployment
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
Hi guys,is it possible to trigger a scheduler once after every deployment? So the regular schedule time is 4 hours, but it will took 4 hours for the first run.Any property to set?Br,Tim

Views

3.6K

Likes

2

Replies

16
Re: Error during build -> commons-io sling-mock
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
I think its more a cross dependency issue with commons-io than an AEM problem.

Views

1.2K

Likes

0

Replies

0
Re: Error during build -> commons-io sling-mock
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
I don't know it do run locally and does build also in another pipeline.the error occurs building on jenkins an artifact and fails with this message. It's a build process out of my control so I am not really able to reproduce it.

Views

1.2K

Likes

0

Replies

2
Re: Create and Set OSGI config variable through dialog
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
Yes that's all I found. Is there maybe another way? start a the same service for every domain with different configs, without duplicating the service with another name?GooglemapsService --> config.plGooglemapsService --> config.comGooglemapsService --> config.nl...

Views

671

Likes

0

Replies

0
Re: Create and Set OSGI config variable through dialog
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
Thanks Ratna So there is really no possibility to create them during runtime? Maybe someone knows a little bit more?

Views

672

Likes

0

Replies

0
Error during build -> commons-io sling-mock
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
Hello I don't know which can cause this issue during build. May I have to close something? inputstream? some of the mocking stuff?my Test:@Testpublic void testDoGetForEnglishPressReleaseWithReleaseImage() throws IOException, WCMException { context.requestPathInfo().setSelectorString("en"); context.requestPathInfo().setExtension("xml"); Class clazz = RssFeedServletTest.class; InputStream inputStream = clazz.getResourceAsStream( "/servlets/rss/result-release-en.txt"); String rssFeedExpected = File...

Views

1.4K

Likes

0

Replies

4
Create and Set OSGI config variable through dialog
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
Hi guys,is it possible to set a OSGI config variable through a dialog? For Example I want enable the authors to change an API Key, but not only to change it I want to create a variable according to the baseurl the component/service is running on.Test.com uses one config variable which is created on startup -> com.test.apikeyTest-test.com uses another config which is created on startup -> com.test-test.apikeyBr,Tim

Views

1.5K

Likes

2

Replies

6
Re: Deleting nodes in JCR via Author dialog
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
Hi, does this mean its not possible to do it directly via the dialog? AEM build-in functionality? What I need is a function behind the deletion button (the red minus) that deletes the node with the according name from the multifield as shown in the picture above.

Views

557

Likes

0

Replies

0
Deleting nodes in JCR via Author dialog
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
I need to create a component (say componentA) whose aim is to allow a user to add a variable number of components (choosing from componentB and componentC). So componentA is like a parsys which contains others components.I'm using a multifieldpanel to create a component's dialog with a user controlled number of field. Something like this: The problem is when I try to eliminate one of the elements added directly from the dialog of componentA: the element is effectively eliminated from the dialog ...

Views

1.1K

Likes

0

Replies

4
Re: Is a sheduler always executed on publish?
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
And how is the content brought to pub? is there a mechanism to publish it automatically? It's a scheduler which runs every 15 minutes.The scheduler only gets data for a servlet.

Views

986

Likes

0

Replies

2
Is a sheduler always executed on publish?
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
I have written a sheduler, it seems to run in author instance but not in publish. Is this the normal behavior?Which JCR is the publish instance using? The data is in author JCR but not in publish JCR.Are there some steps required to bring the data from author jcr to publish JCR or is it required to activate the sheduler on publish also?Thanks and regards!

Views

1.1K

Likes

0

Replies

4
Re: mvn clean install -autoInstallPackage fails due Connection refused
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
Okay I got it now. It was a wrong config in the parent pom...

Views

1.5K

Likes

0

Replies

0
mvn clean install -autoInstallPackage fails due Connection refused
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
Hello, I am developing locally with an author instance only and it has always worked. But I think I deleted something in my instance and now it fails when I try to deploy the package. Is there any configuration to turn of deployment to publish? It looks strange that maven tries to deploy to http://localhost:4503/ It already tried a fresh AEM instance and it does also not work. I tried it for the last 4 hours and set everything up as far as I know.Does the require a system user? I have deleted th...

Views

3.4K

Likes

0

Replies

4
Re: Store config file in JCR and Access on publish
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
At the moment we write our osgi config in code and set it via code, but our deployment process is not that mature and we deploy only once a week. So I want a solution to change configuration as an author and not as a administrator or by deploy again.We have a lot of projects and don't want to go to every project environment and set it via OSGI console.Maybe there is a better way to enable authors to configure a servlet for example?Can you point me to an example how to use the system user?Br,Tim

Views

510

Likes

0

Replies

0
Store config file in JCR and Access on publish
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
Hi guys,I am trying to read a config file from a path in JCR. For example apps/company/company/config/rss-config.properties within a servlet/services.This is working on the author instance but not on publish. Is there a path where to put these files and access them also in the publish instance?They also should not be accessible for unauthorized people so only from the servlet.Can you give me a solution or some hints to solve this issue?The reason for doing this is that we want an author to chang...

Views

691

Likes

0

Replies

4
Re: @reference in Unit Tests
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
Yes I know it works, but the question is how to inject the Reference during unit tests?@Testpublic void testDoGetForJson() throws IOException, WCMException { IRssFeed rssFeed = new RssFeedImpl(); context.registerInjectActivateService(rssFeed); context.requestPathInfo().setSelectorString("rss"); context.requestPathInfo().setExtension("xml"); context.currentPage("/content/de/ueber-uns/presse/press-releases"); rssFeedServlet.doGet(context.request(), context.response());}Then I get this error:org.ap...

Views

1.3K

Likes

0

Replies

0
Re: @reference in Unit Tests
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
Hi, I think you have misunderstood me.I want to inject the RSSImpl inside the servlet not in the test. @Slf4jpublic class RssFeedServlet extends SlingSafeMethodsServlet { @Reference IRssFeed rssFeed; private final SimpleDateFormat ISO_FORMAT = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", Locale.ENGLISH); private String serverName;}

Views

1.4K

Likes

0

Replies

0
Re: @reference in Unit Tests
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
I think it's something wrong in the pom.xmlWhen I do this:IRssFeed rssFeed = new RssFeedImpl();context.registerInjectActivateService(rssFeed);I got this error, so the plugin does not work correctly and does not create the manifest for it.1232 [main] INFO org.apache.jackrabbit.oak.plugins.index.IndexUpdate - Found a new index node [reference]. Reindexing is requested1239 [main] INFO org.apache.jackrabbit.oak.plugins.index.IndexUpdate - Reindexing will be performed for following indexes: [/oak:ind...

Views

1.3K

Likes

0

Replies

0
Re: @reference in Unit Tests
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
It works when deployed to an aem instance. It just don't get injected during the test.And its also in the context after doing: IRssFeed rssFeed = new RssFeedImpl();context.registerService(rssFeed);

Views

1.3K

Likes

0

Replies

0
Re: @reference in Unit Tests
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
Here is my pom file: 4.0.0 com.test.aem test-com-relaunch 1.0.0-SNAPSHOT ../pom.xml test-com-relaunch.core bundle test-com-relaunch - core Core bundle for test-relaunch gson;inline=true; ${project.build.directory} jacoco-ut.exec ${jacoco.outputDir}/coverage-reports/${jacoco.out.ut.file} org.jacoco jacoco-maven-plugin 0.7.9 pre-unit-test prepare-agent ${project.build.directory}/coverage-reports/jacoco-ut.exec surefireArgLine post-unit-test test report ${project.build.directory}-->org.apache.felix-->maven-scr-plugin-->1.24.0-->-->org.apache.felix.scrplugin.bnd.SCRDescriptorBndPlugin;destdir=${project.build.outputDirectory};-->...

Views

1.3K

Likes

0

Replies

0
@reference in Unit Tests
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
Hello, hopefully the last question this week.I inject my Service in the servlet with:@ReferenceIRssFeed rssFeed;The question is now how to do it with AEM Context.@Testpublic void testDoGetForJson() throws IOException, WCMException { context.registerService(IRssFeed.class, new RssFeedImpl());}I also tried the other ways, but the rssFeed is always null.// register OSGi servicecontext.registerService(MyClass.class, myService);// or alternatively: inject dependencies, activate and register OSGi servorg.apache.felix.scrplugin.bnd.SCRDescriptorBndPlugin;destdir=${project.build.outputDirectory};-->...

Views

5.1K

Likes

0

Replies

13
Re: AEM Mocks can not adaptTo(Node.class) from par
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
I also solved this issue, it was an old version of commons-io in mail jet. After excluding it the error disappeared.you can look at the dep tree with: mvn dependency:tree -Dverbose com.mailjet mailjet-client 4.0.6-SNAPSHOT org.apache.commons commons-io

Views

1.4K

Likes

0

Replies

0
Re: AEM Mocks can not adaptTo(Node.class) from par
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
I found this image which seems to point to use the right Mock ResourceResolverBut after adding the following dep to my pom.xml I get an error. org.apache.sling org.apache.sling.testing.sling-mock-oak 2.0.2 test Error:1784 [main] INFO org.apache.jackrabbit.oak.plugins.index.IndexUpdate - Found a new index node [reference]. Reindexing is requested1797 [main] INFO org.apache.jackrabbit.oak.plugins.index.IndexUpdate - Reindexing will be performed for following indexes: [/oak:index/slingResourceType...

Views

1.4K

Likes

2

Replies

0
AEM Mocks can not adaptTo(Node.class) from par
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
Hello, I try to adapt a parsys to Node, it does work with real AEM instance, but with mocking it returns null as subPageNode. As you see in debug mode the par is there.Can any explain why this happens?Br,Tim

Views

3.0K

Likes

2

Replies

2
Re: Create par with AEM Mocks API
Avatar

tim-schwalbe-NZ

tim-schwalbe-NZ
- Adobe Experience Manager
Hello I found a solution.It is very easy to load the content from AEM as a JSON and load it in your test case.Go to your Page and add the extension: press-releases.html.infinity.jsonOnce you have your JSON tree structure you can load it:context.load().json("/press-release-test-data/pressrelease1-testdata.json", "/content/de/ueber-uns/presse/press-releases/2017/release1");Thanks for listening

Views

353

Likes

0

Replies

0