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.

  • Table Name – Each table is listed by name, and each name is also a link that will take you to the Table Edit screen, and the entrance to all the available sub tabs of the Table tab.

  • Views – Views are simply alternate ways of looking at the data. You can create a view to show data in a table in a way that makes sense for the viewer. For example, you may want someone from accounting to view products with the prices and inventory levels, and you may want someone from marketing to be able to view the description and various promotion possibilities for each item. If there have been alternate views created on a table, it will be shown here as a link. For more information regarding Views and their creation, click here.

  • Import – - Bring new information into the internal Interchange database from an outside source, such as a text file.

  • Export - – Export the data from an internal Interchange database, to a file on the server. Which is then available for download using File Transfer.

  • Upload - Click on this link to upload a file of the same name from your computer to the Interchange server. Warning – This will replace the file located on the server … use with care.

  • Download – - Click on this arrow to download the file from the server to your local computer.

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:

Select for table edit: products Product information

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:

  • View::Table – This area displays the view and or table that you are working on. If it is the main table, and no other views have been created, you can use the table name as default. For example, in the screen shot above you can see that just the table name, “products” is displayed in the window. If it were an additional view of the table products, say for example a marketing view you created, it might look like: “marketing::products” instead.

  • Description – Use this to give a brief (one or two word) description of your view. This will be displayed next to the table name on the Tables tab display.

  • Use tabbed display – Yes or No. When you select yes, the table edit area will use multiple page tabs for displaying the categories you set up in the 11.1.1b – Tables – Edit – Configure Table Display – Edit Page. When you select no, the page will be displayed as one single page, with headings separating categories.

  • Allow File Upload for this table – Yes or no. – This will allow, or prevent, upload of a new file for the selected table from the Table Manager. Although I could not get it to work on the demo.

  • Present item specific meta for this table. - ?This determines whether the “Meta” tags are displayed in the item edit area of the table editor. However on the demo the Meta tags are already displayed, and when this is selected, an additional meta tag is displayed.

  • Allow these ITL Tags - ??

  • Import Field Filtering - ?Use Interchange filters to selectively format data displayed.

 

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.

  • Rows on select page – Number of rows to display per page.

  • Sort by on select page – Choose a field to sort the rows that will be displayed.

  • Sort modifier for select page – Four sort modifiers for the previously selected field. You can choose from :

  • None - Standard alphabetic sort, ascending. “A, B,C…a,b,c”.

  • Numeric – Standard numeric sort, ascending “1,2,3,4…9,10”.

  • Reverse – Standard alphabetic sort, descending. “z,x,y…Z,X,Y”.

  • Case insensitive – Alphabetic sort, ascending, case insensitive “apple, Auto, Blue, boy…”

  • Complex sort for select page – If the previous sort options are not enough for you, you can specify more sort options. These sort options DO NOT work in conjunction with the previous simple options, rather they will override them. So if you use this field, remember that it will be the ONLY sort options in effect. To use this option, simply put a comma separated list of fields that you want sorted into this text field. If you want modifiers on the field, add a colon to the field, followed by the modifier. For example, if you wanted to sort first on the price field (descending), and then the description field, you might put

price:r,description

The abbreviated letters for sort modifiers are:

  • Numeric – n

  • Reverse – r

  • Case insensitive – f

  • Show on Select page – Here you choose which fields you want to have displayed on your page. You can also chose some Perl display or formatting attributes such as:

%% 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.

 

  • Special Additions – Allows additional related fields to be displayed. In the example, Qty Price, Options, Up sell, Cross-sell, and promotion are among the selections. Can only relate to tables which have records that are keyed with the same SKU field as your current table. For example, the Promotion selection ties to the promotion field in the merchandising table. The merchandising table is keyed by product SKU’s. The product table is also keyed by product SKU’s.

  • More with alpha links – Displays Alpha links instead of numbers on the More listings. Did not work on Demo site.

  • More decade – This is the maximum number of pages that will be listed before the word Next shows up in the links. For example, if you set the rows on select page to 10, and set More decade to 5, then the more links at the bottom of the page would look like this:

More rows: 1 2 3 4 Next Last

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.

  • Fields to edit – Here is where you set up the categories and fields that will be accessible for someone to edit, when they click on the SKU field. A list of available fields is displayed in the left window. You can create a title or category to group fields in, by using the format shown in the example above. Simply start the entry with an equal sign, and make sure that there is a blank line before and after the entry. If you have chosen to use tabbed display then these titles or categories will each become a tab page, and the fields will be displayed on this page. If you have chosen not to use tabbed display, then the titles will simply appear as a paragraph header, separating this group of items from the next all on one page.

  • Buttons only on bottom – Did not work that I could tell.

  • Buttons only on top – Did not work that I could tell.

  • Custom View from field - ?

  • Form Profile -

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.

  • Table to link in cell – Choose the table that you want to view related information from. In the example we are using the Inventory table.

  • Column to appear before – This is where on the page your linked table information will be displayed. In the example we are putting the Inventory information before the location where the Inactive field is displayed. See below for results of our example.

  • Foreign Key – This is the key from the table we are linking to that relates to the Primary key from the current (products) table, or SKU in our example.

  • Label for linked table – This will be the title that is displayed for the form you are creating. If you look in the example below, you will see that the text “Inventory Table” that we entered above, is displayed to the left of the fields below.

  • Sort linked records by – If you had a number of records that were related to each record in the current table, for example if you had multiple product options for each product such as size or color, then you could sort the records that were returned. In our example, each product only has ONE corresponding Inventory record, so we only get ONE record returned.

  • Fields in table to link – Here you can list the fields that you want to see returned. If you leave this blank, it will return ALL fields from the table. If you want just a few, as we have done in the example, you enter in the fields separated by a space.

  • Allow auto_number in link - Need to understand better to explain.

  • Field indicating valid row - ?

  • Number of blank rows – If you want to enter additional records into the foreign table, say additional options if this was an option table, you can specify how many blank rows will be available. In the example we have left the field blank, therefore defaulting to 1 blank row.

  • View to derive link display - ????

  • HTML style info for linked cells – This is an area that you can use to enter in any special style you may want for the cells you are creating. In the example, we just put a background color in to emphasize what is being formatted. The style info should be appropriate for a HTML <TD your_style_here> </TD> type tag.

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.

  • Column for include to appear before – Use this to determine where your form will be inserted. Use one of the field names that you specified in 11.1.1c – Tables – Edit – Configure Table Display – Edit Page

  • Custom form widget for inclusion – Put your HTML / ITL here.

  • Expand values of include – Yes or No

  • Full interpolate of Include – Yes or No

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.

  • Tab Width – I could not get any of the tab settings to work, all the panel settings worked as expected, but tab settings did not seem to affect anything? I looked at the page, and it looks like the mvpantab is defined as a class, but that class is never used anywhere? Mvpanpanel is defined AND used, but not the tab class. A java script variable is set, but never used that I can tell.

  • Tab Height -

  • Tab Horizontal Offset –

  • Tab CSS Style – You can insert any valid CSS Style sheet into this area, and it will be applied to the tab area.

  • Panel Lightest Shade – Simply sets the background for the panel color. 4 choices, White, Light Gray, Medium Gray, and Dark Gray.

  • Panel Width – Sets the width for the panel display on the Edit screen.

  • Panel Height – Sets the height for the panel display on the Edit Screen.

  • Tab Vertical Offset - ?

  • Panel CSS Style - You can insert any valid CSS Style sheet into this area, and it will be applied to the panel area.

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.

  1. Width Specification for Editor table – Just like it sounds, the over all width for the table, you can use a number for a fixed pixel setting, or a % for a table width set that will fluctuate with the browser width.

  2. HTML Widget Class – This will set the class for the entry or selection boxes.

  3. Break row Class – Not used in this template.

  4. User Widget Class – Not used in this template.

  5. Data cell Class (standard row) – The main cell that contains the HTML selection widget, and the help cell.

  6. Help cell class (standard row) – The help cell that contains (if applicable) the help text. In the example there is only one example, which is in the category row. There is the help text “Enter in box for new category”.

  7. Width specification for label column – Width of the left hand column that contains labels for each of the settings.

  8. Data row class – This is the entire row, which is made up of the Label Cell, and the Data cell(which contains the HTML Widget and Help text cells). May be repetitious, but use as necessary.

  9. Spacer row class – Not used in this template.

  10. Label cell Class (standard row) – The left most cell, that contains labels for each of the settings.

  11. Widget cell Class (standard row) – The cell that holds the HTML Widget. Different from the Data cell class, which holds BOTH the HTML Widget, and the Help text cell.

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.

  • Number of Rows – This is the number of rows to display per page.

  • Column Width – The setting for the columns width is often over ruled by the individual width settings found in the meta settings for individual columns. In the Tables Edit Select for Table Edit screen you will see a small clickable link, to the far right of each field. For example SKU. If you click on this link it will bring you to a screen where the attributes of the individual fields are set. These settings also apply to the Spreadsheet view. If they are not set, then Column width will supply the width.

  • Fields to Edit – Which fields will be displayed for editing. Choose from the scroll window on the left, or enter directly into the window on the right.

  • Rows in a Textarea – Number of rows that will be displayed, maximum, in a text area. Subject to same circumstances described in Column width above.

  • Fields for textarea display – Select which fields, if any, you would like to have displayed as a Text area. Some fields, such as “comment” may contain quite a bit of data, and you may want them displayed so they are easy to view and edit.

  • Fields to meta Display – No, just can’t see what this one does.

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.

 

11.1.3 – Tables - Edit

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.

  • Sort link – The Products table has headings at the top of each column that are called Sort Links. You may want to sort your information for any number of reasons.  Interchange makes it easy.  At the top of each column, is the column heading.  In the Table Edit table on the Demo the column headings are: SKU, Short Description, Product Group, Category, and Product Price. All of these headings are sort links. If you click on any of these headings, the page will be sorted according to the order of the column selected. For example, if you wanted to sort by the Items description, from A-Z, simply click on the Short Description Column. Want to sort from Z-A? Click on the Short Description link again. This time is will be sorted in reverse order.

  • Limit with Search Box – At the top right hand corner of the screen you can see a search box, simply type in what you are looking for and this will search all fields of the current table for results.

  • Line Item Link – Line item links are links that are accessible from the each record line. In this view of the Products table, there is 1 line item link, SKU. In the screen above the first line item link is “os28004”. When you click on this link it will take you to the Tables – New Entry - Select for Table Edit page. The columns in the Table Edit page may vary, and as such the Line Item Links may vary.

  • Vertical Check boxes - The vertical column of check boxes on the left side of the page and adjacent to individual Item records, allows you to select individual Items, or a group of items that you want perform an operation on.  For example if you place a check mark in the box adjacent to the first Item, os28004, then you can use one of the BUTTONS at the bottom of the page to:

  • Delete Checked Items - CAUTION! This is permanent. Use this button to DELETE all Items with a check mark in the vertical check box next to the adjacent Item record WITHOUT FURTHER ACTION!

  • Edit Checked Items - Use this button to move to the “Select for table edit” page all items with a check mark in the vertical check box next to the adjacent Item. You will arrive at the Select for table Edit page with the first item select by checkmark. Once you edit this item, and click on OK, the next selected item will appear on the Item Edit page, and so on until you have clicked OK for each of the selected items.

 


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.

11.1.4 - Tables – Edit - Select for Table Edit

 


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:

  • General - View general information regarding a record, in this case an item, such as description, group, category, etc.

  • Pricing - View and Update product pricing.

  • Images – View, upload images for product, such as full size and thumbnail images.

  • Shipping /Tax /Other – View and edit product weight, tax options, gift certificate options.

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.

 

11.2 – Import Data

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.

  • Table Name – The name of the table that you want to update. In our example, products is the table we will be using.

  • Fields to be ignored – Not applicable – If you wish to import a “slice”, simply include only those fields that you wish to import. The only field or column that is REQUIRED, is the key field, which in the case of the products table is the SKU field or column.

  • Import from File – Use the Browse button to select a file from your local computer, then use the import button to bring the data into your Interchange database.

  • Add new items if present – This window allows you to add new records if there is a new key with the record, if you only want to update existing rows change this to “Ignore new items”.

  • Allow delete – This will allow a record to be deleted. In order to delete an item, you must use a specific format in the import file.

  • You must remove the SKU or whatever entry is in the Key field.

  • Next you must put the word “DELETE” in the second field. Capitalization is REQUIRED!

  • Next you must put the SKU or whatever entry was in the Key field into the third field.

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.

  • Autonumber if no key – Use this option to allow Interchange to insert a number into the key field if it is blank. If you have specific part numbers for your products, do not use this. This option will put a number into the key field if it is empty. You want Interchange to check this for you, in case you forget to put in a value in this field or if you have a poorly formatted import file. If on the other hand you are importing a table that you want Interchange to set up a primary key for you, then you can use this option.

  • Use Transactions – Could not figure out.

  • Import Type – There are basically two types of import, single table and multiple table. Gnumeric and XLS are the multiple table import formats currently used.

  • Single table – Use this for a standard tab delimited, single table import.

  • Gnumeric simple text – Use this when uploading from Linux systems using Gnumeric spreadsheet program. I could not get this to work using a text configurable save as format. Using Gnumeric 1.0.5, tried both single and multiple tables. I was able to get it to work using a save as xls file, and use the procedure described below with the blank table.

  • XLS Spreadsheet - When using the XLS Spreadsheet import option, you have to make sure that you have the proper module, Spreadsheet::ParseExcel, installed on your server. If you do not, it will not work. During the writing of this manual, the following procedure was used to successfully perform a multiple table (multi-sheet) import.

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.

  • Show summary/add record/delete record messages – Shows all available messages for results of import procedure. For example if records are added or deleted it will display not only that records were added or deleted, it will show which records where added or deleted.

  • Show summary messages only – Shows only summary messages, for example if records are added or deleted, will simply show message “table products: 2 records deleted.”

  • Show no messages – Will only show whether or not the operation was successful such as: “Importing multiple tables: Upload succeeded”

  • Field Filters – You can filter the incoming data (change it to meet some criteria you desire) using any of the built-in Interchange filters, or you can build your own. Contact your Interchange Developer if you need assistance with additional filters, or with help applying these. Note: Some of the following filters are not useful in this application, however for completeness sake we will list them all here. Here is a list of pre-built IC Filters:

  • cgi - Returns the value of the CGI variable. Useful for starting a filter sequence with a seed value.

  • digits - Returns only digits.

  • digits_dot - Returns only digits and periods, i.e. [.0-9]. Useful for decommifying numbers.

  • dos- Turns linefeeds into carriage-return / linefeed pairs.

  • entities-Changes < to &lt;, `` to &quot;, etc.

  • gate - Performs a security screening by testing to make sure a corresponding scratch variable has been set.

  • lc- Lowercases the text.

  • lookup - Looks up an item in a database based on the passed table and column. Call would be: [filter op="uc lookup.country.name"]us[/filter]This would be the equivalent of [data table=country column=name key=US].

  • mac - Changes newlines to carriage returns.

  • name - Transposes a LAST, First name pair.

  • namecase - Namecases the text. Only works on values that are uppercase in the first letter, i.e. [filter op=namecase]LEONARDO da Vinci[/filter] will return ``Leonardo da Vinci''.

  • no_white - Strips all whitespace.

  • pagefile -Strips leading slashes and dots.

  • sql - Change single-quote characters into doubled versions, i.e. ' becomes ''.

  • strip - Strips leading and trailing whitespace.

  • text2htm - Rudimentary HTMLizing of text.

  • uc - Uppercases the text.

  • unix - Removes those crufty carriage returns.

  • urlencode-Changes non-word characters (except colon) to %3c notation.

  • value - Returns the value of the user session variable. Useful for starting a filter sequence with a seed value.

  • word - Only returns word characters. Locale does apply if collation is properly set.

*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.

 

11.3 – Export Data

There are two sections to the Export data tab.

  • Export Complete Table to file – This will export any Interchange table to a file located on the server.

  • Download Table Slice – This will allow you to not only export a table or a portion of a table, but also download the resulting file to your local machine!

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.

  • Table to Export – Select a table from the dropdown.

  • Export as – File types to choose from:

  • Current Type/System Default
    Types specified in the Interchange configuration files.

  • TAB Delimited
    First line of the file represents column names. Each line represents a row, with tab characters separating columns.

  • CVS
    The same as TAB delimited, but separated by commas and quotes.

  • PIPE Separated
    The same as TAB delimited, but separated by | characters instead of tabs.

  • %%/%%%
    One column per line, separated by %% lines, with %%% between rows.

*Note: These file type definitions are quoted directly from the IC Demo help file.

  • Export to file – Choose a name for your export file. If you leave this empty, the default file will be used. In our ongoing example, if you were exporting the products table, the products.txt file will be generated (normally replacing the existing products.txt if it exists). You can choose any name you like here if you want to create a separate file for other uses. The resulting file in this case will be located in the catalog_name/products/ directory.

  • Sort by column – You can choose a column to sort by if you wish, lets use price for an example.

  • Sort options, choose one to sort the column you just chose. We might use reverse numeric in this case, or one of the following options:

  • default (alpha)

  • reverse

  • numeric

  • reverse numeric

  • case-insensitive

  • case-insensitive, reverse

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.

  • Fields from table to download – Remember that to choose a specific table, you first use the Table Manager, select a table, then select the Export tab. Now you can choose one, two, or any number of fields to include in the download. For large tables and slow connections this is a great option. The Check all, and Uncheck all are simply quick tools to do just what they say, Check all of the fields, or uncheck all of the fields. For an example, lets say we have a database with 100,000 products that we need to update prices for every day. The first thing we could do is download the existing data via the table slice mode, choosing sku and price as the selected fields. This would give us our basis to work with. We could import that into Access, Excel, or other desktop tool, and update all prices. We could then use the Table Import feature, to just import these two fields, without having to use our internet connection to transfer detailed descriptions, images, categories, or any other unnecessary information.

  • Output File – Enter a name for your download file.

  • Export to file – Not applicable. Download button is located here. Note: Button does not work properly with IE Explorer 6. Mozilla browser works perfectly. For IE Explorer, you click on the Download button, and then do a File save as with the resulting page.

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.

11.5 – Search/Replace

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.

  1. Choose a table to operate on – Pick your table, in our example we will be using the products table.

  2. Choose a column to operate on – Choose the column which contains the text that you want to replace, in our case the text we want to replace is in the Category column of the products table.

  3. Set what to search for in that column – You can use either plain text, which most will probably be familiar with, or if you are familiar with Regular Expressions, you can use them here as well. For our purpose of example, we will use the plain text, “Nails” because we know what we are looking for and it is easily found with plain text. If we had a situation where we wanted to pluck out just part of a string, we could use parentheses. For example if we had “Hammers and Nails” in the string, and we wanted to change that to “Hammers and Nails and Screws”, we could do “Hammers and (Nails)” in the search string, and then “Nails and Screws” in the replace string, and only the string inside the parentheses, “Nails”, would be replaced.

  • Case-sensitive? – Self-explanatory, we will not use this for our example, although if there were other categories that also contained the word nails, we may want to use it so that only our “Nails” with the capital “N” would be replaced.

  1. Choose the replacement string - The exact text you would like to have inserted. In our example we will be putting “Nails and Screws”.

  • Replace all occurrences? – If this is yes, then all occurrences of the target search string will be replaced. If this is no, only the first match will be replaced. (This does not work in the Demo, looks like it might be a typo in the search_replace.html page, line 156 is the beginning of the if ($CGI->{replace_all}) statement, the else is the same as the if.)

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.

11.6 – Direct SQL

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!

11.7 – New Entry

 


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:

  • General - View general information regarding a record, in this case an item, such as description, group, category, etc.

  • Pricing - View and Update product pricing.

  • Images – View, upload images for product, such as full size and thumbnail images.

  • Shipping /Tax /Other – View and edit product weight, tax options, gift certificate options.

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.

 

11.8 – Re-select Table

The Re-select table tab is simply a link back to the Table Manager, where you can select a different table to work with.