Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import guide for Cobalt + minor corrections to optimization.md #73

Merged
merged 4 commits into from
Jul 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 12 additions & 12 deletions en/cobalt/_posts/user/2013-01-01-optimization.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ layout: doc
title: "Improve Cobalt performance"
date: 2013-07-22 18:00:00
tags: other
intro: "How to have Cobalt to work quicker."
intro: "How to make Cobalt work faster."
---

Cobalt is quickest CCK for Joomla for sure. I am glad that improving speed is not greatest concern for all Cobalt users, because it is very good at it by default, even with all features turned on.
Cobalt is the quickest CCK for Joomla for sure. I am glad that improving speed is not the greatest concern for all Cobalt users, because it is very good at it by default, even with all features turned on.

But if you want to ensure that it uses it's maximum performance here are the tips that can help you to understand when and what can slow performance down.
But if you want to ensure that it uses it's maximum performance capabilities, there are some tips that can help you to understand when and what can slow performance down.

## Rule of thumb

There are an additional code behind almost every parameter. Some codes are simple, some may affect performance. The rule here is simple.
There is additional code behind almost every parameter. Some codes are simple, some may affect performance. The rule here is simple:

<div class="alert alert-success">Turn <b>OFF</b> everything you do not use. Turn <b>OFF</b> everything you use but you could survive without or giveup. Only use features you cannot live without.</div>
<div class="alert alert-success">Turn <b>OFF</b> everything you do not use. Turn <b>OFF</b> everything you use but you can live without if not active. Only use features you really need and can't renounce to.</div>

## Section parameter "Category count mode"

Expand All @@ -24,29 +24,29 @@ If in your section you use category records count and do not have unpublished re

## Section parameter "Mark new records"

Although this sounds easy, there is complex algorithm behind. What articles user had not yet opened? What user? What if it is public user? This algorithm is based on user data, sometimes session and cookies. If you do not mark articles as unread, turn this off.
Although this sounds easy, there is complex algorithm behind. What articles user had not yet opened? What user? What if it is public user? This algorithm is based on user data, sometimes session and cookies. If you do not need to mark articles as unread, turn this off.

## Records `ctime` and `extime`

Every record has to important time marks. `ctime` - time of start to be shown in the list and `extime` - time of expiration. To implement that something like this is added to query.
Every record has two important time marks. `ctime` - the first time to be shown in the list and `extime` - time of expiration. To implement that something like this is added to query.

AND ctime < '2013-08-04 03:25:22'
AND (extime = '0000-00-00 00:00:00' OR extime > '2013-08-04 03:25:22')

But very often this features are not used in the section at all. You may turn 2 section parameters "Who can see future articles" and "Who can see expired articles" to _Public_. Then this limiting condition will not be added.
But very often these features are not used in the section at all. You may turn 2 section parameters "Who can see future articles" and "Who can see expired articles" to _Public_. With these limiting condition on, the extra query will not be added.

## Order by fields

If you have a lot of articles in one section, then it is good to avoid if possible sorting them by field.

DB should first order all your articles in section and only then apply limit. This require load all records to memory.
DB should first order all your articles in section and only then apply limit. This require to load all records to memory.

## Show restricted

Section has parameter "Who can see restricted". This allows to list articles that user do not have access to in the list but still not access to full view.
Section has parameter "Who can see restricted". This allows to show list of articles that user do not have full access to.

To check restrictions in the query is an additional `WHERE` conditions in the query. So if it is not important is user can see restricted articles in the list, allow everyone see restricted articles in th list.
To check these restrictions there is an additional query `WHERE` to the DB. So if it is not important that a user can see restricted articles in the list, allow everyone to see restricted articles in the list.





Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
layout: doc
title: "How to use the import feature of Cobalt"
date: 2015-07-27
tags: setup
intro: "Learn how to import records from a .csv file in Cobalt."
---

One of the great features of Cobalt is the possibility to import large amounts of records from a `.CSV` or `.JSON` file into Cobalt so that you can create automatically new article/items/anything in your site. In addition, it is a smart import. If the users import the same file again, Cobalt will create new articles and update previously imported articles. For example, sellers may import their products' CSV to update their stock or prices.

Before starting you need a Section and a Type where to import your records. You can find more information about it in the <a href="http://docs.mintjoomla.com/en/cobalt/cobalt-quick-start">Quick start page</a>.

## Step 1 - Create Joomla Menu Element

As many other functions of Cobalt, you work with imports from the __frontend__ of your site. So you need to create a menu item first to acess the import page.

![Create menu item](http://adwsfiles.s3.amazonaws.com/test/2015-07/1437607371_mj_cob_menuitem_new.png)


choose Cobalt MenuItem types ...

![Cobalt type menu](http://adwsfiles.s3.amazonaws.com/test/2015-07/1437607400_mj_cob_menuitem_types.png)

scroll down and choose Import

![Import menu item](http://adwsfiles.s3.amazonaws.com/test/2015-07/1437607472_mj_cob_menuitem_import.png)


then select a type you want to limit your imports.

<div class="alert">Remember to limit the acess to this menu item accordingly to your site needs, otherwise anyone can populate your record database!</div>


## Step 2 - Import the CSV file

As you can guess you first upload your CSV or JSON file, this is how the import is presented

![Cobalt Import page](http://www.mintjoomla.com/images/cobalt-export-import.jpg)

wait for the upload to complete and click on next. You will now be able to choose an import profile or create a new one. When you create a new profile, the area below will show the parameter fields for the import along with the Fields you created for the Type you specified in the import menu settings (see Step 1 above).

![Import fields](http://i.imgur.com/tTuX5tk.jpg)

In the Name field, you give the name of the import profile you are creating.<br>
The ID field is the special field you can use to allow updates, but you can also leave it alone selecting "Do not import anything here". If you use it, select a column of your spreadsheet file with a "unique" name, so that with next imports, if you import selecting again that same "ID", you will update your records in the DB and create new others if there is something new.<br>
In the Title field you select a column to use to give to each record the title of the article.

The remaining fields are generated based on what you created in the selected Type of the import.

When you have selected all your required fields, click next to finish the process.

<div class="info">If you encounter any issues in the process try to resave your CSV file, and use COMMAS as delimiter of your file.</div>