| 635 | ==== Example 2: Creating a simple association type with a custom color ==== |
| 636 | |
| 637 | {{{ |
| 638 | curl localhost:8080/core/assoctype -i \ |
| 639 | -X POST \ |
| 640 | -H Content-Type:application/json \ |
| 641 | -d '{uri: "spaceorg.planetarium.satellite", |
| 642 | value: "Satellite", |
| 643 | data_type_uri: "dm4.core.text", |
| 644 | view_config_topics: [{ |
| 645 | "type_uri": "dm4.webclient.view_config", |
| 646 | "composite": { |
| 647 | "dm4.webclient.color": "rgb(12, 70, 164)" |
| 648 | }}]}' \ |
| 649 | | jsonpretty |
| 650 | }}} |
| 651 | |
| 652 | Response: |
| 653 | |
| 654 | {{{ |
| 655 | HTTP/1.1 200 OK |
| 656 | Content-Type: application/json |
| 657 | |
| 658 | { |
| 659 | "id": 2804, |
| 660 | "uri": "spaceorg.planetarium.satellite", |
| 661 | "type_uri": "dm4.core.assoc_type", |
| 662 | "value": "Satellite", |
| 663 | "composite": { |
| 664 | }, |
| 665 | "data_type_uri": "dm4.core.text", |
| 666 | "index_mode_uris": [ |
| 667 | ], |
| 668 | "assoc_defs": [ |
| 669 | ], |
| 670 | "label_config": [ |
| 671 | ], |
| 672 | "view_config_topics": [ |
| 673 | { |
| 674 | "id": 2809, |
| 675 | "uri": "", |
| 676 | "type_uri": "dm4.webclient.view_config", |
| 677 | "value": "", |
| 678 | "composite": { |
| 679 | "dm4.webclient.color": "rgb(12, 70, 164)" |
| 680 | } |
| 681 | } |
| 682 | ] |
| 683 | } |
| 684 | }}} |
| 685 | |