Hello Yaron,
thanks for the answer. The big question mark I have here is: will the
object-B properties overwrite or append their values? My guess is append.
Without having tried it, though.
Prove me wrong and I will walk down this route.
Michael.
2012/12/17 Yaron Koren <ya...@wikiworks.com>
> Hi Michael,
>
> I can think of a hack that might accomplish that: transclude the first
> page in the second page, while keeping the first page's contents hidden. So
> adding the following to page "object-B" might work:
>
> <span style="display:none">{{:object-A}}</span>
>
> -Yaron
>
> On Sat, Dec 15, 2012 at 3:54 PM, Michael Rau <michi....@gmail.com> wrote:
>
>> Hello SMW people,
>>
>> my objective is to implement inheritance of properties. Example:
>>
>> page "object-A" has two properties
>> * prop1::test1
>> * prop2::test2
>>
>> Now, object-B inherits from object-A with the following properties:
>> * is::object-A (specifies inheritance!)
>> * prop1::test3
>> * prop3::test4
>>
>> The final properties (also displayed in the factbox) are expected to be:
>> * is::object-A (specifies inheritance!)
>> * prop1::test3 (object-B overwrites object-A)
>> * prop2::test2 (inherited from object-A and not overwritten)
>> * prop3::test4 (new property specific to object-B)
>>
>> My approach is $wgHooks['smwShowFactbox'] defining a parser hook to
>> 1) extract inheritance from property "is"
>> 2) if inheritance is defined, then
>> 2.1) read all properties from parent
>> 2.2) read all properties from child
>> 2.3) append all properties from parent not defined in child
>>
>> The thing is, I have no glue about how to i) extract properties from a
>> page (child and parent) and ii) append new properties. It
>> should be possible as demonstrated in SMW_Factbox::getFactboxTex.
>> Possible approach to append new properties might be to add a silent
>> property definition i.e. [[:prop2::test2]] to the hooks &$text reference.
>> I could also use SMWWriter but I could not get it to work.
>>
>> Any ideas if there is a straight-forward solution and how to read
>> properties from parent and child?
>>
>> Michael.
>>
>>
>>
>> ------------------------------------------------------------------------------
>> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
>> Remotely access PCs and mobile devices and provide instant support
>> Improve your efficiency, and focus on delivering more value-add services
>> Discover what IT Professionals Know. Rescue delivers
>> http://p.sf.net/sfu/logmein_12329d2d
>> _______________________________________________
>> Semediawiki-devel mailing list
>> Semediawiki-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
>>
>>
>
>
> --
> WikiWorks · MediaWiki Consulting · http://wikiworks.com
>
>
> --
> WikiWorks · MediaWiki Consulting · http://wikiworks.com
>
--
Michael Rau
Sarasatestraße 61
D-81247 München
Telefon: +49(0) 89-3584-7665
Mobil: +49(0) 176-6162-8248
Fax: +49 (0) 3212-116719
skype: michael_rau_de
mailto: michi....@gmail.com
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel