11. Tables |
|
|
|
The Tables tab is a frequently used tab, for many different purposes. Interchanges’ Tables tab is the gateway to managing data in most all of the tables that Interchange uses. Many of the previously described tabs use the table editor, formatted to fit the particular need of the task at hand. So the Tables tab is an important area to understand, as it will help you in many aspects of using Interchange. Each table will be slightly different, but the Table editor will use similar functions, regardless of the table. In order to demonstrate the table area, we will use the Products table as an example. Because most everyone will use the Products table, it is the logical choice for demonstration. We will go into each of the functions, but first, lets give a description of the screen below, the default Table screen, and what each link does. Then we will move to the first tab of the table editor area. The screen below, Table Manager, is the first or default screen that you will see when you click on the Tables tab. There is a list of tables and related views, as well as the Import, Export, Upload, and Download links. Here is what each does.
Lets move on to the first sub tab, Table Edit. |
|
11.1
– Edit |
|
The Table Edit screen displays a list of Items. This is also the default Table Edit screen. That simply means that when you click on one of the table names, this will be the first screen that you see. Depending on the table you selected, you will see different information of course, but the general layout will be similar to this. What you are seeing on the screen above is a selected VIEW of the Products table. (or other table depending on your selection). The view may or may not show all of the fields contained within the selected table. You can change this default view, or create a new one by clicking on the link located at the top of the table display area, on the Demo above it looks like this:
And you would click on the products link. This will take you to the “Configure table display:” screen. |
|
11.1.1 – Tables - Edit – Configure Table Display The Configure Table Display allows you to create and customize the view of a chosen table. We will start this by showing you how to edit an existing view, again using the products table as an example. 11.1.1a – Tables – Edit – Configure Table Display - General
The default page that you will be taken to when you click on the “Select for Table edit” link will actually be the Select Page Display tab, but we will start with the General tab, and work from left to right explaining each tab and its functions in order. The General tab has just a few areas of interest, and we will detail them here:
|
|
11.1.1b – Tables – Edit – Configure Table Display – Select Page Display
The select page display tab is the default page that will come up when you access the Configure Table Display area. Most of the things you will need to edit to make your view look the way you want it, will be on this page.
price:r,description The abbreviated letters for sort modifiers are:
%% a percent sign %c a character with the given number %s a string %d a signed integer, in decimal %u an unsigned integer, in decimal %o an unsigned integer, in octal %x an unsigned integer, in hexadecimal %e a floating-point number, in scientific notation %f a floating-point number, in fixed decimal notation %g a floating-point number, in %e or %f notation
Perl permits the following universally-known flags between the % and the conversion letter: space prefix positive number with a space + prefix positive number with a plus sign - left-justify within the field 0 use zeros, not spaces, to right-justify # prefix octal with "0", hex with "0x" number minimum field width .number "precision": digits after decimal point for floating-point, max length for string, minimum length for integer l interpret integer as C type "long" or "unsigned long" h interpret integer as C type "short" or "unsigned short"
If you look at the example above you can see that the price field is formatted with the (%.2f align=right)which is precision, 2 digits after the decimal point with floating fixed decimal location, and of course align right.
If you set More decade to 10 it would look like this: More rows: 1 2 3 4 5 6 7 8 9 10 Next Last And of course after any changes, simply click on OK to put them into effect. 11.1.1c – Tables – Edit – Configure Table Display – Edit Page
The Edit page tab controls how the edit page for each record will look and act. For example, when you click on a SKU from the main Table Edit default page, it will take you to an Edit screen where you can work on the individual item you just selected. The Edit Page tab allows you to control how this Edit screen will work.
|
|
11.1.1d – Tables – Edit – Configure Table Display – Form Linking
The Form linking page allows you to add additional table information, so that you can view and/or update information from a relative table while you are editing the current one. For example, in our products table example, you may want to know how many of a particular item you have in stock. The products table does not have inventory information, but the inventory table does. So in order to see inventory information for the item you are editing, you need to relate the tables so that information from the inventory table can be viewed while you are working on the products table. The Form linking page allows you to do this. Lets go through each item and explain how it is used to link the tables, and then we will display the results of our example below.
|
|
11.1.1e – Tables – Edit – Configure Table Display – Included Form
The Included Form tab allows you to insert your own HTML / ITL code right into the table edit display. In the example shown above, a custom form to display the Product Images is created. To see the results of this form inclusion, see this example. The Product Images area is displayed below the Inactive drop down.
11.1.1f – Tables – Edit – Configure Table Display – Tabbed Display
The Tabbed display tab is an area to format the Tabbed display that you selected back in the 11.1.1a – Tables – Edit – Configure Table Display - General.
11.1.1g – Tables – Edit – Configure Table Display – Edit Page HTML The Edit Page HTML area allows you to completely configure the look and feel of the Table edit page. We will describe what each area configures. For all the following class assignments, you must remember that you have to have the classes defined in your CSS Style sheet. The default CSS Style sheet will be located in your theme directory, i.e. your_catalog/foundation/theme.cfg or your_catalog/default/theme.cfg. The basic CSS is located there, but you can easily enter your own by using Preferences, or going to the Variable.txt and edit the THEME_CSS variable entry.
Each of the areas below are numbered, and a corresponding number is shown on the example screen shot at the end of this section. This will allow you to see which settings are mapped to which areas.
The example screen shot below shows the locations of the above described area classes. I need to remind you again that you HAVE to have the classes you put in here already defined in either the default themes.cfg, or in Preferences, or in the THEME_CSS variable in Variable.txt.
|
|
11.1.1h – Tables – Edit – Configure Table Display – Spreadsheet page The Spreadsheet page tab allows you to set the formatting for the display characteristics of the Tables – Spreadsheet tab. The Spreadsheet tab allows you to view a table in the familiar spreadsheet layout, and edit the records in that layout. The Configure Table Display – Spreadsheet page just lets you decide what will be displayed, and how.
That wraps up the Configure Table Display section. . But to be perfectly accurate, you are not actually looking at the table, you are looking at a “View” of the table. This section has showed how to configure a View. In most cases, you will only have one “View” of a table, however in some cases you may want to have more than one “View”. So next we will look at how to create a new “View” based on the products table.
|
|
11.1.2 – Tables - Edit – Configure Table Display – Create New View The Create New View is actually a link accessed from the Configure Table Display section. There are really only a few screens that differ from the Configure Table Display screen, which is used to customize existing views. The Create New View has an entry screen, shown below.
On the entry screen shown, you will choose a name for your new view. We have chosen products_testview for the example. The Base Table is determined by which table you used to enter the Configure Table Display tab, in the example above we used the Products table. Next you can either start the view from scratch, or use an existing view to base your view on. This can save you some time if your view will be similar to an existing one. Once you finish this screen, click on the Next button and you will be taken to the General Tab of the Configure Table Display tab. |
|
|
|
Now that we have discussed how to configure the views, lets get to using them. The Tables’ tab allows you to access the tables of Interchange in many ways. From editing and viewing the tables through various views, to importing data into and out from the tables, to using SQL to directly access tables if you are using a SQL program such as Postgres or MySQL, Interchange gives you many ways to manipulate your tables. Lets move on now and describe the functions of the Table Edit screen (Remember that all of the columns described below are configurable in Interchange, especially in the Products area you probably will not have all of the same columns described from the Demo) We will explain the screen below, remember that you get to this screen by clicking on the table name link in the Table Manager screen.
Finally, when you select from the Line Item Link, the resulting page that you are taken to includes an additional row of Navigation tabs. This row of tabs is located directly below the standard row of Navigation tabs, Orders, Customers, Items, and so on. The tabs are shown below and consist of: Edit, Import Data, Export Data, Spreadsheet, Search/Replace, Direct SQL, New Entry, and Reselect Table. |
|
|
|
These tabs are also headings you will choose from as you use the Select for Table edit. You got to this tab by selecting an individual record using a Line item link, in the Select for Table Edit screen. You will now be able to edit this individual record; in this case the record is an item in the Products table. If you were editing another table, such as customers, you might be editing a record that was a customer. The point is that the Table editor does not care if it is a product, customer, vendor, whatever. It is simply allowing you to edit a record in a table. It is slightly confusing that the New Entry tab is shown above, but this screen is used to edit an existing record, or to enter a New one. So don’t let that throw you. We will be basically copying this help section for the New Entry section when we describe its uses. |
|
|
|
Sub Tabs – These tabs are for the Products table, and will be different if you are looking at a different table. The tabs may even be different if you are looking at the Products table on your version of Interchange, depending on how this VIEW is configured. We talked about configuring views here. So for examples sake, we are describing the default view of the products table from the demo:
|
|
11.1.4a – Tables - Edit – Select for Table Edit – General The General tab of the Select for Table Edit: screen, displays the following information, from top to bottom. Down the page are labeled text boxes, and each box is editable and updates your products database for the applicable item. The first box in the demo display is SKU. This contains the SKU for the product, it is also the primary key for the table. Normally when you are editing the product, you will not change this. If you do change this, a new product will be created, using the new SKU. If you want to get rid of this one, you would have to go back to the Tables Edit screen, put a check in the proper check box, and use the Delete button. The next box in the demo display is Short Description. Self-explanatory, this is the description that is returned on search results on the web site or other “list” based information about the item Moving back up the page are two “Grouping” boxes. The first is Product group. You can choose and existing group from the drop down window, or you can create a new one by typing into the text box. A Product Group is generally a top level for product grouping, with the Category being the next level down in the tree. In the example, Painting Supplies is the Product Group, and Rollers is the Category that the current product, with the part number or sku of os28004, is classified in. The next field shown for this record is Detailed Description. This is a text box and displays the detailed description for the product. Further down we see an “Inactive?” Label with a dropdown window. This selects whether the product is seen or accessible from the customers side of the website. Select inactive if you do not want this product to be accessible by customers at this time. At the time of writing, this also removed the product from view of the admin! To return the view, use the Direct SQL window and use something like the following, substituting your product sku: update products set inactive = '' where sku = 'os28008' Product images displays the current Image, and Thumbnail image for the product IF they are available and IF the pictures uploaded to the server for each product follow the proper naming convention. For the images to appear the “Image” must be named as follows: “12345.gif” where “12345” is the exact sku of the product. For example in the sample above, the image name is “os28057c.gif” . For images to appear in the “Thumb” they must be named “12345_b.gif” where “12345” is the exact sku of the product. For example in the sample above the thumb image name is “os28057c_b.gif”. Keep this in mind when naming images and thumbs for your site. (This can be changed by your Interchange developer, for example if you use .jpg or .png picture format instead of .gif) Note: The images will still display on the website with an odd name, they just will not show up here in the UI. So if given the choice, follow the naming convention.
|
|
11.1.4b – Tables - Edit – Select for Table Edit – Pricing Pricing area simply allows you to change the pricing for the item. In the demo, 2 pricing fields are shown, Product Price, and Dealer Price. This allows you to set separate pricing for different customers. The pricing fields need to be set in conjunction with the Customer Dealer Status Tab, among other things. |
|
11.1.4c – Tables - Edit – Select for Table Edit – Images Images tab is where you can upload your product images and thumbnails. To upload an image, simply click on the Browse button, select the image from your computer that you want to upload, and press the Open or Save button. Remember, for the image to properly display not only in your admin section but in the rest of the site as well, you must follow the proper naming convention. For the images to appear the “Image” must be named as follows: “12345.gif” where “12345” is the exact sku of the product. For example in the sample above, the image name is “os28004.gif” . For images to appear in the “Thumb” they must be named “12345_b.gif” where “12345” is the exact sku of the product. For example in the sample above the thumb image name is “os28004_b.gif”. Keep this in mind when naming images and thumbs for your site. (This can be changed by your Interchange developer, for example if you use .jpg or .png picture format instead of .gif)
|
|
11.1.4d – Tables - Edit – Select for Table Edit – Shipping / Tax / Other This tab has 3 simple product attributes to view or edit. First the products weight in pounds. This will be used to determine shipping charges if shipping is configured to use weight in the shipping charge calculation. Next is the Taxable field. Simply select yes or no if the product is or is not subject to tax. If “yes” is selected, this will subject the product to taxes that need to be applied based on your selections in Administration – Commerce – Taxes. Finally, Gift certificate Handling. This simply replaces the calculated quantity with the words “Amount of Gift:” in the quantity field. The customer will be entering a “quantity” on the web page, which will then be multiplied by the price you have set for each “unit”. So you may set the product price at $1 (in the price window described above) and the customer can purchase 50 units, or a $50 gift certificate. Once they select how many “units” they are purchasing, the cart will display the “Amount of Gift” verbiage in the quantity field. You can set the unit price at whatever level you like. |
|
|
|
The Table Import page allows you to upload a file from your desktop computer to the Interchange server in order to update one of Interchange's internal tables. We will discuss this page from top to bottom.
That is all that is required, but you must make sure the format is followed, or it will not work. Shown below is an example from an Excel spreadsheet of how to properly format a delete record.
First, to import a multi table import, make sure that each sheet has the proper name; relative to the table you want to upload. For example, if you are going to be updating/replacing the products table, make sure the sheet that has the products info is named “products”. Next, Interchange will not read the first sheet in the file, only subsequent sheets. So create a blank sheet at the beginning of the Workbook. The name of this sheet is not important, nor are the contents of the sheet.
Finally, make sure you have the proper field names and so forth that match your existing data. You can import slices, or partial pieces of the table, for example to update inventory you can simply use the key field, and the quantity and the table will be updated.
*Note these filter parameter definitions are quoted directly from the filter tag definition included in the Interchange documentation. The associated Perl code has been left out, as this is an Administrators Manual, not a Programmers Manual . You can find the code associated with these parameter definitions at the IC DevGroup web site, here. In addition, the filters must be properly formatted, for a single table import you can use something like this: fieldname:filter or using our example of the products database name:uc if you wanted to change all the names in the “name” field to Uppercase. If you were uploading more than one table at a time when you wanted to use the above mentioned filter, you would have to format it thus: products:name:uc so that Interchange would not be confused about which table the filter was to apply to. |
|
|
|
There are two sections to the Export data tab.
11.3.1 – Export Data – Export Complete table to file Export Complete table to file allows you to select a table, select the type of file you want, select the name, sort the resulting file using a column of your choice and also your choice of sort options.
*Note: These file type definitions are quoted directly from the IC Demo help file.
Finally, once you have selected all your options, click on the Export button and your file will be created, and as I said in this case it would be located in the catalog_name/products/directory. If you want to use this file, you would now need to go to the File Transfer page and download it to your computer. But why take all those steps, when there is a new and better way to get the table information onto your local computer, let’s look into the Download Table Slice area. 11.3.2 – Export Data – Download table slice The Download table slice is a fairly new feature to Interchange (as you may be able to tell from the “Export to file” text next to the Download button. But this is a VERY useful feature for administrators. It will let you choose a table, choose the fields from that table, and a name for the resulting file and download directly to your desktop, without all the steps previously required for the Export table to file procedure. The fact that you can choose specific fields, such as price, to be downloaded alone, along with the fact that there are fewer steps, makes this a great new option.
|
|
11.4 – Spreadsheet The spreadsheet view is extremely simple to use. Just edit any record you see, and click on OK. Or you can put a check mark in one or more of the check boxes, and delete them with the click of the Delete checked button. You can also create a new record by entering in the information into the New Record area, then click on OK. |
|
The Search Replace tab in the Tables section allows you to do large updates to specific columns on specific tables. For example, lets say you have a category named Nails, and you want to expand that category to include Screws. So you want the new name of the category to be Nails and Screws. We will go through each area of the Search and Replace tab and describe its use, and how you would use it for our example.
5. Click this button to do it – Ok, if I need to tell you what this button does, take the rest of the day off. Once you do click this button, if the operation is successful you will be taken to the Table Edit screen for the table you are on, and a message indicating how many rows were affected will be displayed. If there were no matches or you messed up with your regular expression, you will be returned to this page and an appropriate error will be displayed. |
|
The Direct SQL Query tab is another very straightforward page. If you are familiar with SQL, simply enter a query into the window and press the Submit Query button. If you are not familiar with SQL, then other methods of searching your data are recommended, such as the search box on the Table Editor screen. Your results can either be simply displayed on the screen, or if you select the Download radio button, you can download the results in a tab delimited text file. (Note: If you are using IE Explorer, clicking the button will display the results on your screen. You will then need to use the File Save menu selection to save your file. Mozilla will work directly) The Limit to window will limit the number of results that are RETURNED. This may trip you up in some cases, so remember it limits the records returned, not displayed. Base table – Select the base table you are querying here, you can do joins and search other tables, but use this to set the base table to be searched. Mike, does this need to be on the form? Just curious. I tried select statements w/o tables, just to see if it worked as a default, but no. Finally, the Clear Buffer button will just clear the collection of queries that will accumulate as you enter them. Queries, with a simple link for quick access, will be shown to the right of the text box as you create them. The will continue to accumulate until you use the Clear Buffer button, at which point they will vamoose! |
|
|
|
Sub Tabs – These tabs are for the Products table, and will be different if you are looking at a different table. The tabs may even be different if you are looking at the Products table on your version of Interchange, depending on how this VIEW is configured. We talked about configuring views here. So for examples sake, we are describing the default view of the products table from the demo:
|
|
11.7.1 – Tables – New Entry – General The General tab of the Tables New Entry screen, displays the following information, from top to bottom. Down the page are labeled text boxes, and each box is editable and updates your products database for the applicable item. The first box in the demo display is SKU. This contains the SKU for the product; it is also the primary key for the table. Normally when you are creating a new product, you may want to change this. Interchange will automatically insert a number here, but if you have specific product numbers you will generally want to use that to identify your product. If you want to get rid of this product, you will have to go back to the Tables Edit screen, put a check in the proper check box, and use the Delete button. The next box in the demo display is Short Description. Self-explanatory, this is the description that is returned on search results on the web site or other “list” based information about the item Moving down the page are two “Grouping” boxes. The first is Product group. You can choose and existing group from the drop down window, or you can create a new one by typing into the text box. A Product Group is generally a top level for product grouping, with the Category being the next level down in the tree The next field shown for this record is Detailed Description. This is a text box and you can enter the detailed description for the product. Further down we see an “Inactive?” Label with a dropdown window. This selects whether the product is seen or accessible from the customers side of the website. Select inactive if you do not want this product to be accessible by customers at this time. At the time of writing, this also removed the product from view of the admin! To return the product to view, use the Direct SQL window and use something like the following, substituting your product sku: update products set inactive = '' where sku = 'os28008' Product images displays the current Image, and Thumbnail image for the product IF they are available and IF the pictures uploaded to the server for each product follow the proper naming convention. There will be nothing displayed here yet, because you are creating a new item. You can upload the images from the Images tab.
|
|
11.7.2 – Tables – New Entry – Pricing Pricing area simply allows you to change the pricing for the item. In the demo, 2 pricing fields are shown, Product Price, and Dealer Price. This allows you to set separate pricing for different customers. The pricing fields need to be set in conjunction with the Customer Dealer Status Tab, among other things. |
|
11.7.3 – Tables – New Entry – Images Images tab is where you can upload your product images and thumbnails. To upload an image, simply click on the Browse button, select the image from your computer that you want to upload, and press the Open or Save button. Remember, for the image to properly display not only in your admin section but in the rest of the site as well, you must follow the proper naming convention. For the images to appear the “Image” must be named as follows: “12345.gif” where “12345” is the exact sku of the product. For example, if the product SKU was “os28004”, then the image name should be “os28004.gif” . For images to appear in the “Thumb” they must be named “12345_b.gif” where “12345” is the exact sku of the product. From the example above the thumb image name would be “os28004_b.gif”. Keep this in mind when naming images and thumbs for your site. (This can be changed by your Interchange developer, for example if you use .jpg or .png picture format instead of .gif)
|
|
11.7.4 – Tables – New Entry – Shipping / Tax / Other This tab has 3 simple product attributes to view or edit. First the products weight in pounds. This will be used to determine shipping charges if shipping is configured to use weight in the shipping charge calculation. Next is the Taxable field. Simply select yes or no if the product is or is not subject to tax. If “yes” is selected, this will subject the product to taxes that need to be applied based on your selections in Administration – Commerce – Taxes. Finally, Gift certificate Handling. This simply replaces the calculated quantity with the words “Amount of Gift:” in the quantity field. The customer will be entering a “quantity” on the web page, which will then be multiplied by the price you have set for each “unit”. So you may set the product price at $1 and the customer can purchase 50 units, or a $50 gift certificate. Once they select how many “units” they are purchasing, the cart will display the “Amount of Gift” verbiage in the quantity field. You can set the unit price at whatever level you like. |
|
The Re-select table tab is simply a link back to the Table Manager, where you can select a different table to work with. |
||
|
|