PUMA/BibSonomy Module

Activities ::: mod_pbm
Maintained by Florian Fassing, Mario Holtmüller
PBM is the PUMA/BibSonomy plugin for Moodle. It helps you to publish publication lists from the Publication Management System http://www.academic-puma.de or http://www.bibsonomy.org .
Latest release:
1 sites
3 downloads
4 fans
Current versions available: 3

PUMA/BibSonomy Module


PBM is the PUMA/BibSonomy plugin for Moodle. It helps you to publish publication lists from the Publication Management System http://www.academic-puma.de or http://www.bibsonomy.org within a Moodle course.

More information about PUMA and BibSonomy can be found at http://www.academic-puma.de and at http://bitbucket.bibsonomy.org

Please note that you need a PUMA account from the PUMA server of your institution in order to fetch publication lists from it. Alternatively you can create a BibSonomy account for free in order to test PBM with BibSonomy.

1. What does it do?
2. For Admins
3. For Users

1. What does it do?


The PBM plugin helps you to publish lists of publications within a moodle course. Such lists are fetched from the Publication Management Software PUMA or the social bookmark and publication sharing system http://www.bibsonomy.org. The lists are configured through specifying a user name, a user group, and/or a set of tags.

The style in which the bibliography is displayed on the moodle course page can be chosen from various CSL files http://citationstyles.org/.



2. For Admins


2.1 Installation

The following steps are necessary to add the PBM Plugin to a running Moodle installation.
 
  •   Download the plugin from the BitBucket repository: https://bitbucket.org/bibsonomy/pbm or directly from Moodles plugin repository: https://moodle.org/plugins/view.php?plugin=mod_pbm
  •   Unzip the file within your mod folder of the moodle installation. (e.g. /var/www/moodle/mod/pbm)
  •   Go to the Moodle website, log in as an administrator and navigate to "Site administration -> Plugins -> Plugins overview".
  •   Click the button "Check for available updates" at the top of the plugins overview page.
  •   Moodle should now inform you that database updates have to be made. Confirm that.
  •   You will be asked for a default server adress, OAuth consumer credentials and a choice of citation styles. See 2.2 for Details.
 
2.2 Configuration


 
 Default PBM Server: Insert the address of your institutional PUMA server or the URL of BibSonomy (e.g. http://puma.uni-kassel.de or http://www.bibsonomy.org). This will be used as the default when adding a PBM instance to a course.

 Comsumer-Key/Consumer-Secret(Optional): An admin of a PUMA system can create OAuth consumer credentials in the local admin settings. They will be used to link user accounts to PUMA in order to use OAuth authentication. Alternatively you can write an E-Mail to webmaster@bibsonomy.org when using BibSonomy to demand OAuth consumer credentials. This is optional as it's also possible to use BasicAuth.

 Available CSL files: Here you can choose between several citation styles which will be available when adding/editing PBM instances within courses. You can find more information about citation styles here: http://citationstyles.org/
 

 3. For Users


3.1 Create a publication list in a Moodle course
The following steps explain how the plugin can be used by a teacher/trainer to generate literature lists on a Moodle course page.
Note: The teacher/trainer who creates a new PBM instance needs valid authentication credentials deposited in his/her user profile settings.
A user profile can be edited by clicking the user name in the upper right corner (default layout) and choosing "Profile". The PBM specific fields can be found under the PUMA/BibSonomy category. See 3.3 for details.

  •  Turn on the editing mode and click the "Add an activity or resource" link.
  •  A list with activity modules will pop up. Mark PBM and click add.
  •  Now you can add information in order to specify the list of publications.
 

 
 Select Content Source: You can create lists using different criteria: Select posts of a specific user, a group, or posts that are viewable for a particular user/group.

 Id of user, group or viewable source: The identifier for a source: e.g. a user name or group id.

 Tags: A white space separated list of tags.

 Downloadable Documents?: When checked, it is possible to download attached documents.

 Select Authentication Method: Determines which authentication method should be used when the publications being fetched from the PUMA/BibSonomy server. See 3.3 for details.

 URL of PUMA or BibSonomy server: Either the PUMA server of your institution or http://www.bibsonomy.org

 Citation style language: Some citation styles may differ between certain languages.

 Citation style: The citation style determines how a single publication will be formatted. PBM comes with a couple of csl files. Get more at http://citationstyles.org/.
 
3.2 Add to my PUMA Button
 
 When a user has provided authentication credentials (See 3.3 for details) he/she can add publications from a list to his personal list on PUMA/BibSonomy.
 This is achieved through the button at the lower right of each publication. When a publication already is in the personal list a green tick will be displayed.
 
3.3 Configuration
 


 API-User: The user id of an PUMA/BibSonomy-Account.

 API-Key: The associated key can be found at "Settings -> Settings-Tab" under the API area when logged in at a PUMA/BibSonomy system.

 OAuth Link: When this field is checked and changes of the profile are saved the user will be redirected to the default PBM server to allow this user using OAuth.

 Note that the user has to be logged in at the PUMA/BibSonomy system before linking his/her account. Otherwise the redirection will not work properly and he/she needs to do the linkage again.
 

4. Changelog

 
 Version: 2015102000
 
  - Added possibility to use OAuth. (For users when using the new add button, for teachers/trainers when publication lists are being fetched from the a list)
  - Prefered authentication method can now be selected in every single PBM instance.
  - A new button makes it easy to add publications directly from Moodle to the personal list on PUMA/BibSonomy.
  - Admins can now limit/extend the available citation styles for users creating a PBM instance.
  - As some citation styles differ between languages it's now possible to specify the language.
  - Revised readme file.

Screenshots

Screenshot #0

Contributors

Florian Fassing (Lead maintainer)
Mario Holtmüller
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Anthony Borrow
    Wed, 8 Oct 2014, 11:47 AM
    Florian - For which versions of Moodle is this plugin intended. The zip file you provided shows that it is only intended for Moodle 1.9 (which has been unsupported for some time); however, the code look to be 2.x. Let me know which versions of Moodle you have tested this plugin. For now, I am going to mark this plugin as needing more work until we get these issues resolved. Thanks for your patience with the review and approval process. Peace -Anthony
  • Anthony Borrow
    Wed, 8 Oct 2014, 11:54 AM
    I am going to copy over David's comments from the initial entry as many still apply (I removed some of the content about renaming that this new entry resolves):

    David Mudrák
    Tue, Aug 26, 2014, 7:18 AM

    Thanks for sharing this plugin with the community. Currently, the uploaded version has supported Moodle set to 1.9 only. It seems that code is supposed to support higher versions, too (I was able to install it in 2.7). On contrary, the $plugin syntax used in the version.php will not probably work in lower versions including 1.9 where $module is expected (not tested).

    I noticed that your plugin is storing its settings in the mdl_config table rather that the mdl_config_plugins. In order to avoid $CFG bloat and potentional collisions, it is recommended to use get_config to pull the data out of mdl_config_plugins.

    Please try to avoid using PHP closing tags at the end of files. They are not needed and they may cause troubles in certain situations.

    The fact that the module does not display anything at the view.php may confuse users a lot. Also, some standard Moodle features (such as access to the activity logs or local role overrides) actually rely on an existence of the page inside the module instance context.

    I noticed that you create classes in the global PHP scope without the valid frankenstyle prefix or namespace declared. This is strongly discouraged in order to prevent collisions with (current and/or future) core code or some other plugin. See http://docs.moodle.org/dev/Coding_style#Functions_and_Methods for details.

    I noticed that the recommended boilerplate was not used in the version.php file. The boilerplate is recommended at the beginning of each file and makes
    explicit the GPL license. You may want to review http://docs.moodle.org/dev/Coding_style#Files to learn more about the boilerplate comments.

    Directories like .hg should not be part of the Moodle plugin ZIP packages.

    ---

    Kindly let us know what has been resolved. It looks like you have removed the .hg directories, PHP closing tags, added the boilerplate to version.php. What other work have you done?
  • Florian Fassing
    Thu, 9 Oct 2014, 8:10 PM
    Hey, thanks for checking.

    My intention was to support as many versions as possible.
    I tested it under 2.4 and 2.7 and it would run fine under both.

    As $plugin is supported since 2.6 and $module is deprecated since 2.7, is it impossible to support 2.4 and 2.7 (or simple > 2.0) ??
    I mean in reality peopel don't keep their moodle up-to-date, do they?

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    "I noticed that you create classes in the global PHP scope without the valid frankenstyle prefix or namespace declared. This is strongly discouraged in order to prevent collisions with (current and/or future) core code or some other plugin. See http://docs.moodle.org/dev/Coding_style#Functions_and_Methods for details."

    I think that should be fixed too. At least for the plugin classes, of course not for third-party-libs.

    "The fact that the module does not display anything at the view.php may confuse users a lot. Also, some standard Moodle features (such as access to the activity logs or local role overrides) actually rely on an existence of the page inside the module instance context."

    Fixed in new version.

    "I noticed that your plugin is storing its settings in the mdl_config table rather that the mdl_config_plugins. In order to avoid $CFG bloat and potentional collisions, it is recommended to use get_config to pull the data out of mdl_config_plugins."

    Should be fixed.

    Greetings
  • David Mudrák
    Fri, 10 Oct 2014, 6:01 PM
    Hi Florian. Thanks for recent updates. Indeed it is possible to support as many Moodle versions as you wish. If there are changes
    in Moodle API between versions (and it happens, naturally), maintainers typically address it by releasing multiple versions of
    their plugin, each supporting certain Moodle versions. So you can have, for example, one version for Moodle 2.0 to 2.5 and another
    one for 2.6 and 2.7. It is possible to even have one version of a plugin that works on Moodle 2.x versions, but your the code has
    to include `if ($CFG->version > xxx)` statements so it implements what the given Moodle version expects. In any case, you have to
    explicitly mark all supported versions in your plugin version form. Currently, you have just 2.0 selected so this module would
    appear as not supporting any higher version. With certain consequences (such as sites not informed about new versions available
    etc).

    I'm getting coding exception after the instance is added to the course in Moodle 2.7 (Argument 1 passed to pbm_cm_info_view() must
    be an instance of cm_info, instance of stdClass given).

    I can see some CSS selectors not being specific enough to your module's scope. Selectors like `.preview_pic` may likely affect
    other HTML elements generated by other plugin, should they use the same class. Please use specific selectors.

    I believe the $string['pluginname'] can safely read just 'PUMA/BibSonomy'. The word "module" there is very redundant in the UI.
    Also note, *_utf8 packages are not supported in Moodle 2.x. Also, the German language pack should better be uploaded to AMOS once
    this module is approved and removed from the plugin's code.

    Please note, if you put your classes into the 'classes' directory instead of the 'class' one, the autoloading would work for you
    in recent Moodle versions (see https://docs.moodle.org/dev/Automatic_class_loading).

    I'll be happy to approve this plugin once we get the situation about the supported Moodle versions sorted out and the coding
    exception issue is fixed. Thanks for your work on this.
  • David Mudrák
    Fri, 10 Oct 2014, 6:02 PM
    Oh, I forgot. Please check https://moodle.org/plugins/pluginversions.php?plugin=mod_pbm&validation=1 and fix the raised validation issues. TIA.
  • Florian Fassing
    Mon, 13 Oct 2014, 9:33 PM
    Thanks for the reapproval!
    Here are some news:

    "David Mudrák
    Fr, 10. Okt 2014, 18:01
    Hi Florian. Thanks for recent updates. Indeed it is possible to support as many Moodle versions as you wish. If there are changes
    in Moodle API between versions (and it happens, naturally), maintainers typically address it by releasing multiple versions of
    their plugin, each supporting certain Moodle versions. So you can have, for example, one version for Moodle 2.0 to 2.5 and another
    one for 2.6 and 2.7. It is possible to even have one version of a plugin that works on Moodle 2.x versions, but your the code has
    to include `if ($CFG->version > xxx)` statements so it implements what the given Moodle version expects. In any case, you have to
    explicitly mark all supported versions in your plugin version form. Currently, you have just 2.0 selected so this module would
    appear as not supporting any higher version. With certain consequences (such as sites not informed about new versions available
    etc)."

    We decided now to release this version for 2.6 and 2.7. For older version we might bring another pbm version up.

    "I'm getting coding exception after the instance is added to the course in Moodle 2.7 (Argument 1 passed to pbm_cm_info_view() must
    be an instance of cm_info, instance of stdClass given)."

    I checked that and can't reproduce this error. I also actually thought I fixed this in the last relase.
    Tell me if you keep getting this error.

    "I can see some CSS selectors not being specific enough to your module's scope. Selectors like `.preview_pic` may likely affect
    other HTML elements generated by other plugin, should they use the same class. Please use specific selectors."

    Fixed.

    "I believe the $string['pluginname'] can safely read just 'PUMA/BibSonomy'. The word "module" there is very redundant in the UI.
    Also note, *_utf8 packages are not supported in Moodle 2.x. Also, the German language pack should better be uploaded to AMOS once
    this module is approved and removed from the plugin's code."

    Fixed.

    "Please note, if you put your classes into the 'classes' directory instead of the 'class' one, the autoloading would work for you
    in recent Moodle versions (see https://docs.moodle.org/dev/Automatic_class_loading)."

    Fixed.

    "Oh, I forgot. Please check https://moodle.org/plugins/pluginversions.php?plugin=mod_pbm&validation=1 and fix the raised validation issues. TIA."

    Fixed.

    Greetings
  • Anthony Borrow
    Tue, 14 Oct 2014, 10:56 AM
    Florian - Thanks for tidying up the issues mentioned above. I was able to get it to install but for some reason had trouble authenticating to the server with the API key so I was not able to do much in terms of testing. While I did not get the coding exception I was seeing some PHP notices - usually these are easy to fix by initializing the variables:

    Notice: Trying to get property of non-object in /var/www/m27/mod/pbm/lib.php on line 172

    Notice: Trying to get property of non-object in /var/www/m27/mod/pbm/lib.php on line 174

    Notice: Trying to get property of non-object in /var/www/m27/mod/pbm/lib.php on line 174

    Notice: Trying to get property of non-object in /var/www/m27/mod/pbm/lib.php on line 178

    Notice: Trying to get property of non-object in /var/www/m27/mod/pbm/lib.php on line 178

    Notice: Trying to get property of non-object in /var/www/m27/mod/pbm/lib.php on line 183

    Notice: Trying to get property of non-object in /var/www/m27/mod/pbm/lib.php on line 191

    It is encouraged to follow Moodles coding style as outlined in: http://docs.moodle.org/dev/Coding_style and http://docs.moodle.org/dev/Coding

    The code checker plugin can be quite helpful in fine tuning your code and can be found at: https://moodle.org/plugins/view.php?plugin=local_codechecker

    You may wish to consider using that tool to further improve your plugin. Below are the initial results:

    Files found: 21

    mod/pbm/classes/pbm_bibsonomy_url.php - 88 error(s) and 28 warning(s)
    mod/pbm/classes/pbm_curl_http_request.php - 33 error(s) and 1 warning(s)
    mod/pbm/classes/pbm_curl_http_request_proxy.php - 34 error(s) and 7 warning(s)
    mod/pbm/classes/pbm_curl_http_response.php - 37 error(s) and 0 warning(s)
    mod/pbm/classes/pbm_document_url.php - 43 error(s) and 12 warning(s)
    mod/pbm/classes/pbm_fetch_bibtex.php - 66 error(s) and 4 warning(s)
    mod/pbm/classes/pbm_fetch_document.php - 38 error(s) and 7 warning(s)
    mod/pbm/classes/utils/pbm_mime_type_mapper.php - 15 error(s) and 0 warning(s)
    mod/pbm/classes/utils/pbm_utils.php - 33 error(s) and 0 warning(s)
    mod/pbm/db/access.php - 38 error(s) and 0 warning(s)
    mod/pbm/db/upgrade.php - 16 error(s) and 2 warning(s)
    mod/pbm/index.php - 15 error(s) and 1 warning(s)
    mod/pbm/lang/de/pbm.php - 14 error(s) and 5 warning(s)
    mod/pbm/lang/en/pbm.php - 14 error(s) and 5 warning(s)
    mod/pbm/lib.php - 131 error(s) and 10 warning(s)
    mod/pbm/libciteproc/license.txt
    mod/pbm/mod_form.php - 65 error(s) and 25 warning(s)
    mod/pbm/settings.php - 16 error(s) and 0 warning(s)
    mod/pbm/styles.css - 1 error(s) and 0 warning(s)
    mod/pbm/version.php - 12 error(s) and 2 warning(s)
    mod/pbm/view.php - 28 error(s) and 7 warning(s)

    Many of those are simply white space issues and are trivial but it will give you a way of cleaning up your code. Another small feature is the index.php which normally lists the type of activity for a given course. Your index.php is just a shell but you can get a good idea of how to do this by looking at one of the core modules like forum or page. When I went to check the code I did find that the last line of the thirdpartylibs.xml file lacked a proper closing (/libraries) and tossed an error. So that should probably be fixed before we approve it.

    Another issue I want to make sure we do a good check on before approving are the licenses. I noticed that some of the json files used ^M for end of lines. Those should probably be replaced but that is not critical or urgent. Could you go through and spell out the different licenses found in the plugin. I noticed New BSD, jquery (essentially MIT license of X11), but I want to make sure I am not missing any. It would be good to have a licenses.txt file that list the various licenses found in the plugin. I think everything is OK with the licenses but wanted to see if I may have missed anything that you might know of.

    For now, I am going to mark this plugin as needing more work until we get these issues resolved. Thanks for your patience with the review and approval process. Peace - Anthony
  • Anthony Borrow
    Tue, 14 Oct 2014, 10:58 AM
    Also we will want to remove the lang/de folder as only English should be included with the zip file. After approval we can use AMOS to upload the de file and make those strings available as part of the language pack.
  • Anthony Borrow
    Tue, 14 Oct 2014, 11:02 AM
    I also prefer to see the copyright declared in files you have modified and minimally in the version.php file
  • Florian Fassing
    Thu, 13 Nov 2014, 7:54 PM
    Update:

    - I adapted the code to the moodle coding style using the code checker.
    - Fixed closing tag in thirdpartylibs.xml.
    - licenses.txt added.
    - lang/de folder removed.
    - copyrights declared.

    NOTE: The api-user and -key are now user properties and can be filled under "Edit profile".

    Greetings and thanks again for your effort!
  • David Mudrák
    Fri, 21 Nov 2014, 5:14 AM
    Hi Florian. Thanks for your patience with the review and approval process, and for addressing the raised issues responsibly. I am going to approve the module now. Good luck with maintaining it and thanks again for sharing it with the community.
Please login to post comments