17 require_once SQ_INCLUDE_PATH.
'/asset_edit/asset_edit_fns.inc';
37 parent::__construct();
38 $this->static_screens[
'details'][
'force_unlock'] = FALSE;
53 $write_access = $asset->writeAccess(
'attributes');
54 $wsdl = $asset->attr(
'wsdl');
57 <table
class=
"sq-backend-table">
59 <td
class=
"sq-backend-table-header">
60 <?php echo
'Service Name'; ?>
62 <td
class=
"sq-backend-table-header">
63 <?php echo
'WSDL URL'; ?>
65 <td
class=
"sq-backend-table-header">
66 <?php echo
'Connection Status'; ?>
71 foreach ($wsdl as $service => $url) {
74 <td
class=
"sq-backend-table-cell">
75 <?php echo $service; ?>
77 <td
class=
"sq-backend-table-cell">
80 text_box($prefix.
'[wsdl_urls]['.$service.
']', $url,
'100');
86 <td
class=
"sq-backend-table-cell">
88 $conn = $asset->connect($service, TRUE);
89 if ($conn === FALSE) {
90 echo
'<span style="color: red"><b>'.translate(
'cmis_not_connected').
'</b></span>';
92 echo
'<span style="color: green"><b>'.translate(
'cmis_connected').
'</b></span>';
117 if (!$asset->writeAccess(
'attributes'))
return FALSE;
119 if (isset($_POST[$prefix][
'wsdl_urls'])) {
120 $wsdl = $_POST[$prefix][
'wsdl_urls'];
121 foreach ($wsdl as $service => $url){
122 $wsdl[$service] = trim($url);
125 $asset->setAttrValue(
'wsdl', $wsdl);
126 $asset->saveAttributes();
146 $wa = $asset->writeAccess(
'attributes');
147 if ($wa) check_box($prefix.
'_synch');
165 if (isset($_POST[$prefix.
'_synch'])) {
166 $vars[
'bridge_id'] = $asset->id;
167 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
168 $hh->queueHipo(
'hipo_job_sync_cmis_bridge', $vars,
'', SQ_PACKAGES_PATH.
'/sharepoint/hipo_jobs/');
187 $wa = $asset->writeAccess(
'attributes');
188 $current_metadata_fields = $asset->attr(
'metadata_fields');
189 $metadata_fields = $asset->getAvailableDocumentFields();
190 if (empty($metadata_fields))
return FALSE;
193 <table
class=
"sq-backend-table">
195 <th><?php echo
"Field"; ?></th>
196 <th><?php echo
"Field Type"; ?></th>
197 <th><?php echo
"Metadata Field ID" ?></th>
200 foreach ($metadata_fields as $property => $info) {
205 echo $info[
'display_name'];
215 $field_id = isset($current_metadata_fields[$property][
'field']) ? $current_metadata_fields[$property][
'field'] :
'';
217 $type_codes = Array(
'metadata_field' =>
'D');
218 if ($property ==
'cmis:objectId') $type_codes = Array(
'metadata_field_text' =>
'I');
219 if ($property ==
'cmis:lastModificationDate') $type_codes = Array(
'metadata_field_date' =>
'I');
220 asset_finder($prefix.
'_'.$property, $field_id, $type_codes);
222 if ($field_id) echo get_asset_tag_line($field_id);
249 if (!$asset->writeAccess(
'attributes'))
return FALSE;
250 $mm = $GLOBALS[
'SQ_SYSTEM']->getMetadataManager();
251 $applied_schemas = $mm->getSchemas($asset->id, TRUE, TRUE);
252 $fields = $mm->getMetadataFields($applied_schemas);
254 $current_metadata_fields = $asset->attr(
'metadata_fields');
255 $metadata_fields = $asset->getAvailableDocumentFields();
256 if (empty($metadata_fields))
return FALSE;
258 foreach ($metadata_fields as $property => $info){
259 $current_field_id = isset($current_metadata_fields[$property][
'field']) ? $current_metadata_fields[$property][
'field'] :
'';
260 $field_id = (isset($_POST[$prefix.
'_'.$property][
'assetid'])) ? $_POST[$prefix.
'_'.$property][
'assetid'] : $current_field_id;
261 if (!empty($field_id)){
262 if (!array_key_exists($field_id, $fields)){
263 trigger_localised_error(
'SHAR0001', E_USER_WARNING, $field_id);
265 $metadata_fields[$property][
'field'] = $current_field_id;
268 if ($property ==
'cmis:objectId'){
269 $type_info = $GLOBALS[
'SQ_SYSTEM']->am->getAssetTypeInfo($field_id, Array(
'metadata_field_text'));
270 if (empty($type_info)) {
271 trigger_localised_error(
'SHAR0004', E_USER_WARNING, $info[
'display_name'],
'Metadata Text Field');
273 $field_id = $current_field_id;
275 }
else if ($property ==
'cmis:lastModificationDate'){
276 $type_info = $GLOBALS[
'SQ_SYSTEM']->am->getAssetTypeInfo($field_id, Array(
'metadata_field_date'));
277 if (empty($type_info)) {
278 trigger_localised_error(
'SHAR0004', E_USER_WARNING, $info[
'display_name'],
'Metadata Date Field');
280 $field_id = $current_field_id;
285 $metadata_fields[$property][
'field'] = $field_id;
288 $asset->setAttrValue(
'metadata_fields', $metadata_fields);
289 $asset->saveAttributes();
306 foreach ($asset->attr(
'wsdl') as $service_name => $url){
307 $connected = $asset->connect($service_name, TRUE);
308 if (!$connected)
break;
310 if (empty($connected))
return FALSE;
312 $repositoryId = $asset->getRepositoryId();
313 if (empty($repositoryId))
return FALSE;