<commit_before># VIVO Widgets

A project build to work with an instance of [VIVO](http://vivoweb.org/).  You can also find documentation on the [VIVO Wiki](http://sourceforge.net/apps/mediawiki/vivo/index.php?title=VIVO_Widgets)

# Background

VIVO Widgets is made of up the following parts.

  1. The web service which used indexed data from VIVO pulled via SPARQL.
  1. Web page widget builder for creating the JavaScript snippets to be included in other sites.
  1. Template changes VIVO that allow for the "Add to my web site".
  1. Web Page Widgets: Embeddable JavaScript that allows content to be easily added to other website from VIVO.
  1. OpenSocial Widget: OpenSocial application that allows a user to search content in VIVO from their OpenSocial container.
  1. JSR 286 Portlet: provide an portlet that can be deployed to JSR compliant portal (like [Liferay](http://www.liferay.com/)).


# Building from Source

  1. Clone the VIVO Widgets project.

  2. Copy or symlink your VIVO deploy.properties into src/main/resources/ and add:
      WidgetsSolr.directory=<path to the solr directory in the vivo_widgets project>

  3. Change into the project directory and launch [sbt](http://code.google.com/p/simple-build-tool).

      $ ./sbt

  4. Fetch the dependencies.

      > update

  5. Start Jetty, enabling continuous compilation and reloading.

      > jetty-run

  6. Browse to http://localhost:8081/.
  
# Pushing Updates to VIVO Widgets

Since VIVO has a separate SOLR index which needs to be kept up to date when changes occur in VIVO.  To accomplish this, we need to a couple of Java files to your VIVO src before you build/deploy it.

  1. Copy the src files to your VIVO src directory:
  
    > cp -R listener/src/ <your vivo src directory>/src/
      
  2. Add the following lines with correct information to your deploy.properties for VIVO:
  
    <pre>
    WidgetUpdateSetup.endpointUri=http://127.0.0.1:8080/widgets/updates/person/uri
    WidgetUpdateSetup.username=username for update request
    WidgetUpdateSetup.password=password for update request
    </pre>
      
  Update the username and password with the values you want to use for your application.  The endpointUri is the location of VIVO widgets.
  
  3. Update your web.xml file in <your vivo src directory>/productMods/WEB-INF/web.xml to include a new listener (add just after the edu.cornell.mannlib.vitro.webapp.config.ConfigurationPropertiesSetup listener):

```<commit_msg>updated location to place listener in web.xml<commit_after># VIVO Widgets

A project build to work with an instance of [VIVO](http://vivoweb.org/).  You can also find documentation on the [VIVO Wiki](http://sourceforge.net/apps/mediawiki/vivo/index.php?title=VIVO_Widgets)

# Background

VIVO Widgets is made of up the following parts.

  1. The web service which used indexed data from VIVO pulled via SPARQL.
  1. Web page widget builder for creating the JavaScript snippets to be included in other sites.
  1. Template changes VIVO that allow for the "Add to my web site".
  1. Web Page Widgets: Embeddable JavaScript that allows content to be easily added to other website from VIVO.
  1. OpenSocial Widget: OpenSocial application that allows a user to search content in VIVO from their OpenSocial container.
  1. JSR 286 Portlet: provide an portlet that can be deployed to JSR compliant portal (like [Liferay](http://www.liferay.com/)).


# Building from Source

  1. Clone the VIVO Widgets project.

  2. Copy or symlink your VIVO deploy.properties into src/main/resources/ and add:
      WidgetsSolr.directory=<path to the solr directory in the vivo_widgets project>

  3. Change into the project directory and launch [sbt](http://code.google.com/p/simple-build-tool).

      $ ./sbt

  4. Fetch the dependencies.

      > update

  5. Start Jetty, enabling continuous compilation and reloading.

      > jetty-run

  6. Browse to http://localhost:8081/.
  
# Pushing Updates to VIVO Widgets

Since VIVO has a separate SOLR index which needs to be kept up to date when changes occur in VIVO.  To accomplish this, we need to a couple of Java files to your VIVO src before you build/deploy it.

  1. Copy the src files to your VIVO src directory:
  
    > cp -R listener/src/ <your vivo src directory>/src/
      
  2. Add the following lines with correct information to your deploy.properties for VIVO:
  
    <pre>
    WidgetUpdateSetup.endpointUri=http://127.0.0.1:8080/widgets/updates/person/uri
    WidgetUpdateSetup.username=username for update request
    WidgetUpdateSetup.password=password for update request
    </pre>
      
  Update the username and password with the values you want to use for your application.  The endpointUri is the location of VIVO widgets.
  
  3. Update your web.xml file in <your vivo src directory>/productMods/WEB-INF/web.xml to include a new listener (add just after the edu.cornell.mannlib.vitro.webapp.search.solr.SolrSetup):

```
{'fraction_non_alphanumeric': 0.06875631951466127, 'fraction_numerical': 0.012942366026289181, 'mean_word_length': 3.488203266787659, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 5}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '57048', 'n_tokens_mistral': 1504, 'n_tokens_neox': 1436, 'n_words': 631}