+ All Categories
Home > Documents > Webnodes Developer Quick Guide

Webnodes Developer Quick Guide

Date post: 09-Apr-2018
Category:
Upload: ole-gulbrandsen
View: 215 times
Download: 0 times
Share this document with a friend
19
 Webnodes Webnodes Developers Quick Guide Want to get started right away? Ole Gulbrandsen 1/1/2010
Transcript

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 1/19

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 2/19

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 3/19

3 | P a g e  

Definitions and meanings of wordsWhen using the term WAF in this document, it is the short expression for

Webnodes Adaptive Framework  

Installation1.  Make sure you got:

  A Windows PC with .Net 3.51 or later

  Visual Studio 2008/2010 or Visual Studio Express

  MS SQL Server, MS SQL Server Express or MySQL

2.  Launch the setup from www.webnodes.com/download 

3.  Click the “Create” button to install a new site. 

4.  Choose the Visual Studio project installation:

5.  Follow the setup wizard in your browser and select the “The WAF framework site” which is

an empty WAF installation. If the setup for some reason fail or you abort it halfway, you must

delete all files in the website folder and run “WAF.Setup.exe” again.

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 4/19

4 | P a g e  

Editing content 

  Type “edit” after the root URL of the website. This will take you to the WAF interface.

Use the master login you specified during the setup. WAF works best with IE or Firefox.

 Maximize the browser window.

  Open the preview by clicking on the “Preview” button on the top right corner.

  Select one of the articles in the menu and click “Edit” at the top. 

  You can now make changes to the text, “Save” and click “Refresh” above the preview frame

and to watch the change live.

This will open the page in WAF and your interface should look similar to this

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 5/19

5 | P a g e  

Things to try out 

  Move articles in the tree view by simple drag drop operations with the mouse.

  Copy articles in the tree view by drag drop operations while you hold the “SHIFT” key in. 

 Search for articles in the search box to the top right.

  Upload images by clicking on the “Upload” button in the “Files” field below the blue editor.

  Select a range of images from your hard drive and watch WAF upload multiple images in one

go.  Once the images are uploaded you can insert them into the editor using the image icon on

the editor toolbar, or simply drag and drop them into the editor.

  Try resizing it and notice how WAF re-samples a new version for each size automatically.

  Once an image is inserted in the HTML field you can edit it by right clicking on the image. This

should give you access to the Image Editor:

You can use the mouse wheel to zoom in and out of the image. Dragging outside the image

moves the image. Dragging inside creates a new cut out.

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 6/19

6 | P a g e  

  You can copy and paste inside the editor to work on multiple versions of the same image:

  There are also advanced image manipulations features like “image seam carving” for better

automatic cropping of images. Example:

  Notice how all the sailboats are present in the right image. WAF automatically removes low

contrast areas of the image while keeping the boats intact.

The crop mode is selected in the image editor:

  Upload a video file to the same field as the images. Insert it in the editor using the media icon

on the editor toolbar. WAF will automatically convert the video to the size and quality you

want.

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 7/19

7 | P a g e  

Once the player is inserted you can resize and resample the video by simply resizing it like an

image:

  Another thing you can try is the Content Link graph. This is a visualization of all links and

relations to the document:

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 8/19

8 | P a g e  

The WAF data model

The semantic data modelling capabilities in WAF is unique and differentiate WAF from other CMS

system. It is the semantic data modelling capabilities that really make WAF a true web application

framework you can use for almost any web application, and not just web publishing. In essence WAFis a fully fledged ORM system with an integrated UI and functionality related to web.

For those of you who are not familiar with ORM systems. ORM is short for Object-relational mapping

and is a technology for converting data and data models found in rational databases with object

oriented language systems. Typically you define your data model in a XML document and the system

generates the database fields and code files for you. In WAF there is a XML file that defines the

semantic data model, but there is also a built in content type editor that is much easier to work with:

The WAF ORM system has built in support for advanced functionality like: Object inheritance, Many

to Many relations, hierarchical relations, revision and role control on all content changes, multiple

language versions of the same object, super fast query caches, cross field free text searches, etc.

Everything you see in WAF is based on the WAF ORM system. That means users, documents,

templates etc. are all part of the same semantic data model and can be queried via the same API. You

can change and customize built in types and make your own utilizing all the capabilities of object

oriented programming.

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 9/19

9 | P a g e  

Examples of data query

For example, to write out the names of all objects in WAF you can make this basic query:

foreach (var o in WAFContext.Session.GetContents()) {

Response.Write(o.Name);}

To get all objects that is part of the menu hierarchy:

foreach (var o in WAFContext.Session.GetContents<HierarchicalContent>()) {Response.Write(o.Name);

}

To get a list of all users from a particular country:

WAFContext.Session.Query<SystemUser>().Where(AqlSystemUser.Country ==  “France”).Execute();

The query language is typed checked at compile time and supports concepts such as “group by”,

nested inner joins, aggregate functions etc:

An example of an inner join between users and user groups:

var group = new AqlAliasUserGroup();var user = new AqlAliasSystemUser();var relation = new AqlAliasRelUserGroup(group, user);var query = new AqlQuery(WAFContext.Session);

query.From(relation);var groupName = query.Select(group.GroupName);query.Where(user.Country == "France" | user.Country == "England");

query.OrderBy(user.ChangeDate);query.Distinct = true;var result = query.Execute();var groupNames = new List<string>();

while (result.Read()) groupNames.Add(groupName.Value);

This query will return a list of names of all user groups that has users from France or England.

Since everything you work with is compiled classes and you get the full benefits of super fastperformance and good integration with Visual Studio and support for full intellisense on all custom

defined classes.

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 10/19

10 | P a g e  

Why is semantic data modelling so important?

Our motivation for making WAF was that we saw that most websites were becoming increasingly

complex and that page publication was just a small part of it. Sure, today most CMS systems come

with a lot of added modules for functionality like Blog, E-shop etc, and so do WAF, but the problem is

that the websites are becoming increasingly integrated with the business processes of a company,

and every company has different needs. Sometimes standardized module can help you out, but often

you need to build things from scratch as it is not possible to customizing the standard modules

enough or using the modules will result in hard compromises on the functionality.

Custom building things from scratch is time consuming and expensive. In addition, the customized

systems become disconnected from the rest of the website and have separate UI.

With the semantic data modelling capabilities of WAF you do not need to create separate customized

systems. WAF will generate the code and database fields for you automatically and it all becomes

part of a tightly integrated system. To summarize, the key aim with WAF is to:

Combine the freedom and flexibility found in custom built software with the

cost and user-friendliness found in standardized software

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 11/19

11 | P a g e  

Some words about processes outside the context page view executionAn important aspect of WAF is the ability to run application threads outside the context of a page

view.

Often it is difficult to complete an operation during the execution of a page view, and sometimes you

want to perform the operation at regular intervals during the week completely disconnected to a

page view. Examples could be sending out thousands of SMS’s or compiling complex financial reports

in PDF from multiple data sources.

In WAF all of this can be achieved within the context of IIS. There is no need to set up a separate

Windows Service. This makes hosting less complicated and you can install in shared hosting

environments that are available at a very low cost. (www.DiscountASP.com or www.uniweb.no )

WAF utilizes the Windows Workflow Foundation (WF) to manage the processes. In fact behind every

dialogue you see in WAF there is a running workflow. This is something that is unique to WAF and

makes it very easy to manage and control complicated interface dialogue sequences.

WAF extends the WF framework with an interface API that utilizes AJAX for real time interface

updates. A typical example is a process progress bar.

A key feature of Windows Workflow Foundation is the ability to release threads and serialize the

workflow object to the database while it is waiting for input from the user. This is critical if you want

to handle dialogues to many users simultaneously. Otherwise you would quickly run out of the 20 or

so ASP.Net threads.

Here is a very simple example on how you make own workflow:

Add a C# class file to the “App_Code” folder, call it “Test.cs” 

Add this code to the class:

using System;using System.Threading;

using WAF.Engine.Workflow.Methods;public class Test : WorkflowMethod {

public override NextCall Invoke(WorkflowMethod invoker) {Info.InBackgroundMode = false;

Info.Caption = "Test workflow running";

for (int i = 0; i < 100; i++) {Thread.Sleep(100);

Info.Description = "Processing item " + i;Info.PercentageComplete = i;

}return null;

}}

To run this workflow from any template you can write:

WAFContext.StartWorkflowMethod(new Test()); 

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 12/19

12 | P a g e  

You may also make the process run automatically every midnight by adding a scheduled task in the

system module:

And then enter the following settings:

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 13/19

13 | P a g e  

When you save and close this dialogue it will run every day after midnight. You may also start it

instantly by clicking the “Run” button:

It is beyond the scope of this quick guide to go further into this, but it is an important architecturalfeature of WAF and can add invaluable functionality that will take your web applications to a new

level.

(Workflows can also be created using the Workflow Designer in Visual Studio, but to our experience

it is has some performance issues and it is often easier to just write the code by hand as in this

example. A new designer is coming in with .NET 4.0 and Visual Studio 2010 and this is much better.)

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 14/19

14 | P a g e  

Making your own templatesTemplates in WAF are just normal .aspx files and is created and edited in Visual Studio. You can

organize them and put them in any folder you like. You can make use of all ASP.NET controls and

build master pages and user controls to create the templates you need for your site.

To make a new template try this:

  Copy the existing template file call Article.aspx under the folder “Templates”.

  Once you have created the .aspx file you must create a template instance in WAF that refers

to this file. Open the template module:

Then double click on the “article2.aspx” file and click on the button “Create template for this

file”. Next, click the “Select” button as shown below to select. 

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 15/19

15 | P a g e  

You may edit the template file directly in WAF by clicking on the “Codebehind File” tab, but

for most of the time we recommend using Visual Studio to edit the templates.

To make an article use this template open an article in the contents module and select the

“Options” tab: 

You can change the appearance of template in Visual Studio.

To change the template of a number of articles in one go you can enable the “Show

advanced property options”: 

This will open a dialogue where you can change any property value on many contents on one

go.

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 16/19

16 | P a g e  

Creating your own content class

Open the Semantics module. And select New Class:

Type the class name “NewTestClass” and let it inherit from “HierarchicalContent”.

Then, add a property named “MyProperty” of type “HTML” 

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 17/19

17 | P a g e  

Next, compile the changes by selecting “Full rebuild” in the menu under “New Definitions”. Now the

system will make the necessary changes to the database and generate the class files in the

“App_Code” folder. When the compilation is complete you can add the class to the site: 

Now you’re ready to use the new content class. Select “New” in the content menu and the new class

will appear in the menu:

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 18/19

18 | P a g e  

Standard modules

Welcome

The default opening module with information about the latest traffic and last edited documents.

Content The default module for editing all content.

Newsletter

A module for sending out email newsletters.

SMS and MMS

A module for sending and receiving SMS and MMS messages.

File library

A module for sharing files across multiple sites and contents.

Blog

A module creating blogs in your site.

Forum

A module for creating forums in your site.

Templates

A module for editing and managing template files and stylesheets.

SemanticsA module for setting up and modifying the data model. This includes classes, relations, enumerations

and content cultures.

User

A module for organizing users and user groups. User groups are key to controlling user permissions.

Explorer

A module for directly accessing the file system. Can be used to upload and download large number of 

files. It supports uploading and expansion of large ZIP archives.

System

A module for monitoring the load status of the system and make system changes like moving the

database, downloading the whole site or re-index all documents etc.

Wastebin

A module where all deleted objects are stored when they are deleted.

8/8/2019 Webnodes Developer Quick Guide

http://slidepdf.com/reader/full/webnodes-developer-quick-guide 19/19

19 | P a g e  

Other key functionality

Other key functionality not mentioned in this guide:

  A free text search engine based on Lucene that enables searches across all fields and text

inside files like PDF, Word, Excel, Windows Write. Etc

  A built in gateway for sending large quantities of Email, SMS and MMS

  Out of the box integration with Google Analytics. Including a simple API to access their REST

API for querying analytics data server side.

  Word like inline spellchecker in for all major languages.

Functionality in development and soon to be released:

  A Forms module, enabling non technical users to create and manage forms.

  A LINQ provider

 Visit side controls to make template creation easier

  E-commerce module

Some examples of what is possible with WAF

  www.startourreiseforum.no 

  www.inma.no 

  www.arkitektur.no 

  www.aibn.no 


Recommended