diff --git a/doc/README_FOR_APP b/doc/README_FOR_APP deleted file mode 100644 index bf8bbc8..0000000 --- a/doc/README_FOR_APP +++ /dev/null @@ -1,118 +0,0 @@ -= Noosfero: a free web-based social platform - -== Setting up a Noosfero development/test environment - -Noosfero is written in Ruby with the "Rails framework":http://www.rubyonrails.org, -so the process of setting it up is pretty similar to other Rails applications. - -=== Requirements - -You need to have a Subversion client (svn) installed, as well as: - -* Ruby: http://www.ruby-lang.org/ -* Rake: http://rake.rubyforge.org/ -* Ruby-GetText: http://www.yotabanana.com/hiki/ruby-gettext.html?ruby-gettext (at least version 1.9.0) -* Mocha: http://mocha.rubyforge.org/ -* Ruby-sqlite3: http://rubyforge.org/projects/sqlite-ruby -* rcov: http://eigenclass.org/hiki/rcov -* Ferret: http://ferret.davebalmain.com/trac -* RMagick: http://rmagick.rubyforge.org/ -* RedCloth: http://whytheluckystiff.net/ruby/redcloth/ -* Ruby Locale: http://rubyforge.org/projects/locale/ -* will_paginate: http://github.com/mislav/will_paginate/wikis - -There are Debian packages available for all of them but ferret. Try: - - # aptitude install subversion ruby rake libgettext-ruby libmocha-ruby libsqlite3-ruby rcov librmagick-ruby libredcloth-ruby liblocale-ruby libwill-paginate-ruby - -Ferret shall enter Debian soon (as libferret-ruby). until there you have two options: - -1. build the source package from svn://svn.debian.org/svn/pkg-ruby-extras/packages-wip/libferret-ruby -1. install ferret via rubygems: issue gem install ferret as root (you'll need to install the rubygems package for it) - -If you have problems with the setup, use the development mailing list. In -special its possible that the requirements list above is not complete. - -=== Boostraping the test environment - -You can copy and paste the commands below into a terminal (please review the -commands and make sure you understand what you are doing): - - # checkout the code from repository - svn checkout https://svn.colivre.coop.br/svn/noosfero/trunk/ noosfero - # enter the directory - cd noosfero - # copy a sample config file - cp config/database.yml.sqlite3 config/database.yml - # create the database: - rake db:migrate - # compile translations: - rake makemo - # create some test data: - ./script/populate - # install the test dependences: - aptitude install libtidy-ruby libhpricot-ruby - # run the automated test suite to make sure your environment is sane: - rake test - -You should now be ready to go. Issue the following command to start the Rails -development server: - - ./script/server - -The server will be available at http://localhost:3000/ . If you want to use -another port than 3000, you can use the -p option of ./script/server: - - ./script/server -p 9999 - -The above command makes the server available at http://localhost:9999/ - -The populate script creates some test users, one of them has login 'ze' and -password 'test'. You can use it or you can register a new user. - -== Reporting bugs - -Use Noosfero Tracker application at http://www.colivre.coop.br/Noosfero. - -== Helping with development - -* It's recommended that you subscribe to the development mailing - list: http://ynternet.net/mailman/listinfo/noosfero -* If you have a patch, create an appropriate action item - (bugs/requirement/enhancement) in the Tracker web (see "Reporting bugs" - above) of type. - -== Releasing noosfero - -To prepare a release of noosfero, you must follow the steps below: - -* finish all requirements and bugs assigned to the to-be-released version -* make sure all tests pass -* write release notes at the version's wiki topic. -* generate package with rake package. Your tarball will be under the pkg/ - directory, named as noosfero-${VERSION}.tar.gz -* test that the package contains everything that is needed: explode the tarball - in a temporary directory, copy config/database.yml.sqlite3 to - config/database.yml, and make rake db:migrate and rake test. If - everything is ok, you are done. If not, maybe some files are not going into - the tarball. See lib/tasks/package.rake, probably you'll need to change it. -* Go to the version's wiki topic and edit it to reflect the new reality. -* Attach the generated package to that topic. Before attaching calculate the md5 of the package (with mu5sum and paste the MD5 hash as comment in the attachment form) -* Download the attached and verify the MD5 hash -* create a svn tag for the released version with rake tag. See - lib/tasks/svn.rake in case of any questions. -* IMMEDIATELY change the version in lib/noosfero.rb to the next version. (e.g. - 0.2.0 -> 0.3.0) -* update an eventual demonstration version that you run. -* write an announcement e-mail to the relevant maimling lists pointing to the release notes, and maybe to the demonstration version. - -If you had any problem during these steps, you can do rake clobber_package to -completely delete the generated packages and start the process again. - -== Working with translations - -* Update translation files: rake updatepo. Then svn commit them. -* Send the PO files to the translators. -* Get the PO files back from translators, put in po/ under the correct language - name (e.,g. po/pt_BR/) and svn commit. -* test translations: rake makemo and browse the application on the web. diff --git a/doc/README_FOR_APP b/doc/README_FOR_APP new file mode 120000 index 0000000..179de81 --- /dev/null +++ b/doc/README_FOR_APP @@ -0,0 +1 @@ +README_FOR_APP.pt_BR \ No newline at end of file diff --git a/doc/README_FOR_APP.en b/doc/README_FOR_APP.en new file mode 100644 index 0000000..bf8bbc8 --- /dev/null +++ b/doc/README_FOR_APP.en @@ -0,0 +1,118 @@ += Noosfero: a free web-based social platform + +== Setting up a Noosfero development/test environment + +Noosfero is written in Ruby with the "Rails framework":http://www.rubyonrails.org, +so the process of setting it up is pretty similar to other Rails applications. + +=== Requirements + +You need to have a Subversion client (svn) installed, as well as: + +* Ruby: http://www.ruby-lang.org/ +* Rake: http://rake.rubyforge.org/ +* Ruby-GetText: http://www.yotabanana.com/hiki/ruby-gettext.html?ruby-gettext (at least version 1.9.0) +* Mocha: http://mocha.rubyforge.org/ +* Ruby-sqlite3: http://rubyforge.org/projects/sqlite-ruby +* rcov: http://eigenclass.org/hiki/rcov +* Ferret: http://ferret.davebalmain.com/trac +* RMagick: http://rmagick.rubyforge.org/ +* RedCloth: http://whytheluckystiff.net/ruby/redcloth/ +* Ruby Locale: http://rubyforge.org/projects/locale/ +* will_paginate: http://github.com/mislav/will_paginate/wikis + +There are Debian packages available for all of them but ferret. Try: + + # aptitude install subversion ruby rake libgettext-ruby libmocha-ruby libsqlite3-ruby rcov librmagick-ruby libredcloth-ruby liblocale-ruby libwill-paginate-ruby + +Ferret shall enter Debian soon (as libferret-ruby). until there you have two options: + +1. build the source package from svn://svn.debian.org/svn/pkg-ruby-extras/packages-wip/libferret-ruby +1. install ferret via rubygems: issue gem install ferret as root (you'll need to install the rubygems package for it) + +If you have problems with the setup, use the development mailing list. In +special its possible that the requirements list above is not complete. + +=== Boostraping the test environment + +You can copy and paste the commands below into a terminal (please review the +commands and make sure you understand what you are doing): + + # checkout the code from repository + svn checkout https://svn.colivre.coop.br/svn/noosfero/trunk/ noosfero + # enter the directory + cd noosfero + # copy a sample config file + cp config/database.yml.sqlite3 config/database.yml + # create the database: + rake db:migrate + # compile translations: + rake makemo + # create some test data: + ./script/populate + # install the test dependences: + aptitude install libtidy-ruby libhpricot-ruby + # run the automated test suite to make sure your environment is sane: + rake test + +You should now be ready to go. Issue the following command to start the Rails +development server: + + ./script/server + +The server will be available at http://localhost:3000/ . If you want to use +another port than 3000, you can use the -p option of ./script/server: + + ./script/server -p 9999 + +The above command makes the server available at http://localhost:9999/ + +The populate script creates some test users, one of them has login 'ze' and +password 'test'. You can use it or you can register a new user. + +== Reporting bugs + +Use Noosfero Tracker application at http://www.colivre.coop.br/Noosfero. + +== Helping with development + +* It's recommended that you subscribe to the development mailing + list: http://ynternet.net/mailman/listinfo/noosfero +* If you have a patch, create an appropriate action item + (bugs/requirement/enhancement) in the Tracker web (see "Reporting bugs" + above) of type. + +== Releasing noosfero + +To prepare a release of noosfero, you must follow the steps below: + +* finish all requirements and bugs assigned to the to-be-released version +* make sure all tests pass +* write release notes at the version's wiki topic. +* generate package with rake package. Your tarball will be under the pkg/ + directory, named as noosfero-${VERSION}.tar.gz +* test that the package contains everything that is needed: explode the tarball + in a temporary directory, copy config/database.yml.sqlite3 to + config/database.yml, and make rake db:migrate and rake test. If + everything is ok, you are done. If not, maybe some files are not going into + the tarball. See lib/tasks/package.rake, probably you'll need to change it. +* Go to the version's wiki topic and edit it to reflect the new reality. +* Attach the generated package to that topic. Before attaching calculate the md5 of the package (with mu5sum and paste the MD5 hash as comment in the attachment form) +* Download the attached and verify the MD5 hash +* create a svn tag for the released version with rake tag. See + lib/tasks/svn.rake in case of any questions. +* IMMEDIATELY change the version in lib/noosfero.rb to the next version. (e.g. + 0.2.0 -> 0.3.0) +* update an eventual demonstration version that you run. +* write an announcement e-mail to the relevant maimling lists pointing to the release notes, and maybe to the demonstration version. + +If you had any problem during these steps, you can do rake clobber_package to +completely delete the generated packages and start the process again. + +== Working with translations + +* Update translation files: rake updatepo. Then svn commit them. +* Send the PO files to the translators. +* Get the PO files back from translators, put in po/ under the correct language + name (e.,g. po/pt_BR/) and svn commit. +* test translations: rake makemo and browse the application on the web. diff --git a/doc/README_FOR_APP.pt_BR b/doc/README_FOR_APP.pt_BR new file mode 100644 index 0000000..c5e1f16 --- /dev/null +++ b/doc/README_FOR_APP.pt_BR @@ -0,0 +1,351 @@ += Menu + +* MVC +* Como criar um Article? +* Como criar um Block? +* Como criar uma Task? +* Visão Geral do Banco de Dados + += MVC + +A sigla MVC vem de Modelo, Visão e Controle. Esta arquitetura sugere uma separação do código em três camadas distintas, com papéis bem definidos. + +A Visão é a camada que interage diretamente com o usuário, recebendo e disponibilizando os dados da aplicação. A camada de Visão tem o objetivo de apresentar o resultado do processamento da camada de Controle, formatada para ser usável pelo usuário, consituindo a parte visível do sistema. + +A camada de Controle é a responsável por processar todas as requisições feitas pelo usuário através da interface (Visão). Esta camada interpreta as ações do usuário e gerencia a execução das regras de negócios pelo Modelo. + +O modelo refere-se ao gerenciamento da informação e ao comportamento da aplicação. Em uma visão simplificada, a camada de modelo funciona como uma representação das entidades de domínio e suas regras de negócio. Possui a função de validar os dados vindos da interface do usuário com os dados da aplicação. + += Como criar um Article? + +Um artigo é um tipo de conteúdo que um usuário pode criar e gerenciar através do botão "gerenciar conteúdo" no seu painel de controle. Ele também é listado no bloco "conteúdo recente" e em alguns outros lugares como no resultado das buscas por exemplo. Os artigos podem ser de vários tipos, artigos que usam marcação de texto textile é um tipo de artigo, artigos com edição visual WYSIWYG é um outro tipo, artigos também podem ser arquivos enviados pelo usuário ou um simplesmente um feed RSS. + +Cada um desses tipos de artigo são subclasses de Article que implementam métodos para editá-lo e exibi-lo. Os métodos que tem que ser sobrescritos são: to_html (para converter o conteudo em html), decription e short_decription (para indicar o que o artigo é para um usuário). Para cada Model que representa um tipo especifico de Article deve existir também um partial rhtml na pasta de views do controller cms em app/views/cms com o nome do tipo de artigo que é a interface de edição do artigo. + +Então basicamente o layout de um novo tipo de artigo ficaria assim: + +class NovoTipo < Article + def description + _('Este é um novo tipo de artigo') + end + def short_description + _('Novo tipo de artigo') + end + def to_html + #Algum código para gerar o html a partir de outras informações armazenadas + end +end + +Por padrão já existem alguns atributos que podem ser usados na geração do html para o artigo. + +* body - corpo do artigo +* name - nome do artigo +* created_at - quando o artigo foi criado +* updated_at - quando foi alterado pela última vez + +Caso seja necessário armazenar alguma informação além destas pode-se adicionar campos personalizados com o método setting_items. + +Para criar por exemplo um artigo que mostre um texto com uma lista de referêcias em separado pode-se adicionar um campo de texto usando settings_items para armazenar as referências. + +app/model/texto_com_referencia.rb + +class TextoComReferencia < Article + def description + _('Este é uma artigo com referências em separado.') + end + def short_description + _('Artigo com referêcias') + end + settings_items :referencias, :type => 'text' + def to_html + body + "