Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Creating Custom Tables from Old Site Tables View modes: 
User avatar
Member
Member
Armysniper89 - 6/7/2011 11:33:58 AM
   
Creating Custom Tables from Old Site Tables
I have a site I am importing into Kentico from SiteFinity. In this site I had a custom job board with job postings and alot of support tables. Would custom tables be the way to go so I can leverage the search capabilities or is there another way? If there is alot of support tables should I look to another route?

If I do custom tables for Job Postings, how do I relate fields in the sub tables. For example "State" is a table that provides states to the job posting. Only the ID of the state is stored in the posting.

Any guidance will help.
Thanks!

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 6/8/2011 5:18:14 AM
   
RE:Creating Custom Tables from Old Site Tables
Hi,

to import the content of your tables to Kentico you can use Import Toolkit. It will map content of your old tables to new in Kentico.

Before you import the content you will need to define custom tables in Kentico. To create a relation you can define one field (Step 3) of dropdown list type. For dropdown list you can create a query (by checking SQL Query (it must return value and text fields) option) so in the field will be stored requested ID.

The Country selector is already created in Kentico, so you would not define the drop down list, but the ID would not match definition of your State table.

I hope that description makes sense.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
Armysniper89 - 6/8/2011 12:05:39 PM
   
RE:Creating Custom Tables from Old Site Tables
Any examples how to wire up the SQL Query to the drop down list properly? I find the help rather vague on this.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 6/9/2011 2:25:46 AM
   
RE:Creating Custom Tables from Old Site Tables
Hi,

here are details:

1. In a Fields definition of custom table you need to select:
Attribute type: Text
Field type: Drop-down list

2. Now choose option SQL Query (it must return value and text fields)

3. The query could look like below one (it is a simple SQL Query which returns 2 columns):

SELECT NameColumn, ValueColumn From SomeTable

Best regards,
Ivana Tomanickova

User avatar
Member
Member
Armysniper89 - 6/9/2011 10:43:17 AM
   
RE:Creating Custom Tables from Old Site Tables
Since I am storing an integer from the table...lets say states which has a StateID (integer), State Name (NText), SortOrder (int), and Active(bit)...what should the AttributeSize be to be efficient? I am thinking 10 to be safe but want to make sure.

Since my Job Postings table from my old site is now a Cutom Table, is it safe in SQL to setup relationships between it and CMS_User and all of the support tables I brought over from my other site, such as State?

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 6/10/2011 8:25:57 AM
   
RE:Creating Custom Tables from Old Site Tables
Hi,

the dropdown list stores only valueColumn in the database in string format. Therefore if you select StateID as a value of drop down list the size of 10 will be more than sufficient.

Could you please describe your design in more details? You need to connect user with your custom table? I mean enable user to select State from the custom table and stores it is his profile?

This way you could add a new field to CMS_User table. The same way as you have created custom tables fields. Configuration of user table you can find in the Site Manager -> Development -> System tables. This way user can select the state from drop down list which selects data from your custom table.

Best regards,
Ivana Tomanickova