3

I am not sure whether to ask this question here. I have a requirement where I have to validate a product code entered by a user on a page. Client will provide product data in CSV format and that will be in thousands.

My question is: what is the best way to achieve this?

I thought to dump a csv file in some folder and then write .net code to read it. However this solution is supposed to be global and will be used by more than one site.

I thought to create WEB API/WCF Service which will read the Product data and verify against user product code. However I am not sure where should I store product data?

I also came across oData but not sure whether to use it for this solution.

My main concern is, where should the Product data be stored?

2
  • You haven't specified anything about Tridion like how you are going use tridion. Feb 10, 2014 at 16:11
  • Hi siva, I am not sure what do you mean. I have already multilingual site in Tridion. In Tridion I will be creating new Schema, Component Template, Template Building Block and finally create page to use these. The page will have small form with one input box. Where user will enter product code, which I will be validate against Product code data I may have somewhere in Tridion. Question is where do i keep this data?
    – vip
    Feb 10, 2014 at 16:42

3 Answers 3

6

If you do not need to manage the product data as content in anyway (edit it, translate it, link to it, put it through workflow etc.) there is no reason to put it in a Content Management System like Tridion at all - particularly if it runs to thousands of items. Tridion just becomes a middleman sitting between your web application and Product Information Management system that you do not really need.

It sounds like your requirement (validate a product code entered by a visitor on your website) is totally unrelated to Content Management, and more in the field of Product Information Management.

3

From the sounds of it, you need to import thousands of products from Excel/CSV along with the product codes used to look them up in the system. This can be achieved fully outside of Tridion with a custom database (or XML file), or you can create a Custom Page (Core Service job) in the Tridion CM to facilitate importing your data into Components.

I've done similar implementations where the editor imported their CSV using a Custom Page. This Custom Page called the Core Service to create a "Product" component that had the product code set as a Custom Meta field. Then a Dynamic Component Template was used to publish the Components as DCPs and the website then queried the Broker by CustomMeta Criteria with the Product Code. Hope this helps.

2
  • I would opt for the first option, a custom database. The way I see it the product data has no relationship with your CMS in any way, so trying to add it in a Component is the wrong approach from my point of view. Feb 10, 2014 at 19:07
  • 1
    Unless, as Will says in his answer, the product data (e.g. the description, imagery, etc) is content that you want to manage in the CMS, and the CSV is just an initial mass import. Feb 10, 2014 at 20:16
2

As per your comments, below are the possibilities:

  1. Store all the Product data in the form of tridion components
    • Use the components to publish as "Product XML"
    • Use the Product XML for validating the product page based on the user inputs
    • Here you can cache the product XML and invalidate the XML whenever it gets modified
  2. Store all the Product data in the custom database
    • Query the database to validate the product page based on the user inputs

Update:

How to create a Page?

  1. Create a Schema called "Product Schema" which contains one "MultiLine Text" Field
  2. Create a Component with Product Schema
  3. Dump all the CSV product data in "MultiLine Text" Field
  4. Create a Component Template called "Product Template"
  5. Component Template reads the field and render the product data as mentioned in the sample format
  6. Create a page called "Product XML" with Product Component and Product Template
  7. Publish the Product XML

Sample XML:

  <productData>
    <code>ABC</code>
    <code>DEF</code>
    ...
    ...
    <code>XYZ</code>
  </productData>
4
  • Hi Siva many thanks for your reply. I am not sure how to create component in Tridion, which you can publish as xml. Do you mean Component template?
    – vip
    Feb 10, 2014 at 17:42
  • @vip: To have more understanding, I have updated the answer. Feb 10, 2014 at 18:25
  • If the csv only contains product coders, no other data, you might as well use the original csv in the webapp. Just read the file and put it in memory. Fast, simple, easy to maintain. The csv file can be deployed on the webservers directly, or the editor can put it in a multimedia component and deploy it though Tridion publishing.
    – Jan H
    Feb 12, 2014 at 6:30
  • @JanH: Yes you are right. If user doesn't use tridion, ideally best solution is to have CSV file on the application itself. Later file can be cached and use it accordingly. Feb 12, 2014 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.