Skip to content

Commit

Permalink
Rename app->project in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrodob committed Mar 11, 2015
1 parent ee44759 commit 84016bf
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 67 deletions.
2 changes: 1 addition & 1 deletion doc/admin.rst
Expand Up @@ -35,7 +35,7 @@ Administrators can manage three different areas of the server:
monitor all the background jobs and even cancel them or retry failed ones.

.. _`RQ dashboard`: https://github.com/nvie/rq-dashboard
.. _featured-apps:
.. _featured-projects:

Featured Projects
=================
Expand Down
37 changes: 19 additions & 18 deletions doc/api.rst
Expand Up @@ -16,6 +16,9 @@ It expects and returns JSON.
.. autoclass:: pybossa.api.AppAPI
:members:

.. autoclass:: pybossa.api.ProjectAPI
:members:

.. autoclass:: pybossa.api.TaskAPI
:members:

Expand Down Expand Up @@ -50,14 +53,14 @@ get something like this:
"info": 65,
"user_id": null,
"links": [
"<link rel='parent' title='app' href='http://localhost:5000/api/app/90'/>",
"<link rel='parent' title='project' href='http://localhost:5000/api/project/90'/>",
"<link rel='parent' title='task' href='http://localhost:5000/api/task/5894'/>"
],
"task_id": 5894,
"created": "2012-07-07T17:23:45.714184",
"finish_time": "2012-07-07T17:23:45.714210",
"calibration": null,
"app_id": 90,
"project_id": 90,
"user_ip": "X.X.X.X",
"link": "<link rel='self' title='taskrun' href='http://localhost:5000/api/taskrun/8969'/>",
"timeout": null,
Expand All @@ -66,14 +69,14 @@ get something like this:
The object link will have a tag **rel** equal to **self**, while the parent
objects will be tagged with **parent**. The **title** field is used to specify
the type of the object: task, taskrun or app.
the type of the object: task, taskrun or project.

Apps will not have a **links** field, because these objects do not have
Projects will not have a **links** field, because these objects do not have
parents.

Tasks will have only one parent: the associated project (application).
Tasks will have only one parent: the associated project.

Task Runs will have only two parents: the associated task and associated app.
Task Runs will have only two parents: the associated task and associated project.

.. _`Hypermedia as the Engine of Application State`: http://en.wikipedia.org/wiki/HATEOAS

Expand Down Expand Up @@ -102,15 +105,13 @@ PyBossa, as it is really simple to check those values:
import requests
import time
res = requests.get('http://SERVER/api/app')
res = requests.get('http://SERVER/api/project')
if int(res.headers['X-RateLimit-Remaining']) < 10:
time.sleep(300) # Sleep for 5 minutes
else:
pass # Do your stuff
Operations
----------

Expand All @@ -123,9 +124,9 @@ List domain objects::
GET http://{pybossa-site-url}/api/{domain-object}
For example, you can get a list of registered projects (applications) like this::
For example, you can get a list of registered Projects like this::

GET http://{pybossa-site-url}/api/app
GET http://{pybossa-site-url}/api/project

Or a list of Tasks::

Expand Down Expand Up @@ -177,7 +178,7 @@ If the object is not found you will get a JSON object like this:
{
"status": "failed",
"action": "GET",
"target": "app",
"target": "project",
"exception_msg": "404 Not Found",
"status_code": 404,
"exception_cls": "NotFound"
Expand Down Expand Up @@ -229,7 +230,7 @@ If an error occurs, the action will return a JSON object like this:
{
"status": "failed",
"action": "POST",
"target": "app",
"target": "project",
"exception_msg": "type object 'Project' has no attribute 'short_ame'",
"status_code": 415,
"exception_cls": "AttributeError"
Expand All @@ -255,7 +256,7 @@ If an error occurs, the action will return a JSON object like this:
{
"status": "failed",
"action": "PUT",
"target": "app",
"target": "project",
"exception_msg": "type object 'Project' has no attribute 'short_ame'",
"status_code": 415,
"exception_cls": "AttributeError"
Expand All @@ -281,7 +282,7 @@ If an error occurs, the action will return a JSON object like this:
{
"status": "failed",
"action": "DELETE",
"target": "app",
"target": "project",
"exception_msg": "type object 'Project' has no attribute 'short_ame'",
"status_code": 415,
"exception_cls": "AttributeError"
Expand All @@ -296,7 +297,7 @@ Requesting a new task for current user
You can request a new task for the current user (anonymous or authenticated)
by::

GET http://{pybossa-site-url}/api/{app.id}/newtask
GET http://{pybossa-site-url}/api/{project.id}/newtask

This will return a domain Task object in JSON format if there is a task
available for the user, otherwise it will return **None**.
Expand Down Expand Up @@ -327,6 +328,6 @@ Where 'provider' will be any of the third parties supported, i.e. 'twitter',
Example Usage
-------------

Create a Project (Application) object::
Create a Project object::

curl -X POST -H "Content-Type:application/json" -s -d '{"name":"myapp", "info":{"xyz":1}}' 'http://localhost:5000/api/app?api_key=API-KEY'
curl -X POST -H "Content-Type:application/json" -s -d '{"name":"myproject", "info":{"xyz":1}}' 'http://localhost:5000/api/project?api_key=API-KEY'
2 changes: 1 addition & 1 deletion doc/build_with_pybossa.rst
Expand Up @@ -15,6 +15,6 @@ understand how things fit together.
user/overview
user/pbs
user/tutorial
user/app_settings
user/project_settings
api
model
12 changes: 6 additions & 6 deletions doc/customizing.rst
Expand Up @@ -156,9 +156,9 @@ As you can see, you will be able to give a full personality to your own PyBossa
server without problems.

.. note::
You can specify a different amount of apps per page if you want. Change the
default value in your settings_local.py file of APPS_PER_PAGE to the number
that you want. By default it gives you access to 20.
You can specify a different amount of projects per page if you want. Change
the default value in your settings_local.py file of APPS_PER_PAGE to the
number that you want. By default it gives you access to 20.

.. _`repository pybossa-default-theme`: https://github.com/PyBossa/pybossa-default-theme

Expand Down Expand Up @@ -354,7 +354,7 @@ settings_local.py file, you can adapt it to your own needs.
Configuring upload method
=========================

PyBossa by default allows you to upload avatars for users, icons for apps, etc.
PyBossa by default allows you to upload avatars for users, icons for projects, etc.
using the local file system of your server. While this is nice for small
setups, when you need to add more nodes to serve the same content, this feature
could become a problem. For this reason, PyBossa also supports cloud solutions
Expand Down Expand Up @@ -547,7 +547,7 @@ only administrators will be able to see the following pages:
* http://server/stats
* http://server/account/
* http://server/account/user/
* http://server/app/stats
* http://server/project/stats

Anonymous and authenticated will see a warning message like this:

Expand Down Expand Up @@ -595,7 +595,7 @@ you want::
PRESENTERS = ["basic", "image", "sound", "video", "map", "pdf", "yourtemplate"]

**Yourtemplate** should be a template that you have to save in the theme
folder: **/templates/applications/snippets/** with the same name. Check the
folder: **/templates/projects/snippets/** with the same name. Check the
other templates to use them as a base layer for your template.

After adding the template, the server will start offering this new template to
Expand Down
12 changes: 6 additions & 6 deletions doc/faq.rst
Expand Up @@ -27,7 +27,7 @@ sections.
Can I disable anonymous contributions?
--------------------------------------
Yes, you can. Check your project settings and toggle the drop down menu:
*Allow Anonymous Contributors* from Yes to No. Check the :ref:`app-details`
*Allow Anonymous Contributors* from Yes to No. Check the :ref:`project-details`
for further information.

Can I create *golden tasks*?
Expand All @@ -45,7 +45,7 @@ Can I delete my project and all the task and task runs?
-----------------------------------------------------------
Yes, you can. If you are the owner of the project you can delete the
project, and automatically all the task and associated task runs will be
deleted (**note**: this cannot be undone!). Check the :ref:`app-delete` section
deleted (**note**: this cannot be undone!). Check the :ref:`project-delete` section
for further details.

Do you provide any statistics about the users for my project?
Expand All @@ -56,7 +56,7 @@ will take to complete all your tasks, the top 5 authenticated and anonymous
users, etc. Check the *Statistics* link in the left local sidebar of your
project.

My project is not getting too much attention, how can it be a *featured* app?
My project is not getting too much attention, how can it be a *featured* project?
---------------------------------------------------------------------------------
Featured projects are managed by the administrators of the site. Contact
them about this issue, and they will decide about your project.
Expand All @@ -68,7 +68,7 @@ your file to a file server like DropBox, copy the public link and paste it in
the importer section. PyBossa also supports Google Drive Spreadsheets, see
:ref:`csv-import` section for further details.

My data is in a Google Doc Spreadsheet, can I import the data into my app?
My data is in a Google Doc Spreadsheet, can I import the data into my project?
--------------------------------------------------------------------------
Yes, you can. PyBossa supports the Google Drive Spreadsheets, so make it
public, copy the link and use that link to import it the Google Drive importer
Expand Down Expand Up @@ -110,11 +110,11 @@ version 3.0`_.

.. _`GNU Affero general public license version 3.0`: http://www.gnu.org/licenses/agpl-3.0.html

Do you provide project templates or examples apps?
Do you provide project templates or examples projects?
------------------------------------------------------
Yes, we do. You can find several open source project examples that can be
re-used for image/sound pattern recognition problems, geo-coding, PDF transcription,
etc. Check the official `Git repository`_ for all the available apps.
etc. Check the official `Git repository`_ for all the available projects.

.. _`Git repository`: http://github.com/PyBossa/

Expand Down
2 changes: 1 addition & 1 deletion doc/index.rst
Expand Up @@ -59,7 +59,7 @@ Useful Links

* Mailing list: http://lists.okfn.org/mailman/listinfo/okfn-labs
* Source code: https://github.com/PyBossa/pybossa
* Template apps: https://github.com/PyBossa
* Template projects: https://github.com/PyBossa

==================
Indices and tables
Expand Down
6 changes: 3 additions & 3 deletions doc/install.rst
Expand Up @@ -392,17 +392,17 @@ Migrating Your Old DB Records
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In versions prior to v0.2.3, HTML was supported as the default option for the
'long_description' field in apps. In new versions of PyBossa, Markdown has been
'long_description' field in projects. In new versions of PyBossa, Markdown has been
adopted as the default option. However, you can use HTML instead of Markdown
by modifying the default PyBossa theme or using your own forked from the default
one.

If you were have been using PyBossa for a while you may have apps in your
If you were have been using PyBossa for a while you may have projects in your
database whose 'long_description' is in HTML format. Hence, if you are using the
default theme for PyBossa you will no longer see them rendered as HTML and may
have some issues.

In order to avoid this, you can run a simple script to convert all the DB app's
In order to avoid this, you can run a simple script to convert all the DB project's
'long_description' field from HTML to Markdown, just by running the following
commands::

Expand Down
8 changes: 4 additions & 4 deletions doc/user/advance.rst
Expand Up @@ -14,7 +14,7 @@ a specific Task for a given project.

The following URL is available for every project::

http://pybossa.com/app/slug/task/id
http://pybossa.com/project/slug/task/id

The new endpoint is the same one as the **presenter** one, so the template.html
should take care of using this new endpoint using some JavaScript.
Expand All @@ -24,7 +24,7 @@ DEPRECATED: New Work Flow

This new endpoint opens the possibility to use the following work flow:

* Users will load the following page http://pybossa.com/app/newtask
* Users will load the following page http://pybossa.com/project/newtask
* The template.html JavaScript should check if the window.location.pathname has the following sub-string: task
* If the answer is Yes, then, it should load using an AJAX call the information for the given task
* Else, the pybossa.newTask() method should be used to obtain a task for the user, and change the window.location.href to the new endpoint:
Expand Down Expand Up @@ -55,7 +55,7 @@ load a specific task, or request a new one for the user using PyBossa.JS::
pybossa.newTask("flickrperson").done( function( data ) {
if ( !$.isEmptyObject(data.task) ) {
window.location.pathname = "/app/flickrperson/task/" + data.task.id;
window.location.pathname = "/project/flickrperson/task/" + data.task.id;
}
else {
$(".skeleton").hide();
Expand Down Expand Up @@ -122,7 +122,7 @@ from the same page, however we have to do it in a different way.
Once the answer has been saved, the submitTask(answer) function should change
the pathname again for requesting a new task::

window.location.pathname = "/app/flickrperson/newtask"
window.location.pathname = "/project/flickrperson/newtask"

This will trigger the right methods described in the beginning of this section,
checking if the URL has the **task** keyword in the pathname, and acting
Expand Down
16 changes: 8 additions & 8 deletions doc/user/overview.rst
Expand Up @@ -17,7 +17,7 @@ will have the following items:
#. **Description**

The **slug** or **short name** is a shortcut for accessing the project via
the web (short urls like this http://domain.com/app/slug).
the web (short urls like this http://domain.com/project/slug).

The **description** is a short sentence that will be used to describe your
project.
Expand Down Expand Up @@ -123,7 +123,7 @@ Tasks can be imported from a CSV file or a Google Spreadsheet via the simple
built-in :ref:`task-creator`. You have to do the following:

1. Navigate to your project's page (you can directly access it using
the *slug* project name: http://server/app/slug).
the *slug* project name: http://server/project/slug).

.. image:: http://i.imgur.com/98o4ixD.png

Expand Down Expand Up @@ -236,7 +236,7 @@ If you want to import the data points submitted to a **public** EpiCollect_
project, you will have to follow the next steps:

1. Navigate to your project's page (you can directly access it using
the *slug* project name: http://server/app/slug).
the *slug* project name: http://server/project/slug).

.. image:: http://i.imgur.com/98o4ixD.png

Expand Down Expand Up @@ -428,7 +428,7 @@ tasks and associated task runs** from your project.
delete all the tasks.**

If you are sure that you want to flush all the tasks and task runs for your
project, go to the project page (http://server/app/slug/tasks/) and click in
project, go to the project page (http://server/project/slug/tasks/) and click in
the **Settings** option of the left local navigation menu:

.. image:: http://i.imgur.com/XsAOjnb.png
Expand Down Expand Up @@ -461,7 +461,7 @@ to access your project URL to work with your project. If your project
*slug* or *short name* is *flickrperson* you will be able to access the
project managing options in this URL::

http://PYBOSSA-SERVER/app/flickrperson
http://PYBOSSA-SERVER/project/flickrperson

.. note::

Expand Down Expand Up @@ -531,7 +531,7 @@ Creating a project using the API involves also three steps:
Creating the project
~~~~~~~~~~~~~~~~~~~~~~~~

You can create a project via the API URL **/api/app** with a POST request (See
You can create a project via the API URL **/api/project** with a POST request (See
:ref:`api`).

You have to provide the following information about the project and convert
Expand Down Expand Up @@ -580,7 +580,7 @@ that should have the link to the photo that we want to identify:
info = dict (link=photo['link'],
url=photo['url_m'],
question='Do you see a human face in this photo?')
data = dict (app_id=app_id,
data = dict (project_id=project_id,
state=0,
info=info,
calibration=0,
Expand Down Expand Up @@ -655,7 +655,7 @@ with your own editor, or using the PyBossa interface (see previous section).
This API-KEY should be passed as a POST argument like this with the
previous data:

[POST] http://domain/api/app/?api_key=API-KEY
[POST] http://domain/api/project/?api_key=API-KEY

We recommend to read the
:doc:`Step by step tutorial on
Expand Down

0 comments on commit 84016bf

Please sign in to comment.