Support > Repository > Definition of model items > String - zip code
ja | en

You can specify a zip code as a string type attribute. Address linking function becomes effective.

Example of execution

After entering the postal code, click the "Synchronize address" button.Then, the address information is supplemented.(FIGS. 1 and 2)

Figure 1 Enter the zip code and press the address synchronization button
Figure 2 Address is set

Definition method

Select "Postal code" in the type detail setting of the string type item.At this time you can not press the OK button.(Figure 3)

Select figure Zip code

Specify the item corresponding to the postal code.(Fig. 4) After specifying, press the OK button.

Specify an address item corresponding to the figure zip code
If there is no item corresponding to the address, you can not use the postal code type.

Search rule

When you specify a search condition in the "ZIP code" type item, you must also specify the corresponding address item in the search condition together.

Regular expression check for zip code type items

Regular expression checking is automatically enabled by default.It becomes "3 digit number + hyphen (none is acceptable) + 4 digit number".

Example of execution

You can also enter the postal code halfway and click the "Synchronize Address" button.The choices for the zip code and address candidate are displayed.

In Figure 3, we have entered the first five digits.

Figure 3 I entered the postal code halfway

When you press the "Synchronize Address" button, candidates are output to the list box.

Figure 4 Candidate is output

Select one of the candidates and confirm the zip code and address by pressing the "Synchronize Address" button again.(FIG. 5, FIG. 6)

Figure 5 Select a candidate
Fig. 6 Confirm postal code and address

Definition method

There is no special definition.The candidate output function works with standard.

As postcode is a type of string type, the "string (general)" filter is selected by default.
This filter converts numbers to single-byte characters, but "-" (full-width hyphen) remains full-width characters.

Then you can revise "Fullwidth → Half Horizon" again so that you can convert the hyphen to half-width.

Wagby has"Zipcloud" provided by Ibisu Inc.When,Postal code data provided by Japan Post (business postal zip code)A zip code dictionary file generated based on is included.

Postal codes provided by Japan Post include irregular data.Specifically, it is a special notation which can not be interpreted by a program.(Example: "For addresses not listed below xxx" etc.)

Ibis' "zipcloud" provides what is processed in such a way that such irregular data is eliminated as much as possible.(However, please note that conversion of all zip codes is not guaranteed in advance.)

Postal code you are using

For each version of Wagby, at what point in time zip code data is included, Wagby'supdate informationIt is stated in.

File location

The body of the postal code dictionary is a binary file called zipcode.dat in the WEB-INF/jmaster folder.

I will explain how to create zipcode.dat using zip code data provided by Ibis Corporation and individual zip code data of business offices provided by Japan Post.

  1. "Zipcloud" provided by Ibisu Inc.And click the "download" link.This data is released free of charge.
    Figure 7 zipcloud
  2. Download "" (YYYY is the year number, MM is the month) Renamed "", Wagbyapp/webapps/wagby/WEB-INF/jmaster.
  3. Postal code search site of Japan Post Access the "Download zip code data" link.(It is updated once a month at the end of the month.)
    Figure 8 Zip Code Search Site
  4. Click the link to download the individual zip code of the business office.
    Fig. 9 Individual zip code download at work site (1)
  5. Click the link to download in zip format.
    Fig. 10 Individual zip code download at work site (2)
  6. Click on the download link of the latest data, the file "" will be downloaded.(The file size varies depending on the year and month.)
    Fig. 11 Individual zip code download at the office (3)
  7. Also download the downloaded "" in wagbyapp/webapps/wagby/WEB - INF/jmaster.
    Figure 12 jmaster folder
  8. Stop the Wagby application.
  9. Launch the command prompt and go to the wagbyapp/webapps/wagby/WEB-INF folder.
    Enter the following command and execute it.
    java -cp lib/j_util.jar;lib/commons-lang.jar jp.jasminesoft.util.address.GenerateMasterData
    If the java command does not work,Installation of JavaFollow the instructions to install Java.

    It is output as follows.

    >Java -cp lib / j_util.jar; lib / commons-lang.jar jp.jasminesoft.util.address.GenerateMasterData Generate Master Data Program. Compaction = true Reading postal file ... done. Creating zip file ... done.
    Figure 13 Command execution
  10. Make sure that wagbyapp/webapps/wagby/WEB - INF/jmaster/zipcode.dat has been updated.
  11. Exit the command prompt.
  12. Restart the Wagby application.
If you do a build process after this, save the zipcode.dat created here again in the wagbyapp/webapps/wagby/WEB-INF/jmaster folder.
  • When a postal code item is used as a search condition, please also specify the corresponding address item as a search condition.

The value of model/modelitem/@ type is "postal code".

The repository key that stores the address item ID is model/modelitem/zipcodeinfo/@addressfield.