[SMW-devel] List composer packages used within MediaWiki

2013-11-25 Thread James HK
Hi,

In order to free the end-user from handling and installing individual
dependencies, Composer will be used as preferred installation method
starting with SMW 1.9 and while end-users probably have less interest
in what packages are installed, sometimes developers want to see
information about installed packages therefore [1] can be used to list
those information (together with type, version, last update, and
dependencies) within a SpecialPage.

PS: MW-core doesn't provide a sufficient hook for the Special:Version
page that would allow to list package information therefore
Special:ListComposerPackages is used instead.

[1] https://github.com/mwjames/mw-composerpackages

Cheers

--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] List composer packages used within MediaWiki

2013-11-25 Thread James HK
Hi Mark,

I know what I need to make it work but the last time I tried to add
something to MW-core it took 8 month so I'm rather reluctant to waste
my time on MW-core issues.

Cheers

On 11/26/13, Mark A. Hershberger m...@everybody.org wrote:
 On 11/25/2013 12:59 PM, James HK wrote:
 PS: MW-core doesn't provide a sufficient hook for the Special:Version
 page that would allow to list package information therefore
 Special:ListComposerPackages is used instead.

 Since MW 1.22 is going to ship with the barest beginnings of Composer
 support, I think we should extend Special:Version to support this.

 For now, though, we can add hooks  -- do you have any suggestions?

 --
 http://hexmode.com/

 When you are generous, you are not bestowing a gift, but
 repaying a debt.
  -- On Living Simply, St John Chrysostom



--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] List composer packages used within MediaWiki

2013-11-25 Thread Mark A. Hershberger
On 11/25/2013 01:17 PM, James HK wrote:
 I know what I need to make it work but the last time I tried to add
 something to MW-core it took 8 month so I'm rather reluctant to waste
 my time on MW-core issues.
I understand your reluctance.  https://bugzilla.wikimedia.org/56455 is
currently giving me grief.

Still, If you can put something in gerrit, I'd love to advocate for it. 
If you just want to provide a patch to me, I can submit it -- naming you
as the author or not as you like.

Mark

-- 
http://hexmode.com/

When you are generous, you are not bestowing a gift, but
repaying a debt.
 -- On Living Simply, St John Chrysostom


--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


[SMW-devel] Error in form editing when coordinates are blank

2013-11-25 Thread Benjamin Pelletier
I have a semantic form with one input that accepts coordinates, and I use
Semantic Maps to let the user fill that field.  I'm having a problem when
that input is left blank though -- when I go to edit the page after not
filling in the location, I get big red text that says Attempt to get the
latitude of an invalid location and the rest of the form doesn't display.
 See, for instance, here:

http://ropewiki.com/index.php?title=Church_Rock_Canyonaction=formedit

Is there a bug for this behavior already?

Thanks,
Ben
--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Subsection headings cripple content parsing?

2013-11-25 Thread Benjamin Pelletier
Just an update on this: I changed the regular expression on line 1422
to '/(^==[^=].*[^=]==\s*?$)/m' to get things working on my site.
 Unfortunately, this isn't a general fix because it 1) doesn't allow
pre-defined section headings with only one character and 2) doesn't
recognize predefined sections with any level other than 2.  Neither of
these problems are issues for my site so the fix works great, but it's not
something I recommend merging into trunk.

I am still having a few other difficulties with section parsing in Semantic
Forms, but I'm still working on those to figure out what the root cause is.


On Wed, Nov 20, 2013 at 3:36 PM, Yaron Koren ya...@wikiworks.com wrote:

 Hi Ben,

 Yes, you can use the Wikimedia Bugzilla:

 https://bugzilla.wikimedia.org/

 Select the MediaWiki extensions product, and the SemanticForms
 component.


 On Wed, Nov 20, 2013 at 6:31 PM, Benjamin Pelletier 
 bjpcalt...@gmail.comwrote:

 Awesome, sounds good.  I'll implement the changes on my wiki and look
 forward to finding out whether the subsection fix would be easy.  If it
 isn't, I'll see if I can dig in to changing it myself.  Does SF have a bug
 reporting system for me to list this bug in?

 Thanks once more for all the responses!


 On Wed, Nov 20, 2013 at 3:25 PM, Yaron Koren ya...@wikiworks.com wrote:

 Hi Ben,

 Well, maybe it's not surprising that the first person to use the
 section tag is a new user. You have a blank canvas for your data!

 You should be able to tell people to use {{!}}, yes.

 Escaping and un-escaping pipes would be difficult, actually - there are
 various complications, like that the form can't know for sure what the
 intended variant was, and that (contrary to what I said before) sometimes
 pipes *are* allowed - if you have a parser function like {{#if:..., I
 think pipes within there are fine. (That is, they're fine for template
 calls - SF fails on them, I believe.) Semantic Forms' handling could
 definitely be improved, but I don't think it'll ever be perfect.

 -Yaron


 On Wed, Nov 20, 2013 at 5:41 PM, Benjamin Pelletier 
 bjpcalt...@gmail.com wrote:

 Ah, nice, I didn't realize the section feature was that recent -- I
 just discovered Semantic a week or two ago and the process is just
 beautiful (I'm not yet finished with it).  I'll let you guys take a look
 [at the subsection parsing thing] first since it would take me a fair
 amount of effort to spool up my understanding of how everything works.  But
 if it turns out to be difficult then maybe I can give it a shot because I'd
 really like to have subsections work with the section feature.  Thanks for
 the code line pointer -- I'll take a look at that for background 
 regardless.

 The separate Introduction input makes sense -- that seems like a pretty
 reasonable hack and I think I'll adopt that approach.  I should be able to
 instruct my users to use {{!}} instead of | in the Introduction and
 everything will work, right?  (I already have the ! Template defined)

 I think I understand the benefits and drawbacks to property-izing the
 content and you're correct, I don't want to do that.  I'm a little
 surprised about the | issue though -- on the one hand, I understand why
 that could cause problems.  But on the other hand, wouldn't it be possible
 to sanitize and desanitize the content?  Or do extensions dynamically
 generate wiki code rather than HTML code?  (I'm not familiar with
 MediaWiki's architecture)

 Thanks again!
 --Ben


 On Wed, Nov 20, 2013 at 2:23 PM, Yaron Koren ya...@wikiworks.comwrote:

 Hi Ben,

 Wow, great! I believe this is the first real-world usage that I've
 seen of the new section feature in Semantic Forms. (It was added in
 version 2.6, about a month ago.) Unfortunately, it's accompanied by the
 first-ever bug report. :) Your diagnosis is correct - the subsections
 within that section are messing up the parsing. I guess we didn't think
 about the possibility of users adding subsections when we planned this
 feature. We'll look into this - maybe there's an easy fix. If you want to
 look into it yourself, I think the relevant code is around lines 1415-1450
 of /includes/SF_FormPrinter.php.

 To answer your other question: you can make an output like that, via a
 hack: make the top introductory text be another field within the main
 template, and then have the template display that field by itself, above
 the infobox table.

 (You could also, in theory, take that same approach for all the page
 sections below the infobox - and some people have done that - although
 that's an even bigger hack, and it leads to various problems, most notably
 that parsing gets messed up if there's a | anywhere in the text.)

 -Yaron


 On Wed, Nov 20, 2013 at 4:43 PM, Benjamin Pelletier 
 bjpcalt...@gmail.com wrote:

 Issue 1:
 I have a category of pages called Canyons and I've designed my
 Semantic Form to allow entering a bunch of simple data followed by a 
 number
 of pre-determined sections.  This is great for creating 

Re: [SMW-devel] Error in form editing when coordinates are blank

2013-11-25 Thread Benjamin Pelletier
Update: I've changed the MapsLocation class in
Maps/includes/Maps_Location.php to return '' rather than throwing an
exception upon getLatitude, getLongitude, getAltitude, and getAddress calls
when $isValid is false.  This has the undesired result of showing the lat,
lng position of an unspecified location at (0,0), but I don't see any other
ill effects.  I think this bug should be easy to reproduce locally (just
create a form with a location input, then create a page with that form and
leave the location blank, then edit that page with form), but here is my
stack trace for reference:

string(2549) #0 /var/www/
ropewiki.com/extensions/Maps/includes/Maps_Location.php(433):
MapsLocation-getLatitude()
#1 /var/www/
ropewiki.com/extensions/Maps/includes/manipulations/Maps_ParamLocation.php(77):
MapsLocation-getJSONObject()
#2 /var/www/
ropewiki.com/extensions/Validator/includes/ItemParameterManipulation.php(61):
MapsParamLocation-doManipulation(Object(MapsLocation),
Object(ListParameter), Array)
#3 /var/www/ropewiki.com/extensions/Validator/includes/Param.php(244):
ItemParameterManipulation-manipulate(Object(ListParameter), Array)
#4 /var/www/ropewiki.com/extensions/Validator/includes/Validator.php(341):
Param-format(Array, Array, Object(ValidatorOptions))
#5 /var/www/ropewiki.com/extensions/Validator/includes/Validator.php(281):
Validator-doParamProcessing()
#6 /var/www/
ropewiki.com/extensions/SemanticMaps/includes/forminputs/SM_FormInput.php(115):
Validator-validateParameters()
#7 /var/www/
ropewiki.com/extensions/SemanticMaps/includes/forminputs/SM_FormInputs.php(129):
SMFormInput-getInputOutput('', 'Canyon[Coordina...', false, false, Array)
#8 [internal function]: smfSelectFormInputHTML('', 'Canyon[Coordina...',
false, false, Array)
#9 /var/www/
ropewiki.com/extensions/SemanticForms/includes/SF_FormPrinter.php(1760):
call_user_func_array('smfSelectFormIn...', Array)
#10 /var/www/
ropewiki.com/extensions/SemanticForms/includes/SF_FormPrinter.php(1262):
SFFormPrinter-formFieldHTML(Object(SFFormField), '')
#11 /var/www/
ropewiki.com/extensions/SemanticForms/includes/SF_AutoeditAPI.php(822):
SFFormPrinter-formHTML('includeonly?...', false, true, 119,
'{{Canyon?|Regio...', 'Church Rock Can...', NULL)
#12 /var/www/
ropewiki.com/extensions/SemanticForms/includes/SF_AutoeditAPI.php(116):
SFAutoeditAPI-doAction()
#13 /var/www/
ropewiki.com/extensions/SemanticForms/specials/SF_FormEdit.php(96):
SFAutoeditAPI-execute()
#14 /var/www/
ropewiki.com/extensions/SemanticForms/includes/SF_FormEditAction.php(196):
SFFormEdit::printForm('Canyon', 'Church Rock Can...')
#15 /var/www/
ropewiki.com/extensions/SemanticForms/includes/SF_FormEditAction.php(32):
SFFormEditAction::displayForm(Object(SFFormEditAction), Object(Article))
#16 /var/www/ropewiki.com/includes/Wiki.php(439): SFFormEditAction-show()
#17 /var/www/ropewiki.com/includes/Wiki.php(305):
MediaWiki-performAction(Object(Article), Object(Title))
#18 /var/www/ropewiki.com/includes/Wiki.php(565):
MediaWiki-performRequest()
#19 /var/www/ropewiki.com/includes/Wiki.php(458): MediaWiki-main()
#20 /var/www/ropewiki.com/index.php(59): MediaWiki-run()
#21 {main}


On Mon, Nov 25, 2013 at 10:21 AM, Benjamin Pelletier
bjpcalt...@gmail.comwrote:

 I have a semantic form with one input that accepts coordinates, and I use
 Semantic Maps to let the user fill that field.  I'm having a problem when
 that input is left blank though -- when I go to edit the page after not
 filling in the location, I get big red text that says Attempt to get the
 latitude of an invalid location and the rest of the form doesn't
 display.  See, for instance, here:

 http://ropewiki.com/index.php?title=Church_Rock_Canyonaction=formedit

 Is there a bug for this behavior already?

 Thanks,
 Ben

--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Error in form editing when coordinates are blank

2013-11-25 Thread Yaron Koren
Hi Benjamin,

I, too, have experienced this problem, on a wiki that uses Semantic Maps
2.0. However, it doesn't happen on semantic-mediawiki.org, which is running
Semantic Maps 3.0 alpha. Thus, I assume the bug has been fixed already
(although on a version that hasn't yet been officially released).

-Yaron


On Mon, Nov 25, 2013 at 5:03 PM, Benjamin Pelletier bjpcalt...@gmail.comwrote:

 Update: I've changed the MapsLocation class in
 Maps/includes/Maps_Location.php to return '' rather than throwing an
 exception upon getLatitude, getLongitude, getAltitude, and getAddress calls
 when $isValid is false.  This has the undesired result of showing the lat,
 lng position of an unspecified location at (0,0), but I don't see any other
 ill effects.  I think this bug should be easy to reproduce locally (just
 create a form with a location input, then create a page with that form and
 leave the location blank, then edit that page with form), but here is my
 stack trace for reference:

 string(2549) #0 /var/www/
 ropewiki.com/extensions/Maps/includes/Maps_Location.php(433):
 MapsLocation-getLatitude()
 #1 /var/www/
 ropewiki.com/extensions/Maps/includes/manipulations/Maps_ParamLocation.php(77):
 MapsLocation-getJSONObject()
 #2 /var/www/
 ropewiki.com/extensions/Validator/includes/ItemParameterManipulation.php(61):
 MapsParamLocation-doManipulation(Object(MapsLocation),
 Object(ListParameter), Array)
 #3 /var/www/ropewiki.com/extensions/Validator/includes/Param.php(244):
 ItemParameterManipulation-manipulate(Object(ListParameter), Array)
 #4 /var/www/ropewiki.com/extensions/Validator/includes/Validator.php(341):
 Param-format(Array, Array, Object(ValidatorOptions))
 #5 /var/www/ropewiki.com/extensions/Validator/includes/Validator.php(281):
 Validator-doParamProcessing()
 #6 /var/www/
 ropewiki.com/extensions/SemanticMaps/includes/forminputs/SM_FormInput.php(115):
 Validator-validateParameters()
 #7 /var/www/
 ropewiki.com/extensions/SemanticMaps/includes/forminputs/SM_FormInputs.php(129):
 SMFormInput-getInputOutput('', 'Canyon[Coordina...', false, false, Array)
 #8 [internal function]: smfSelectFormInputHTML('', 'Canyon[Coordina...',
 false, false, Array)
 #9 /var/www/
 ropewiki.com/extensions/SemanticForms/includes/SF_FormPrinter.php(1760):
 call_user_func_array('smfSelectFormIn...', Array)
 #10 /var/www/
 ropewiki.com/extensions/SemanticForms/includes/SF_FormPrinter.php(1262):
 SFFormPrinter-formFieldHTML(Object(SFFormField), '')
 #11 /var/www/
 ropewiki.com/extensions/SemanticForms/includes/SF_AutoeditAPI.php(822):
 SFFormPrinter-formHTML('includeonly?...', false, true, 119,
 '{{Canyon?|Regio...', 'Church Rock Can...', NULL)
 #12 /var/www/
 ropewiki.com/extensions/SemanticForms/includes/SF_AutoeditAPI.php(116):
 SFAutoeditAPI-doAction()
 #13 /var/www/
 ropewiki.com/extensions/SemanticForms/specials/SF_FormEdit.php(96):
 SFAutoeditAPI-execute()
 #14 /var/www/
 ropewiki.com/extensions/SemanticForms/includes/SF_FormEditAction.php(196):
 SFFormEdit::printForm('Canyon', 'Church Rock Can...')
 #15 /var/www/
 ropewiki.com/extensions/SemanticForms/includes/SF_FormEditAction.php(32):
 SFFormEditAction::displayForm(Object(SFFormEditAction), Object(Article))
 #16 /var/www/ropewiki.com/includes/Wiki.php(439): SFFormEditAction-show()
 #17 /var/www/ropewiki.com/includes/Wiki.php(305):
 MediaWiki-performAction(Object(Article), Object(Title))
 #18 /var/www/ropewiki.com/includes/Wiki.php(565):
 MediaWiki-performRequest()
 #19 /var/www/ropewiki.com/includes/Wiki.php(458): MediaWiki-main()
 #20 /var/www/ropewiki.com/index.php(59): MediaWiki-run()
 #21 {main}


 On Mon, Nov 25, 2013 at 10:21 AM, Benjamin Pelletier bjpcalt...@gmail.com
  wrote:

 I have a semantic form with one input that accepts coordinates, and I use
 Semantic Maps to let the user fill that field.  I'm having a problem when
 that input is left blank though -- when I go to edit the page after not
 filling in the location, I get big red text that says Attempt to get
 the latitude of an invalid location and the rest of the form doesn't
 display.  See, for instance, here:

 http://ropewiki.com/index.php?title=Church_Rock_Canyonaction=formedit

 Is there a bug for this behavior already?

 Thanks,
 Ben




 --
 Shape the Mobile Experience: Free Subscription
 Software experts and developers: Be at the forefront of tech innovation.
 Intel(R) Software Adrenaline delivers strategic insight and game-changing
 conversations that shape the rapidly evolving mobile landscape. Sign up
 now.
 http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel




-- 
WikiWorks · MediaWiki Consulting · http://wikiworks.com
--
Shape the Mobile 

[SMW-devel] raising composer features

2013-11-25 Thread Lists
Hi, 


this morning I made some beta tests on the new composer oportunities.

MW 1.22.R0 + SMW 1.9

results:
- successfully installed MW 1.22 via composer with an composer.json (command
line failed)
- ext. SWM was not installed (command git not found)
- ext. validator was placed in the expected folder (extension top level,
type: mediawiki-extension)
- ext. data-values and param-processor where put in wiki-root/vendor
(type: library) 


I would make some assumptions, but I am new to this tech and some of my
related questions are still open.
So I only report my first expressions.

By the way... there is currently no git installed on my test-system.

I installed one of my own ext. (type mediawiki-extension) but autoload.php
seems to be placed wrong. 

I also played with composer the whole weekend and got some individual
dev.-problems: scripting with composer-events failed,
create an installer-plugin failed ;-).  


cheers.


--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] raising composer features

2013-11-25 Thread James HK
Hi,

If you follow the steps below non of your described issues are occurring:

* Install MW 1.22
* Rename composer-example.json to composer.json
* Add mediawiki/semantic-mediawiki: dev-master and
minimum-stability : dev to the composer.json placed within the MW
directory (for more details see [1])
* Run composer install or composer update from the MW directory

That's all you have to do.

[1] 
https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/docs/INSTALL.md#composer-installation

Cheers


On 11/26/13, Lists li...@psycholutions.com wrote:
 Hi,


 this morning I made some beta tests on the new composer oportunities.

 MW 1.22.R0 + SMW 1.9

 results:
 - successfully installed MW 1.22 via composer with an composer.json
 (command
 line failed)
 - ext. SWM was not installed (command git not found)
 - ext. validator was placed in the expected folder (extension top level,
 type: mediawiki-extension)
 - ext. data-values and param-processor where put in wiki-root/vendor
 (type: library)


 I would make some assumptions, but I am new to this tech and some of my
 related questions are still open.
 So I only report my first expressions.

 By the way... there is currently no git installed on my test-system.

 I installed one of my own ext. (type mediawiki-extension) but autoload.php
 seems to be placed wrong.

 I also played with composer the whole weekend and got some individual
 dev.-problems: scripting with composer-events failed,
 create an installer-plugin failed ;-).


 cheers.


 --
 Shape the Mobile Experience: Free Subscription
 Software experts and developers: Be at the forefront of tech innovation.
 Intel(R) Software Adrenaline delivers strategic insight and game-changing
 conversations that shape the rapidly evolving mobile landscape. Sign up now.

 http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] List composer packages used within MediaWiki

2013-11-25 Thread Jeroen De Dauw
Hey James,

Great work!

And you beat me to it! I started working on the exact same thing yesterday.
You can currently observe the lack of code in my GitHub repo for this [0].

Though what you are currently going is only a subset of what I had in mind.
One can retrieve package info from Packagist (and perhaps the other
repositories listed in composer.json), which URLs like [1]. This can be
used to enrich the information of installed extensions (and perhaps other
packages as well), in particular with what the latest version is.

And when we know there is an update, we can actually show an update button,
that when clicked, causes the corresponding composer command to be
executed. Furthermore, we do not need to limit this to updating. We can
display a list of available MediaWiki extensions that are not installed
yet. A list of MediaWiki extensions can be obtained from Packagist via [2].

So I'm imagining having a installed stuff page, with tow sections: first
extensions, then libraries. A second page would be for stuff that can be
installed. Perhaps this can be on the same special page but use tabs? That
question is getting a bit to UI for me.

At this point there is no way to filter by supported MW version, or to
specify this in the page definitions to begin with. I plan to investigate
this, though good if someone gets it done before me.

The two API urls from Packagist listed [1, 2] I got from the Packagist
maintainer after chatting with him. They are not documented, though are
supposed to be stable. Furthermore there is no way to get package info in
batch now, the .json urls need to be hit one by one.

Since MW 1.22 is going to ship with the barest beginnings of Composer
 support, I think we should extend Special:Version to support this.

 For now, though, we can add hooks  -- do you have any suggestions?


If you go for what I just described, which I think we should (and if people
disagree, I'll be hacking up a proof of concept regardless), then putting
this all on Special:Version really makes no sense. Special:ExtensionManager
is what I came up with.

Having an additional list there might be nice, and can be done without to
much hassle, at least technically. There are quite some core people
screaming murder at libraries like Diff showing up on Special:Credits
(though being cynical about it, I'd not be surprised if they where actually
just upset about my name being there) already, so I'm with James in
thinking that attempting real integration here is likely to result in a lot
of wasted time and effort.

Perhaps it is more worthwhile to, when a nice little initial implementation
of extension management stuff on top of Composer is done, try getting that
extension bundled with core by default. In this case I figure putting it in
core even makes sense, as it is functionality one almost always desires.
That means adding new clean code to core though, which is like locking an
insentient person in a jail with some big bloke criminals. Poor code.

James: I outlined these ideas here in part so you could go ahead and do
more awesome stuff already. I might be able to get to poking more at this
tomorrow evening, though quite possibly only on Thursday. In any case, I'd
appreciate a heads up if you want to poke at any of the additional stuff
described, so we don't end up doing the exact same work there. I'm thinking
the functionality should be in the same component/repo, as it has quite
high cohesion and makes sense together functionality wise. Even if you
already end up implementing all of the things to be done here functionality
wise before I can get to it, I'd still like to contribute by improving some
things in the code. Like fixing some of those annoying naming issues you
currently have in there, mostly without even bothering you about them :D

Also, did you steal [3] from [4 and 5], or is this an instance where we
where also thinking the same thing, but I won the implementation race? This
shows clearly that the lack of decent interfaces in the i18n component
provides by core is a general issues for anyone working on top of MW. I
think a component that does the same for i18n as what WikibaseDatabase did
for db interaction is in order. I was planning to create that as soon as I
ran into the need of [4], [5] or similar somewhere else, though again, if
someone beats me to it, great.

[0] https://github.com/JeroenDeDauw/ExtensionManager
[1] https://packagist.org/packages/mediawiki/semantic-mediawiki.json
[2] https://packagist.org/packages/list.json?type=mediawiki-extension
[3]
https://github.com/mwjames/composer-packages/blob/master/src/ComposerPackages/TextBuilder.php
[4]
https://github.com/JeroenDeDauw/WikibaseQuery/blob/master/src/Wikibase/Query/MessageBuilder.php
[5]
https://github.com/JeroenDeDauw/WikibaseQuery/blob/master/src/Wikibase/Query/MessageTextBuilder.php

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--

Re: [SMW-devel] List composer packages used within MediaWiki

2013-11-25 Thread Jeroen De Dauw
Hey,

I had another idea related to the topic of this thread, though technically
quite independent from (virtually all) the implementation needed for the
other functionality described already.

Have an API module that simply serves the composer.lock file. This can be
implemented as trivially as reading the file and serving that, or perhaps
doing a json parse in between and feeding the array to the MW API thing. In
fact, I'd not go further and add additional things on top here, so it stays
as simple as it can be for this use case. And if it is this trivial, it
might be feasible to get it into MW core.

Be warned, whoever implements this might be forever loved by Jamie
Thingelstad (Wikiapiary).

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--
--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] raising composer features

2013-11-25 Thread Jeroen De Dauw
Hey Lists,

If you are getting an error because git is not installed, we, that sucks. I
was under the impression Composer would be smart enough to get the code as
tarball in such a case. Though perhaps it normally is, and simply cannot do
this in your case, as you are likely specifying dev-master (which refers to
the master branch on git) to be installed.

Two things I suggest trying, that might get around this issue:

* add the --prefer-dist flag at the end of your Composer install command
when running it. This will get packages as tarballs when available.
* rather then using dev-master as version, use *

In any case, I highly suspect that this will not occur when specifying 1.9
once it has been released. You can try installing version 1.0 the
SubPageList extension [0] and see if you run into the same issue or not.

[0] https://github.com/wikimedia/mediawiki-extensions-SubPageList

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--
--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


[SMW-devel] New documentation on our Composer usage

2013-11-25 Thread Jeroen De Dauw
Hey,

I recently wrote two blog posts filling gaps in our documentation, after
noticing people kept asking the same questions.

The first one is aimed at developers, and explains how to make extensions
compatible with, and installable via, Composer:
http://www.bn2vs.com/blog/2013/11/24/introduction-to-composer-for-mediawiki-developers/

The second one is aimed at users, explaining how to upgrade from an
extension version where Composer is not used, to one where it is. ie from
SMW 1.8 to SMW 1.9 beta.
http://www.bn2vs.com/blog/2013/11/24/upgrading-an-extension-that-now-uses-composer/

I hope this helps developers in increasing the amount of extensions that
can be installed in a nice way, and helps users to test SMW 1.9 beta.

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--
--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] raising composer features

2013-11-25 Thread Lists
Hi Jeroen,

this works. SubPageList is no problem too.

I got Semantic MediaWiki (Version 1.9 beta-1) incl. 

DataValues
DataValues (Version 0.1.1)  Collection of objects representing various
kinds of values Jeroen De Dauw
DataValues Geo (Version 0.1)Geographical value objects, parsers and
formatters  Jeroen De Dauw and The Wikidata team
DataValues Number (Version 0.1) Numerical value objects, parsers and
formatters  The Wikidata team
DataValues Time (Version 0.1)   Time value objects, parsers and formatters
The Wikidata team
DataValues Validators (Version 0.1) Contains common ValueValidator
implementations Jeroen De Dauw and The Wikidata team
DataValuesCommon (Version 0.1.1)Contains common implementations of
the interfaces defined by DataValuesInterfaces  Jeroen De Dauw and The
Wikidata team
DataValuesInterfaces (Version 0.1.2)Defines interfaces for ValueParsers,
ValueFormatters and ValueValidators Jeroen De Dauw
Other

But some extensions are now in wikiroot/vendor others in wikiroot/extensions

What about:
include_once( __DIR__ . '/vendor/autoload.php' );

Befor I begin to make my extensions composer compatible I want to make clear
what I have to include.

In the entry point of SMW it tries to include autoload with: 

include_once( __DIR__ . '/vendor/autoload.php' );

...but in extensions/SemanticMediawiki resist no autoload.php.

...does... 

autoload: {
files: [MyExtension.php]
 
...mean I'am a substitution of autoload.php?


By the way after installing subpages in a second turn SMW was uninstalled!
;-). Might be because of my composer.json...I replaced the require
statements.

Any ideas how to implement partial updates and different repositories?


cheers.

-Ursprüngliche Nachricht-
Von: Jeroen De Dauw [mailto:jeroended...@gmail.com] 
Gesendet: Dienstag, 26. November 2013 02:09
An: Lists
Cc: Semantic MediaWiki developers
Betreff: Re: [SMW-devel] raising composer features

Hey Lists,


If you are getting an error because git is not installed, we, that sucks. I
was under the impression Composer would be smart enough to get the code as
tarball in such a case. Though perhaps it normally is, and simply cannot do
this in your case, as you are likely specifying dev-master (which refers to
the master branch on git) to be installed.


Two things I suggest trying, that might get around this issue:


* add the --prefer-dist flag at the end of your Composer install command
when running it. This will get packages as tarballs when available.

* rather then using dev-master as version, use *


In any case, I highly suspect that this will not occur when specifying 1.9
once it has been released. You can try installing version 1.0 the
SubPageList extension [0] and see if you run into the same issue or not.

[0] https://github.com/wikimedia/mediawiki-extensions-SubPageList


Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--



--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] raising composer features

2013-11-25 Thread Jeroen De Dauw
Hey Lists,

 But some extensions are now in wikiroot/vendor others in
wikiroot/extensions

The idea here is that extensions end up in wikiroot/extensions, and all
other packages end up in wikiroot/vendor. This should already be the case
when doing an SMW install. Though not all my packages have been updated to
use the mediawiki-extension type yet, so some extensions might currently be
ending up in wikiroot/vendor, which will be fixed in due time.

What about:
 include_once( __DIR__ . '/vendor/autoload.php' );

 Befor I begin to make my extensions composer compatible I want to make
 clear
 what I have to include.

 In the entry point of SMW it tries to include autoload with:

 include_once( __DIR__ . '/vendor/autoload.php' );

 ...but in extensions/SemanticMediawiki resist no autoload.php.

 ...does...

 autoload: {
 files: [MyExtension.php]

 ...mean I'am a substitution of autoload.php?


If you want to make your package installable via Composer, you just need to
correctly specify things in the autoload section, as I described in my blog
post. If you are writing a MediaWiki extension, you do not need to bother
with the composer autoloader, or even really know it exists.

The autoloader is supposed to be included by the package into which the
Composer install is done. In our case this is MediaWiki core (or the
Extension Installer). You thus can provide support for installing
dependencies into a MediaWiki extension, as SMW has been doing for a while.
This supports an entirely different workflow then the one I'm recommending
MediaWiki users to follow though. It is mainly of use to developers. For
instance, you can include the autoloader from your test bootstarp, so one
can clone a project and just run phpunit, without having to set things up
manually. Example:
https://github.com/DataValues/Geo/blob/master/tests/bootstrap.php

By the way after installing subpages in a second turn SMW was uninstalled!
 ;-). Might be because of my composer.json...I replaced the require
 statements.


Well doh! If you remove the package from your package list, Composer will
be helpful and clean it up for you next time you run its updater!

Any ideas how to implement partial updates and different repositories?


I'm not sure what you mean by this. Can you detail what this functionality
would entail and why it is useful?

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--
--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] raising composer features

2013-11-25 Thread Lists
Hi Jeroen,


ok, as far as I understand

include_once( __DIR__ . '/vendor/autoload.php' );

...is meant to be...

require_once( __DIR__ . '/../vendor/autoload.php' );

...and autoload.php will resist in wikiroot/vendor together with additional
packages which are not mediawiki-extensions.

We do not need multiple autoloader.php.

Then I can follow your blog instructions.

I'm not sure what you mean by this.

Well for example if I want to install an extension locally from disk
(zip-archive) into directory extensions I have to change 

the global composer.json under wikiroot (packagist: false etc.). Or is
there another workflow? Or is there a way to target different

sections of the entry repositories: in the global composer.json under
wikiroot?


cheers.


-Ursprüngliche Nachricht-
Von: Jeroen De Dauw [mailto:jeroended...@gmail.com] 
Gesendet: Dienstag, 26. November 2013 03:48
An: Lists
Cc: Semantic MediaWiki developers
Betreff: Re: [SMW-devel] raising composer features

Hey Lists,


 But some extensions are now in wikiroot/vendor others in 
 wikiroot/extensions


The idea here is that extensions end up in wikiroot/extensions, and all
other packages end up in wikiroot/vendor. This should already be the case
when doing an SMW install. Though not all my packages have been updated to
use the mediawiki-extension type yet, so some extensions might currently be
ending up in wikiroot/vendor, which will be fixed in due time.



What about:
include_once( __DIR__ . '/vendor/autoload.php' );

Befor I begin to make my extensions composer compatible I want to
make clear
what I have to include.

In the entry point of SMW it tries to include autoload with:

include_once( __DIR__ . '/vendor/autoload.php' );

...but in extensions/SemanticMediawiki resist no autoload.php.

...does...

autoload: {
files: [MyExtension.php]

...mean I'am a substitution of autoload.php?



If you want to make your package installable via Composer, you just need to
correctly specify things in the autoload section, as I described in my blog
post. If you are writing a MediaWiki extension, you do not need to bother
with the composer autoloader, or even really know it exists.


The autoloader is supposed to be included by the package into which the
Composer install is done. In our case this is MediaWiki core (or the
Extension Installer). You thus can provide support for installing
dependencies into a MediaWiki extension, as SMW has been doing for a while.
This supports an entirely different workflow then the one I'm recommending
MediaWiki users to follow though. It is mainly of use to developers. For
instance, you can include the autoloader from your test bootstarp, so one
can clone a project and just run phpunit, without having to set things up
manually. Example:
https://github.com/DataValues/Geo/blob/master/tests/bootstrap.php



By the way after installing subpages in a second turn SMW was
uninstalled!
;-). Might be because of my composer.json...I replaced the require
statements.



Well doh! If you remove the package from your package list, Composer will be
helpful and clean it up for you next time you run its updater!



Any ideas how to implement partial updates and different
repositories?



I'm not sure what you mean by this. Can you detail what this functionality
would entail and why it is useful?


Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--



--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Displaying unit-correct numbers

2013-11-25 Thread Benjamin Pelletier
That doesn't seem to work for me.  This is what I have in my template:
{{#show:{{PAGENAME}}|?Has length of hike}}
...and this is the HTML that shows up:
1.2nbsp;miles1.931nbsp;km
As you can see, there are no divs or other elements that have IDs of
smwttcontent, so adding the above to MediaWiki/Common.css has no effect.
 Here is an example of a page with that template; there are four numbers
that have units in it:
http://ropewiki.com/index.php/Napoleon_Falls

How can I get my quantities to display their units correctly?


On Sat, Nov 23, 2013 at 9:16 AM, Leonard Wallentin
leo.wallen...@gmail.comwrote:

 If the printout is actually 100 ft30.48 m it probably means that you
 have javascript turned off, or that something is wrong with the scripts
 served. I use this  css hack to serve something slightly more readable to
 non js users:


 .client-nojs .smwttcontent {

1. font-size: .7em;

 }

 .client-nojs .smwttcontent:before {

1. content:  (;

 }
 .client-nojs .smwttcontent:after {

1. content: );

 }

 (see http://xn--ssongsmat-v2a.nu/ssm/Recept:Aloo_Palak)

 /Leo


 ___
 Leonard Wallentin
 http://leowallentin.se


 2013/11/23 Benjamin Pelletier bjpcalt...@gmail.com

 I have a Semantic template that has a few quantity inputs I'd like to
 display on the page.  I could do this:

 [[Has longest rappel::{{{Longest rappel|}}}]]

 But that works poorly because the user can enter 100, 100 ft, 100 feet,
 30.48 meters, etc and all those inputs are identical in the database, but
 get displayed differently.  It seems I can get around this by doing

 {{#set:Has longest rappel={{{Longest
 rappel|}{{#show:{{PAGENAME}}|?Has longest rappel#-}}

 But man, that seems ugly, long, and inefficient.  Is there a better way?

 Also, separately, the Display units for Has longest rappel consist of two
 units (ft and m), and the output of

 {{#show:{{PAGENAME}}|?Has longest rappel}}

 is actually

 100 ft30.48 m

 Why is it displayed that way (pretty much useless) instead of

 100 ft (30.48 m)

 ...like it is on, say, the Browse properties page?


 --
 Shape the Mobile Experience: Free Subscription
 Software experts and developers: Be at the forefront of tech innovation.
 Intel(R) Software Adrenaline delivers strategic insight and game-changing
 conversations that shape the rapidly evolving mobile landscape. Sign up
 now.

 http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel



--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel