Thanks a lot Greg, It really cleared me about the work flow of roller and how we get the results from database. I was really struggling understanding the roller flow, day by day I am becoming more familiar to the structure of roller. One thing I was having problem today was understanding the CreateUser form, for creating the new user we have form in which action marked is createUser!save. I did not find any servlet mentioned in web.xml for this and how its using CreateUser class.

<s:form action="createUser!save">
.
.
.
</s:form>

I will be very thankful to you if you can explain me how this struts form works ?

Thanks
Gaurav

On Tuesday 17 December 2013 07:29 PM, Greg Huber wrote:
Gaurav,

following through the logic:

#set($pinnedEntries = $site.getPinnedWeblogEntries(5))
  #foreach($pinnedEntry in $pinnedEntries)


$site == org.apache.roller.weblogger.ui.rendering.model.SiteModel

So if you check getPinnedWeblogEntries(..) of SiteModel:

/**
      * Get pinned entries.
      * @param sinceDays Only consider weblogs updated in the last sinceDays
      * @param length    Max number of results to return
      */
     public List getPinnedWeblogEntries(int length) {
         List results = new ArrayList();
         try {
             Weblogger roller = WebloggerFactory.getWeblogger();
             WeblogEntryManager wmgr = roller.getWeblogEntryManager();
             List weblogs = wmgr.getWeblogEntriesPinnedToMain(length);
             for (Iterator it = weblogs.iterator(); it.hasNext();) {
                 WeblogEntry entry = (WeblogEntry) it.next();
                 results.add(WeblogEntryWrapper.wrap(entry, urlStrategy));
             }
         } catch (Exception e) {
             log.error("ERROR: fetching pinned weblog entries", e);
         }
         return results;
     }

It retrieves a list worf weblogs:

List weblogs = wmgr.getWeblogEntriesPinnedToMain(length);

from method getWeblogEntriesPinnedToMain of

org.apache.roller.weblogger.business.jpa.JPAWeblogEntryManagerImpl


public List getWeblogEntriesPinnedToMain(Integer max)
     throws WebloggerException {
         Query query = strategy.getNamedQuery(
                 "WeblogEntry.getByPinnedToMain&statusOrderByPubTimeDesc");
         query.setParameter(1, Boolean.TRUE);
         query.setParameter(2, WeblogEntry.PUBLISHED);
         if (max != null) {
             query.setMaxResults(max);
         }
         return query.getResultList();
     }

it will execute a named query:

WeblogEntry.getByPinnedToMain&statusOrderByPubTimeDesc

from:
app/src/main/resources/org/apache/roller/weblogger/pojos/WeblogEntry.orm.xml

<named-query
name="WeblogEntry.getByPinnedToMain&amp;statusOrderByPubTimeDesc">
             <query>SELECT w FROM WeblogEntry w WHERE w.pinnedToMain = ?1
AND w.status = ?2 ORDER BY w.pubTime DESC</query>
</named-query>

Is this OK?

Cheers Greg




On 17 December 2013 13:33, Gaurav <gauravsain...@gmail.com> wrote:

Hello,

I am still not able to populate the results in frontpage theme. The
condition I see in this theme is different from other is this
[#foreach($pinnedEntry in $pinnedEntries)]. Can any one explain me what is
pinnedEntry here ? As in that theme we still use #foreach($entry in
$entries) for the search results, that is why I was saying search results
are coming fine.

Thanks
Gaurav

On Tuesday 17 December 2013 03:29 PM, Greg Huber wrote:

It should work ok, the front page theme is for the initial front page
weblog, right?

Cheers Greg.


On 17 December 2013 09:38, Gaurav <gauravsain...@gmail.com> wrote:

  Hello,
I tried using the frontpage theme of roller, but it seems like this theme
has some issue as It did not show up any data (no blogs, hottags, hot
blogs
etc.)
But when I tried searching in the search of that theme, then it shows the
blogs. I am looking into this, just want to know Is anyone out there for
whom this theme is working perfectly fine ?

--
Regards,
*Gaurav Saini*
/Developer, Digital Marketing and Pursuing B.Tech/
/Email: gauravsain...@gmail.com/



Reply via email to