Login

Username

Password





Register   Reset password

Get Cuyahoga at SourceForge.net. Fast, secure and Free Open Source software downloads

Forum

Welcome Guest Search | Active Topics | Members

Cuyahoga forum module - v1.0 Beta 1 Options
rabol
Posted: Tuesday, December 6, 2005 5:11:06 AM
Rank: Advanced Member
Groups: Member

Joined: 10/29/2005
Posts: 30
Points: 0
Location: Kiev, Ukraine
Hi

Sorry for the delay, but we are very close to a deadline at work, so I'm very busy at the moment happy

Here we go, the first beta version of my forum module.
All the basics that you could expect of a forum module is implemented
Including attachments WITHOUT saving the post first!

To-do:
Minor code cleanup
Better layout - Need help on this one!
Improve the admin part

I expect 3 beta versions before the final release version.
My hope is that the final version will be ready just around Christmas.

Note:
There are no binaries in the zip file, so you have to build the module yourself!
It is based on the latest SVN version!

File Attachment(s):
Forum_5.zip (116kb) downloaded 256 time(s).


rabol
Posted: Tuesday, December 6, 2005 2:07:12 PM
Rank: Advanced Member
Groups: Member

Joined: 10/29/2005
Posts: 30
Points: 0
Location: Kiev, Ukraine
Hi

I have just discovered that the string resource file is not updated - I'll post an update later today.

Best
Steen
rabol
Posted: Tuesday, December 6, 2005 2:42:47 PM
Rank: Advanced Member
Groups: Member

Joined: 10/29/2005
Posts: 30
Points: 0
Location: Kiev, Ukraine
Here is an updated resource file.

Best
Steen

File Attachment(s):
Strings.resx (5kb) downloaded 214 time(s).


martijnb
Posted: Tuesday, December 6, 2005 4:07:41 PM

Rank: Administration
Groups: Administration , Member

Joined: 12/30/2004
Posts: 1,674
Points: 1,824
Location: Wageningen (NL)
Great! Thanks
rabol
Posted: Tuesday, December 6, 2005 6:03:51 PM
Rank: Advanced Member
Groups: Member

Joined: 10/29/2005
Posts: 30
Points: 0
Location: Kiev, Ukraine
Hi

As of today you can get the source from: svn://www.1-4-all.dk/cuyahoga/forum
wxy
Posted: Friday, December 9, 2005 4:21:54 PM
Rank: Newbie
Groups: Member

Joined: 12/9/2005
Posts: 4
Points: 0
It is based on the latest SVN version!

SVN version,where ????
it can not find mothed RegisterStylesheet?
help
thank?
martijnb
Posted: Friday, December 9, 2005 5:03:23 PM

Rank: Administration
Groups: Administration , Member

Joined: 12/30/2004
Posts: 1,674
Points: 1,824
Location: Wageningen (NL)
The SVN repository is located at http://tijnthuus.demon.nl/svn/repos/cuyahoga/trunk.
pmgahan
Posted: Tuesday, October 10, 2006 12:06:42 AM
Rank: Advanced Member
Groups: Member

Joined: 6/4/2006
Posts: 56
Points: 27
Hi Rabol,

Do you have a newer version of the forum?

Thanks,
Patrick
pmgahan
Posted: Tuesday, October 10, 2006 12:48:09 AM
Rank: Advanced Member
Groups: Member

Joined: 6/4/2006
Posts: 56
Points: 27
I had to change this
tUser = (User)this.PageEngine.CoreRepository.ActiveSession.Load(typeof(Cuyahoga.Core.Domain.User),this._module.CurrentUserId);

into this
tUser = (Cuyahoga.Core.Domain.User)Context.User.Identity;
in the Forumviewprofile.cs file BindProfile method

and I had to modify this

hql = "from ForumPost f where f.Message like 'confusedv' order by f.DateCreated ";

into this

hql = "from ForumPost f where f.Message like confusedv order by f.DateCreated ";

in the forummodule.cs file SearchForumPosts method in order to get the search feature working.

Patrick.
pmgahan
Posted: Tuesday, October 10, 2006 6:06:56 PM
Rank: Advanced Member
Groups: Member

Joined: 6/4/2006
Posts: 56
Points: 27
Hi,

Each time I open the forum module for the first time I get the following error:

in expected: fc [from ForumCategory fc ]
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: NHibernate.QueryException: in expected: fc [from ForumCategory fc ]

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[QueryException: in expected: fc [from ForumCategory fc ]]
NHibernate.Hql.FromParser.Token(String token, QueryTranslator q) +1785
NHibernate.Hql.ClauseParser.Token(String token, QueryTranslator q) +955
NHibernate.Hql.PreprocessingParser.End(QueryTranslator q) +23
NHibernate.Hql.ParserHelper.Parse(IParser p, String text, String seperators, QueryTranslator q) +244
NHibernate.Hql.QueryTranslator.Compile() +160
NHibernate.Hql.QueryTranslator.Compile(ISessionFactoryImplementor factory, IDictionary replacements, Boolean scalar) +64
NHibernate.Impl.SessionFactoryImpl.GetQuery(String queryString, Boolean shallow) +134
NHibernate.Impl.SessionImpl.GetQueries(String query, Boolean scalar) +29
NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters) +122
NHibernate.Impl.QueryImpl.List() +84
Cuyahoga.Modules.Forum.ForumModule.GetAllCategories() +124

[Exception: Unable to get forum categories ]
Cuyahoga.Modules.Forum.ForumModule.GetAllCategories() +186
Cuyahoga.Modules.Forum.ForumList.BindCategories() +36
Cuyahoga.Modules.Forum.ForumList.Page_Load(Object sender, EventArgs e) +120
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061

Then I hit refresh and it works as supposed to.
Does anyone know what is the problem?
Thanks,
Patrick.
martijnb
Posted: Wednesday, October 11, 2006 5:37:48 AM

Rank: Administration
Groups: Administration , Member

Joined: 12/30/2004
Posts: 1,674
Points: 1,824
Location: Wageningen (NL)
I'm afraid it's tough to help you out with this. We haven't heard from the original author for quite a while and I'm afraid development has stalled entirely.

Now about the problem you're having: it might be caused by the fact that old forum module was built for Cuyahoga 1.0 and you're using the current SVN version if I'm correct?

pmgahan
Posted: Wednesday, October 11, 2006 9:54:12 PM
Rank: Advanced Member
Groups: Member

Joined: 6/4/2006
Posts: 56
Points: 27
Yes, that was the problem, I had to replace the session manager by the new one:

- Add the Castle libraries to the references

Replace the following code:

This

public class ForumModule : ModuleBase

To

public class ForumModule : ModuleBase, INHibernateModule


AND

this

this._currentAction = ForumModuleAction.ForumList;
//
// Register all the forum classes
//
_categorySortBy = CategorySortBy.None;
_categorySortDirection = SortDirection.ASC;
_forumSortBy = ForumSortBy.None;
_forumSortDirection = SortDirection.ASC;
_forumPostSortBy = ForumPostSortBy.DateCreated;
_forumPostSortDirection = SortDirection.ASC;

SessionFactory sf = SessionFactory.GetInstance();
sf.RegisterPersistentClass(typeof(ForumForum));
sf.RegisterPersistentClass(typeof(ForumCategory));
sf.RegisterPersistentClass(typeof(ForumPost));
sf.RegisterPersistentClass(typeof(ForumEmotion));
sf.RegisterPersistentClass(typeof(ForumTag));
sf.RegisterPersistentClass(typeof(ForumUser));
sf.RegisterPersistentClass(typeof(ForumFile));
base.SessionFactoryRebuilt = sf.Rebuild();

this._forumthemepath = UrlHelper.GetApplicationPath() + "Modules/Forum/Images/Standard/";


to

_sessionManager = sessionManager;

this._currentAction = ForumModuleAction.ForumList;
//
// Register all the forum classes
//

_categorySortBy = CategorySortBy.None;
_categorySortDirection = SortDirection.ASC;
_forumSortBy = ForumSortBy.None;
_forumSortDirection = SortDirection.ASC;
_forumPostSortBy = ForumPostSortBy.DateCreated;
_forumPostSortDirection = SortDirection.ASC;


this._forumthemepath = UrlHelper.GetApplicationPath() + "Modules/Forum/Images/Standard/";



And then replace for each method
this


public IList GetForumsByCategoryId(int categoryid)
{
try
{
string hql = "from ForumForum f where f.CategoryId = :categoryId " + this.GetCategoryOrderByClause("f"wink;
IQuery q = base.NHSession.CreateQuery(hql);
q.SetInt32("categoryId", categoryid);
return q.List();
}
catch (Exception ex)
{
throw new Exception("Unable to get forum by category", ex);
}
}


to


public IList GetForumsByCategoryId(int categoryid)
{
ISession session = this._sessionManager.OpenSession();

try
{
string hql = "from ForumForum f where f.CategoryId = :categoryId " + this.GetCategoryOrderByClause("f"wink;
IQuery q = session.CreateQuery(hql);
q.SetInt32("categoryId", categoryid);
return q.List();
}
catch (Exception ex)
{
throw new Exception("Unable to get forum by category", ex);
}
}


for the update or delete methods:

from this


public void SaveForum(ForumForum forum)
{
ITransaction tx = base.NHSession.BeginTransaction();
try
{
base.NHSession.SaveOrUpdate(forum);
tx.Commit();
}
catch (Exception ex)
{
tx.Rollback();
throw new Exception("Unable to save Forum ", ex);
}
}


to


[Transaction(TransactionMode.RequiresNew)]
public virtual void SaveForum(ForumForum forum)
{
ISession session = this._sessionManager.OpenSession();
try
{
session.SaveOrUpdate(forum);
}
catch (Exception ex)
{
throw new Exception("Unable to save Forum ", ex);
}
}



That's it!

I will post the complete forum as soon as I get it finished.


martijnb
Posted: Thursday, October 12, 2006 2:35:10 AM

Rank: Administration
Groups: Administration , Member

Joined: 12/30/2004
Posts: 1,674
Points: 1,824
Location: Wageningen (NL)
That looks perfectly fine now. Good job!
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Yet Another Forum.net version 1.9.0 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.