18 require_once SQ_PACKAGES_PATH.
'/web_services/api/soap_api/soap_api.inc';
43 parent::__construct($assetid);
58 'CreateAssetLink' =>
'1',
59 'DeleteAssetLink' =>
'1',
60 'GetAllChildLinks' =>
'1',
62 'GetDependantChildren' =>
'1',
63 'GetDependantParents' =>
'1',
65 'GetLinkByAsset' =>
'1',
66 'GetLinkLineages' =>
'1',
68 'GetParentsUnderTree' =>
'1',
98 $request_info = (Array) $request;
99 $majorid = array_get_index($request_info,
'MajorID',
'');
100 $minorid = array_get_index($request_info,
'MinorID',
'');
101 $link_type = array_get_index($request_info,
'LinkType',
'1');
102 $link_value = array_get_index($request_info,
'LinkValue',
'');
103 $sort_order = self::getNullIndex($request_info,
'SortOrder', NULL);
104 $is_dependant = self::getBooleanIndex($request_info,
'IsDependant', 0);
105 $is_exclusive = self::getBooleanIndex($request_info,
'IsExclusive', 0);
107 if (!empty($majorid) && !empty($minorid) && !empty($link_type)) {
108 $major = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($majorid);
109 $minor = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($minorid);
110 $new_link_id = $GLOBALS[
'SQ_SYSTEM']->am->createAssetLink($major, $minor, $link_type, $link_value, $sort_order, $is_dependant, $is_exclusive);
111 if ($new_link_id == 0) {
112 throw new SoapFault(
'Server',
'Unable to create link');
115 $this->updateLookupsforAsset($minorid);
118 'CreateAssetLinkResult' => $new_link_id,
121 throw new SoapFault(
'Server',
'Missing information to create link. Make sure MajorID, MinorID and LinkType is provided');
142 $request_info = (Array) $request;
143 $linkid = array_get_index($request_info,
'LinkID',
'');
145 if (!empty($linkid)) {
146 $link = $GLOBALS[
'SQ_SYSTEM']->am->getLinkById($linkid);
148 $GLOBALS[
'SQ_SYSTEM']->am->acquireLock($link[
'majorid'],
'all');
149 $GLOBALS[
'SQ_SYSTEM']->am->acquireLock($link[
'minorid'],
'all');
150 $significant_parent_links = $GLOBALS[
'SQ_SYSTEM']->am->getLinks($link[
'minorid'], SQ_SC_LINK_SIGNIFICANT,
'', TRUE,
'minor');
151 if (count($significant_parent_links) > 1) {
153 $result = $GLOBALS[
'SQ_SYSTEM']->am->deleteAssetLink($linkid);
156 $result = $GLOBALS[
'SQ_SYSTEM']->am->trashAsset($link[
'minorid']);
159 $this->updateLookupsforAsset($link[
'minorid']);
161 $GLOBALS[
'SQ_SYSTEM']->am->releaseLock($link[
'minorid'],
'all');
162 $GLOBALS[
'SQ_SYSTEM']->am->releaseLock($link[
'majorid'],
'all');
166 'DeleteAssetLinkResult' => $result,
169 throw new SoapFault(
'Server',
'Unable To Delete Link');
172 throw new SoapFault(
'Server',
'There no such link with the Link ID provided');
176 throw new SoapFault(
'Server',
'The Link ID Provided Is Empty');
200 $request_info = (Array) $request;
201 $assetid = array_get_index($request_info,
'AssetID',
'');
202 $link_type = array_get_index($request_info,
'LinkType', 0);
203 if (!empty($assetid)) {
204 $all_child_links = $GLOBALS[
'SQ_SYSTEM']->am->getAllChildLinks($assetid, $link_type);
205 $link_results = Array();
207 foreach ($all_child_links as $treeid => $link_info) {
208 $link_results[$i][
'TreeID'] = $treeid;
209 $link_results[$i][
'Level'] = $link_info[
'lvl'];
210 $link_results[$i][
'LinkID'] = $link_info[
'linkid'];
211 $link_results[$i][
'AssetID'] = $link_info[
'assetid'];
212 $link_results[$i][
'TypeCode'] = $link_info[
'type_code'];
213 $link_results[$i][
'LinkType'] = $link_info[
'link_type'];
214 $link_results[$i][
'SortOrder'] = $link_info[
'sort_order'];
215 $link_results[$i][
'Value'] = ($link_info[
'value'] === NULL) ?
'' : $link_info[
'value'];
216 $link_results[$i][
'IsDependant'] = $link_info[
'is_dependant'];
217 $link_results[$i][
'IsExclusive'] = $link_info[
'is_exclusive'];
218 $link_results[$i][
'DependantTreeID'] = $link_info[
'dependant_treeid'];
223 'GetAllChildLinksResult' => $link_results,
226 throw new SoapFault(
'Server',
'Asset ID is not valid. Please provide a valid Asset ID');
249 $request_info = (Array) $request;
250 $assetid = array_get_index($request_info,
'AssetID',
'');
251 $type_code = array_get_index($request_info,
'TypeCode',
'');
252 $strict_type_code = self::getBooleanIndex($request_info,
'StrictTypeCode', TRUE);
254 if (!empty($assetid)) {
255 $dependant_children = $GLOBALS[
'SQ_SYSTEM']->am->getDependantChildren($assetid, $type_code, $strict_type_code);
256 $dependant_results = Array();
258 foreach ($dependant_children as $dependant_assetid => $type_code_info) {
259 $dependant_results[$i][
'AssetID'] = $dependant_assetid;
260 $dependant_results[$i][
'TypeCode'] = $type_code_info[0][
'type_code'];
265 'GetDependantChildrenResult' => $dependant_results,
268 throw new SoapFault(
'Server',
'Asset ID is not valid. Please provide a valid Asset ID');
291 $request_info = (Array) $request;
292 $assetid = array_get_index($request_info,
'AssetID',
'');
293 $type_code = array_get_index($request_info,
'TypeCode',
'');
294 $strict_type_code = self::getBooleanIndex($request_info,
'StrictTypeCode', TRUE);
295 $include_all_dependants = self::getBooleanIndex($request_info,
'IncludeAllDependants', TRUE);
297 $dependant_results = Array();
298 if (!empty($assetid)) {
299 $dependant_parents = $GLOBALS[
'SQ_SYSTEM']->am->getDependantParents($assetid, $type_code, $strict_type_code, $include_all_dependants);
301 foreach ($dependant_parents as $dependant_assetid) {
302 $dependant_results[$i][
'AssetID'] = $dependant_assetid;
307 'GetDependantParentsResult' => $dependant_results,
310 throw new SoapFault(
'Server',
'Asset ID is not valid. Please provide a valid Asset ID');
341 $request_info = (Array) $request;
342 $assetid = array_get_index($request_info,
'AssetID',
'');
343 $link_type = array_get_index($request_info,
'LinkType', 1);
344 $type_code = array_get_index($request_info,
'TypeCode',
'');
345 $strict_type_code = self::getBooleanIndex($request_info,
'StrictTypeCode', TRUE);
346 $side_of_link = array_get_index($request_info,
'SideOfLink',
'major');
347 $value = self::getNullIndex($request_info,
'LinkValue', NULL);
348 $dependant = self::getNullIndex($request_info,
'Dependant', NULL);
349 $exclusive = self::getNullIndex($request_info,
'Exclusive', NULL);
350 $sort_by = self::getNullIndex($request_info,
'SortBy', NULL);
351 $access = self::getNullIndex($request_info,
'PermissionLevel', NULL);
352 $effective = self::getBooleanIndex($request_info,
'Effective', TRUE);
354 $access = self::getPermValue($access);
355 if (!empty($assetid)) {
356 $links = $GLOBALS[
'SQ_SYSTEM']->am->getLinks($assetid, $link_type, $type_code, $strict_type_code, $side_of_link, $value, $dependant, $exclusive, $sort_by, $access, $effective);
358 if (!empty($links)) {
359 $link_results = Array();
360 $other_side_of_link = $side_of_link ==
'major' ?
'minor' :
'major';
362 foreach ($links as $link_info) {
363 $link_results[$i][ucwords($other_side_of_link).
'ID'] = $link_info[$other_side_of_link.
'id'];
364 $link_results[$i][
'LinkID'] = $link_info[
'linkid'];
365 $link_results[$i][
'Value'] = ($link_info[
'value'] === NULL) ?
'' : $link_info[
'value'];
366 $link_results[$i][
'LinkType'] = $link_info[
'link_type'];
367 $link_results[$i][ucwords($other_side_of_link).
'TypeCode'] = $link_info[$other_side_of_link.
'_type_code'];
368 $link_results[$i][
'SortOrder'] = $link_info[
'sort_order'];
369 $link_results[$i][
'IsDependant'] = $link_info[
'is_dependant'];
370 $link_results[$i][
'IsExclusive'] = $link_info[
'is_exclusive'];
374 'GetLinksResult' => $link_results,
377 throw new SoapFault(
'Server',
'There is no links for the specified criterions');
380 throw new SoapFault(
'Server',
'Asset ID is not valid. Please provide a valid Asset ID');
404 $request_info = (Array) $request;
405 $linkid = array_get_index($request_info,
'LinkID',
'');
406 $link_type = array_get_index($request_info,
'LinkType', 0);
407 $to_parent_id = array_get_index($request_info,
'ToParentID', 0);
408 $to_parent_position = array_get_index($request_info,
'ToParentPosition', 0);
410 if (!empty($linkid) && !empty($to_parent_id)) {
411 $new_link_id = $GLOBALS[
'SQ_SYSTEM']->am->moveLink($linkid, $to_parent_id, $link_type, $to_parent_position);
413 $new_link = $GLOBALS[
'SQ_SYSTEM']->am->getLinkById($new_link_id);
414 $minorid = array_get_index($new_link,
'minorid',
'');
415 $this->updateLookupsforAsset($minorid);
417 if (!empty($new_link_id)) {
419 'MoveLinkResult' => $new_link_id,
422 throw new SoapFault(
'Server',
'Unable To Move Link');
425 throw new SoapFault(
'Server',
'Either Link ID or ToParentID is invalid. Please provide valid LinkID and ToParentID');
449 $request_info = (Array) $request;
450 $linkid = array_get_index($request_info,
'LinkID',
'');
451 $link_type = self::getNullIndex($request_info,
'LinkType', NULL);
452 $link_value = self::getNullIndex($request_info,
'LinkValue', NULL);
453 $sort_order = self::getNullIndex($request_info,
'SortOrder', NULL);
455 if (!empty($linkid)) {
456 $new_link_id = $GLOBALS[
'SQ_SYSTEM']->am->updateLink($linkid, $link_type, $link_value, $sort_order);
458 if (!empty($new_link_id)) {
460 'UpdateLinkResult' => $new_link_id,
463 throw new SoapFault(
'Server',
'Unable To Update Link');
466 throw new SoapFault(
'Server',
'Link ID is not valid. Please provide a valid Link ID');
497 $request_info = (Array) $request;
498 $assetid = array_get_index($request_info,
'AssetID',
'');
499 $type_code = array_get_index($request_info,
'TypeCode',
'');
500 $strict_type_code = self::getBooleanIndex($request_info,
'StrictTypeCode', TRUE);
501 $dependant = self::getNullIndex($request_info,
'Dependant', NULL);
502 $sort_by = self::getNullIndex($request_info,
'SortBy', NULL);
503 $access = self::getNullIndex($request_info,
'PermissionLevel', NULL);
504 $effective = self::getBooleanIndex($request_info,
'EffectiveAccess', TRUE);
505 $min_depth = self::getNullIndex($request_info,
'MinDepth', NULL);
506 $max_depth = self::getNullIndex($request_info,
'MaxDepth', NULL);
507 $direct_shadow_only = self::getBooleanIndex($request_info,
'DirectShadowsOnly', TRUE);
508 $link_value_wanted = self::getNullIndex($request_info,
'LinkValueWanted', NULL);
510 $access = self::getPermValue($access);
511 if (!empty($assetid)) {
512 $children = $GLOBALS[
'SQ_SYSTEM']->am->getChildren($assetid, $type_code, $strict_type_code, $dependant, $sort_by, $access, $effective, $min_depth, $max_depth, $direct_shadow_only, $link_value_wanted);
513 $children_result = Array();
515 foreach ($children as $child_assetid => $child_type_code_info) {
516 if (!is_null($sort_by)) {
517 $children_result[$i][
'AssetID'] = $child_assetid;
518 $children_result[$i][
'TypeCode'] = $child_type_code_info;
520 $children_result[$i][
'AssetID'] = $child_assetid;
521 $children_result[$i][
'TypeCode'] = $child_type_code_info[0][
'type_code'];
527 'GetChildrenResult' => $children_result,
530 throw new SoapFault(
'Server',
'Asset ID is not valid. Please provide a valid Asset ID');
561 $request_info = (Array) $request;
562 $assetid = array_get_index($request_info,
'AssetID',
'');
563 $type_code = array_get_index($request_info,
'TypeCode',
'');
564 $strict_type_code = self::getBooleanIndex($request_info,
'StrictTypeCode', TRUE);
565 $sort_by = self::getNullIndex($request_info,
'SortBy', NULL);
566 $access = self::getNullIndex($request_info,
'PermissionLevel', NULL);
567 $effective = self::getBooleanIndex($request_info,
'EffectiveAccess', TRUE);
568 $min_depth = self::getNullIndex($request_info,
'MinDepth', NULL);
569 $max_depth = self::getNullIndex($request_info,
'MaxDepth', NULL);
570 $ignore_bridge = self::getBooleanIndex($request_info,
'DirectShadowsOnly', FALSE);
571 $link_value_wanted = self::getNullIndex($request_info,
'LinkValueWanted', NULL);
573 $access = self::getPermValue($access);
574 if (!empty($assetid)) {
575 $parents = $GLOBALS[
'SQ_SYSTEM']->am->getParents($assetid, $type_code, $strict_type_code, $sort_by, $access, $effective, $min_depth, $max_depth, $ignore_bridge, $link_value_wanted);
576 $parents_result = Array();
578 foreach ($parents as $parent_assetid => $parent_type_code) {
579 $parents_result[$i][
'AssetID'] = $parent_assetid;
580 $parents_result[$i][
'TypeCode'] = $parent_type_code;
583 if (!empty($parents)) {
585 'GetParentsResult' => $parents_result,
588 throw new SoapFault(
'Server',
'Unable To Get Parents');
591 throw new SoapFault(
'Server',
'Asset ID is not valid. Please provide a valid Asset ID');
605 $request_info = (Array) $request;
606 $assetid = array_get_index($request_info,
'AssetID',
'');
607 $rootid = array_get_index($request_info,
'RootID',
'');
608 $minLevel = array_get_index($request_info,
'MinLevel', NULL);
609 $maxLevel = array_get_index($request_info,
'MaxLevel', NULL);
611 if (!empty($assetid) && !empty($rootid)) {
612 $treeids = $GLOBALS[
'SQ_SYSTEM']->am->getAssetTreeids($rootid);
614 foreach ($treeids as $index => $treeid) {
615 $treeids[$index] = Array($treeid);
618 $lineages = $GLOBALS[
'SQ_SYSTEM']->am->getLinkLineages($assetid, 0, $treeids,
'name', TRUE);
619 $lineageResult = Array();
621 foreach ($lineages as $lineageDetail) {
622 $parentAsset = Array();
623 foreach ($lineageDetail[
'lineage'] as $parentid => $parent_name) {
624 $parentAsset[] = Array (
625 'ParentID' => $parentid,
626 'ParentName' => $parent_name,
630 if (!is_null($minLevel) && !is_null($maxLevel)) {
632 $maxParentAsset = array_slice($parentAsset, (-1) * $maxLevel);
634 $parentAsset = array_slice($maxParentAsset, 0, count($maxParentAsset) - $minLevel + 1);
637 $lineageResult[] = Array(
638 'LinkID' => $lineageDetail[
'linkid'],
639 'LinkType' => $lineageDetail[
'link_type'],
640 'ParentAssets' => $parentAsset,
644 return $lineageResult;
647 throw new SoapFault(
'Server',
'Asset ID or Root ID is not valid. Please provide a valid Asset ID');
674 $request_info = (Array) $request;
675 $assetid = array_get_index($request_info,
'AssetID',
'');
676 $other_assetid = array_get_index($request_info,
'OtherAssetID',
'');
677 $link_type = array_get_index($request_info,
'LinkType', NULL);
678 $link_value = array_get_index($request_info,
'LinkValue', NULL);
679 $side_of_link = array_get_index($request_info,
'SideOfLink',
'major');
680 $dependant = self::getNullIndex($request_info,
'IsDependant', NULL);
681 $exclusive = self::getNullIndex($request_info,
'IsExclusive', NULL);
683 if (!empty($assetid)) {
684 $links = $GLOBALS[
'SQ_SYSTEM']->am->getLinkByAsset($assetid, $other_assetid, $link_type, $link_value, $side_of_link, TRUE, $dependant, $exclusive);
685 if (!empty($links)) {
686 $link_results = Array();
688 $other_side_of_link = $side_of_link ==
'major' ?
'minor' :
'major';
689 foreach ($links as $link_info) {
690 $link_results[$i][ucwords($other_side_of_link).
'ID'] = $link_info[$other_side_of_link.
'id'];
691 $link_results[$i][
'LinkID'] = $link_info[
'linkid'];
692 $link_results[$i][
'Value'] = ($link_info[
'value'] === NULL) ?
'' : $link_info[
'value'];
693 $link_results[$i][
'LinkType'] = $link_info[
'link_type'];
694 $link_results[$i][ucwords($other_side_of_link).
'TypeCode'] = $link_info[$other_side_of_link.
'_type_code'];
695 $link_results[$i][
'SortOrder'] = $link_info[
'sort_order'];
696 $link_results[$i][
'IsDependant'] = $link_info[
'is_dependant'];
697 $link_results[$i][
'IsExclusive'] = $link_info[
'is_exclusive'];
702 'GetLinkByAssetResult' => $link_results,
705 throw new SoapFault(
'Server',
'Unable To Get Link Between Assets');
708 throw new SoapFault(
'Server',
'Asset ID is not valid. Please provide a valid Asset ID');
723 $request_info = (Array) $request;
724 $assetid = array_get_index($request_info,
'AssetID',
'');
725 $root_assetid = array_get_index($request_info,
'RootNode',
'');
727 if (!empty($assetid)) {
730 if (!empty($root_assetid)) {
731 $treeids = $GLOBALS[
'SQ_SYSTEM']->am->getAssetTreeids($root_assetid);
732 foreach ($treeids as $index => $treeid) {
733 $treeids[$index] = Array($treeid);
737 $lineages = $GLOBALS[
'SQ_SYSTEM']->am->getLinkLineages($assetid, 0, $treeids,
'name', TRUE);
738 $lineages_result = array();
739 foreach ($lineages as $lineage_info) {
740 $lineage_details = array();
741 $lineage_details[
'LinkID'] = $lineage_info[
'linkid'];
742 $lineage_details[
'LinkType'] = $lineage_info[
'link_type'];
744 foreach ($lineage_info[
'lineage'] as $parentid => $parent_name) {
745 $one_lineage = array();
746 $one_lineage[
'AssetID'] = $parentid;
747 $one_lineage[
'AssetName'] = $parent_name;
748 $one_lineage[
'Order'] = $order;
749 $lineage_details[
'Lineage'][] = $one_lineage;
753 $lineages_result[] = $lineage_details;
754 $lineage_details = array();
760 throw new SoapFault(
'Server',
'Asset ID is not valid. Please provide a valid Asset ID');
765 'GetLinkLineagesResult' => $lineages_result,
779 $obj_optional = self::getArgType(
'AssetObject', 0, 1);
780 $link_details = self::getArgType(
'LinkDetails', 0,
'unbounded', TRUE);
781 $link_info_summary = self::getArgType(
'LinkInfoSummary', 0,
'unbounded', TRUE);
782 $children_info_summary = self::getArgType(
'ChildrenInfoSummary', 0,
'unbounded', TRUE);
783 $link_type = self::getArgType(
'LinkTypeValue', 0, 1);
784 $asset_types = self::getArgType(
'AssetType', 0, 1);
785 $link_type = self::getArgType(
'LinkTypeValue', 0, 1);
786 $lineages_details = self::getArgType(
'LineagesDetails', 0,
'unbounded');
787 $parent_path_details = self::getArgType(
'ParentPathsDetails', 0,
'unbounded');
789 $complex_types = Array (
790 'CreateAssetLink' => Array (
791 'CreateAssetLink' => Array (
792 'MajorID' => self::$string_non_optional,
793 'MinorID' => self::$string_non_optional,
794 'LinkType' => $link_type,
795 'LinkValue' => self::$string_optional,
796 'SortOrder' => self::$string_optional,
797 'IsDependant' => self::$string_optional,
798 'IsExclusive' => self::$string_optional,
800 'CreateAssetLinkResponse' => Array (
801 'CreateAssetLinkResult' => self::$string_optional,
804 'DeleteAssetLink' => Array (
805 'DeleteAssetLink' => Array (
806 'LinkID' => self::$string_non_optional,
808 'DeleteAssetLinkResponse' => Array (
809 'DeleteAssetLinkResult' => self::$boolean_optional,
812 'GetAllChildLinks' => Array (
813 'GetAllChildLinks' => Array (
814 'AssetID' => self::$string_non_optional,
815 'LinkType' => $link_type,
817 'GetAllChildLinksResponse' => Array (
818 'GetAllChildLinksResult' => $link_details,
821 'GetChildren' => Array (
822 'GetChildren' => Array (
823 'AssetID' => self::$string_non_optional,
824 'TypeCode' => self::$string_non_optional,
825 'StrictTypeCode' => self::$string_optional,
826 'Dependant' => self::$string_optional,
827 'SortBy' => self::$string_optional,
828 'PermissionLevel' => self::$string_optional,
829 'EffectiveAccess' => self::$string_optional,
830 'MinDepth' => self::$string_optional,
831 'MaxDepth' => self::$string_optional,
832 'DirectShadowsOnly' => self::$string_optional,
833 'LinkValueWanted' => self::$string_optional,
835 'GetChildrenResponse' => Array (
836 'GetChildrenResult' => $children_info_summary,
839 'GetDependantChildren' => Array (
840 'GetDependantChildren' => Array (
841 'AssetID' => self::$string_non_optional,
842 'TypeCode' => $asset_types,
843 'StrictTypeCode' => self::$boolean_optional,
845 'GetDependantChildrenResponse' => Array (
846 'GetDependantChildrenResult' => $link_info_summary,
850 'GetDependantParents' => Array (
851 'GetDependantParents' => Array (
852 'AssetID' => self::$string_non_optional,
853 'TypeCode' => self::$string_optional,
854 'StrictTypeCode' => self::$boolean_optional,
855 'IncludeAllDependants' => self::$boolean_optional,
857 'GetDependantParentsResponse' => Array (
858 'GetDependantParentsResult' => $link_info_summary,
861 'GetLinks' => Array (
862 'GetLinks' => Array (
863 'AssetID' => self::$string_non_optional,
864 'LinkType' => $link_type,
865 'TypeCode' => $asset_types,
866 'StrictTypeCode' => self::$boolean_optional,
867 'SideOfLink' => self::$string_optional,
868 'LinkValue' => self::$string_optional,
869 'Dependant' => self::$boolean_optional,
870 'Exclusive' => self::$boolean_optional,
871 'SortBy' => self::$string_optional,
872 'PermissionLevel' => self::$string_optional,
873 'Effective' => self::$boolean_optional,
875 'GetLinksResponse' => Array (
876 'GetLinksResult' => $link_details,
879 'GetLinkByAsset' => Array (
880 'GetLinkByAsset' => Array (
881 'AssetID' => self::$string_non_optional,
882 'OtherAssetID' => self::$string_non_optional,
883 'LinkType' => $link_type,
884 'LinkValue' => self::$string_optional,
885 'SideOfLink' => self::$string_optional,
886 'IsDependant' => self::$boolean_optional,
887 'IsExclusive' => self::$boolean_optional,
889 'GetLinkByAssetResponse' => Array (
890 'GetLinkByAssetResult' => $link_details,
893 'GetLinkLineages' => Array (
894 'GetLinkLineages' => Array (
895 'AssetID' => self::$string_non_optional,
896 'RootNode' => self::$string_optional,
898 'GetLinkLineagesResponse' => Array (
899 'GetLinkLineagesResult' => $lineages_details,
902 'MoveLink' => Array (
903 'MoveLink' => Array (
904 'LinkID' => self::$string_non_optional,
905 'LinkType' => $link_type,
906 'ToParentID' => self::$string_optional,
907 'ToParentPosition' => self::$string_optional,
909 'MoveLinkResponse' => Array (
910 'MoveLinkResult' => self::$int_optional,
913 'UpdateLink' => Array (
914 'UpdateLink' => Array (
915 'LinkID' => self::$string_non_optional,
916 'LinkType' => $link_type,
917 'LinkValue' => self::$string_optional,
918 'SortOrder' => self::$string_optional,
920 'UpdateLinkResponse' => Array (
921 'UpdateLinkResult' => self::$string_optional,
924 'GetParents' => Array (
925 'GetParents' => Array (
926 'AssetID' => self::$string_non_optional,
927 'TypeCode' => $asset_types,
928 'StrictTypeCode' => self::$string_optional,
929 'SortBy' => self::$string_optional,
930 'PermissionLevel' => self::$string_optional,
931 'Effective' => self::$string_optional,
932 'MinDepth' => self::$string_optional,
933 'MaxDepth' => self::$string_optional,
934 'DirectShadowOnly' => self::$string_optional,
935 'LinkValueWanted' => self::$string_optional,
938 'GetParentsResponse' => Array (
939 'GetParentsResult' => $link_info_summary,
942 'GetParentsUnderTree' => Array (
943 'GetParentsUnderTree' => Array (
944 'AssetID' => self::$string_non_optional,
945 'RootID' => self::$string_non_optional,
946 'MinLevel' => self::$string_non_optional,
947 'MaxLevel' => self::$string_non_optional,
949 'GetParentsUnderTreeResponse' => Array (
950 'ParentPaths' => $parent_path_details,
955 $complex_types_available = parent::getComplexElements($complex_types);
957 return $complex_types_available;
971 $link_details = Array (
972 'LinkDetails' => Array (
973 'TreeID' => self::$string_optional,
974 'LinkID' => self::$string_non_optional,
975 'Level' => self::$string_optional,
976 'MinorID' => self::$string_optional,
977 'MajorID' => self::$string_optional,
978 'MinorTypeCode' => self::$string_optional,
979 'MajorTypeCode' => self::$string_optional,
980 'AssetID' => self::$string_optional,
981 'TypeCode' => self::$string_optional,
982 'LinkType' => self::$string_optional,
983 'SortOrder' => self::$string_optional,
984 'Value' => self::$string_optional,
985 'IsDependant' => self::$string_optional,
986 'IsExclusive' => self::$string_optional,
987 'DependantTreeID' => self::$string_optional,
990 $lineages_details = self::getArgType(
'LineagesDetails', 0,
'unbounded');
991 $lineage = self::getArgType(
'Lineage', 0,
'unbounded');
993 $lineages_details = Array (
994 'LineagesDetails' => Array (
995 'LinkID' => self::$string_non_optional,
996 'LinkType' => self::$string_non_optional,
997 'Lineage' => $lineage,
1000 'AssetID' => self::$string_non_optional,
1001 'AssetName' => self::$string_non_optional,
1002 'Order' => self::$int_non_optional,
1006 $parent_list = self::getArgType(
'ParentAssets', 0,
'unbounded');
1007 $parent_paths_details = Array (
1008 'ParentPathsDetails' => Array (
1009 'LinkID' => self::$string_non_optional,
1010 'LinkType' => self::$string_non_optional,
1011 'ParentAssets' => $parent_list,
1013 'ParentAssets' => Array (
1014 'ParentID' => self::$string_non_optional,
1015 'ParentName' => self::$string_non_optional,
1019 $complex_types = Array (
1020 'GetAllChildLinks' => $link_details,
1021 'GetLinks' => $link_details,
1022 'GetLinkByAsset' => $link_details,
1023 'GetLinkLineages' => $lineages_details,
1024 'GetParentsUnderTree' => $parent_paths_details,
1025 'GetDependantParents' => Array (
1026 'LinkInfoSummary' => Array (
1027 'AssetID' => self::$string_non_optional,
1028 'TypeCode' => self::$string_optional,
1031 'GetChildren' => Array (
1032 'ChildrenInfoSummary' => Array (
1033 'AssetID' => self::$string_non_optional,
1034 'TypeCode' => self::$string_non_optional,
1039 $complex_types_available = parent::getComplexElements($complex_types);
1041 return $complex_types_available;
1054 $asset_types_info = $GLOBALS[
'SQ_SYSTEM']->am->getAssetTypes(TRUE, TRUE);
1055 $asset_types = Array();
1056 foreach ($asset_types_info as $asset_type_info) {
1057 $asset_types[] = $asset_type_info[
'type_code'];
1060 $common_types = Array (
1061 'LinkTypeValue' => Array (
1062 'restriction_base' =>
'string',
1063 'enumeration' => Array (
1070 $simple_restricted_types = Array (
1071 'CreateAssetLink' => Array (
1072 'LinkTypeValue' => $common_types[
'LinkTypeValue'],
1074 'GetLinks' => Array (
1075 'LinkTypeValue' => $common_types[
'LinkTypeValue'],
1076 'AssetType' => Array (
1077 'restriction_base' =>
'string',
1078 'enumeration' => $asset_types,
1081 'MoveLink' => Array (
1082 'LinkTypeValue' => $common_types[
'LinkTypeValue'],
1084 'UpdateLink' => Array (
1085 'LinkTypeValue' => $common_types[
'LinkTypeValue'],
1087 'GetLinkByAsset' => Array (
1088 'LinkTypeValue' => $common_types[
'LinkTypeValue'],
1090 'GetAllChildLinks' => Array (
1091 'LinkTypeValue' => $common_types[
'LinkTypeValue'],
1093 'GetChildren' => Array (
1094 'AssetType' => Array (
1095 'restriction_base' =>
'string',
1096 'enumeration' => $asset_types,
1099 'GetDependantChildren' => Array (
1100 'AssetType' => Array (
1101 'restriction_base' =>
'string',
1102 'enumeration' => $asset_types,
1105 'GetDependantParents' => Array (
1106 'AssetType' => Array (
1107 'restriction_base' =>
'string',
1108 'enumeration' => $asset_types,
1111 'GetParents' => Array (
1112 'AssetType' => Array (
1113 'restriction_base' =>
'string',
1114 'enumeration' => $asset_types,
1119 $simple_restricted_types_available = parent::processSimpleRestrictedTypes($simple_restricted_types);
1121 return $simple_restricted_types_available;
1134 private static function getPermValue($permission)
1136 $perm_level = Array (
1141 if (empty($permission) || !isset($perm_level[$permission]))
return NULL;
1143 return $perm_level[$permission];