Site structure
Version 3.x > Site structure > libray site structure View modes: 
User avatar
Member
Member
eagleag-yahoo - 1/27/2009 8:38:21 AM
   
libray site structure
hi,

I'm trying to create a site for a library.

I have Books and Clients.
I had no problem updating the list of Books and Clients but when I want to create reports
that show:
1. Books- which client has taken each one out.
2. Clients - which books have each client taken (can have multiple books).

I've create documents and transformations and stuff but couldnt get it to work.

Would much appreciate if someone could explain what the RIGHT way to do this is.

THANKS :)

User avatar
Member
Member
eagleag-yahoo - 1/27/2009 8:49:55 AM
   
libray site structure
forgot to mention that I would like to use 4.0 for this projects

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/28/2009 10:01:05 AM
   
RE:libray site structure
Hi,

Could you please give us more light into your design?

How did you create the books and clients? Are they document types or what?
Could you please also describe the relationship between these two entities?

Thank you for additional information.

Best Regards,
Juraj Ondrus


User avatar
Member
Member
eagleag-yahoo - 1/28/2009 3:50:48 PM
   
RE:libray site structure
Could you please give us more light into your design?

I would like to be able to generate reports like:
- who has each book
-each client: how many book does he have

I would like the adminsiatrator of the site to be able to update the informartion throw CMS DESK. when someone takes out a book he will go to CMS DESk and EDIT that book item and choose from drop down list which client took it out.

currently I have a document type for books and one for clients.
in the book document there is a field that is called "bookClient", that generates a list of all clients so you can choose who took out the book.
I achived this using a drop down list field with a quiere getting the data.

I am currently using kentico 3.1 but would be very happy to hear s solution using kentico 4.

I havnet used a RELATIONSHIP functionality becuse I'm not sure what it does.
I couldn't find a clear enough explanation in the documentaion. I'm sure it there but i missed it or didn't understand it.

THANKS SO MUCH FOR YOUR HELP :)

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/29/2009 3:14:52 AM
   
RE:libray site structure
Hi,

Thank you for the information. I think that more transparent way will be to develop custom module for this (http://www.kentico.com/docs/devguide/custom_modules.htm). You need to ensure the relations between client and books and the best way is to use separate DB tables with foreign keys, etc.

In your current design I cannot imagine this relation and there is a big risk of inconsistence. You need to update every client and also every book document each time or you need to develop some utility, which will ensure that if some client has a book, also the record in the book document is updated. This could be pretty complicated.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
eagleag-yahoo - 2/1/2009 6:30:07 AM
   
RE:libray site structure
thanks.
I've followed the instructions but I keep on getting an error:

Error 1 The type or namespace name 'CMSDeskPage' could not be found (are you missing a using directive or an assembly reference?) C:\Inetpub\KenticoCMS4\CMSModules\MyModule\Default.aspx.cs 15

Can you advise?
thanks :)

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 2/2/2009 8:53:14 AM
   
RE:libray site structure
Hi,

I have followed the description and it is working fine. Could you please paste here the code you are using?

Best Regards,
Juraj Ondrus

User avatar
Member
Member
eagleag-yahoo - 2/2/2009 10:09:22 AM
   
RE:libray site structure
I'm using kentico 4 and Developers Guide 4.0.
Developing custom models -> custom models

First thing it says to dois find this code in the code behind:

public partial class CMSDesk_Tools_MyModule_Default : System.Web.UI.Page

in my code behind file this is the code:

public partial class CMSModules_MyModule_Default : System.Web.UI.Page

Th rest of the code im using is what it says to use in the developers guide.
Is this enough info?

THANKS :)

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 2/2/2009 10:15:23 AM
   
RE:libray site structure
Hi,

You need to change the System.Web.UI.Page to CMSDeskPage. Could you please try it?

Moreover, the documentation for 4.0 version is not finished yet, so there is a little mistake in the class definition.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
eagleag-yahoo - 2/2/2009 10:37:24 AM
   
RE:libray site structure
Did what you said and got the error:

The type or namespace name 'CMSDeskPage' could not be found (are you missing a using directive or an assembly reference?)

this is my code behind code:

using CMS.CMSHelper;
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class CMSModules_MyModule_Default : CMSDeskPage

{
protected void Page_Load(object sender, EventArgs e)
{
if (!CMSContext.CurrentUser.IsAuthorizedPerResource("myprojects.mymodule", "read"))
{

RedirectToAccessDenied("myprojects.mymodule", "Read");

}

}
protected void btnGetTime_Click(object sender, EventArgs e)
{
if (CMSContext.CurrentUser.IsAuthorizedPerResource("myprojects.mymodule", "gettime"))
{

lblTime.Text = DateTime.Now.ToString();

}

else
{

lblTime.Text = "You're not authorized to get the current date and time.";

}

}
}


this is reg file code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="CMSModules_MyModule_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:Button ID="btnGetTime" runat="server" Text="Get Time"
onclick="btnGetTime_Click" />

<asp:Label ID="lblTime" runat="server" Text=""></asp:Label>

</div>
</form>
</body>
</html>


Your help is much appreciated-THANKS


User avatar
Kentico Support
Kentico Support
kentico_jurajo - 2/3/2009 4:34:05 AM
   
RE:libray site structure
Hi,

I am sorry for the confusion - there is another mistake in the documentation. In the new version were moved some classes. Could you please add to the beginning of the code this namespace: using CMS.UIControls;

Best Regards,
Juraj Ondrus

User avatar
Member
Member
eagleag-yahoo - 2/4/2009 3:20:50 AM
   
RE:libray site structure
made all the changes you said and got this error:


Error 1
The type 'System.Web.Script.Services.ScriptMethodAttribute' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\kentico4\76aaeda4\4834e52b\assembly\dl3\e8fbf49d\009a5e81_b476c701\System.Web.Extensions.DLL' and 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll' C:\Inetpub\kentico4\App_Code\CMSPages\TagSelectorService.csC:\Inetpub\kentico4\

TagSelectosService.cs lines28 & 18

another error:

Error 3
Assembly 'CMS.UIControls, Version=4.0.3303.37872, Culture=neutral, PublicKeyToken=834b12a258f213f9' uses 'CMS.ExtendedControls, Version=4.0.3303.37858, Culture=neutral, PublicKeyToken=834b12a258f213f9' which has a higher version than referenced assembly 'CMS.ExtendedControls, Version=3.1.3142.27540, Culture=neutral, PublicKeyToken=834b12a258f213f9'


Many thanks for you help


User avatar
Kentico Support
Kentico Support
kentico_jurajo - 2/4/2009 7:22:58 AM
   
RE:libray site structure
Hi,

I assume that you are using .Net 3.5 and AJAX toolkit 3.5.

It seems that you have used .Net 2.0 before. Could you please try to delete the .Net cache - c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\kentico4 ?

Best Regards,
Juraj Ondrus