Instruction Manual

The specification of Scan-List was changed from v 1.1.0. (April 16, 2021 Updated)

The environment you need


Database

MySQL or PostgreSQL, etc.
It's a reward support.

Web Server


Apache, etc.
It's a reward support.

Wi-Fi or Internet Access


t's a reward support.

Barcode or QR code


It responds to both common barcodes and QR code.
There are a lot of barcodes format, so please make sure that Swan DB is responding to you and adopt it.
It's a reward support.

iOS / iPadOS Device


You need iOS / iPadOS version 13.0 or later.
If you want to update iOS/iPadOS, check in advance and use it in business. You don’t have to do an iOS/iPadOS update, especially if you are not disabled with the actions of Swan DB.
Automatic updates with iOS / iPadOS, and Swan DB are recommended off.
To read a barcode or a QR code, you need a back camera on the device . The front camera is off-minded. Some iPods and iPods do not have light features and vibration features that illuminate dark places.
Also, if you use Swan DB and other apps on two screens in the multitask feature of iPad, the camera is not available. So far, this is a specification.
What kind of model would you prefer, if you prioritize your mobileity, if you have a lot of information you want to see, an iPad, you can choose on the interval, and the iPad mini, the iPhone Pro Max, etc.
We're not responding to Android devices.
It's a reward support.


About Web Apps


Create web apps that can be connected to your database with PHP or Python, etc. In this manual, I will explain it with PHP. The Swan DB sample web apps are also created in PHP.
If you want to get results, use HTTP GET Method. If you want to update your database, use HTTP POST Method.
These are recommended.Because you can't reload on the POST screen.
Even if you go back & forward on your browser, you do it on your web apps and off on the Swan DB recommendation.
It's a reward support.


How to set the Scan-List

If you use the Scan-List feature, you can download an entry list from the database after you read an order barcode, and then you can send together continuously after a single individual read.
To use this feature, you will need to make webs app along the specification.

When Swan DB Inner browser receives the JavaScript's "swan_subscan" callback, the Scan-List screen will be activated. The collback argument will be a associative array of JSON format.


Example PHP

<?php
    $dic_json = json_encode($php_array);
?>

<script>
    window.webkit.messageHandlers.swan_subscan.postMessage(<?php echo $dic_json; ?>);
</script>

Format of JSON

{
    "swan_master_id" : "21-03-2980",
    "swan_subscan" : "barcode",
    "swan_title" : "Oder 21-03-2980",
    "swan_url" : "https://www.polylize.com/Swan DB/sampledb/2-3_post.php",
    "swan_count_title" : "Recive",
    "swan_sub_text_title" : "Shelf number",
    "swan_list" : [
        {
            "id" : "A1234567",
            "name" : "Item A",
            "sub_text" : "1F-A212",
            "count" : 30
        },
        {
            "id" : "A1234568",
            "name" : "Item B",
            "sub_text" : "2F-B311",
            "count" : 12
        }
    ]
}
    

If you change key name or lack the key, it doesn't work correctly. Please fill out this way. In case of the QR code scan, change the value of "swan_subscan" from "barcode" to "qr". The difference is the height of the camera screen.
It's the same if it's an iPad.
“Swan_master_id" is a code read in a forward screen. I think it will be an order number that identifies the list.
Even in numbers, Swan DB will be treated as a string.
"Swan_title" is the text shown on the top of the screen. If the workers make information that is easy to recognize, it prevents errors.
Please specify the POST URL for "Swan_url". It's definitely HTTP POST method.

Only if there is a key to the "wan_count_title" will enable "count" of "swan_list". The value of Swan_count_title" is displayed on the user interface. This example is used on Receive count.
Similarly, only if there is a key to "swan_sub_text_title" will enable "sub_text" of "swan_list" will be effective.
The value of “Swan_sub_text_title” is displayed on the user interface. This example is used on Shelf number.
“Id” is a unique string to narrow down the object you want to update. Even in numbers, Swan DB will be treated as a string.
“count” is the number of manipulation. It is also possible in the string, but please put in the valid number. The decimal is also possible but the index notation is not use. You can't use Plus Minus symbols or three digit districts.

"Sub_text" is a string of manipulation. Please use the shelf number and so on.

"Swan_count_title" and "Swan_sub_text_title" decide whether it will enable according to the content of your work.


Screen on Swan DB



image0


The data sent from Swan DB after reading is also a associative array of JSON format.


Specification of JSON Format

{
    "swan_master_id" : "21-03-2980",
    "swan_list" : [
        {
            "id" : "A1234567",
            "name" : "Item A",
            "new_sub_text" : "1F-A212"
            "new_count" : 0
        },
        {
            "id" : "A1234568",
            "name" : "Item B"
        }
    ]
}

The specification of Scan-List was changed from v 1.1.0. (April 16, 2021 Updated)
The number is stored in the "new_count" regardless of the number of changes.
Without any string changes, the “sub_text” is stored in the "new_sub_text".
If you receive JSON on the web app and update your database, please also show the JSON’s associative array on a web app page.


Example PHP

<?php
    echo json_encode ($dic_success);
?>

Success JSON Format

{
    "swan_success" : " 2 items is Updated."
}

If the JSON has a "swan_success" key, Swan DB will show its value in the alert and close the Scan-List screen.
Please show the errors contents such as if the update is failing. No parallel, not the JSON format or HTML tags. It's not JSON format sequence or HTML tags, but in a normal text.

Example ERROR

<?php
    echo 'ERROR:It is negative number.';
?>

Others are a reward support.