Importing into SiteFinity - asp.net

I just finished installing SiteFinity 3.7 standard version on windows server 2008. Is there a way to entirely/partially import an already existing .NET project (ASP.NET) into SiteFinity with some minor changes in the code of course (may be by changinf a couple of xml files or something similar). I could only see an "export" under Administration->Tools section but no import. I am new to SiteFinity so a detailed help/guidance would be much appreciated.
Thanks.

I think you're on your own here. Sitefinity stores everything in a database so you'll have to programmatically convert the sitemap (read XML insert into database). Sitefinity does have an API that allows you to do this. You can for example create pages and add controls to that page.
Sitefinity uses MasterPages as templates so that's easy. You can also re-use any controls you have.
But, by the time you're done writing the conversion code, I think you'll find that you could have done it all by hand in less time. Unless this is a huge website you need to convert.

if you just need to import the pages you can add them as "external pages". this allows you to set permissions, page properties, and add it to you navigation/sitemap but of course doesn't let you edit the page inside of sitefinity. I did this with some sites that were developed seperately but needed to be in our sitemap.
You could also wrap the content and code into user controls, then add those to the page. We did this for an application that we built. the pages had to live inside of sitefinity, but the programming was already done, and needed to be in user controls. Once again you don't get to edit the content in sitefinity, but you get to keep your existing code.
Finally, if you used any kind of content management system, you can easily import stuff like news/events/etc via the various managers, it works something like:
var mgr = new ContentManager("News");
var content = new mgr.CreateItem("text/html");
content.SetMetaData("Title", importedItem.Title)
...
mgr.SaveContent(content);
this isn't EXACTLY the code but it's something similar; you can use the api documentation to learn more.
If it's plain text, then unfortunately yes, you'll have to manually copy this into sitefinity. It is a bit of work, I did this with our hundreds of pages, but in the end it's worth it to have the cms benefits.
hope this was helpful!

Related

Can Sitecore templates be used to store SQL Queries or JavaScript

We are building a Page with dynamic functionality using ASP.NET + Sitecore 7.0.
Is it practical and appropriate use Sitecore templates for:
SQL Stored Procedure Name to be invoked
JavaScript to be invoked
ColumnNames to be used etc (related to coding customization)
Or should these configuration properties remain inside the ASP.NET Project itself?
What is the primary purpose of Data Templates in Sitecore?
Are they for developer customization or customer-level customization?
The purpose of a data template in Sitecore is to define the set of fields for content items which inherit from that template. - Think of a data template as a class and the content items (pages) as instances of that class.
Templates are usually used to define the user-editable content of pages within a site, that being said you can have items to store information which is not managed by regular content editors. The question is where do you draw the line between things which should be put into Sitecore and things which should be a part of the solution. My advice is only put things in Sitecore if they need to be there. If you have to have the ability for editors or admins to configure those settings/properties.
I would say that putting SQL/ColumnNames is probably a bad idea unless you are building some sort of report builder interface in which case it may be essential?
Likewise with placing JavaScript into Sitecore; this can be OK in moderation (e.g. snippets of analytics code which content editors may want control over?). If you're placing whole libraries of JavaScript into Sitecore, you're probably doing it wrong.
One final point to note is findability/re-factorability of code: if you have code spread between Sitecore and your solution, it can make it very difficult to maintain as it is difficult to get a complete overview of code involved.

ASP.NET - best method for website where user can create articles (like a blog)

I'm an ASP.NET newbie, but not so new at programming in general.
I'm creating a commercial website, and I want to allow an admin to add new articles (an article consists of text, images and various properties such as category).
I am trying to decide the optimal Modus Operandi. This site is commercial, so SEO is a major consideration. This means that I want each url to be "unique". That is, if someone navigates to an article about raccoons, he should be redirected to www.mysite.com/articles/raccoons. This means - I can't have one page that loads the appropriate article dynamically a-la AJAX (gotta use deep-linking)
So how exactly do I do this? suppose the admin entered his text, uploaded the images and set the article properties. I create a new subfolder, save the images to the server (I understand that saving images to a DB is a big no-no), their addresses in a DB, and the content itself to the DB. But now what?
How do I go about creating the actual page?
Is there a function for creating a new aspx file? then what about its corresponding cs file? Or is it unwise to use aspx? Maybe plain html? but then how does it work with my site's master page? Or maybe just create another copy of a general aspx file which is populated with an article according to a parameter?
I would like to know what is the "smartest" approach before I dive in too deep.
You can Consider ASP.Net MVC for this. What you need is more like a Content Management System rather than a Blog, as you mentioned an administrator will add articles.
By Using ASP.Net MVC, you have a very clean implementation there, your urls will stay as you need it for SEO, You dont have to create aspx pages on the fly but the framework will let you deal with new urls from your class files.

Customizing GraffitiCMS

I downloaded GraffitiCMS the other day(now open source and free), and like a lot of what I see, but what I really want to use it for, is to add CMS capabilities to an existing asp.net database/application.
Without getting bogged down with all the details of my app, can someone give me the basic 'approach' that should be taken to add custom content to Graffiti; content that won't be a 'post'?
I've seen for example, how to add custom-widgets to Graffiti - basically inherit from the widget class, compile your dll and plop it into the correct directory and it becomes part of the system. Is there a way to do something similar for the main content areas?
For simplicity sake, pretend I have a non-graffiti database with gig's of data that I want to display on the website using standard asp.net grid's and forms. I realize I could just go in and hack apart the source code to integrate my existing app, but that is likely not the correct approach.
Not looking for a complete solution her, just a pointer and what areas to investigate...thanks.
If you check out the latest source of Graffiti (or the 1.3 branch that was recently created), support was added to put widgets anywhere you want on any page. There is a new chalk function - $macros.Widget - that provides you with this ability. Dan Hounshell wrote a blog post on how you can use this new functionality:
http://danhounshell.com/blog/graffiti-cms-1-3-add-a-widget-anywhere-in-a-view-with-new-widget-macro/
If you're looking for something different than that, just let me know - we're working to make Graffiti even better for situations just like you are currently in.
What we have done to be able to integrate Graffiti CMS with our current ASP.NET projects is to create a post in Graffiti called "hidden" and then with our standard .ASPX pages we call a class in our Render Override that pulls the "hidden" post (ie: site.com/hidden/) and uses the header and footer to wrap the Graffiti theme around our custom .ASPX page. We use some HTML comments in the "hidden" post to be able to parse the header and the footer. It is kind of a hack, but has worked out really well for us.
I think you're trying to put the cart before the horse - depending on the size and amount of functionality, I would be looking to rebuild it after learning the development platform of my CMS system of choice.
I'm pretty much in the same boat right now. I have avoided Graffiti because I have to learn "Chalk" (whatever that is) and Umbraco (using XSLT for layouts is retarded). So far, this leaves me with Sitefinity at the top of my list and Telerik have just pulled the free version!
I may end up grabbing a very basic CMS which is easier to customize. I know this doesn't directly answer your question, but it may give you some food for thought :-)

Where is the best place to put a DB query in drupal?

I have a few forms who's data needs to be written to the main database in their own tables. Just simple name-email collection forms, that are part of regular pages in drupal. I suspect the right way to do this would be to write a module that would have the query in a function, but this is just a guess. I've never written a module before, and don't know how the form would be processed that way.
It's also a guess that to perform the db query within a node would be insecure?
The only other idea I have would be to use a php file on the server to do the form processing, with the db query written there, but that seems very non-drupal, as far as I can tell.
How to??
http://drupal.org/node/508 is Drupal's info on module development
You'll be wanting to use the function "db_query()"
You can use Drupal's built in methods to build forms though that will save the data for you. Have a look at the module developers guide though and you should be able to figure it out. Module development sounds intimidating but it's not as hectic as it seems once you actually know what's going on with Drupal (hence, read the guide).
Have you checked what's already out there? Webform may be able to solve your needs without any custom code.
Also, I highly recommend the book Pro Drupal Development if you want to learn more about Drupal and basic module development.
I'd second the Webform module. Create a really simple webform with name and email (results can be emailed or stored automatically in the DB, and can be exported easily in several formats). Then check out the Webform Block module to put that webform in a block and place wherever you need it on your site. No custom coding required!
Here is an excerpt from the Webform Block project page:
Allows embedding a webform node into a block which can be positioned in any block region (theme space permitting).
Handles redirecting back to the current page on validation errors.
A good use for this is to add a site wide contact form inline on your pages, such as in the footer or sidebar.
Multiple webforms can appear on the same page. The contents of the block is simply a node, so theme work can be done in the node-webform.tpl.php file as usual.

How to make a fully customizable hosted ASP.NET MVC application

This is related to my previous question regarding serving static html files but that doesn't seem to be a good solution,
I want to make a fully customizable ASP.NET MVC application as a hosted service. See allowing the user to customize the look/feel of their own page but it is still dynamic, meaning the data is hosted in the central database.
I looked at the "theme" or "skin" in ASP.NET but I don't think it is customizable enough. It seems only the developer can add new themes. I want to have something like the theme editor in WordPress so you can just change the look in anyway you want from a web-based interface.
I wonder how the theme files will be stored for the popular blogging platform? Are they stored in database or a file in filesystem? I prefer to store it in database, because if it is in filesystem it will have scalability problem. Each user will be tired to a particular web server and I have to determine how much disk space for each webserver.
I thought of doing something like the old MovableType, to generate static HTML when you add new post. This solution is problematic as well, because the flexibility depends on the complexity of the template engine.
Ideas? Suggestions?
Thanks!
"Fully customizable" is the most elusive of the white whales ;-)
I see your question is old, but none the less;
first I'd recommend defining some very clear,
and cohesive rules governing just what the "bottom-line" is,
or an inheritable template of sorts.
You get a pretty good impression of what might be useful during developing, I'd guess.
Next; just what and how is the customizing supposed to be presented and achieved?
The inherit ASP.NET custom custard, Web Parts, need quite some cajoling to behave in MVC views :
https://stackoverflow.com/questions/1106629/using-webparts-in-an-mvc-application
If you're leaning more towards customizable appearance (theme's n' skin's),
how about having a CSS file for each user, saves like a charm as VARCHAR(MAX), and can easily be inserted
in e.g. your Master Page's head.
The theme editor in WordPress simply allows you to edit Theme PHP files...
You can do it exactly like in wordpress but instead of editing PHP files your theme is composed of a set of aspx\ascx files without code-behinds...

Resources