From a453ebd4cbe48e88940dc405a74d730ca4c17cbc Mon Sep 17 00:00:00 2001 From: gnosygnu Date: Sun, 20 Oct 2019 09:28:28 -0400 Subject: [PATCH] Wikibase: Reorganize Wikibase classes; add some basic support for formatters [#593] --- 400_xowa/.classpath | 8 +- .../DataValues/MonolingualTextValue.java | 135 ++++++++++++++++++ .../DataValues/DataValues/DataValue.java | 99 +++++++++++++ .../DataValues/IllegalValueException.java | 20 +++ .../ValueFormatters/ValueFormatter.java | 30 ++++ .../client/config/WikibaseClientDefault.java | 2 +- .../client/includes/Wbase_client.java | 2 +- .../client/includes/Wbase_repo_linker.java | 2 +- .../client/includes/Wbase_settings.java | 2 +- .../scribunto/Wbase_entity_accessor.java | 2 +- ...ikibaseLanguageIndependentLuaBindings.java | 4 +- .../Formatters/MonolingualHtmlFormatter.java | 52 +++++++ .../Formatters/MonolingualTextFormatter.java | 35 +++++ .../lib/includes/Formatters/SnakFormat.java | 59 ++++++++ .../Formatters/SnakFormatterFormat.java | 37 +++++ .../WikibaseValueFormatterBuilder.java | 44 ++++++ .../Store/EntityRetrievingTermLookup.java | 3 +- .../includes/specials/Wbase_entityPage.java | 2 +- .../gplx/xowa/specials/Xow_special_mgr.java | 2 +- .../scribunto/libs/Scrib_lib_wikibase.java | 4 +- .../gplx/xowa/xtns/wbases/Wdata_wiki_mgr.java | 2 +- 21 files changed, 530 insertions(+), 16 deletions(-) create mode 100644 400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/DataValues/Common/DataValues/MonolingualTextValue.java create mode 100644 400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/DataValues/DataValues/DataValue.java create mode 100644 400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/DataValues/DataValues/IllegalValueException.java create mode 100644 400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/DataValues/Interfaces/ValueFormatters/ValueFormatter.java rename 400_xowa/src/gplx/xowa/{xtns/wbases/mediawiki => mediawiki/extensions/Wikibase}/client/config/WikibaseClientDefault.java (88%) rename 400_xowa/src/gplx/xowa/{xtns/wbases/mediawiki => mediawiki/extensions/Wikibase}/client/includes/Wbase_client.java (80%) rename 400_xowa/src/gplx/xowa/{xtns/wbases/mediawiki => mediawiki/extensions/Wikibase}/client/includes/Wbase_repo_linker.java (90%) rename 400_xowa/src/gplx/xowa/{xtns/wbases/mediawiki => mediawiki/extensions/Wikibase}/client/includes/Wbase_settings.java (85%) rename 400_xowa/src/gplx/xowa/{xtns/wbases/mediawiki => mediawiki/extensions/Wikibase}/client/includes/dataAccess/scribunto/Wbase_entity_accessor.java (86%) rename 400_xowa/src/gplx/xowa/{xtns/wbases/mediawiki => mediawiki/extensions/Wikibase}/client/includes/dataAccess/scribunto/WikibaseLanguageIndependentLuaBindings.java (69%) create mode 100644 400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/MonolingualHtmlFormatter.java create mode 100644 400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/MonolingualTextFormatter.java create mode 100644 400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/SnakFormat.java create mode 100644 400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/SnakFormatterFormat.java create mode 100644 400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/WikibaseValueFormatterBuilder.java rename 400_xowa/src/gplx/xowa/{xtns/wbases/mediawiki => mediawiki/extensions/Wikibase}/lib/includes/Store/EntityRetrievingTermLookup.java (75%) rename 400_xowa/src/gplx/xowa/{xtns/wbases/mediawiki => mediawiki/extensions/Wikibase}/repo/includes/specials/Wbase_entityPage.java (82%) diff --git a/400_xowa/.classpath b/400_xowa/.classpath index 233d2ba85..3e06bab74 100644 --- a/400_xowa/.classpath +++ b/400_xowa/.classpath @@ -13,9 +13,9 @@ - - - - + + + + diff --git a/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/DataValues/Common/DataValues/MonolingualTextValue.java b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/DataValues/Common/DataValues/MonolingualTextValue.java new file mode 100644 index 000000000..b4aeda986 --- /dev/null +++ b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/DataValues/Common/DataValues/MonolingualTextValue.java @@ -0,0 +1,135 @@ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.xowa.mediawiki.extensions.Wikibase.DataValues.Common.DataValues; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.extensions.*; import gplx.xowa.mediawiki.extensions.Wikibase.*; import gplx.xowa.mediawiki.extensions.Wikibase.DataValues.*; import gplx.xowa.mediawiki.extensions.Wikibase.DataValues.Common.*; +import gplx.xowa.mediawiki.extensions.Wikibase.DataValues.DataValues.*; +// REF.MW:https://github.com/DataValues/Common/blob/master/src/DataValues/MonolingualTextValue.php +public class MonolingualTextValue implements DataValue { + /** + * @var String + */ + private String languageCode; + + /** + * @var String + */ + private String text; + /** + * @param String languageCode + * @param String String text + * + * @throws IllegalValueException + */ + public MonolingualTextValue(String languageCode, String text) { +// if ( !is_string( languageCode ) || languageCode === '' ) { +// throw new IllegalValueException( 'languageCode must be a non-empty String' ); +// } +// if ( !is_string( String text ) ) { +// throw new IllegalValueException( 'String text must be a String' ); +// } + this.languageCode = languageCode; + this.text = text; + } + +// /** +// * @see Serializable::serialize +// * +// * @return String +// */ +// public function serialize() { +// return serialize( [ this.languageCode, this.text ] ); +// } +// /** +// * @see Serializable::unserialize +// * +// * @param String $value +// */ +// public function unserialize( $value ) { +// list( languageCode, String text ) = unserialize( $value ); +// this.__construct( languageCode, String text ); +// } +// /** +// * @see DataValue::getType +// * +// * @return String +// */ +// public static function getType() { +// return 'monolingualtext'; +// } +// /** +// * @see DataValue::getSortKey +// * +// * @return String +// */ +// public function getSortKey() { +// // TODO: we might want to re-think this key. Perhaps the language should simply be omitted. +// return this.languageCode . this.text; +// } + + /** + * @see DataValue::getValue + * + * @return self + */ + public Object getValue() { + return this; + } + + /** + * @return String + */ + public String getText() { + return this.text; + } + + /** + * @return String + */ + public String getLanguageCode() { + return this.languageCode; + } + +// /** +// * @see DataValue::getArrayValue +// * +// * @return String[] +// */ +// public function getArrayValue() { +// return [ +// 'text' => this.text, +// 'language' => this.languageCode, +// ]; +// } +// /** +// * Constructs a new instance from the provided data. Required for @see DataValueDeserializer. +// * This is expected to round-trip with @see getArrayValue. +// * +// * @deprecated since 1.0.0. Static DataValue::newFromArray constructors like this are +// * underspecified (not in the DataValue interface), and misleadingly named (should be named +// * newFromArrayValue). Instead, use DataValue builder callbacks in @see DataValueDeserializer. +// * +// * @param mixed $data Warning! Even if this is expected to be a value as returned by +// * @see getArrayValue, callers of this specific newFromArray implementation can not guarantee +// * this. This is not even guaranteed to be an array! +// * +// * @throws IllegalValueException if $data is not in the expected format. Subclasses of +// * InvalidArgumentException are expected and properly handled by @see DataValueDeserializer. +// * @return self +// */ +// public static function newFromArray( $data ) { +// self::requireArrayFields( $data, [ 'language', 'text' ] ); +// return new static( $data['language'], $data['text'] ); +// } +} diff --git a/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/DataValues/DataValues/DataValue.java b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/DataValues/DataValues/DataValue.java new file mode 100644 index 000000000..6940d6c3b --- /dev/null +++ b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/DataValues/DataValues/DataValue.java @@ -0,0 +1,99 @@ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.xowa.mediawiki.extensions.Wikibase.DataValues.DataValues; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.extensions.*; import gplx.xowa.mediawiki.extensions.Wikibase.*; import gplx.xowa.mediawiki.extensions.Wikibase.DataValues.*; +// REF.MW:https://github.com/DataValues/DataValues/blob/master/src/DataValues/DataValue.php +/** +* Interface for objects that represent a single data value. +* +* @since 0.1 +*/ +public interface DataValue { // extends Hashable, Comparable, Serializable, Immutable + /** + * Returns the identifier of the datavalues type. + * + * This is not to be confused with the DataType provided by the DataTypes extension. + * + * @since 0.1 + * + * @return String + */ + // public static function getType(); + + /** + * Returns a key that can be used to sort the data value with. + * It can be either numeric or a String. + * + * @since 0.1 + * + * @return String|float|int + */ + // Object getSortKey(); + + /** + * Returns the value contained by the DataValue. If this value is not simple and + * does not have it's own type that represents it, the DataValue itself will be returned. + * In essence, this method returns the "simplest" representation of the value. + * + * Example: + * - NumberValue returns a float or integer + * - MediaWikiTitleValue returns a Title Object + * - QuantityValue returns itself + * + * @since 0.1 + * + * @return mixed + */ + Object getValue(); + + /** + * Returns the value in a form suitable for an array serialization. + * + * For simple values (ie a String) the return value will be equal to that of {@see getValue}. + * + * Complex DataValues can provide a nicer implementation though, for instance a + * geographical coordinate value could provide an array with keys latitude, + * longitude and altitude, each pointing to a simple float value. + * + * @since 0.1 + * + * @return mixed + */ + // Object getArrayValue(); + + /** + * Returns the whole DataValue in array form. + * + * The array contains: + * - value: mixed, same as the result of {@see getArrayValue} + * - type: String, same as the result of {@see getType} + * + * This is sufficient for unserialization in a factory. + * + * @since 0.1 + * + * @return array + */ + // Object toArray(); + + /** + * Returns a deep copy of the Object. + * + * @since 0.1 + * + * @return DataValue + */ + // DataValue getCopy(); +} diff --git a/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/DataValues/DataValues/IllegalValueException.java b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/DataValues/DataValues/IllegalValueException.java new file mode 100644 index 000000000..fb23be170 --- /dev/null +++ b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/DataValues/DataValues/IllegalValueException.java @@ -0,0 +1,20 @@ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.xowa.mediawiki.extensions.Wikibase.DataValues.DataValues; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.extensions.*; import gplx.xowa.mediawiki.extensions.Wikibase.*; import gplx.xowa.mediawiki.extensions.Wikibase.DataValues.*; +// REF.MW:https://github.com/DataValues/DataValues/blob/master/src/DataValues/IllegalValueException.php +// extends https://www.php.net/manual/en/class.invalidargumentexception.php +public class IllegalValueException { +} diff --git a/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/DataValues/Interfaces/ValueFormatters/ValueFormatter.java b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/DataValues/Interfaces/ValueFormatters/ValueFormatter.java new file mode 100644 index 000000000..5f62aada5 --- /dev/null +++ b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/DataValues/Interfaces/ValueFormatters/ValueFormatter.java @@ -0,0 +1,30 @@ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.xowa.mediawiki.extensions.Wikibase.DataValues.Interfaces.ValueFormatters; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.extensions.*; import gplx.xowa.mediawiki.extensions.Wikibase.*; import gplx.xowa.mediawiki.extensions.Wikibase.DataValues.*; import gplx.xowa.mediawiki.extensions.Wikibase.DataValues.Interfaces.*; +// REF: https://github.com/DataValues/Interfaces/blob/master/src/ValueFormatters/ValueFormatter.php +public interface ValueFormatter { + // public static final String OPT_LANG = "lang"; + /** + * @since 0.1 + * + * @param mixed $value + * + * @return mixed + * @throws FormattingException + * @throws \InvalidArgumentException when value is of wrong type or out of accepted range/pattern + */ + Object format(Object val); +} diff --git a/400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/config/WikibaseClientDefault.java b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/config/WikibaseClientDefault.java similarity index 88% rename from 400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/config/WikibaseClientDefault.java rename to 400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/config/WikibaseClientDefault.java index c72837488..42020d931 100644 --- a/400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/config/WikibaseClientDefault.java +++ b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/config/WikibaseClientDefault.java @@ -13,7 +13,7 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.xtns.wbases.mediawiki.client.config; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wbases.*; import gplx.xowa.xtns.wbases.mediawiki.*; import gplx.xowa.xtns.wbases.mediawiki.client.*; +package gplx.xowa.mediawiki.extensions.Wikibase.client.config; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.extensions.*; import gplx.xowa.mediawiki.extensions.Wikibase.*; import gplx.xowa.mediawiki.extensions.Wikibase.client.*; import gplx.xowa.xtns.wbases.core.*; import gplx.xowa.xtns.wbases.claims.*; import gplx.xowa.xtns.wbases.claims.enums.*; import gplx.xowa.xtns.wbases.claims.itms.*; import gplx.xowa.xtns.wbases.stores.*; public class WikibaseClientDefault { private final Hash_adp_bry settingCache = Hash_adp_bry.cs(); diff --git a/400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/includes/Wbase_client.java b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/includes/Wbase_client.java similarity index 80% rename from 400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/includes/Wbase_client.java rename to 400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/includes/Wbase_client.java index 7c65e23c5..8a472afa6 100644 --- a/400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/includes/Wbase_client.java +++ b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/includes/Wbase_client.java @@ -13,7 +13,7 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.xtns.wbases.mediawiki.client.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wbases.*; import gplx.xowa.xtns.wbases.mediawiki.*; import gplx.xowa.xtns.wbases.mediawiki.client.*; +package gplx.xowa.mediawiki.extensions.Wikibase.client.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.extensions.*; import gplx.xowa.mediawiki.extensions.Wikibase.*; import gplx.xowa.mediawiki.extensions.Wikibase.client.*; import gplx.xowa.mediawiki.*; public class Wbase_client { private Wbase_repo_linker repoLinker; diff --git a/400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/includes/Wbase_repo_linker.java b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/includes/Wbase_repo_linker.java similarity index 90% rename from 400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/includes/Wbase_repo_linker.java rename to 400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/includes/Wbase_repo_linker.java index 51fb243c2..481e73a0b 100644 --- a/400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/includes/Wbase_repo_linker.java +++ b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/includes/Wbase_repo_linker.java @@ -13,7 +13,7 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.xtns.wbases.mediawiki.client.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wbases.*; import gplx.xowa.xtns.wbases.mediawiki.*; import gplx.xowa.xtns.wbases.mediawiki.client.*; +package gplx.xowa.mediawiki.extensions.Wikibase.client.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.extensions.*; import gplx.xowa.mediawiki.extensions.Wikibase.*; import gplx.xowa.mediawiki.extensions.Wikibase.client.*; import gplx.xowa.mediawiki.*; // https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/client/includes/RepoLinker.php public class Wbase_repo_linker { diff --git a/400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/includes/Wbase_settings.java b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/includes/Wbase_settings.java similarity index 85% rename from 400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/includes/Wbase_settings.java rename to 400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/includes/Wbase_settings.java index 5b590edd7..195dd6941 100644 --- a/400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/includes/Wbase_settings.java +++ b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/includes/Wbase_settings.java @@ -13,7 +13,7 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.xtns.wbases.mediawiki.client.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wbases.*; import gplx.xowa.xtns.wbases.mediawiki.*; import gplx.xowa.xtns.wbases.mediawiki.client.*; +package gplx.xowa.mediawiki.extensions.Wikibase.client.includes; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.extensions.*; import gplx.xowa.mediawiki.extensions.Wikibase.*; import gplx.xowa.mediawiki.extensions.Wikibase.client.*; public class Wbase_settings { private static final Hash_adp_bry hash = Hash_adp_bry.cs(); public byte[] getSetting(String key) {return getSetting(Bry_.new_u8(key));} diff --git a/400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/includes/dataAccess/scribunto/Wbase_entity_accessor.java b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/includes/dataAccess/scribunto/Wbase_entity_accessor.java similarity index 86% rename from 400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/includes/dataAccess/scribunto/Wbase_entity_accessor.java rename to 400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/includes/dataAccess/scribunto/Wbase_entity_accessor.java index 58d4b65b6..595d88454 100644 --- a/400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/includes/dataAccess/scribunto/Wbase_entity_accessor.java +++ b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/includes/dataAccess/scribunto/Wbase_entity_accessor.java @@ -13,7 +13,7 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.xtns.wbases.mediawiki.client.includes.dataAccess.scribunto; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wbases.*; import gplx.xowa.xtns.wbases.mediawiki.*; import gplx.xowa.xtns.wbases.mediawiki.client.*; import gplx.xowa.xtns.wbases.mediawiki.client.includes.*; import gplx.xowa.xtns.wbases.mediawiki.client.includes.dataAccess.*; +package gplx.xowa.mediawiki.extensions.Wikibase.client.includes.dataAccess.scribunto; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.extensions.*; import gplx.xowa.mediawiki.extensions.Wikibase.*; import gplx.xowa.mediawiki.extensions.Wikibase.client.*; import gplx.xowa.mediawiki.extensions.Wikibase.client.includes.*; import gplx.xowa.mediawiki.extensions.Wikibase.client.includes.dataAccess.*; import gplx.xowa.xtns.wbases.*; import gplx.xowa.xtns.wbases.claims.*; import gplx.xowa.xtns.wbases.claims.itms.*; import gplx.xowa.xtns.wbases.claims.enums.*; import gplx.xowa.xtns.wbases.stores.*; public class Wbase_entity_accessor { private final Wbase_doc_mgr entity_mgr; diff --git a/400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/includes/dataAccess/scribunto/WikibaseLanguageIndependentLuaBindings.java b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/includes/dataAccess/scribunto/WikibaseLanguageIndependentLuaBindings.java similarity index 69% rename from 400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/includes/dataAccess/scribunto/WikibaseLanguageIndependentLuaBindings.java rename to 400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/includes/dataAccess/scribunto/WikibaseLanguageIndependentLuaBindings.java index b0f63a610..9d73cd877 100644 --- a/400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/client/includes/dataAccess/scribunto/WikibaseLanguageIndependentLuaBindings.java +++ b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/client/includes/dataAccess/scribunto/WikibaseLanguageIndependentLuaBindings.java @@ -13,9 +13,9 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.xtns.wbases.mediawiki.client.includes.dataAccess.scribunto; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wbases.*; import gplx.xowa.xtns.wbases.mediawiki.*; import gplx.xowa.xtns.wbases.mediawiki.client.*; import gplx.xowa.xtns.wbases.mediawiki.client.includes.*; import gplx.xowa.xtns.wbases.mediawiki.client.includes.dataAccess.*; +package gplx.xowa.mediawiki.extensions.Wikibase.client.includes.dataAccess.scribunto; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.extensions.*; import gplx.xowa.mediawiki.extensions.Wikibase.*; import gplx.xowa.mediawiki.extensions.Wikibase.client.*; import gplx.xowa.mediawiki.extensions.Wikibase.client.includes.*; import gplx.xowa.mediawiki.extensions.Wikibase.client.includes.dataAccess.*; import gplx.xowa.xtns.wbases.*; import gplx.xowa.xtns.wbases.claims.*; import gplx.xowa.xtns.wbases.claims.itms.*; import gplx.xowa.xtns.wbases.claims.enums.*; import gplx.xowa.xtns.wbases.stores.*; -import gplx.xowa.xtns.wbases.mediawiki.lib.includes.Store.*; import gplx.xowa.xtns.wbases.mediawiki.client.config.*; +import gplx.xowa.mediawiki.extensions.Wikibase.lib.includes.Store.*; import gplx.xowa.mediawiki.extensions.Wikibase.client.config.*; public class WikibaseLanguageIndependentLuaBindings { private final EntityRetrievingTermLookup termLookup; private final WikibaseClientDefault settings = WikibaseClientDefault.New(); diff --git a/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/MonolingualHtmlFormatter.java b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/MonolingualHtmlFormatter.java new file mode 100644 index 000000000..74847e7d6 --- /dev/null +++ b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/MonolingualHtmlFormatter.java @@ -0,0 +1,52 @@ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.xowa.mediawiki.extensions.Wikibase.lib.includes.Formatters; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.extensions.*; import gplx.xowa.mediawiki.extensions.Wikibase.*; import gplx.xowa.mediawiki.extensions.Wikibase.lib.*; import gplx.xowa.mediawiki.extensions.Wikibase.lib.includes.*; +import gplx.xowa.mediawiki.extensions.Wikibase.DataValues.Interfaces.ValueFormatters.*; +import gplx.xowa.mediawiki.extensions.Wikibase.DataValues.Common.DataValues.*; +// REF.MW:https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/lib/includes/Formatters/MonolingualHtmlFormatter.php +public class MonolingualHtmlFormatter implements ValueFormatter { + /** + * @var LanguageNameLookup + */ +// private String languageNameLookup; +// public MonolingualHtmlFormatter(LanguageNameLookup languageNameLookup ) { +// this.languageNameLookup = languageNameLookup; +// } + /** + * @see ValueFormatter::format + * + * @param MonolingualTextValue $value + * + * @throws InvalidArgumentException + * @return String HTML + */ + public Object format(Object val) { + // if ( !( $value instanceof MonolingualTextValue ) ) { + // throw new InvalidArgumentException( 'Data value type mismatch. Expected a MonolingualTextValue.' ); + // } +// MonolingualTextValue monolingualVal = ((MonolingualTextValue)val); +// String text = monolingualVal.getText(); +// String languageCode = monolingualVal.getLanguageCode(); +//// $languageName = this.languageNameLookup->getName($languageCode); +// return wfMessage("wikibase-monolingualtext", +// wfEscapeWikiText(text), +// wfEscapeWikiText(languageCode), +// wfEscapeWikiText(languageName) +// ).parse(); + // "wikibase-monolingualtext": "$1 ($3)", + return null; + } +} diff --git a/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/MonolingualTextFormatter.java b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/MonolingualTextFormatter.java new file mode 100644 index 000000000..447e9b026 --- /dev/null +++ b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/MonolingualTextFormatter.java @@ -0,0 +1,35 @@ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.xowa.mediawiki.extensions.Wikibase.lib.includes.Formatters; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.extensions.*; import gplx.xowa.mediawiki.extensions.Wikibase.*; import gplx.xowa.mediawiki.extensions.Wikibase.lib.*; import gplx.xowa.mediawiki.extensions.Wikibase.lib.includes.*; +import gplx.xowa.mediawiki.extensions.Wikibase.DataValues.Interfaces.ValueFormatters.*; +import gplx.xowa.mediawiki.extensions.Wikibase.DataValues.Common.DataValues.*; +// REF.MW:https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/lib/includes/Formatters/MonolingualTextFormatter.php +public class MonolingualTextFormatter implements ValueFormatter { + /** + * @see ValueFormatter::format + * + * @param MonolingualTextValue $value + * + * @throws InvalidArgumentException + * @return String Text + */ + public Object format(Object val) { + // if (!Type_.Eq_by_obj(val, typeof(MonolingualTextValue))) { + // throw new InvalidArgumentException( 'Data value type mismatch. Expected a MonolingualTextValue.' ); + // } + return ((MonolingualTextValue)val).getText(); + } +} diff --git a/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/SnakFormat.java b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/SnakFormat.java new file mode 100644 index 000000000..eed9a0a80 --- /dev/null +++ b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/SnakFormat.java @@ -0,0 +1,59 @@ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.xowa.mediawiki.extensions.Wikibase.lib.includes.Formatters; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.extensions.*; import gplx.xowa.mediawiki.extensions.Wikibase.*; import gplx.xowa.mediawiki.extensions.Wikibase.lib.*; import gplx.xowa.mediawiki.extensions.Wikibase.lib.includes.*; +import gplx.xowa.xtns.wbases.claims.enums.*; +// REF.MW: https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/lib/includes/Formatters/SnakFormat.php +public class SnakFormat { + /** + * Get the format to fallback to, in case a given format is not available. + * + * @param String $format One of the SnakFormatter::FORMAT_... constants. + * + * @throws InvalidArgumentException + * @return String One of the SnakFormatter::FORMAT_* constants. + */ + public Wbase_enum_itm getFallbackFormat(Wbase_enum_itm format) { + switch (format.Tid()) { + case SnakFormatterFormat.Tid__plain: + break; + } + throw Err_.new_wo_type(""); + } + + +// public function getFallbackFormat( $format ) { +// switch ( $format ) { +// case SnakFormatter::FORMAT_HTML: +// case SnakFormatter::FORMAT_HTML_DIFF: +// case SnakFormatter::FORMAT_HTML_VERBOSE: +// return SnakFormatter::FORMAT_HTML; +// case SnakFormatter::FORMAT_HTML_VERBOSE_PREVIEW: +// return SnakFormatter::FORMAT_HTML_VERBOSE; +// case SnakFormatter::FORMAT_WIKI: +// case SnakFormatter::FORMAT_PLAIN: +// return $format; +// } +// throw new InvalidArgumentException( 'Unsupported output format: ' . $format ); +// } + public Wbase_enum_itm getBaseFormat(Wbase_enum_itm format) { + switch (format.Tid()) { + case SnakFormatterFormat.Tid__plain: + break; + } + throw Err_.new_wo_type(""); + } + +} diff --git a/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/SnakFormatterFormat.java b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/SnakFormatterFormat.java new file mode 100644 index 000000000..8946724f7 --- /dev/null +++ b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/SnakFormatterFormat.java @@ -0,0 +1,37 @@ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.xowa.mediawiki.extensions.Wikibase.lib.includes.Formatters; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.extensions.*; import gplx.xowa.mediawiki.extensions.Wikibase.*; import gplx.xowa.mediawiki.extensions.Wikibase.lib.*; import gplx.xowa.mediawiki.extensions.Wikibase.lib.includes.*; +import gplx.xowa.xtns.wbases.claims.enums.*; +// REF.MW: https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/lib/includes/Formatters/SnakFormatter.php +public class SnakFormatterFormat { + public static final byte + Tid__plain = 1 + , Tid__wiki = 2 + , Tid__html = 3 + , Tid__html_diff = 4 + , Tid__html_verbose = 5 + , Tid__html_verbose_preview = 6 + ; + public static final Wbase_enum_hash Reg = new Wbase_enum_hash("snak_format", 6); + public static final Wbase_enum_itm + Itm__plain = Reg.Add(Tid__plain , "text/plain") + , Itm__wiki = Reg.Add(Tid__wiki , "text/x-wiki") + , Itm__html = Reg.Add(Tid__html , "text/html") + , Itm__html_diff = Reg.Add(Tid__html_diff , "text/html; disposition=diff") + , Itm__html_verbose = Reg.Add(Tid__html_verbose , "text/html; disposition=verbose") + , Itm__html_verbose_preview = Reg.Add(Tid__html_verbose_preview , "text/html; disposition=verbose-preview") + ; +} diff --git a/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/WikibaseValueFormatterBuilder.java b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/WikibaseValueFormatterBuilder.java new file mode 100644 index 000000000..3a29b9dee --- /dev/null +++ b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Formatters/WikibaseValueFormatterBuilder.java @@ -0,0 +1,44 @@ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +XOWA is licensed under the terms of the General Public License (GPL) Version 3, +or alternatively under the terms of the Apache License Version 2.0. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +The terms of each license can be found in the source code repository: + +GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.xowa.mediawiki.extensions.Wikibase.lib.includes.Formatters; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.extensions.*; import gplx.xowa.mediawiki.extensions.Wikibase.*; import gplx.xowa.mediawiki.extensions.Wikibase.lib.*; import gplx.xowa.mediawiki.extensions.Wikibase.lib.includes.*; +import gplx.xowa.xtns.wbases.claims.enums.*; +import gplx.xowa.mediawiki.extensions.Wikibase.DataValues.Interfaces.ValueFormatters.*; +public class WikibaseValueFormatterBuilder { + private final SnakFormat snakFormat = new SnakFormat(); + + /** + * @param String $format The desired target format, see SnakFormatter::FORMAT_XXX + * + * @return MonolingualHtmlFormatter|MonolingualWikitextFormatter|MonolingualTextFormatter + */ + public ValueFormatter newMonolingualFormatter(Wbase_enum_itm format) { + switch (snakFormat.getBaseFormat(format).Tid()) { + case SnakFormatterFormat.Tid__html: + return null; + } + return null; + } +// public function newMonolingualFormatter( $format ) { +// switch ( $this->snakFormat->getBaseFormat( $format ) ) { +// case SnakFormatter::FORMAT_HTML: +// return new MonolingualHtmlFormatter( $this->languageNameLookup ); +// case SnakFormatter::FORMAT_WIKI: +// return new MonolingualWikitextFormatter(); +// default: +// return new MonolingualTextFormatter(); +// } +// } +} diff --git a/400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/lib/includes/Store/EntityRetrievingTermLookup.java b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Store/EntityRetrievingTermLookup.java similarity index 75% rename from 400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/lib/includes/Store/EntityRetrievingTermLookup.java rename to 400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Store/EntityRetrievingTermLookup.java index 7e27e9e77..b3b6df85b 100644 --- a/400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/lib/includes/Store/EntityRetrievingTermLookup.java +++ b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/lib/includes/Store/EntityRetrievingTermLookup.java @@ -13,8 +13,9 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.xtns.wbases.mediawiki.lib.includes.Store; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wbases.*; import gplx.xowa.xtns.wbases.mediawiki.*; import gplx.xowa.xtns.wbases.mediawiki.lib.*; import gplx.xowa.xtns.wbases.mediawiki.lib.includes.*; +package gplx.xowa.mediawiki.extensions.Wikibase.lib.includes.Store; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.extensions.*; import gplx.xowa.mediawiki.extensions.Wikibase.*; import gplx.xowa.mediawiki.extensions.Wikibase.lib.*; import gplx.xowa.mediawiki.extensions.Wikibase.lib.includes.*; import gplx.xowa.xtns.wbases.core.*; import gplx.xowa.xtns.wbases.claims.*; import gplx.xowa.xtns.wbases.claims.enums.*; import gplx.xowa.xtns.wbases.claims.itms.*; import gplx.xowa.xtns.wbases.stores.*; +import gplx.xowa.xtns.wbases.*; public class EntityRetrievingTermLookup { private final Wbase_doc_mgr entity_mgr; public EntityRetrievingTermLookup(Wbase_doc_mgr entity_mgr) { diff --git a/400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/repo/includes/specials/Wbase_entityPage.java b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/repo/includes/specials/Wbase_entityPage.java similarity index 82% rename from 400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/repo/includes/specials/Wbase_entityPage.java rename to 400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/repo/includes/specials/Wbase_entityPage.java index 00af0d7b7..dafe07b84 100644 --- a/400_xowa/src/gplx/xowa/xtns/wbases/mediawiki/repo/includes/specials/Wbase_entityPage.java +++ b/400_xowa/src/gplx/xowa/mediawiki/extensions/Wikibase/repo/includes/specials/Wbase_entityPage.java @@ -13,7 +13,7 @@ The terms of each license can be found in the source code repository: GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt */ -package gplx.xowa.xtns.wbases.mediawiki.repo.includes.specials; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.wbases.*; import gplx.xowa.xtns.wbases.mediawiki.*; import gplx.xowa.xtns.wbases.mediawiki.repo.*; import gplx.xowa.xtns.wbases.mediawiki.repo.includes.*; +package gplx.xowa.mediawiki.extensions.Wikibase.repo.includes.specials; import gplx.*; import gplx.xowa.*; import gplx.xowa.mediawiki.*; import gplx.xowa.mediawiki.extensions.*; import gplx.xowa.mediawiki.extensions.Wikibase.*; import gplx.xowa.mediawiki.extensions.Wikibase.repo.*; import gplx.xowa.mediawiki.extensions.Wikibase.repo.includes.*; import gplx.xowa.specials.*; import gplx.core.net.qargs.*; import gplx.xowa.xtns.wbases.stores.*; import gplx.xowa.xtns.wbases.core.*; public class Wbase_entityPage implements Xow_special_page { public void Special__gen(Xow_wiki wiki, Xoa_page page, Xoa_url url, Xoa_ttl ttl) { diff --git a/400_xowa/src/gplx/xowa/specials/Xow_special_mgr.java b/400_xowa/src/gplx/xowa/specials/Xow_special_mgr.java index 8e8be88b8..befdd8c8a 100644 --- a/400_xowa/src/gplx/xowa/specials/Xow_special_mgr.java +++ b/400_xowa/src/gplx/xowa/specials/Xow_special_mgr.java @@ -18,7 +18,7 @@ import gplx.xowa.users.history.*; import gplx.xowa.langs.*; import gplx.xowa.langs.specials.*; import gplx.xowa.specials.*; import gplx.xowa.specials.allPages.*; import gplx.xowa.specials.nearby.*; import gplx.xowa.specials.statistics.*; import gplx.xowa.xtns.translates.*; import gplx.xowa.specials.movePage.*; -import gplx.xowa.specials.xowa.system_data.*; import gplx.xowa.specials.xowa.default_tab.*; import gplx.xowa.specials.xowa.popup_history.*; import gplx.xowa.addons.wikis.imports.*; import gplx.xowa.specials.xowa.diags.*; import gplx.xowa.xtns.wbases.mediawiki.repo.includes.specials.*; import gplx.xowa.specials.xowa.errors.*; +import gplx.xowa.specials.xowa.system_data.*; import gplx.xowa.specials.xowa.default_tab.*; import gplx.xowa.specials.xowa.popup_history.*; import gplx.xowa.addons.wikis.imports.*; import gplx.xowa.specials.xowa.diags.*; import gplx.xowa.mediawiki.extensions.Wikibase.repo.includes.specials.*; import gplx.xowa.specials.xowa.errors.*; import gplx.xowa.xtns.wbases.specials.*; import gplx.xowa.users.data.*; import gplx.xowa.users.bmks.*; import gplx.xowa.specials.mgrs.*; import gplx.xowa.addons.wikis.searchs.specials.*; diff --git a/400_xowa/src/gplx/xowa/xtns/scribunto/libs/Scrib_lib_wikibase.java b/400_xowa/src/gplx/xowa/xtns/scribunto/libs/Scrib_lib_wikibase.java index 8ea5b74f5..05c31aa57 100644 --- a/400_xowa/src/gplx/xowa/xtns/scribunto/libs/Scrib_lib_wikibase.java +++ b/400_xowa/src/gplx/xowa/xtns/scribunto/libs/Scrib_lib_wikibase.java @@ -17,7 +17,7 @@ package gplx.xowa.xtns.scribunto.libs; import gplx.*; import gplx.xowa.*; import import gplx.langs.jsons.*; import gplx.xowa.xtns.wbases.*; import gplx.xowa.xtns.wbases.parsers.*; import gplx.xowa.xtns.wbases.claims.itms.*; import gplx.xowa.xtns.wbases.stores.*; import gplx.xowa.wikis.domains.*; import gplx.xowa.xtns.scribunto.procs.*; -import gplx.xowa.xtns.wbases.core.*; import gplx.xowa.xtns.wbases.mediawiki.client.includes.*; import gplx.xowa.xtns.wbases.mediawiki.client.includes.dataAccess.scribunto.*; +import gplx.xowa.xtns.wbases.core.*; import gplx.xowa.mediawiki.extensions.Wikibase.client.includes.*; import gplx.xowa.mediawiki.extensions.Wikibase.client.includes.dataAccess.scribunto.*; public class Scrib_lib_wikibase implements Scrib_lib { private final Scrib_core core; private Wbase_doc_mgr entity_mgr; @@ -206,6 +206,8 @@ public class Scrib_lib_wikibase implements Scrib_lib { } public boolean FormatValue(Scrib_proc_args args, Scrib_proc_rslt rslt) { /* + String rv = Wdata_prop_val_visitor_.Render_snaks(core.Wiki(), core.Page().Url_bry_safe(), args.Pull_kv_ary_safe(0)); + return rslt.Init_obj(rv); public function formatValues( $snaksSerialization ) { $this->checkType( 'formatValues', 1, $snaksSerialization, 'table' ); try { diff --git a/400_xowa/src/gplx/xowa/xtns/wbases/Wdata_wiki_mgr.java b/400_xowa/src/gplx/xowa/xtns/wbases/Wdata_wiki_mgr.java index a9224bb21..ecabe8c3c 100644 --- a/400_xowa/src/gplx/xowa/xtns/wbases/Wdata_wiki_mgr.java +++ b/400_xowa/src/gplx/xowa/xtns/wbases/Wdata_wiki_mgr.java @@ -21,7 +21,7 @@ import gplx.xowa.langs.*; import gplx.xowa.parsers.*; import gplx.xowa.wikis.domains.*; import gplx.xowa.htmls.*; import gplx.xowa.parsers.logs.*; import gplx.xowa.apps.apis.xowa.xtns.*; import gplx.xowa.apps.apis.xowa.html.*; import gplx.xowa.users.*; import gplx.xowa.xtns.wbases.core.*; import gplx.xowa.xtns.wbases.claims.*; import gplx.xowa.xtns.wbases.claims.enums.*; import gplx.xowa.xtns.wbases.claims.itms.*; import gplx.xowa.xtns.wbases.parsers.*; import gplx.xowa.xtns.wbases.pfuncs.*; import gplx.xowa.xtns.wbases.hwtrs.*; import gplx.xowa.xtns.wbases.stores.*; -import gplx.xowa.xtns.wbases.mediawiki.client.includes.dataAccess.scribunto.*; +import gplx.xowa.mediawiki.extensions.Wikibase.client.includes.dataAccess.scribunto.*; public class Wdata_wiki_mgr implements Gfo_evt_itm, Gfo_invk { private final Xoae_app app; private final Wdata_prop_val_visitor prop_val_visitor;