List Info

Thread: recent comments




recent comments
country flaguser name
United States
2007-09-11 06:08:24
blojsom 3.2

I have an issue with the display of my recent comments when
clicking
on the template url corasponding to
the actual comment entries made.   I'm running my own server
and have
blojsom configured via Mod proxy:

My set up is as follows:

# Mod_proxy_ajp
      #

        Alias /blog "/blojsom/blog/default/"
        <Directory
"/blojsom/blog/default/">
         Options Indexes FollowSymLinks
         AllowOverride None
         allow from all
        </Directory>

        ProxyPass /blog
ajp://localhost:8009/blojsom/blog/default/
        ProxyPassReverse /blog
ajp://localhost:8009/blojsom/blog/ 
default/

My Properties relative to blog urls are as follows:

blog-url   http://www2.macunkie
.com:82/blog
blog-base-url http://www2.macun
kie.com:82/blojsom

With this configuration ALL other functions work fine in my
blog.

My template code is as follows:

Template code:

<h5>
              <img src="/images/comments.png"
height="16" width="16"
alt="Comments Icon"/>
              Recent Comments
            </h5>
            <ul class="listbar">
            #foreach ($comment in
$BLOJSOM_PLUGIN_RECENT_COMMENTS)
              #FriendlyPermalink($comment.getEntry())
              <li>
                <a
href="$entryLink#comment-$comment.getId()">
                  $comment.getAuthor():
                  #set ( $sanitisedComment = 
$comment.getComment
().replaceAll("<.*>",""))
                  #if ($sanitisedComment.length() > 20)
                    $sanitisedComment.substring(0, 20)...
                  #else
                    $sanitisedComment
                  #end
                </a>
              </li>
            #end
            </ul>

My plugin chain contains ... comment, comment-moderation.

My issue is that the comments are working as well as the
moderation.
When I click on the relative template link to view the
actual entry
it displays

http://www2
.macunkie.com:82/blog/General/$entry.getDateAsFormat
('yyyy')/$entry.getDateAsFormat('MM')/$entry.getDateAsFormat
('dd')/
$entry.getPostSlug()#comment-2

in my browser and not a page containing the comments.

I recently got help from Cliff and his suggestions were as
follows:

"I can't spot anything obviously wrong from the
code."

At the moment I suspect that it has something to do with the
line
#FriendlyPermalink($comment.getEntry())

somehow the FriendlyPermalink macro is not getting any value
from
$comment.getEntry(), and hence you're seeing those $entry
code in your
recent comments link.

Try adding the line:
Debugging entry here: $comment.getEntry() ...

right below the line
#foreach ($comment in $BLOJSOM_PLUGIN_RECENT_COMMENTS)

I tried his suggestions and got no new info.   Can someone
tell me
why possibly the FriendlyPermalink macro is not getting any
value?

Thanks for any help,

Samuel.



------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Blojsom-users mailing list
Blojsom-userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers

Re: recent comments
user name
2007-09-11 08:06:44
I just checked my deployed Blojsom instance, and I just remembered that I made a tweak to Comment.hbm.xml.

Blojsom by default does not load Entry object associated to the Comment object. Hence that explains the problem you're having, you get the comments without any entry.

I think your configurations are just fine, it's not an issue with mod proxy or your other configuration.

Try adding this line below to your WEB-INF/classes/Comment.hbm.xml file
<many-to-one name=";entry"; column=&quot;entry_id" class=&quot; org.blojsom.blog.database.DatabaseEntry&quot; lazy=";false"; insert=&quot;false&quot; update=&quot;false&quot;/>

Though order is not an issue, I put it between status and meta data
 ; &nbsp; &nbsp; &nbsp; <property name=";status&quot;>
&nbsp; &nbsp;   ; &nbsp; &nbsp;  <column name=";status&quot; length=&quot;255";/>
&nbsp; &nbsp; &nbsp; &nbsp; </property>

&nbsp; &nbsp;   ;  <!-- put that line here -->

&nbsp; &nbsp;   ;  <map name=";metaData&quot; table=&quot;CommentMetadata"; cascade=&quot;all&quot; inverse=&quot;false&quot; lazy=";false"; order-by=&quot;metadata_key";>
&nbsp; &nbsp; &nbsp;   ; &nbsp;  <key column=&quot;comment_id" not-null=&quot;true&quot;/>
&nbsp;   ; &nbsp; &nbsp; &nbsp;  <map-key column=&quot;metadata_key" type=";string&quot;/>
&nbsp; &nbsp; &nbsp;   ; &nbsp;  <element column=&quot;metadata_value"; type=";string&quot;/>
&nbsp;   ; &nbsp;  </map&gt;
 
Note that loading entry for every comment will add extra work to Blojsom, but I never have any problem with it.

Sorry I didn't recall this earlier. Haven't touched Blojsom source for ages.

On 9/11/07, Samuel V. Green III < unkiecox.net">unkiecox.net&gt; wrote:
blojsom 3.2

I have an issue with the display of my recent comments when clicking
on the template url corasponding to
the actual comment entries made. ;  I'm running my own server and have
blojsom configured via Mod proxy:

My set up is as follows:

# Mod_proxy_ajp
 &nbsp;   ; #

&nbsp;   ; &nbsp; &nbsp;Alias /blog "/blojsom/blog/default/&quot;
 &nbsp; &nbsp;   ; <Directory "/blojsom/blog/default/&quot;>
&nbsp; &nbsp; &nbsp; &nbsp;  Options Indexes FollowSymLinks
&nbsp; &nbsp; &nbsp; &nbsp;  AllowOverride None
 ; &nbsp; &nbsp; &nbsp;  allow from all
   ; &nbsp; &nbsp; &lt;/Directory>

&nbsp; &nbsp; &nbsp; &nbsp; ProxyPass /blog ajp://localhost:8009/blojsom/blog/default/
  ; &nbsp; &nbsp; &nbsp;ProxyPassReverse /blog ajp://localhost:8009/blojsom/blog/
default/

My Properties relative to blog urls are as follows:

blog-url&nbsp;  http://www2.macunkie.com:82/blog
blog-base-url http://www2.macunkie.com:82/blojsom

With this configuration ALL other functions work fine in my blog.

My template code is as follows:

Template code:

<;h5>
&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp;<img src="/images/comments.png&quot; height=&quot;16" width=&quot;16"
alt=";Comments Icon"/>
 ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp;Recent Comments
&nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;</h5>
 ; &nbsp; &nbsp; &nbsp; &nbsp;   ;<ul class=&quot;listbar&quot;>
&nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp;#foreach ($comment in $BLOJSOM_PLUGIN_RECENT_COMMENTS)
 &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; #FriendlyPermalink($comment.getEntry())
 ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp;<li>;
 &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &lt;a href=";$entryLink#comment-$comment.getId()"&gt;
 &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ;$comment.getAuthor():
 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; #set ( $sanitisedComment = &nbsp;$comment.getComment
().replaceAll(";<.*>",&quot;"))
  ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; #if ($sanitisedComment.length() > 20)
   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp;$sanitisedComment.substring(0, 20)...
&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  #else
 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp; $sanitisedComment
&nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; #end
 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &lt;/a>
&nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;</li>
 ; &nbsp; &nbsp; &nbsp; &nbsp;   ;#end
 ; &nbsp; &nbsp; &nbsp; &nbsp;   ;</ul>;

My plugin chain contains ... comment, comment-moderation.

My issue is that the comments are working as well as the moderation.
When I click on the relative template link to view the actual entry
it displays

http://www2.macunkie.com:82/blog/General/$entry.getDateAsFormat
('yyyy')/$entry.getDateAsFormat(&#39;MM')/$entry.getDateAsFormat('dd&#39;)/
$entry.getPostSlug()#comment-2

in my browser and not a page containing the comments.

I recently got help from Cliff and his suggestions were as follows:

"I can't spot anything obviously wrong from the code.";

At the moment I suspect that it has something to do with the line
#FriendlyPermalink($comment.getEntry())

somehow the FriendlyPermalink macro is not getting any value from
$comment.getEntry(), and hence you're seeing those $entry code in your
recent comments link.

Try adding the line:
Debugging entry here: $comment.getEntry() ...

right below the line
#foreach ($comment in $BLOJSOM_PLUGIN_RECENT_COMMENTS)

I tried his suggestions and got no new info. ;  Can someone tell me
why possibly the FriendlyPermalink macro is not getting any value?

Thanks for any help,

Samuel.



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Blojsom-users mailing list
Blojsom-userslists.sourceforge.net">Blojsom-userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/blojsom-users

Re: recent comments
country flaguser name
United States
2007-09-11 18:22:58
I placed the below code exactly as you sent and got these
errors in  
attached file:



--Samuel.
On Sep 11, 2007, at 6:06 AM, Cliffano Subagio wrote:

> <many-to-one name="entry"
column="entry_id" class="  
> org.blojsom.blog.database.DatabaseEntry"
lazy="false"  
> insert="false" update="false"/>


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Blojsom-users mailing list
Blojsom-userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/blojsom-u
sers

  
Re: recent comments
country flaguser name
United States
2007-09-19 20:12:13
It works perfectly!
Thanks Cliff!

Cheers!

--Samuel.
On Sep 19, 2007, at 4:52 PM, Cliffano Subagio wrote:

Sam,

I accidentally put a space between class=" and org.blojsom.blog.database.DatabaseEntry when typing the code snippet in that email.
Please remove that space and try it again, sorry about that.


On 9/12/07, Samuel V. Green III < unkiecox.net">unkiecox.net > wrote:
I placed the below code exactly as you sent and got these errors in
attached file:



--Samuel.
On Sep 11, 2007, at 6:06 AM, Cliffano Subagio wrote:

&gt; <many-to-one name="entry" column="entry_id" class="
&gt; org.blojsom.blog.database.DatabaseEntry " lazy="false"
> insert="false" update="false"/>





[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )