<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get Alfresco context and audit ScheduledJob in java? in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-alfresco-context-and-audit-scheduledjob-in-java/m-p/27725#M11885</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all I hope you are not (re-)defining the audit service and audit component beans in your context file. Those beans already exist and you should not be messed with it. You also do not need to define your own scheduler factory - you can just re-use the one already provided by Alfresco. That way your jobs would even show up in the scheduled jobs admin console tool (from either Enterprise Edition or OOTBee Support Tools).&lt;/P&gt;&lt;P&gt;As to your question, simply inject the audit component into your job via the job data map and you should be perfectly fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Oct 2017 20:39:23 GMT</pubDate>
    <dc:creator>afaust</dc:creator>
    <dc:date>2017-10-12T20:39:23Z</dc:date>
    <item>
      <title>How to get Alfresco context and audit ScheduledJob in java?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-alfresco-context-and-audit-scheduledjob-in-java/m-p/27724#M11884</link>
      <description>Hi eveybody,i need to audit my scheduled job, which is defined in xml beans and java class, but i m not able to get context from java class or call auditComponent.recordValues() method. Is there some guide for this in java or did i miss somethingthis is my scheduledjob definition xml&amp;lt;?xml version</description>
      <pubDate>Wed, 11 Oct 2017 09:41:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-alfresco-context-and-audit-scheduledjob-in-java/m-p/27724#M11884</guid>
      <dc:creator>jrautner</dc:creator>
      <dc:date>2017-10-11T09:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Alfresco context and audit ScheduledJob in java?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-alfresco-context-and-audit-scheduledjob-in-java/m-p/27725#M11885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all I hope you are not (re-)defining the audit service and audit component beans in your context file. Those beans already exist and you should not be messed with it. You also do not need to define your own scheduler factory - you can just re-use the one already provided by Alfresco. That way your jobs would even show up in the scheduled jobs admin console tool (from either Enterprise Edition or OOTBee Support Tools).&lt;/P&gt;&lt;P&gt;As to your question, simply inject the audit component into your job via the job data map and you should be perfectly fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 20:39:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-alfresco-context-and-audit-scheduledjob-in-java/m-p/27725#M11885</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2017-10-12T20:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Alfresco context and audit ScheduledJob in java?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-alfresco-context-and-audit-scheduledjob-in-java/m-p/27726#M11886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Axel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you for your help, it works now. But i get in the trouble in other way. I was testing code from&amp;nbsp;AuditComponentTest.java class testAudit_basic method. Not this method but i tried to use this as a sample audit call. Everything works fine, no exceptions, but also no entries in database. Could you give me some advices what am i missing or what im doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your time&lt;/P&gt;&lt;P&gt;Jakub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ps:&lt;/P&gt;&lt;P&gt;final RetryingTransactionCallback&amp;lt;Map&amp;lt;String,Serializable&amp;gt;&amp;gt; testCallback = new RetryingTransactionCallback&amp;lt;Map&amp;lt;String,Serializable&amp;gt;&amp;gt;() {&lt;BR /&gt; &lt;BR /&gt; @Override&lt;BR /&gt; public Map&amp;lt;String, Serializable&amp;gt; execute() throws Throwable {&lt;BR /&gt; &lt;BR /&gt; LOG.info("execute Start");&lt;BR /&gt; Map&amp;lt;String, Serializable&amp;gt; values = new HashMap&amp;lt;&amp;gt;(13);&lt;BR /&gt; &lt;BR /&gt; values.put("/3.1/4.1", new Long(41));&lt;BR /&gt; values.put("/3.1/4.2", "42");&lt;BR /&gt; values.put("/3.1/4.3", new Date());&lt;BR /&gt; values.put("/3.1/4.4", "");&lt;BR /&gt; values.put("/3.1/4.5", null);&lt;BR /&gt; &lt;BR /&gt; Map&amp;lt;String, Serializable&amp;gt; ret = new HashMap&amp;lt;&amp;gt;();&lt;BR /&gt; &lt;BR /&gt; ret = auditComponent.recordAuditValues("/test/one.one/two.one", values);&lt;BR /&gt; int count = 0;&lt;BR /&gt; LOG.info("KeySetSize: " + ret.keySet().size());&lt;BR /&gt; for (String iterable_element : ret.keySet()) {&lt;BR /&gt; &lt;BR /&gt; String key = iterable_element.toString();&lt;BR /&gt; String value = ret.get(iterable_element).toString();&lt;BR /&gt; LOG.info(count + ", Key: "+key + ", value: " + value );&lt;BR /&gt; count++;&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; LOG.info("execute END");&lt;BR /&gt; return ret;&lt;BR /&gt; // TODO Auto-generated method stub&lt;BR /&gt; //return null;&lt;BR /&gt; }&lt;BR /&gt; };&lt;BR /&gt; &lt;BR /&gt; RunAsWork&amp;lt;Map&amp;lt;String, Serializable&amp;gt;&amp;gt; testRunsAs = new RunAsWork&amp;lt;Map&amp;lt;String,Serializable&amp;gt;&amp;gt;() {&lt;BR /&gt; &lt;BR /&gt; @Override&lt;BR /&gt; public Map&amp;lt;String, Serializable&amp;gt; doWork() throws Exception {&lt;BR /&gt; // TODO Auto-generated method stub&lt;BR /&gt; LOG.info("DO WORK Start");&lt;BR /&gt; return transactionService.getRetryingTransactionHelper().doInTransaction(testCallback);&lt;BR /&gt; }&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;result of this is empty map.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 11:47:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-alfresco-context-and-audit-scheduledjob-in-java/m-p/27726#M11886</guid>
      <dc:creator>jrautner</dc:creator>
      <dc:date>2017-10-17T11:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Alfresco context and audit ScheduledJob in java?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-alfresco-context-and-audit-scheduledjob-in-java/m-p/27727#M11887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In order for any data to get written to the database you need to have an audit application configuration to actually map and record data. The audit component is only used to "offer" data for recording. Elements that use that record API are called "audit data producers" while an audit application would be an "audit data consumer".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 20:27:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-alfresco-context-and-audit-scheduledjob-in-java/m-p/27727#M11887</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2017-10-17T20:27:04Z</dc:date>
    </item>
  </channel>
</rss>

