Changes

Jump to navigation Jump to search
no edit summary
[[Category: McNair Admin]]
 
Alex's notes from creating a test web server that will eventually host important stuff (aka a test run on a cheap Dell Inspiron).
Add these lines to LocalSettings.php:
require_once("$IP/extensions/GoogleAnalytics/googleAnalytics.php");
// Replace xxxxxxx-x with YOUR GoogleAnalytics UA number
$wgGoogleAnalyticsAccount = 'UA-xxxxxxx-x';
== Installing Semantic Mediawiki (3/25/2016) ==
There's an [https://www.mediawiki.org/wiki/Extension:Semantic_Forms/Quick_start_guide#Example example data structure] on the Semantic Forms page. I followed most of the steps, except for '''Enabling links to forms'''. I couldn't get #formredlink to work properly (the template wasn't parsing the silent property declaration with #set properly), so I instead added a line to the "Was written by" property page:
<nowiki>[[Creates pages with form::Author]]</nowiki>
And this way, once a new Book page is created, the redlink for the book's author (when clicked) automatically generates an Author page.
I also added #default_form lines at the end of the Book and Author template pages, e.g. for the Author template page, the last few lines looked like:
<nowiki>
...
[[Category:Authors]]
{{#default_form:Author}}
</includeonly>
</nowiki>
and I did something similar for the Book template page. This way, every Book and Author page will have a "Edit with form" tab in addition to the "Edit" tab (and the "edit with form" tab is significantly more useful).
$ cd /var/lib/mediawiki/extensions/Cargo/maintenance
$ php cargoRecreateData.php
 
You'll have to edit the template pages to add queries, but at that point, you may just want to write the templates yourself.
 
As with Semantic Mediawiki + Semantic Forms, you can add the #default_form parser function to the template page to display an "edit with form" tab alongside the "edit" tab (you'll likely have to refresh the page to see the changes).
 
== Cargo Data structuring (3/30/2016) ==
 
Sahil and I came up with a SQL database schema for the organizations and events in the startup ecosystem. Organization subtypes are: startups, VC funds, accelerators, incubators, service providers. Event subtypes are: financing, training, liquidity. Each subtype has fields specific to it, but all organizations need to have a name, logo, URL, address, founding date, and status, and all events need to have a date and need to include which organizations are involved.
 
We tried doing foreign keys, but you can't do that with Cargo, so maybe we should look into other options. One easy way out would be to just duplicate the columns that are common to all organizations in each organization subtype's table. but this seems like bad practice. I found [https://www.mediawiki.org/wiki/Extension:Cargo/Storing_data#Attaching_to_a_table #cargo_attach] which may help us in this sort of situation.
 
There is an issue with using <code>#cargo_query</code> in the test wiki. When a new page is created that is related to a page that is already in existence, the page that is already in existence should update automatically to display that it is related to the new page. Instead, the old page won't display its relation to the new page until someone goes into the old page, hits the edit button, and saves an edit to the page. Even if there is no change in the page text from the previous version, the old page will now display it's relation to the new page. For example on the page [http://128.42.44.22/wiki/Bolt Bolt], you can see it is directed by Byron Howard, and on the page [http://128.42.44.22/wiki/Byron_Howard Byron Howard], you can see that Bolt is one of his films. This is working as intended; however, on the page [http://128.42.44.22/wiki/Tangled Tangled] it shows that Tangled is also directed by Byron Howard. On Byron Howard's page, it did not show that Tangled was one of his films until I edited the page. It then updated to show Tangled as one of his films.
 
It seems like the above problem is called because when <code>#cargo_query</code> is used on a page, the query is not called each time the page is refreshed, but rather only when an edit is saved to the page and then saved from then on. This could cause display issues with pages for accelerator's in the future not displaying new companies added.
 
== Back to Semantic Mediawiki (4/8/2016) ==
 
Semantic Mediawiki might be better for the inheritance (i.e. foreign keys in SQL). In SMW, we can define the properties and templates for a superclass and subclass. If we make a form that includes both templates, the form creates pages that has the templates for the superclass and subclass included, and the properties are all there. This might be the solution we're looking for, but it seems to be more difficult to query, since there is no explicit distinction between the attributes common to all subclasses and the attributes specific to a single subclass.
 
Ed likes it so far. We should just move forward with the actual data structure on SMW until major roadblocks prevent further progress.
 
Some notes on why SMW seems to be more flexible than Cargo: the properties in SMW are responsible for storing data, whereas the templates in Cargo are responsible for storing data (using #cargo_store calls). This means that a Semantic Form using SMW properties that includes multiple templates is okay, whereas an Semantic Form using Cargo tables needs to ensure that the templates are each affecting different tables, which isn't the case for inheritance.
== To-do list ==
 
* Google Analytics on the test blog. we need FTP access (port 21) to be able to install new plugins, apparently...
 
[[admin_classification::IT Build| ]]

Navigation menu