Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataGlobals.php |
— | — | @@ -27,6 +27,8 @@ |
28 | 28 | $wgIdenticalMeaningAttributeName, |
29 | 29 | $wgIncomingRelationsAttributeName, |
30 | 30 | $wgLevelAnnotationAttributeName, |
| 31 | + $wgLinkAttributeAttributeName, |
| 32 | + $wgLinkAttributeValuesAttributeName, |
31 | 33 | $wgOptionAttributeOptionAttributeName, |
32 | 34 | $wgOptionAttributeOptionsAttributeName, |
33 | 35 | $wgOptionAttributeValuesAttributeName, |
— | — | @@ -47,9 +49,7 @@ |
48 | 50 | $wgTranslatedTextAttributeAttributeName, |
49 | 51 | $wgTranslatedTextAttributeName, |
50 | 52 | $wgTranslatedTextAttributeValueAttributeName, |
51 | | - $wgTranslatedTextAttributeValuesAttributeName, |
52 | | - $wgUrlAttributeAttributeName, |
53 | | - $wgUrlAttributeValuesAttributeName; |
| 53 | + $wgTranslatedTextAttributeValuesAttributeName; |
54 | 54 | |
55 | 55 | $wgAlternativeDefinitionAttributeName = "Alternative definition"; |
56 | 56 | $wgAlternativeDefinitionsAttributeName = "Alternative definitions"; |
— | — | @@ -97,8 +97,8 @@ |
98 | 98 | $wgTranslatedTextAttributeName = "Translated text"; |
99 | 99 | $wgTranslatedTextAttributeValueAttributeName = "Text"; |
100 | 100 | $wgTranslatedTextAttributeValuesAttributeName = "Text properties"; |
101 | | -$wgUrlAttributeAttributeName = "Property"; |
102 | | -$wgUrlAttributeValuesAttributeName = "URLs"; |
| 101 | +$wgLinkAttributeAttributeName = "Property"; |
| 102 | +$wgLinkAttributeValuesAttributeName = "Links"; |
103 | 103 | |
104 | 104 | // Attribute Ids |
105 | 105 | |
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialSuggest.php |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | case 'text-attribute': |
73 | 73 | $sql = getSQLToSelectPossibleAttributes($objectId, $attributesLevel, 'TEXT'); |
74 | 74 | break; |
75 | | - case 'url-attribute': |
| 75 | + case 'link-attribute': |
76 | 76 | $sql = getSQLToSelectPossibleAttributes($objectId, $attributesLevel, 'URL'); |
77 | 77 | break; |
78 | 78 | case 'language': |
— | — | @@ -118,7 +118,7 @@ |
119 | 119 | $query == 'option-attribute' or |
120 | 120 | $query == 'translated-text-attribute' or |
121 | 121 | $query == 'text-attribute' or |
122 | | - $query == 'url-attribute' or |
| 122 | + $query == 'link-attribute' or |
123 | 123 | $query == 'collection') |
124 | 124 | $searchCondition = " WHERE $rowText LIKE " . $dbr->addQuotes("$search%"); |
125 | 125 | else |
— | — | @@ -162,8 +162,8 @@ |
163 | 163 | case 'option-attribute': |
164 | 164 | list($recordSet, $editor) = getOptionAttributeAsRecordSet($queryResult); |
165 | 165 | break; |
166 | | - case 'url-attribute': |
167 | | - list($recordSet, $editor) = getURLAttributeAsRecordSet($queryResult); |
| 166 | + case 'link-attribute': |
| 167 | + list($recordSet, $editor) = getLinkAttributeAsRecordSet($queryResult); |
168 | 168 | break; |
169 | 169 | case 'defined-meaning': |
170 | 170 | list($recordSet, $editor) = getDefinedMeaningAsRecordSet($queryResult); |
— | — | @@ -414,20 +414,20 @@ |
415 | 415 | return array($recordSet, $editor); |
416 | 416 | } |
417 | 417 | |
418 | | -function getURLAttributeAsRecordSet($queryResult) { |
| 418 | +function getLinkAttributeAsRecordSet($queryResult) { |
419 | 419 | global |
420 | 420 | $idAttribute; |
421 | 421 | |
422 | 422 | $dbr =& wfGetDB(DB_SLAVE); |
423 | 423 | |
424 | | - $urlAttributeAttribute = new Attribute("url-attribute", "URL attribute", "short-text"); |
425 | | - $recordSet = new ArrayRecordSet(new Structure($idAttribute, $urlAttributeAttribute), new Structure($idAttribute)); |
| 424 | + $linkAttributeAttribute = new Attribute("link-attribute", "Link attribute", "short-text"); |
| 425 | + $recordSet = new ArrayRecordSet(new Structure($idAttribute, $linkAttributeAttribute), new Structure($idAttribute)); |
426 | 426 | |
427 | 427 | while ($row = $dbr->fetchObject($queryResult)) |
428 | 428 | $recordSet->addRecord(array($row->attribute_mid, $row->spelling)); |
429 | 429 | |
430 | 430 | $editor = createSuggestionsTableViewer(null); |
431 | | - $editor->addEditor(createShortTextViewer($urlAttributeAttribute)); |
| 431 | + $editor->addEditor(createShortTextViewer($linkAttributeAttribute)); |
432 | 432 | |
433 | 433 | return array($recordSet, $editor); |
434 | 434 | } |
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php |
— | — | @@ -215,19 +215,19 @@ |
216 | 216 | $textAttributeValuesAttribute = new Attribute(null, $wgTextAttributeValuesAttributeName, $textAttributeValuesStructure); |
217 | 217 | |
218 | 218 | global |
219 | | - $urlAttribute, $urlAttributeIdAttribute, $urlAttributeObjectAttribute, $urlAttributeAttribute, $urlAttributeValuesStructure, $urlAttributeValuesAttribute, |
220 | | - $wgUrlAttributeValuesAttributeName, $wgUrlAttributeAttributeName, $hyperLinkAttribute, $hyperLinkLabelAttribute, $hyperLinkURLAttribute; |
| 219 | + $linkAttributeIdAttribute, $linkAttributeObjectAttribute, $linkAttributeAttribute, $linkAttributeValuesStructure, $linkAttributeValuesAttribute, |
| 220 | + $wgLinkAttributeValuesAttributeName, $wgLinkAttributeAttributeName, |
| 221 | + $linkAttribute, $linkLabelAttribute, $linkURLAttribute; |
221 | 222 | |
222 | | - $hyperLinkLabelAttribute = new Attribute("label", "Label", "short-text"); |
223 | | - $hyperLinkURLAttribute = new Attribute("url", "URL", "url"); |
224 | | - $hyperLinkAttribute = new Attribute("hyperlink", "Link", new Structure($hyperLinkLabelAttribute, $hyperLinkURLAttribute)); |
| 223 | + $linkLabelAttribute = new Attribute("label", "Label", "short-text"); |
| 224 | + $linkURLAttribute = new Attribute("url", "URL", "url"); |
| 225 | + $linkAttribute = new Attribute("link", "Link", "url");// new Structure($linkLabelAttribute, $linkURLAttribute)); |
225 | 226 | |
226 | | - $urlAttribute = new Attribute("url", "URL", "url"); |
227 | | - $urlAttributeIdAttribute = new Attribute("url-attribute-id", "Attribute identifier", "object-id"); |
228 | | - $urlAttributeObjectAttribute = new Attribute("url-attribute-object-id", "Attribute object", "object-id"); |
229 | | - $urlAttributeAttribute = new Attribute("url-attribute", $wgUrlAttributeAttributeName, $definedMeaningReferenceStructure); |
230 | | - $urlAttributeValuesStructure = new Structure("url-attribute-values", $urlAttributeIdAttribute, $urlAttributeObjectAttribute, $urlAttributeAttribute, $urlAttribute, $objectAttributesAttribute); |
231 | | - $urlAttributeValuesAttribute = new Attribute(null, $wgUrlAttributeValuesAttributeName, $urlAttributeValuesStructure); |
| 227 | + $linkAttributeIdAttribute = new Attribute("link-attribute-id", "Attribute identifier", "object-id"); |
| 228 | + $linkAttributeObjectAttribute = new Attribute("link-attribute-object-id", "Attribute object", "object-id"); |
| 229 | + $linkAttributeAttribute = new Attribute("link-attribute", $wgLinkAttributeAttributeName, $definedMeaningReferenceStructure); |
| 230 | + $linkAttributeValuesStructure = new Structure("link-attribute-values", $linkAttributeIdAttribute, $linkAttributeObjectAttribute, $linkAttributeAttribute, $linkAttribute, $objectAttributesAttribute); |
| 231 | + $linkAttributeValuesAttribute = new Attribute(null, $wgLinkAttributeValuesAttributeName, $linkAttributeValuesStructure); |
232 | 232 | |
233 | 233 | global |
234 | 234 | $optionAttributeIdAttribute, $optionAttributeAttribute, $optionAttributeObjectAttribute, $optionAttributeOptionAttribute, $optionAttributeValuesAttribute, |
Index: trunk/extensions/Wikidata/OmegaWiki/Controller.php |
— | — | @@ -518,35 +518,35 @@ |
519 | 519 | } |
520 | 520 | } |
521 | 521 | |
522 | | -class URLAttributeValuesController extends ObjectAttributeValuesController { |
| 522 | +class LinkAttributeValuesController extends ObjectAttributeValuesController { |
523 | 523 | public function add($keyPath, $record) { |
524 | 524 | global |
525 | | - $urlAttribute, $urlAttributeAttribute; |
| 525 | + $linkAttribute, $linkAttributeAttribute; |
526 | 526 | |
527 | 527 | $objectId = $this->objectIdFetcher->fetch($keyPath); |
528 | | - $urlAttributeId = $record->getAttributeValue($urlAttributeAttribute); |
529 | | - $url = $record->getAttributeValue($urlAttribute); |
| 528 | + $linkAttributeId = $record->getAttributeValue($linkAttributeAttribute); |
| 529 | + $url = $record->getAttributeValue($linkAttribute); |
530 | 530 | |
531 | | - if ($urlAttributeId != 0 && $url != '') |
532 | | - addURLAttributeValue($objectId, $urlAttributeId, $url); |
| 531 | + if ($linkAttributeId != 0 && $url != '') |
| 532 | + addLinkAttributeValue($objectId, $linkAttributeId, $url); |
533 | 533 | } |
534 | 534 | |
535 | 535 | public function remove($keyPath) { |
536 | 536 | global |
537 | | - $urlAttributeIdAttribute; |
| 537 | + $linkAttributeIdAttribute; |
538 | 538 | |
539 | | - $urlId = $keyPath->peek(0)->getAttributeValue($urlAttributeIdAttribute); |
540 | | - removeURLAttributeValue($urlId); |
| 539 | + $linkId = $keyPath->peek(0)->getAttributeValue($linkAttributeIdAttribute); |
| 540 | + removeLinkAttributeValue($linkId); |
541 | 541 | } |
542 | 542 | |
543 | 543 | public function update($keyPath, $record) { |
544 | 544 | global |
545 | | - $urlAttributeIdAttribute, $urlAttribute; |
| 545 | + $linkAttributeIdAttribute, $linkAttribute; |
546 | 546 | |
547 | | - $urlId = $keyPath->peek(0)->getAttributeValue($urlAttributeIdAttribute); |
548 | | - $url = $record->getAttributeValue($urlAttribute); |
| 547 | + $linkId = $keyPath->peek(0)->getAttributeValue($linkAttributeIdAttribute); |
| 548 | + $url = $record->getAttributeValue($linkAttribute); |
549 | 549 | |
550 | | - updateURLAttributeValue($url, $urlId); |
| 550 | + updateLinkAttributeValue($url, $linkId); |
551 | 551 | } |
552 | 552 | } |
553 | 553 | |
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialTransaction.php |
— | — | @@ -1169,7 +1169,7 @@ |
1170 | 1170 | |
1171 | 1171 | $editor->addEditor(new ObjectPathEditor($objectIdAttribute)); |
1172 | 1172 | $editor->addEditor(createDefinedMeaningReferenceViewer($attributeAttribute)); |
1173 | | - $editor->addEditor(createURLViewer($URLAttribute)); |
| 1173 | + $editor->addEditor(createLinkViewer($URLAttribute)); |
1174 | 1174 | $editor->addEditor(createShortTextViewer($operationAttribute)); |
1175 | 1175 | $editor->addEditor(createBooleanViewer($isLatestAttribute)); |
1176 | 1176 | |
— | — | @@ -1666,9 +1666,9 @@ |
1667 | 1667 | |
1668 | 1668 | function rollBackURLAttribute($rollBackAction, $valueId, $objectId, $attributeId, $url, $operation) { |
1669 | 1669 | if (shouldRemove($rollBackAction, $operation)) |
1670 | | - removeURLAttributeValue($valueId); |
| 1670 | + removeLinkAttributeValue($valueId); |
1671 | 1671 | else if (shouldRestore($rollBackAction, $operation)) |
1672 | | - createURLAttributeValue($valueId, $objectId, $attributeId, $url); |
| 1672 | + createLinkAttributeValue($valueId, $objectId, $attributeId, $url); |
1673 | 1673 | } |
1674 | 1674 | |
1675 | 1675 | function rollBackTextAttributes($idStack, $textAttributes) { |
Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataAPI.php |
— | — | @@ -730,22 +730,22 @@ |
731 | 731 | return $dbr->fetchObject($queryResult); |
732 | 732 | } |
733 | 733 | |
734 | | -function addURLAttributeValue($objectId, $urlAttributeId, $url) { |
| 734 | +function addLinkAttributeValue($objectId, $linkAttributeId, $url) { |
735 | 735 | $dc=wdGetDataSetContext(); |
736 | 736 | $urlValueAttributeId = newObjectId("{$dc}_url_attribute_values"); |
737 | | - createURLAttributeValue($urlValueAttributeId, $objectId, $urlAttributeId, $url); |
| 737 | + createLinkAttributeValue($urlValueAttributeId, $objectId, $linkAttributeId, $url); |
738 | 738 | } |
739 | 739 | |
740 | | -function createURLAttributeValue($urlValueAttributeId, $objectId, $urlAttributeId, $url) { |
| 740 | +function createLinkAttributeValue($urlValueAttributeId, $objectId, $linkAttributeId, $url) { |
741 | 741 | $dc=wdGetDataSetContext(); |
742 | 742 | $dbr = &wfGetDB(DB_MASTER); |
743 | 743 | $dbr->query( |
744 | 744 | "INSERT INTO {$dc}_url_attribute_values (value_id, object_id, attribute_mid, url, label, add_transaction_id) " . |
745 | | - "VALUES ($urlValueAttributeId, $objectId, $urlAttributeId, " . $dbr->addQuotes($url) . ", " . $dbr->addQuotes($url) . ", ". getUpdateTransactionId() .")" |
| 745 | + "VALUES ($urlValueAttributeId, $objectId, $linkAttributeId, " . $dbr->addQuotes($url) . ", " . $dbr->addQuotes($url) . ", ". getUpdateTransactionId() .")" |
746 | 746 | ); |
747 | 747 | } |
748 | 748 | |
749 | | -function removeURLAttributeValue($urlValueAttributeId) { |
| 749 | +function removeLinkAttributeValue($urlValueAttributeId) { |
750 | 750 | $dc=wdGetDataSetContext(); |
751 | 751 | $dbr = &wfGetDB(DB_MASTER); |
752 | 752 | $dbr->query( |
— | — | @@ -755,10 +755,10 @@ |
756 | 756 | ); |
757 | 757 | } |
758 | 758 | |
759 | | -function updateURLAttributeValue($url, $urlValueAttributeId) { |
| 759 | +function updateLinkAttributeValue($url, $urlValueAttributeId) { |
760 | 760 | $urlValueAttribute = getURLValueAttribute($urlValueAttributeId); |
761 | | - removeURLAttributeValue($urlValueAttributeId); |
762 | | - createURLAttributeValue($urlValueAttributeId, $urlValueAttribute->object_id, $urlValueAttribute->attribute_mid, $url); |
| 761 | + removeLinkAttributeValue($urlValueAttributeId); |
| 762 | + createLinkAttributeValue($urlValueAttributeId, $urlValueAttribute->object_id, $urlValueAttribute->attribute_mid, $url); |
763 | 763 | } |
764 | 764 | |
765 | 765 | function getURLValueAttribute($urlValueAttributeId) { |
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiEditors.php |
— | — | @@ -12,17 +12,17 @@ |
13 | 13 | global |
14 | 14 | $objectAttributesAttribute, $definedMeaningIdAttribute, |
15 | 15 | $textValueObjectAttributesEditor, $textAttributeIdAttribute, |
16 | | - $urlValueObjectAttributesEditor, $urlAttributeIdAttribute, |
| 16 | + $linkValueObjectAttributesEditor, $linkAttributeIdAttribute, |
17 | 17 | $translatedTextValueObjectAttributesEditor, $translatedTextAttributeIdAttribute, |
18 | 18 | $optionValueObjectAttributesEditor, $optionAttributeIdAttribute, $annotationMeaningName; |
19 | 19 | |
20 | 20 | $textValueObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5); |
21 | | - $urlValueObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5); |
| 21 | + $linkValueObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5); |
22 | 22 | $translatedTextValueObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5); |
23 | 23 | $optionValueObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5); |
24 | 24 | |
25 | 25 | setObjectAttributesEditor($textValueObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $textAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
26 | | - setObjectAttributesEditor($urlValueObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $urlAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
| 26 | + setObjectAttributesEditor($linkValueObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $linkAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
27 | 27 | setObjectAttributesEditor($translatedTextValueObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $translatedTextAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
28 | 28 | setObjectAttributesEditor($optionValueObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $optionAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute)); |
29 | 29 | } |
— | — | @@ -125,7 +125,7 @@ |
126 | 126 | function setObjectAttributesEditor(Editor $objectAttributesEditor, ViewInformation $viewInformation, Fetcher $objectIdFetcher, $levelDefinedMeaningName, Fetcher $dmObjectIdFetcher) { |
127 | 127 | $objectAttributesEditor->addEditor(getTextAttributeValuesEditor($viewInformation, new TextAttributeValuesController($objectIdFetcher), $levelDefinedMeaningName, $dmObjectIdFetcher)); |
128 | 128 | $objectAttributesEditor->addEditor(getTranslatedTextAttributeValuesEditor($viewInformation, new TranslatedTextAttributeValuesController($objectIdFetcher, $viewInformation->filterLanguageId), $levelDefinedMeaningName, $dmObjectIdFetcher)); |
129 | | - $objectAttributesEditor->addEditor(getURLAttributeValuesEditor($viewInformation, new URLAttributeValuesController($objectIdFetcher), $levelDefinedMeaningName, $dmObjectIdFetcher)); |
| 129 | + $objectAttributesEditor->addEditor(getLinkAttributeValuesEditor($viewInformation, new LinkAttributeValuesController($objectIdFetcher), $levelDefinedMeaningName, $dmObjectIdFetcher)); |
130 | 130 | $objectAttributesEditor->addEditor(getOptionAttributeValuesEditor($viewInformation, new OptionAttributeValuesController($objectIdFetcher), $levelDefinedMeaningName, $dmObjectIdFetcher)); |
131 | 131 | } |
132 | 132 | |
— | — | @@ -361,15 +361,15 @@ |
362 | 362 | return $editor; |
363 | 363 | } |
364 | 364 | |
365 | | -function getURLAttributeValuesEditor(ViewInformation $viewInformation, UpdateController $controller, $levelDefinedMeaningName, Fetcher $objectIdFetcher) { |
| 365 | +function getLinkAttributeValuesEditor(ViewInformation $viewInformation, UpdateController $controller, $levelDefinedMeaningName, Fetcher $objectIdFetcher) { |
366 | 366 | global |
367 | | - $urlAttributeAttribute, $urlAttribute, $urlAttributeValuesAttribute, $urlValueObjectAttributesEditor, |
| 367 | + $linkAttributeAttribute, $linkAttribute, $linkAttributeValuesAttribute, $linkValueObjectAttributesEditor, |
368 | 368 | $wgPopupAnnotationName; |
369 | 369 | |
370 | | - $editor = new RecordSetTableEditor($urlAttributeValuesAttribute, new SimplePermissionController(true), new ShowEditFieldChecker(true), new AllowAddController(true), true, false, $controller); |
371 | | - $editor->addEditor(new URLAttributeEditor($urlAttributeAttribute, new SimplePermissionController(false), true, $levelDefinedMeaningName, $objectIdFetcher)); |
372 | | - $editor->addEditor(new URLEditor($urlAttribute, new SimplePermissionController(true), true)); |
373 | | - $editor->addEditor(new PopUpEditor($urlValueObjectAttributesEditor, $wgPopupAnnotationName)); |
| 370 | + $editor = new RecordSetTableEditor($linkAttributeValuesAttribute, new SimplePermissionController(true), new ShowEditFieldChecker(true), new AllowAddController(true), true, false, $controller); |
| 371 | + $editor->addEditor(new LinkAttributeEditor($linkAttributeAttribute, new SimplePermissionController(false), true, $levelDefinedMeaningName, $objectIdFetcher)); |
| 372 | + $editor->addEditor(new LinkEditor($linkAttribute, new SimplePermissionController(true), true)); |
| 373 | + $editor->addEditor(new PopUpEditor($linkValueObjectAttributesEditor, $wgPopupAnnotationName)); |
374 | 374 | |
375 | 375 | addTableMetadataEditors($editor, $viewInformation); |
376 | 376 | |
— | — | @@ -580,8 +580,8 @@ |
581 | 581 | return new ShortTextEditor($attribute, new SimplePermissionController(false), false); |
582 | 582 | } |
583 | 583 | |
584 | | -function createURLViewer($attribute) { |
585 | | - return new URLEditor($attribute, new SimplePermissionController(false), false); |
| 584 | +function createLinkViewer($attribute) { |
| 585 | + return new LinkEditor($attribute, new SimplePermissionController(false), false); |
586 | 586 | } |
587 | 587 | |
588 | 588 | function createBooleanViewer($attribute) { |
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiRecordSets.php |
— | — | @@ -557,7 +557,7 @@ |
558 | 558 | function getObjectAttributesRecord($objectId, ViewInformation $viewInformation, $structuralOverride = null) { |
559 | 559 | global |
560 | 560 | $objectIdAttribute, |
561 | | - $urlAttributeValuesAttribute, $textAttributeValuesAttribute, |
| 561 | + $linkAttributeValuesAttribute, $textAttributeValuesAttribute, |
562 | 562 | $translatedTextAttributeValuesAttribute, $optionAttributeValuesAttribute, |
563 | 563 | $definedMeaningAttributesAttribute; |
564 | 564 | |
— | — | @@ -569,7 +569,7 @@ |
570 | 570 | $record->setAttributeValue($objectIdAttribute, $objectId); |
571 | 571 | $record->setAttributeValue($textAttributeValuesAttribute, getTextAttributesValuesRecordSet(array($objectId), $viewInformation)); |
572 | 572 | $record->setAttributeValue($translatedTextAttributeValuesAttribute, getTranslatedTextAttributeValuesRecordSet(array($objectId), $viewInformation)); |
573 | | - $record->setAttributeValue($urlAttributeValuesAttribute, getURLAttributeValuesRecordSet(array($objectId), $viewInformation)); |
| 573 | + $record->setAttributeValue($linkAttributeValuesAttribute, getLinkAttributeValuesRecordSet(array($objectId), $viewInformation)); |
574 | 574 | $record->setAttributeValue($optionAttributeValuesAttribute, getOptionAttributeValuesRecordSet(array($objectId), $viewInformation)); |
575 | 575 | |
576 | 576 | return $record; |
— | — | @@ -601,7 +601,7 @@ |
602 | 602 | $definedMeaningAttributesAttribute, $objectIdAttribute, |
603 | 603 | $textAttributeValuesAttribute, $textAttributeAttribute, |
604 | 604 | $translatedTextAttributeAttribute, $translatedTextAttributeValuesAttribute, |
605 | | - $urlAttributeAttribute, $urlAttributeValuesAttribute, |
| 605 | + $linkAttributeAttribute, $linkAttributeValuesAttribute, |
606 | 606 | $optionAttributeAttribute, $optionAttributeValuesAttribute; |
607 | 607 | |
608 | 608 | $result = new ArrayRecord(new Structure($definedMeaningAttributesAttribute)); |
— | — | @@ -619,9 +619,9 @@ |
620 | 620 | $attributeIds |
621 | 621 | )); |
622 | 622 | |
623 | | - $result->setAttributeValue($urlAttributeValuesAttribute, filterAttributeValues( |
624 | | - $sourceRecord->getAttributeValue($urlAttributeValuesAttribute), |
625 | | - $urlAttributeAttribute, |
| 623 | + $result->setAttributeValue($linkAttributeValuesAttribute, filterAttributeValues( |
| 624 | + $sourceRecord->getAttributeValue($linkAttributeValuesAttribute), |
| 625 | + $linkAttributeAttribute, |
626 | 626 | $attributeIds |
627 | 627 | )); |
628 | 628 | |
— | — | @@ -743,7 +743,7 @@ |
744 | 744 | global |
745 | 745 | $textAttributeObjectAttribute, $textAttributeValuesAttribute, |
746 | 746 | $translatedTextAttributeObjectAttribute, $translatedTextAttributeValuesAttribute, |
747 | | - $urlAttributeObjectAttribute, $urlAttributeValuesAttribute, |
| 747 | + $linkAttributeObjectAttribute, $linkAttributeValuesAttribute, |
748 | 748 | $optionAttributeObjectAttribute, $optionAttributeValuesAttribute; |
749 | 749 | |
750 | 750 | $recordSetStructure = $recordSet->getStructure(); |
— | — | @@ -780,15 +780,15 @@ |
781 | 781 | |
782 | 782 | $emptyTranslatedTextAttributesRecordSet = new ArrayRecordSet($allTranslatedTextAttributeValuesRecordSet->getStructure(), $allTranslatedTextAttributeValuesRecordSet->getKey()); |
783 | 783 | |
784 | | - // URL attributes |
785 | | - $allURLAttributeValuesRecordSet = getURLAttributeValuesRecordSet($objectIds, $viewInformation); |
786 | | - $urlAttributeValuesRecordSets = |
| 784 | + // Link attributes |
| 785 | + $allLinkAttributeValuesRecordSet = getLinkAttributeValuesRecordSet($objectIds, $viewInformation); |
| 786 | + $linkAttributeValuesRecordSets = |
787 | 787 | splitRecordSet( |
788 | | - $allURLAttributeValuesRecordSet, |
789 | | - $urlAttributeObjectAttribute |
| 788 | + $allLinkAttributeValuesRecordSet, |
| 789 | + $linkAttributeObjectAttribute |
790 | 790 | ); |
791 | 791 | |
792 | | - $emptyURLAttributesRecordSet = new ArrayRecordSet($allURLAttributeValuesRecordSet->getStructure(), $allURLAttributeValuesRecordSet->getKey()); |
| 792 | + $emptyLinkAttributesRecordSet = new ArrayRecordSet($allLinkAttributeValuesRecordSet->getStructure(), $allLinkAttributeValuesRecordSet->getKey()); |
793 | 793 | |
794 | 794 | // Option attributes |
795 | 795 | $allOptionAttributeValuesRecordSet = getOptionAttributeValuesRecordSet($objectIds, $viewInformation); |
— | — | @@ -817,11 +817,11 @@ |
818 | 818 | else |
819 | 819 | $translatedTextAttributeValuesRecordSet = $emptyTranslatedTextAttributesRecordSet; |
820 | 820 | |
821 | | - // URL attributes |
822 | | - if (isset($urlAttributeValuesRecordSets[$objectId])) |
823 | | - $urlAttributeValuesRecordSet = $urlAttributeValuesRecordSets[$objectId]; |
| 821 | + // Link attributes |
| 822 | + if (isset($linkAttributeValuesRecordSets[$objectId])) |
| 823 | + $linkAttributeValuesRecordSet = $linkAttributeValuesRecordSets[$objectId]; |
824 | 824 | else |
825 | | - $urlAttributeValuesRecordSet = $emptyURLAttributesRecordSet; |
| 825 | + $linkAttributeValuesRecordSet = $emptyLinkAttributesRecordSet; |
826 | 826 | |
827 | 827 | // Option attributes |
828 | 828 | if (isset($optionAttributeValuesRecordSets[$objectId])) |
— | — | @@ -833,7 +833,7 @@ |
834 | 834 | $objectAttributesRecord->setAttributeValue($objectIdAttribute, $objectId); |
835 | 835 | $objectAttributesRecord->setAttributeValue($textAttributeValuesAttribute, $textAttributeValuesRecordSet); |
836 | 836 | $objectAttributesRecord->setAttributeValue($translatedTextAttributeValuesAttribute, $translatedTextAttributeValuesRecordSet); |
837 | | - $objectAttributesRecord->setAttributeValue($urlAttributeValuesAttribute, $urlAttributeValuesRecordSet); |
| 837 | + $objectAttributesRecord->setAttributeValue($linkAttributeValuesAttribute, $linkAttributeValuesRecordSet); |
838 | 838 | $objectAttributesRecord->setAttributeValue($optionAttributeValuesAttribute, $optionAttributeValuesRecordSet); |
839 | 839 | |
840 | 840 | $record->setAttributeValue($attributeToExpand, $objectAttributesRecord); |
— | — | @@ -1006,28 +1006,28 @@ |
1007 | 1007 | return $recordSet; |
1008 | 1008 | } |
1009 | 1009 | |
1010 | | -function getURLAttributeValuesRecordSet(array $objectIds, ViewInformation $viewInformation) { |
| 1010 | +function getLinkAttributeValuesRecordSet(array $objectIds, ViewInformation $viewInformation) { |
1011 | 1011 | global |
1012 | | - $urlAttributeValuesTable, $urlAttributeIdAttribute, $urlAttributeObjectAttribute, |
1013 | | - $urlAttributeAttribute, $urlAttribute, $objectAttributesAttribute, |
1014 | | - $urlAttributeValuesStructure; |
| 1012 | + $linkAttributeValuesTable, $linkAttributeIdAttribute, $linkAttributeObjectAttribute, |
| 1013 | + $linkAttributeAttribute, $linkAttribute, $objectAttributesAttribute, |
| 1014 | + $linkAttributeValuesStructure; |
1015 | 1015 | |
1016 | 1016 | $recordSet = queryRecordSet( |
1017 | | - $urlAttributeValuesStructure->getStructureType(), |
| 1017 | + $linkAttributeValuesStructure->getStructureType(), |
1018 | 1018 | $viewInformation->queryTransactionInformation, |
1019 | | - $urlAttributeIdAttribute, |
| 1019 | + $linkAttributeIdAttribute, |
1020 | 1020 | new TableColumnsToAttributesMapping( |
1021 | | - new TableColumnsToAttribute(array('value_id'), $urlAttributeIdAttribute), |
1022 | | - new TableColumnsToAttribute(array('object_id'), $urlAttributeObjectAttribute), |
1023 | | - new TableColumnsToAttribute(array('attribute_mid'), $urlAttributeAttribute), |
1024 | | - new TableColumnsToAttribute(array('url'), $urlAttribute) |
| 1021 | + new TableColumnsToAttribute(array('value_id'), $linkAttributeIdAttribute), |
| 1022 | + new TableColumnsToAttribute(array('object_id'), $linkAttributeObjectAttribute), |
| 1023 | + new TableColumnsToAttribute(array('attribute_mid'), $linkAttributeAttribute), |
| 1024 | + new TableColumnsToAttribute(array('url'), $linkAttribute) |
1025 | 1025 | ), |
1026 | | - $urlAttributeValuesTable, |
| 1026 | + $linkAttributeValuesTable, |
1027 | 1027 | array("object_id IN (" . implode(", ", $objectIds) . ")") |
1028 | 1028 | ); |
1029 | 1029 | |
1030 | | - expandDefinedMeaningReferencesInRecordSet($recordSet, array($urlAttributeAttribute)); |
1031 | | - expandObjectAttributesAttribute($recordSet, $objectAttributesAttribute, $urlAttributeIdAttribute, $viewInformation); |
| 1030 | + expandDefinedMeaningReferencesInRecordSet($recordSet, array($linkAttributeAttribute)); |
| 1031 | + expandObjectAttributesAttribute($recordSet, $objectAttributesAttribute, $linkAttributeIdAttribute, $viewInformation); |
1032 | 1032 | |
1033 | 1033 | return $recordSet; |
1034 | 1034 | } |
Index: trunk/extensions/Wikidata/OmegaWiki/Editor.php |
— | — | @@ -1016,7 +1016,7 @@ |
1017 | 1017 | } |
1018 | 1018 | } |
1019 | 1019 | |
1020 | | -class URLEditor extends ShortTextEditor { |
| 1020 | +class LinkEditor extends ShortTextEditor { |
1021 | 1021 | public function getViewHTML(IdStack $idPath, $value) { |
1022 | 1022 | global |
1023 | 1023 | $escapedValue; |
— | — | @@ -1230,9 +1230,9 @@ |
1231 | 1231 | } |
1232 | 1232 | } |
1233 | 1233 | |
1234 | | -class URLAttributeEditor extends AttributeEditor { |
| 1234 | +class LinkAttributeEditor extends AttributeEditor { |
1235 | 1235 | protected function suggestType() { |
1236 | | - return "url-attribute"; |
| 1236 | + return "link-attribute"; |
1237 | 1237 | } |
1238 | 1238 | } |
1239 | 1239 | |
Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataTables.php |
— | — | @@ -351,7 +351,7 @@ |
352 | 352 | } |
353 | 353 | } |
354 | 354 | |
355 | | -class URLAttributeValuesTable extends VersionedTable { |
| 355 | +class LinkAttributeValuesTable extends VersionedTable { |
356 | 356 | public $valueId; |
357 | 357 | public $objectId; |
358 | 358 | public $attributeMid; |
— | — | @@ -381,6 +381,7 @@ |
382 | 382 | $collectionMembershipsTable, |
383 | 383 | $definedMeaningTable, |
384 | 384 | $expressionTable, |
| 385 | + $linkAttributeValuesTable, |
385 | 386 | $meaningRelationsTable, |
386 | 387 | $optionAttributeOptionsTable, |
387 | 388 | $optionAttributeValuesTable, |
— | — | @@ -388,8 +389,7 @@ |
389 | 390 | $textAttributeValuesTable, |
390 | 391 | $translatedContentAttributeValuesTable, |
391 | 392 | $translatedContentTable, |
392 | | - $transactionsTable, |
393 | | - $urlAttributeValuesTable; |
| 393 | + $transactionsTable; |
394 | 394 | |
395 | 395 | $dc=wdGetDataSetContext(); |
396 | 396 | $alternativeDefinitionsTable = new AlternativeDefinitionsTable("alt_meaningtexts"); |
— | — | @@ -399,6 +399,7 @@ |
400 | 400 | $collectionMembershipsTable = new CollectionMembershipsTable("collection_contents"); |
401 | 401 | $definedMeaningTable = new DefinedMeaningTable("defined_meaning"); |
402 | 402 | $expressionTable = new ExpressionTable("expression_ns"); |
| 403 | +$linkAttributeValuesTable = new LinkAttributeValuesTable("url_attribute_values"); |
403 | 404 | $meaningRelationsTable = new MeaningRelationsTable("meaning_relations"); |
404 | 405 | $syntransTable = new SyntransTable("syntrans"); |
405 | 406 | $textAttributeValuesTable = new TextAttributeValuesTable("text_attribute_values"); |
— | — | @@ -407,7 +408,6 @@ |
408 | 409 | $translatedContentTable = new TranslatedContentTable("translated_content"); |
409 | 410 | $optionAttributeOptionsTable = new OptionAttributeOptionsTable("option_attribute_options"); |
410 | 411 | $optionAttributeValuesTable = new OptionAttributeValuesTable("option_attribute_values"); |
411 | | -$urlAttributeValuesTable = new URLAttributeValuesTable("url_attribute_values"); |
412 | 412 | |
413 | 413 | function select(array $expressions, array $tables, array $restrictions) { |
414 | 414 | $result = "SELECT " . $expressions[0]->toExpression(); |