Login Skip Navigation LinksWilsonWebPortal > Forums Search
Download WebPortal Download WebPortal
Download and start using the full WebPortal completely free, including the source for the basic modules so you can see how to create your own if the included modules aren't enough.

PayPal Subscribe
Get It All for $50 USD:
WebPortal, ORMapper,
Source Code, All Updates
PayPal

User Login User Login
Log In
 
 
Reset Password

Wilson WebPortal Forums Wilson WebPortal Forums : Advanced Topics : Create new portal from outside WWP

Date Post
5/21/2007 9:50:24 PM How do I go about creating a new portal from an external asp.net application?

I tried this:

    protected void btnNewRegistration_Click(object sender, EventArgs e)
    {
        WebPortal.Core.Config.Initialize("localhost/defwwp");
   
        WebPortal.Core.Portal myPortal = null;

        myPortal = WebPortal.Manager.DB.GetObject<WebPortal.Core.Portal>();

        myPortal.Name = this.TextBox1.Text.ToString();
        myPortal.Group = WebPortal.Core.Group.GetById(1);
        myPortal.Theme = WebPortal.Core.Theme.GetById(1);
        myPortal.Skin = WebPortal.Core.Skin.GetById(1);
        myPortal.Frame = WebPortal.Core.Frame.GetById(1);
        myPortal.Email = "me@something.com";
        myPortal.FavIcon = "myFavIcon";
        myPortal.Logo = "myLogo";
        myPortal.Description = "myDescr";
        myPortal.Keywords = "myKeyword";
        myPortal.Save();

        WebPortal.Core.Setup.BuildPortal(myPortal);
    }

But I keep getting an error in Page.cs:
        static Page() {
            string where = Manager.Helper.GetExpression("Page.PortalId", Portal.Current.Id);  << HERE
            Cache.Register<Page>(where);
        }

Please advise ASAP. Thanks!
5/22/2007 12:34:12 AM

There is no support for doing it outside of the portal itself, short of creating some db scripts I suppose.  That's an interesting request though, something that I'll consider next time around.

Thanks, Paul Wilson

5/22/2007 1:28:44 PM

So, you are saying there is nothing I can call in the wilson wp from an external application that will allow me to create a new portal?
If not, could you give me a few pointers as to how I might go about doing this? Maybe just point me in the right direction...

Thanks!