[SMW-devel] Parse template

2013-12-27 Thread Alexey Klimovich
Hi, everyone!
I wonder if there is a way to parse template into object with mediawiki 
functions/classes? The goal is to extract parameters and values from 
string like:

{{MyTemplate|param1=10|Param2=20}}

I can not find related class or function.


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


[SMW-devel] A bit more MVC into MediaWiki!

2013-08-25 Thread Alexey Klimovich
Hi, everyone!

I would like to share another helper instrument for extension 
developers. It is class, called "Model"[1].

Abstractions help us keep code clean and readable, focus on logic. One 
way or another, when developing big mediawiki extension, which should 
have a lot of functions and work with database, we should create models 
for not to be messed in SQL at the end of development.

I have created small abstract class Model, which can help to solve this 
task easily. Possibly it have some minuses, but feel free to make it 
better, if you involved.

To describe short how Model works, look at this example:
fetch user by id, change password and save user back.

*With Mediawiki:
---

  //Select
  $dbr = wfGetDB( DB_MASTER );
   $result = $dbr->select(
  'users',
   '*',
   array( 'user_id' => 10 ),
   __METHOD__
   );
   $user = $result->fetchObject();
  }

  $newPassword = '1234';

  //Update
  $dbr->update(
   'users',
   array( 'password' => $newPassword ),
   array( 'user_id' => 10 ),
   __METHOD__
  );



*With Model over Mediawiki:
--

  $users = Model_User::find( 10 );
  $users[0]->password = '1234';
  $users[0]->save();

Today, Model know how to load models from DB (inc. conditions), validate 
them from external data, store models back and delete entities from DB. 
Have load-on-access.

You can find more examples and documentation by following this links:

[1] https://github.com/vedmaka/Mediawiki-Model


--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


[SMW-devel] Useful tiny thing extension developers - Views

2013-08-25 Thread Alexey Klimovich
Hi, everyone.
I want to share my tiny class "Views"[1] which helps me in development 
process. Many extensions created have UI-part: kind of panels, widgets, 
etc added to page output. Usually, html code just stored in some 
variable and pushed to $wgOut:

$myWidget = 'Today weather:' .$someData. '';
$wgOut->addHtml($myWidget);

But, it is more convenient, if template for this html code will be in 
separate folder, not mixed with php code.

This is what "Views" for. With it this code looks like:

$myWidget = Views::forge('widget', array('some' => $someData) );
$wgOut->addHtml( $myWidget );

Extension have "views" folder in root
(e.g. /extensions/MyWidget/views ), which contains widget.php file with 
contents:

Today weather:  

So, after "Views"[1] call, $myWidget variable will hold the result.

You can download this helper as extension for Mediawiki and use it, 
after include in LocalSetting.php

[1] https://github.com/vedmaka/Mediawiki-Views


--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Using SMW queries to find information about the wiki

2013-06-27 Thread Alexey Klimovich
Looks like you can query special property "Modification date" [1] with 
|sort parameters to obtain pages for "Last X Edits".

[1] 
http://semantic-mediawiki.org/wiki/Help:Special_property_Modification_date

27.06.2013 23:33, Mark A. Hershberger пишет:
> I'm helping Mozilla with their wiki and they have the following request:
>
> https://bugzilla.mozilla.org/show_bug.cgi?id=887939
> Create widgets: "X Most Popular in Last Y Days" and "Last X Edits"
>
> Since they're using SMW, I thought there might be a way to query for the
> recent edits or page counters.  No one in #semantic-mediawiki seemed to
> know of a way to do this, though.  I poked through the SMW extensions,
> but nothing jumped out at me.
>
> So, my next thought is to make the page counter and recent edit list
> available for SMW queries.  Any pointers on how to do that?
>
> That said, maybe I'm just completely missing some obvious functionality
> of SMW because of my own ignorance.  In that case, I seek enlightenment.
>
> Thanks for any help!
>
> Mark.
>



--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] [SRF] Filtered result format effected by PHP upgrade

2013-06-27 Thread Alexey Klimovich
Hi!
Do you see any errors or warnings? If no, try to set php settings for 
error_reporting option to E_ALL in php.ini and check again. Also, can 
you post link to page with filtered?

Also try to run
/maintenance/update.php
and
/extensions/SemanticMediawiki/SMW_refreshData.php

27.06.2013 17:31, Desiree Gennaro пишет:
> We just upgraded from PHP 5.4.13 to 5.4.16 due to a patch requirement.
> Doing this has caused the filtered format to only show 1 or 2 (it
> changes) of the 157 results. I have already tried upgrading SMW to
> 1.8.0.5 and SRF 1.9 alpha. Please help.
>
>
> --
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
>
>
>
> ___
> Semediawiki-devel mailing list
> Semediawiki-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
>



--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Making subobjects correctly ordered

2013-06-20 Thread Alexey Klimovich
We are using anonymous (name=hash) subobjects in our system. In semantic
queries and from code, we linking them using their hash. Subobjects not
changing from every page save or edit. Only one way we discovered they
change their hash - when page has renamed/moved. So, subobjects have a good
consistency for now.



--
View this message in context: 
http://wikimedia.7.x6.nabble.com/Making-subobjects-correctly-ordered-tp5007553p5007566.html
Sent from the Semantic Mediawiki - Development mailing list archive at 
Nabble.com.

--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Making subobjects correctly ordered

2013-06-20 Thread Alexey Klimovich
Hi, Yaron!

I think subobjects sorting is good task, but i suggest not to use subobjects
name for this because of big problem with that:

imagine we have 3 subobjects on page:

Page name#001_4bd1f1b74a76de5322dd74956a71f089
Page name#002_03163dfd1d2502668b00c1f521688984
Page name#003_02dwa3j349j8d3jds3843234jd8349490

now, we edit page, delete subobject 002. What should happen? 
Should other subobjects be renamed to keep sorting? What if they already
linked from other pages/queries?

I think better way is to automaticaly attach some semantic property ("Sort"
for example) 
to every subobject on page. This property should contain subobjects number
on page.



--
View this message in context: 
http://wikimedia.7.x6.nabble.com/Making-subobjects-correctly-ordered-tp5007553p5007558.html
Sent from the Semantic Mediawiki - Development mailing list archive at 
Nabble.com.

--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] SMW 1.9, Subobject - get properties

2013-06-03 Thread Alexey Klimovich
Thanks, James! I have successfully fetched sub-objects properties thanks 
to your advice!

03.06.2013 19:58, James HK пишет:
> Hi,
>
>>> new Subobject( $title )
>
> This won't work because you a just created a new instance which at
> this point has nothing to to with the store.
>
>>> $subObject->getSemanticData()->getProperties();
>
> This won't work because the instance you just created as now
> properties added therefore it won't return any properties.
>
> Stored data are generally accessed through the Store/StoreEngine. In
> order to get access to those data you can use either the
> SMW\ParserData object (see at [1], the test will show how to access
> data from a $title/$parserOutput object) or you dig deeper into [2]
> which shows how to access the data directly from the store.
>
> [1] 
> https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/SemanticMediaWiki.git;a=blob;f=tests/phpunit/includes/parserhooks/SubobjectParserFunctionTest.php;HEAD#l278
>
> [2] 
> https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/SemanticMediaWiki.git;a=blob;f=includes/specials/SMW_SpecialBrowse.php;hb=HEAD#l106
>
> PS: Tests deployed with SMW 1.9 will generally show how to access or
> interact with those objects therefore a general advise is to use those
> sources to verify their use cases.
>
> Cheers
>
> On 6/4/13, Alexey Klimovich  wrote:
>> Hi, everyone!
>> I have a little question about Sub-objects in SMW 1.9.
>>
>> I am trying to fetch sub-object properties list, like a page properties
>> list, but unsuccessful.
>>
>> I have a sub-objects $title variable (received from semantic query),
>> which holds Title with mFragment holding sub-object name. This is what i
>> am trying to do:
>>
>> $subObject = new Subobject( $title );
>>
>> //also tried: new Subobject( $title, $title->getFragment() );
>>
>> $propList = $subObject->getSemanticData()->getProperties();
>>
>> Looks like this is wrong way to create subobject instance and read its
>> properties? Can anyone point me to right way?
>>
>>
>> --
>> Get 100% visibility into Java/.NET code with AppDynamics Lite
>> It's a free troubleshooting tool designed for production
>> Get down to code-level detail for bottlenecks, with <2% overhead.
>> Download for free and get started troubleshooting in minutes.
>> http://p.sf.net/sfu/appdyn_d2d_ap2
>> ___
>> Semediawiki-devel mailing list
>> Semediawiki-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
>>
>
> --
> Get 100% visibility into Java/.NET code with AppDynamics Lite
> It's a free troubleshooting tool designed for production
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://p.sf.net/sfu/appdyn_d2d_ap2
>



--
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


[SMW-devel] SMW 1.9, Subobject - get properties

2013-06-03 Thread Alexey Klimovich
Hi, everyone!
I have a little question about Sub-objects in SMW 1.9.

I am trying to fetch sub-object properties list, like a page properties 
list, but unsuccessful.

I have a sub-objects $title variable (received from semantic query), 
which holds Title with mFragment holding sub-object name. This is what i 
am trying to do:

$subObject = new Subobject( $title );

//also tried: new Subobject( $title, $title->getFragment() );

$propList = $subObject->getSemanticData()->getProperties();

Looks like this is wrong way to create subobject instance and read its 
properties? Can anyone point me to right way?


--
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Webinar for amateur SMW programmers

2013-05-10 Thread Alexey Klimovich
I am also think such webinars can be very useful for understanding SMW 
architecture and make things a bit clearer for side developers.

I will be happy to assist Yury in writing down the meeting and creating 
guides/howtos after.

09.05.2013 21:08, Yury Katkov пишет:

> (I've changed the subject name. See previous e-mails if you need a context.)
>
> *PROBLEM*: Nobody understand how SMW works and how to inprove it, except
> 2-4 core developers. The documentation of the code is not sufficient for a
> new deloper to quickly start participating in SMW development.
> *GOAL*: Eliminate the barriers that hinder new developers from
> participation. Create the documentation for the programmers but waste
> minimum of core developers' time.
> *IDEA*:  Organize a hangout/webinar where the gurus describe the basic
> concepts in the code, relations between the main classes in SMW and ways to
> implement the common use cases of improving SMW.
>
> *PLANNED RESULTS: *
> 1) videorecord of the webinar
> 2) Architechture Guide improved by webinar participants
> 3) Some howtos on how to solve real problems in SMW.
>
> I think we can create a wikipage of the topics that can be discussed on
> such webinar. This can also be used in SMW tutorials on the next SMWCon.
>
> -
> Yury Katkov, WikiVote
>
>
>
> On Thu, May 9, 2013 at 8:31 PM, Jeroen De Dauw wrote:
>
>> Hey,
>>
>> Maybe smth like webinars or google hangouts with core developers could be
>>> an option? I understand that it's easier to describe the architecture
>>> verbally than to write a guide. I'm volunteering to do the technical
>>> writing job, I think I know at least two more developers who also can help
>>> with writing down.
>>>
>>
>> I'd be happy to join such a hangout.
>>
>>
>> Cheers
>>
>> --
>> Jeroen De Dauw
>> http://www.bn2vs.com
>> Don't panic. Don't be evil.
>> --
>>
>
> --047d7b3a9580bcff8504dc4c1ae9
> Content-Type: text/html; charset=ISO-8859-1
> Content-Transfer-Encoding: quoted-printable
>
> (I've changed the subject name. See previous e-mails if you nee=
> d a context.)PROBLEM: Nobody understand=
>   how SMW works and how to inprove it, except 2-4 core developers. The do=
> cumentation of the code is not sufficient for a new deloper to quickly s=
> tart participating in SMW development.=A0
>
>
> GOAL: Eliminate the=A0barriers that hinder new developers fr=
> om participation. Create the documentation for the programmers but waste=
>   minimum of core developers' time.=A0IDEA: =A0Orga=
> nize a hangout/webinar where the gurus describe the basic concepts in th=
> e code, relations between the main classes in SMW and ways to implement =
> the common use cases of improving SMW.=A0
>
> PLANNED RESULTS:=A01) videorecord =
> of the webinar2) Architechture Guide improved by webinar part=
> icipants3) Some howtos on how to solve real problems in SMW.<=
> /div>
> I think we can create a wikipage of the topics =
> that can be discussed on such webinar. This can also be used in SMW tuto=
> rials on the next SMWCon.-> Yury Katkov, WikiVote
>
> 
> On Thu, May 9, 2013 at 8:31 PM, Jer=
> oen De Dauw  qqe8avxtiumw...@public.gmane.org" target=3D"=5Fblank">jeroendedauw-Re5JQ=
> eeqqe8avxtiumw...@public.gmane.org> wrote: class=3D"gmail=5Fquote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc =
> solid;padding-left:1ex">
>
>
> Hey, er-left:1px solid rgb(204,204,204);padding-left:1ex" class=3D"gmail=5Fqu=
> ote">Maybe smth like webinars or google hangouts with core developers co=
> uld
> be an option? I understand that it's easier to describe the architec=
> ture
>   verbally than to write a guide. I'm volunteering to do the technica=
> l
> writing job, I think I know at least two more developers who also can
> help with writing down.I'd be happy to jo=
> in such a hangout.Cheers--Jeroen De Dauw href=3D"http://www.bn2vs.com"; target=3D"=5Fblank">http://www.bn2vs.com a>
> Don't panic. Don't be evil.
>
> --
> 
>
> --047d7b3a9580bcff8504dc4c1ae9--
>
>
> --===6392967318840319407==
> Content-Type: text/plain; charset="us-ascii"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline
>
> --
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and
> their applications. This 200-page book is written by three acclaimed
> leaders in the field. The early access version is available now.
> Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
> --===6392967318840319407==
> Content-Type: text/plain; charset="us-ascii"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline
>
> ___
> Semediawiki-devel mailing list
> Semediawiki-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
>
> --===6392967318840319407==--
>


--

Re: [SMW-devel] [SF] Turning "uploadable" into "input type=upload"

2013-05-09 Thread Alexey Klimovich
Hi, Yaron!

I think standalone "upload" input type is a good idea.
In my vision, upload input should carry only "file upload" case and not 
"existing file choose" case, like it can be done threw textarea/text + 
autocomplete on Files namespace.

Simple and lightweight for users upload input like on this picture will 
be really usable thing:

http://i.imm.io/15lne.png

Such input should hide wiki-upload process from users, just allowing 
them to select file, they want to use.



--
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


[SMW-devel] SMW 1.18 and Maps update errors

2012-12-10 Thread Alexey Klimovich
Hi, everyone!
I am suffering from such problem: when i am run update to SMW 1.8 Store3 
with Maps and SMaps 2.0 extensions enabled:

  php SMW_refreshData.php -v -b SMWSQLStore3 -fp

i've got error like:

(234) Processing ID 240 ...
(235) Processing ID 241 ...
(236) Processing ID 242 ...

Invalid marker:UNIQ7002d0767318a02c-item-63--QIN
Backtrace:
#0 /home/www/xxx.xxx.ru/www/includes/parser/StripState.php(66): 
StripState->addItem('general', UNIQ7002d07673...', 'insertStripItem('http://p.sf.net/sfu/logmein_12329d2d
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel