1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Creating a Catalog of Items

Creating a Catalog of Items

7 posts, 0 answered
  1. Brian
    Brian avatar
    3 posts
    Registered:
    13 Jun 2008
    03 Nov 2008
    Link to this post
    I need to create a catalog of items, a course catalog specifically.  Conceptually, this seems to be similar to the ContentView derived web controls; however, I cannot get the data via Nolics--there is already a defined mechanism for getting the data.  I would like to tage advantage of the URL rewriting capability of the ContentView control and would like the individual item pages to be indexed.

    I am unsure how to proceed.  Can I use the ContentView control and create my own provider for getting the data or do I need to pursue another path?

    Thanks for your help.

    Brian
  2. John
    John avatar
    32 posts
    Registered:
    08 Oct 2008
    03 Nov 2008
    Link to this post
    Hey Brian,

    You can use any ORM you want, such as LINQ, so not using or knowing Nolics is not an issue. The Sitefinity team chose Nolics because the ORM can create databases and tables, so as the system went through upgrades Nolics changed the database around accordingly. You could even use SQL Datasource controls if you wanted to in your project.

    You could do something like the Products Module, but if you have one hundred courses, then this could be a lot of work. Writing your own provider could also be time consuming. In your project, you could use a RadGrid bound to a LINQ DataSource (I love LINQ :) !) RadGrid also has a CardView, so you could list the courses from beginning to end that way.

    ~John
  3. Brian
    Brian avatar
    3 posts
    Registered:
    13 Jun 2008
    03 Nov 2008
    Link to this post

    Thanks for pointing me to the Products Module example.  I believe I do want to implement something like the ContentView derived control of this sample, ProductView.  I'm still confused about my original question--given that I won't be using Nolics, how do I provide the ProductView with data?

    Reading through the sample, it seems as though I would need to implement a provider of some kind, but its unclear what abstract class or interface I would need to implement.

    Brian

  4. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    04 Nov 2008
    Link to this post
    Hello Brian,

    when creating a Generic Content based module you do not need to write DAL or provider. Namely, you can define the fields your module will need as metafields and Sitefinity will do the rest for you (that's how its done in the sample products module).

    If that is not enough, you have another option as well. Let's suppose that your module will need to have suppliers and that each product belongs to a supplier. You can then implement your own provider and inherit from the Telerik.Cms.Engine.Data.Providers.DefaultProvider and inside of it implement only the methods that are concerning suppliers. And these methods you can implement in any way you see fit (ADO.NET, Linq to Sql, DataSets, XML....).

    So you would end up with following:
    - Suppliers - your object and you implement the CRUD methods in the derived provider in any way that you see fit
    - Products - object of type IContent > data access provided by Sitefinity (this is exactly as it is done in the products sample in the manual).

    I would personally reuse GC provider for products, because I can't see what could be gained from rewriting the already existing provider (except, of course, unless you will be using webservices, xml or a database not supported by Nolics.NET to store your products).

    I hope you'll find this information helpful. Let me know if I wasn't clear enough or if you get stuck somewhere.

    All the best,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Brian
    Brian avatar
    3 posts
    Registered:
    13 Jun 2008
    07 Nov 2008
    Link to this post
    Thanks for the information, Ivan.  It is entirely possible I'm making something more difficult than it has to be, so I will describe the goals I want to achieve and let Telerik comment on potential approaches.

    We have a catalog of courses.  The course information is accessible via business objects we have created.  The website will be able to use those business objects to display the course information but does not have access to the database where the information is stored.

    From an ASP.NET perspective, we'll have no problem creating a page that lists all courses and a details page that shows the details for a particular course.  Our primary goal is that we want the course details to be indexed so that students can use the standard search feature to find courses.

    As a "nice to have" feature, we would like the course details page to make use of URL rewriting so that the URLs for courses look something like:

    http://website/CourseCatalog/CS100.aspx
    http://website/CourseCatalog/ENG105.aspx
    etc.

    I'll look forward to your thoughts.

    Brian
  6. John
    John avatar
    32 posts
    Registered:
    08 Oct 2008
    07 Nov 2008
    Link to this post
    Hey Brian -

    Ivan recently published a post on search indexing the products module and it is available here. The search index allows you to have a ProductsIndex option (like News and Blogs) in the Administration > Search section of the CMS.

    The URL rewriting could work, if you are using query string to request each class. For example, you could have http://www.school.edu/CourseCatalog/Classes.aspx?ClassNameID=CS100 you could rewrite it to http://website/CourseCatalog/CS100.aspx. Your URL Rewriting would look something like this:

    <rule>
            <url>/CourseCatalog/Classes(.*)\.aspx</url>
            <rewrite>Classes.aspx?ClassID=$1</rewrite>
          </rule>

    The Sitefinity User Manual has a section called URL Rewriting on this.

    ~John
  7. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    14 Nov 2008
    Link to this post
    Hello John,

    Thank you for your reply in our community forums! We appreciate your answer, and believe it is helpful. Therefore we updated your Telerik accounts with some points :)

    Best wishes,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
7 posts, 0 answered