Commit c2cd46b3da6d80785fcb4e8e4a434b1c2715bf3d
1 parent
7695bd0d
KTS-1694
"SOAP Webservice Implementation" Updated. Fixed metadata to be more or less working. Still need to work on metadata tree... Reviewed By: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6471 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
41 additions
and
1 deletions
ktwebservice/webservice.php
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | |
| 28 | 28 | require_once('../config/dmsDefaults.php'); |
| 29 | 29 | require_once('../ktapi/ktapi.inc.php'); |
| 30 | -require_once("SOAP/Server.php"); | |
| 30 | +require_once('SOAP/Server.php'); | |
| 31 | 31 | require_once('SOAP/Disco.php'); |
| 32 | 32 | require_once('KTDownloadManager.inc.php'); |
| 33 | 33 | |
| ... | ... | @@ -198,6 +198,7 @@ class KTWebService |
| 198 | 198 | $this->__typedef['kt_metadata_fieldset'] = |
| 199 | 199 | array( |
| 200 | 200 | 'fieldset' => 'string', |
| 201 | + 'description' => 'string', | |
| 201 | 202 | 'fields' => "{urn:$this->namespace}kt_metadata_fields" , |
| 202 | 203 | ); |
| 203 | 204 | |
| ... | ... | @@ -1656,6 +1657,45 @@ class KTWebService |
| 1656 | 1657 | |
| 1657 | 1658 | $metadata = $document->get_metadata(); |
| 1658 | 1659 | |
| 1660 | + $num_metadata=count($metadata); | |
| 1661 | + for($i=0;$i<$num_metadata;$i++) | |
| 1662 | + { | |
| 1663 | + $num_fields = count($metadata[$i]['fields']); | |
| 1664 | + for($j=0;$j<$num_fields;$j++) | |
| 1665 | + { | |
| 1666 | + $selection=$metadata[$i]['fields'][$j]['selection']; | |
| 1667 | + $new = array(); | |
| 1668 | + | |
| 1669 | + foreach($selection as $item) | |
| 1670 | + { | |
| 1671 | + $new[] = array( | |
| 1672 | + 'id'=>null, | |
| 1673 | + 'name'=>$item, | |
| 1674 | + 'value'=>$item, | |
| 1675 | + 'parent_id'=>null | |
| 1676 | + ); | |
| 1677 | + } | |
| 1678 | + $metadata[$i]['fields'][$j]['selection'] = $new; | |
| 1679 | + } | |
| 1680 | + } | |
| 1681 | + /*foreach($metadata as & $fieldset) | |
| 1682 | + { | |
| 1683 | + foreach($fieldset['fields'] as &$fields) | |
| 1684 | + { | |
| 1685 | + $selection = array(); | |
| 1686 | + foreach($fields['selection'] as $item) | |
| 1687 | + { | |
| 1688 | + $selection[] = array( | |
| 1689 | + 'id'=>null, | |
| 1690 | + 'name'=>$item, | |
| 1691 | + 'value'=>$item, | |
| 1692 | + 'parent_id'=>null | |
| 1693 | + ); | |
| 1694 | + } | |
| 1695 | + $fieldset['fields']['selection'] = $selection; | |
| 1696 | + } | |
| 1697 | + }*/ | |
| 1698 | + | |
| 1659 | 1699 | $response = array( |
| 1660 | 1700 | 'status_code' => KTWS_SUCCESS, |
| 1661 | 1701 | 'message' => '', | ... | ... |