I successfully installed SenseNet Framework and it is running on my computer, but I don't know how to use this framework for our database to develop with my private website project and how to begin dev? can you help me ?
many thanks!
I successfully installed SenseNet Framework and it is running on my computer, but I don't know how to use this framework for our database to develop with my private website project and how to begin dev? can you help me ?
many thanks!
I'll try ro give an overview of the current possibilities (as of SenseNet version 6.5.4, because new options are coming in the near future).
This is what you did: install the package and you get a full web app: portal UI and Content Repository (db). You can customize the GUI by creating a new skin or creating pages and moving portlets around on pages. Here are a few getting started links to begin with:
About maintaining the project (e.g. backup, etc.) please take a look at the operator and dev articles on the wiki - or ask a specific question here :).
Developers may build on the OData REST API we offer: you can manage content in the Content Repository through http requests (or using the client SDK from C#). This requires the same SenseNet installation as the first option, but you can keep your existing ASP.NET application and only make requests to the SenseNet rest api from your backend (it is also possible to make cross-site ajax calls from JavaScript, but you would have to deal with cross-site authentication in case of sensitive content).
Currently this is a bit tricky as there is no 'how to' wiki article for this scenario. Basically you would be able to use your existing (or new) ASP.NET webforms or MVC application, and build on the Content Repository as a storage. This way you would loose the built-in UI and the possibility of making REST API calls to the repo (as it is possible in the previous options), but you could still connect directly to the repo usig the SenseNet C# api (this is called in-proc behavior).
To achieve this, you have to copy all the contents from the built-in SenseNet web.config to your app's web config file, and if you want to do some initialization stuff at startup (MVC or web api routing, etc.) than you will have to inherit from the built-in global class (called SenseNetGlobal), implement the usual methods (app start, app end, etc) and register it in the global.asax file in your web root. If you have the correct connection string and all the other values set up in web.config, you should be able to use the SenseNet api (e.g. load and manipulate content items, query the repo) from now on.
Edit: details on custom tables
Regardless of which way you go, you can of course add your own custom tables to the SenseNet database. Before you do that, please consider storing your objects as regular Content items in the Content Repository though, that way you may benefit from the built-in features of the platform, e.g. indexing and permissions.
But if you already have a table structure you want to reuse or integrate, or it is easier to implement it independently from SN, you can store your custom data in the same database. We offer an API for accessing the database, you do not have to worry about connection strings and other stuff, you can simply use the SqlProcedure SenseNet helper class for executing direct SQL queries.
using (var cmd = new SqlProcedure { CommandText = "SELECT * FROM MyTable WHERE RefId = @MyId", CommandType = CommandType.Text })
{
cmd.Parameters.Add("@MyId", SqlDbType.Int).Value = myId;
var result = new List<int>();
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
result.Add(reader.GetSafeInt32(0));
return result;
}
}
It is also possible to present or even edit external items (e.g. records in your custom table) using the built-in ASP.NET webforms user interface of SenseNet. The platform (with a small amout of development) is able to display external object with built-in field controls (e.g. short texts, dropdowns, etc) and let users manipulate them, without you having to create CRUD user interfaces from scratch.
Of course you can also build a custom UI using your existing dev skills and preferred controls.