cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Posts Not Automatically Posting (in preview)

foosetv
Champ in-the-making
Champ in-the-making
I'm having an odd issue that I'm looking for some help on. I have a Quick Start site that for some reason will not automatically post the latest articles using the dynamic method. The only time I can get the section.articles "folder" to grab the newest posts is if I make a change in the metadata Query field and save. It seems only then alfresco will refresh and grab the new articles. I have the refresh set to 1 minute and I don't believe I have anything odd in my query.

SELECT d.* FROM cmis:document AS d JOIN ws:webasset AS wa ON d.cmis:objectId = wa.cmis:objectId WHERE d.cmis:objectTypeId='D:ws:article' AND in_tree(d, '${section:.}') ORDER BY wa.ws:publishedTime DESC

It's almost as if CRON wasn't working or the site isn't connected to a CRON in any way. I'm not sure how all the backend of the WCMQS works to perform dynamic posts, is there a setting I have incorrect somewhere? If it makes any difference I'm running this instance of Alfresco on a Linux server. What's odd is that I have this QS site replicated on my local development box which is a package install of Alfresco on a Windows machine and the dynamic posts seem to work correctly. Is there some additional configuration I need to do on a Linux install verses a Windows install for the QS dynamic posts to function?
6 REPLIES 6

bremmington
Champ on-the-rise
Champ on-the-rise
That's odd. Do you find that, once you've nudged it by editing the query, it then picks up the schedule again?

There are two properties that are looked at when automatically refreshing the dynamic asset collections: "ws:isDynamic" and "ws:refreshAt". The code that checks which asset collections need refreshing is in the DynamicCollectionProcessor class. Are you familiar with the Node Browser? If so, it would be useful to know what the values of these properties are on the asset collection node that you're having trouble with.

The code that causes the dynamic asset collection to be refreshed when you change the query is the onUpdateProperties method in the WebassetCollectionType class. The code that actually runs the query and associates the results with the asset collection is in the WebassetCollectionHelper class. This is also the code that sets the ws:refreshAt property.

Reviewing the code again just now, the logic seems to be correct, so there's obviously something unexpected happening. If you can, let me know what the values are of those properties are (and how the refreshAt property relates to the current time).

Something else that may be useful is boosting the logging in that area of the code. Try adding this line to your log4j.properties file:

log4j.logger.org.alfresco.module.org_alfresco_module_wcmquickstart.jobs.DynamicCollectionProcessor=debug

foosetv
Champ in-the-making
Champ in-the-making
No, nudging the query doesn't kickstart the schedule again. It still sits idle after the change.

Unfortunately I don't know much about the Node Browser. I know where it is located but I don't know how to use it. I took a look at it but I'm not sure how how to search for the properties you mentioned in there. Is there some instructions or guide I can follow that would help me with the Node Browser?

I'll try adding that line to the log later on tonight when my traffic dies down and I can restart the application.

bremmington
Champ on-the-rise
Champ on-the-rise
Unfortunately there's not much information about the node browser. Here's a quick set of instructions to get to the relevant data:
  1. Open the node browser

  2. In the list of available stores, select "workspace://SpacesStore"

  3. In the "Children" section of the page that's shown, select "company_home"

  4. In the "Children" section of the page that's shown, select "sites"

  5. In the "Children" section of the page that's shown, select the Share site that you're using for your WQS installation

  6. In the "Children" section of the page that's shown, select "documentLibrary"

  7. Keep drilling down the folder structure in this way to get to the problematic asset collection

  8. On each page that the node browser shows you, there is a "Properties" section that shows you every property set on that node.
When you have reached your asset collection node, you should see values for these properties:

{http://www.alfresco.org/model/website/1.0}minsToQueryRefresh
{http://www.alfresco.org/model/website/1.0}refreshAt
{http://www.alfresco.org/model/website/1.0}isDynamic

Let me know what these values are, as well as the local time when you look at them. The refreshAt property should be greater than currentTime and less than (currentTime + minsToQueryRefresh). isDynamic should be "true". minsToQueryRefresh should be whatever you've set (probably "1", based on your initial post).

foosetv
Champ in-the-making
Champ in-the-making
Sorry for my delay in replying. Thanks for pointing out the node browser and the help in navigating it. I think I have a basic grasp of it and I think it can be very helpful.

As for the values you've mentioned here is what I have:

I pulled this data on Mar. 02, 18:11:34 UTC


http://www.alfresco.org/model/website/1.0}minsToQueryRefresh     1
{http://www.alfresco.org/model/website/1.0}refreshAt             Tue Mar 01 17:23:20 UTC 2011
{http://www.alfresco.org/model/website/1.0}isDynamic             true

It appears that the "refreshAt" value is in the past. Just to be clear, should this node be constantly updating upon each refresh?

bremmington
Champ on-the-rise
Champ on-the-rise
Very strange. That data is indicating that that particular asset collection was last updated at Mar 01 17:22:20 UTC 2011, but should have been updated again at Mar 01 17:23:20 UTC 2011. I can't imagine why it wasn't. I'll check the code again - remind me what version you're using?

Do you have any other dynamic asset collections on this installation that are being updated correctly? Please would you post the query that you have defined on the asset collection? In fact posting all the information from the node browser window may be useful. Are any errors appearing in the log file? Certainly if an error occurs while executing the query then the refreshAt property won't be updated.

foosetv
Champ in-the-making
Champ in-the-making
I'm using 3.4d from a nightly build from 1/12/11. I do not have a successful dynamic post on my live install but I do have sucessful dynamic posts on my local development box. They are both using the same builds the only difference being my live server is run on a Linux platform whereas my dev box is running the Windows version.

I will try looking at the log file. I will try to make it do a dynamic post after editing the query again and see any fresh errors. I will post what I find when I see it. I will also post a copy of the entire node browser info. I'll put it in another reply as I'm juggling another project at the moment.  Smiley Sad