start new module

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
4/8/2009 12:56:32 PM
Gravatar
Total Posts 71

start new module

hi,

can anyone give me a simple way to crreame my own module,

 

4/8/2009 1:52:11 PM
Gravatar
Total Posts 18439

Re: start new module

http://www.mojoportal.com/hello-world-developer-quick-start.aspx

Hope it helps,

Joe 

4/8/2009 2:59:00 PM
Gravatar
Total Posts 71

Re: start new module

hi ,joe

 can you give me other tutorials or idea for do better interact with mojoportal in my module(like create my own tables on default database or authenticate and etc.) or witch of existed modules are simple and helpful ?

 

thank you for your rapid reply

 

4/9/2009 5:34:05 AM
Gravatar
Total Posts 18439

Re: start new module

Hi Nasser,

You can study the code for existingfeatures for example code for almost anything you need to do. You can see how I create business classes that I use in the web code (I never talk directly to the db from web code), the business classes talk to static methods on a data class and these static methods retrieve or update data from the db. Simple features like the Links module or Contact Form are good ones to start with learning.

There is nothing to create your tables for you, but if you create your own table with a primary key we do have Code Generation scripts that can give you a jump start. There is a training video about code generation on this page. There is an old freeware version of Codesmith included with the source code if you look in the CodesmithTemplates folder.

Hope it helps,

Joe

4/11/2009 3:17:18 PM
Gravatar
Total Posts 71

Re: start new module

hi,Joe,

how i can define some setting(options) for my module? like yours,

<<ModuleSettings.aspx?mid=9&pageid=3>>

 for example : i have a grid that show data from database,but the count of rows must be set by admin(like only 10 rows per grid page);

now how i can get that number ?

thank you,

4/12/2009 6:27:39 AM
Gravatar
Total Posts 18439

Re: start new module

Hi Nasser,

Module settings can be defined using the UI under Admin > Advanced Tools > Feature Definitions > Settings.

They can also be defined in config files and then visiting the setuip page will create the settings in the database according to the config file specs. Some information about how to do it with config files is in the article Using the Installation System.

Once the settings are created in the db they will show up in the ModuleSettings.aspx page. To retrieve the settings in code you can look at examples in various features by reviewing the source code. You will see that the SiteModule control alredy has the module settings in a hashtable named "Settings", so you can see example code like this:

HideAddThisButton = WebUtils.ParseBoolFromHashtable(
Settings, "BlogHideAddThisButtonSetting", HideAddThisButton);

ExcerptLength = WebUtils.ParseInt32FromHashtable(
Settings, "BlogExcerptLengthSetting", ExcerptLength);

if (Settings.Contains("BlogExcerptSuffixSetting"))
{
ExcerptSuffix = Settings["BlogExcerptSuffixSetting"].ToString();
}

In other pages or if not using SiteModule as a base clase you can get them like this:
Hashtable moduleSettings = ModuleSettings.GetModuleSettings(moduleId);

Hope it helps,

Joe

 

6/16/2011 10:06:06 PM
Gravatar
Total Posts 3

Re: start new module

I have a test install of mojo portal here: mojo.evodynamic.net and I've tried to follow the Hello Mojo Quick-Start but it doesn't seem to be working. Is there something I've done wrong?

Here's a snippet of my system log:

2011-06-16 19:52:23,403 INFO mojoPortal.Business.WebHelpers.IndexWriterTask - started IndexWriterTask task
2011-06-16 19:52:26,133 ERROR mojoPortal.Web.UI.CmsPage - failed to load control EvoDynamicModules/HelloMojoSiteModule.ascx
System.Web.HttpParseException (0x80004005): Unknown server tag 'portal:OuterWrapperPanel'. ---> System.Web.HttpParseException (0x80004005): Unknown server tag 'portal:OuterWrapperPanel'. ---> System.Web.HttpException (0x80004005): Unknown server tag 'portal:OuterWrapperPanel'.
   at System.Web.UI.TagPrefixTagNameToTypeMapper.System.Web.UI.ITagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs)
   at System.Web.UI.MainTagNameToTypeMapper.GetControlType2(String tagName, IDictionary attribs, Boolean fAllowHtmlTags)
   at System.Web.UI.MainTagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs, Boolean fAllowHtmlTags)
   at System.Web.UI.RootBuilder.GetChildControlType(String tagName, IDictionary attribs)
   at System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty)
   at System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText)
   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ProcessException(Exception ex)
   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)
   at System.Web.UI.TemplateParser.ParseInternal()
   at System.Web.UI.TemplateParser.Parse()
   at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()
   at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)
   at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
   at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
   at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath)
   at mojoPortal.Web.UI.CmsPage.LoadPage()
2011-06-16 19:52:26,133 ERROR mojoPortal.Web.UI.CmsPage - failed to load control EvoDynamicModules/HelloMojoUserControl.ascx
System.Web.HttpParseException (0x80004005): Unknown server tag 'portal:OuterWrapperPanel'. ---> System.Web.HttpParseException (0x80004005): Unknown server tag 'portal:OuterWrapperPanel'. ---> System.Web.HttpException (0x80004005): Unknown server tag 'portal:OuterWrapperPanel'.
   at System.Web.UI.TagPrefixTagNameToTypeMapper.System.Web.UI.ITagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs)
   at System.Web.UI.MainTagNameToTypeMapper.GetControlType2(String tagName, IDictionary attribs, Boolean fAllowHtmlTags)
   at System.Web.UI.MainTagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs, Boolean fAllowHtmlTags)
   at System.Web.UI.RootBuilder.GetChildControlType(String tagName, IDictionary attribs)
   at System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty)
   at System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText)
   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ProcessException(Exception ex)
   at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
   at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)
   at System.Web.UI.TemplateParser.ParseInternal()
   at System.Web.UI.TemplateParser.Parse()
   at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()
   at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)
   at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
   at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
   at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath)
   at mojoPortal.Web.UI.CmsPage.LoadPage()
2011-06-16 19:52:33,262 INFO mojoPortal.Web.WebTaskManager - started WebTaskManager task

EvoDynamicModules is found at /mojo.evodynamic.net/wwwroot/EvoDynamicModules/ on my host (Arvixe.com).

I'm really trying to determine if I want to use this with my new client. Thanks for your assistance.

Kind regards,

Brian

6/17/2011 6:46:43 AM
Gravatar
Total Posts 18439

Re: start new module

Hi,

The problem is that the Hello World example code has been updated for the latest version of mojoPortal (2.3.6.6), but your site is not running the latest version so it causes errors. If you upgrade it should solve it.

Hope that helps,

Joe

6/18/2011 12:02:52 AM
Gravatar
Total Posts 3

Re: start new module

Joe:

Ahh, that makes all the difference. Wonderful. On to testing and exploring. Thanks so much. If I choose Mojo for my project, I'll be sure to fill your mug. Thanks for the quick reply.

Kind Regards,

Brian

You must sign in to post in the forums. This thread is closed to new posts.