Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/martineq/tp7552 into dev…
Browse files Browse the repository at this point in the history
…elop
  • Loading branch information
Romina committed Nov 26, 2015
2 parents 7f0ebec + f1bd33d commit 8ba17d3
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 51 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@
### Instalación y ejecución

Descargar la última versión del script de instalación:
* [:arrow_down: Versión 0.4 :arrow_down:](https://raw.githubusercontent.com/martineq/tp7552/master/server/server_install_v0.4.sh) ( :ballot_box_with_check: Última versión ) ( :warning: Sistema Operativo soportado: Ubuntu 14.04 LTS )
* [:arrow_down: Versión 0.5 :arrow_down:](https://raw.githubusercontent.com/martineq/tp7552/master/server/server_install_v0.5.sh) ( :ballot_box_with_check: Última versión ) ( :warning: Sistema Operativo soportado: Ubuntu 14.04 LTS )
* [:arrow_down: Versión 0.4 :arrow_down:](https://raw.githubusercontent.com/martineq/tp7552/master/server/server_install_v0.4.sh) ( :warning: Sistema Operativo soportado: Ubuntu 14.04 LTS )
* [:arrow_down: Versión 0.3 :arrow_down:](https://raw.githubusercontent.com/martineq/tp7552/develop/server/server_install_v0.3.sh) ( :warning: Sistema Operativo soportado: Ubuntu 14.04 LTS )
* [:arrow_down: Versión 0.2 :arrow_down:](https://raw.githubusercontent.com/martineq/tp7552/develop/server/server_install_v0.2.sh) ( :warning: Sistema Operativo soportado: Ubuntu 14.04 LTS )
* [:arrow_down: Versión 0.1 :arrow_down:](https://raw.githubusercontent.com/martineq/tp7552/master/server/server_install_v0.1.sh) ( :warning: Sistema Operativo soportado: Ubuntu 14.04 LTS )

Para la instalación:

`sudo chmod 777 server_install_v0.4.sh`
`sudo chmod 777 server_install_v0.5.sh`

`sudo ./server_install_v0.4.sh`
`sudo ./server_install_v0.5.sh`

Luego ejecutar el servidor con:

Expand All @@ -39,10 +40,8 @@ Luego ejecutar el servidor con:
### Instalación y ejecución

Descargar el archivo apk de instalación (Android) correspondiente a la misma versión del servidor:
<!---
TODO: Actualizar el link para la versión 0.3 del apk
-->
* [:arrow_down: Versión 0.4 :arrow_down:](https://github.com/martineq/tp7552/raw/master/client/uDrive.apk) ( :ballot_box_with_check: Última versión )
* [:arrow_down: Versión 0.5 :arrow_down:](https://github.com/martineq/tp7552/raw/master/client/src/Udrive/app/app-release.apk) ( :ballot_box_with_check: Última versión )
* [:arrow_down: Versión 0.4 :arrow_down:](https://github.com/martineq/tp7552/raw/master/client/uDrive.apk)
* [:arrow_down: Versión 0.3 :arrow_down:](https://github.com/martineq/tp7552/raw/master/client/src/Udrive/app/app-release.apk)
* [:arrow_down: Versión 0.2 :arrow_down:](https://github.com/martineq/tp7552/raw/v0.2/client/src/Udrive/app/app-release.apk)
* [:arrow_down: Versión 0.1 :arrow_down:](https://github.com/martineq/tp7552/raw/344e1550a2eab0febc324910d4edaf2256522ac9/client/src/Udrive/app/app-release.apk) ( :warning: Esta versión se conecta a un servidor remoto de testeo )
Expand Down
Binary file modified client/src/Udrive/app/app-release.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -48,45 +48,14 @@ protected void onCreate(Bundle savedInstanceState) {
((ScrollView)findViewById(R.id.scroll_layout)).smoothScrollTo(0, 0);
mFileInfo = (FileInfo) getIntent().getSerializableExtra(FILE_INFO);

/** TODO: delete this fragment after loading file info from HTTP response **/
/*UserBasicData owner = new UserBasicData("Owner", "User", "owner@owner.com");
File file = new File("Image.jpg", 565421,'a', false, "21/08/2015 08:53", null,null);
file.setId(1);
UserBasicData updatedBy = owner;
double updatedFromLatitude = -34.795713;
double updatedFromLongitude = -58.348321;
ArrayList<UserBasicData> collaborators = new ArrayList<>();
collaborators.add(new UserBasicData("user1", "user1", "user1@lala.com"));
collaborators.add(new UserBasicData("AnotherUser", "AnotherUser", "anotheruser@lolo.com"));
collaborators.add(new UserBasicData("Bono", "Vox", "blabla@blabla.com"));
collaborators.add(new UserBasicData("Sharon", "Den Adel", "xxxxx@yyyy.com"));
ArrayList<Tag> tags = new ArrayList<>();
tags.add(new Tag("tag1"));
tags.add(new Tag("tag2"));
tags.add(new Tag("tag3"));
tags.add(new Tag("tag1"));
tags.add(new Tag("tag2"));
tags.add(new Tag("tag3"));
tags.add(new Tag("tag1"));
tags.add(new Tag("tag2"));
tags.add(new Tag("tag3"));
tags.add(new Tag("tag1"));
tags.add(new Tag("tag2"));
tags.add(new Tag("tag3"));
tags.add(new Tag("tag2"));
mFileInfo = new FileInfo(owner, file, updatedBy, updatedFromLatitude, updatedFromLongitude,
collaborators, tags);*/
/******/
ListView access = (ListView)findViewById(R.id.list_access);
// who has access
ArrayList<String> names = new ArrayList<>();
ArrayList<String> mails = new ArrayList<>();
int i;
ArrayList<UserBasicData> coll = mFileInfo.getCollaborators();
for (i = 0; i < coll.size(); i++){
names.add(coll.get(i).getFirstname()+" "+coll.get(i).getLastname());
names.add(Util.capitalize(coll.get(i).getFirstname()+" "+coll.get(i).getLastname()));
mails.add(coll.get(i).getEmail());
System.out.println("Collab name >>>> " + coll.get(i).getFirstname() + " " + coll.get(i).getLastname());
System.out.println("Collab email >>>> "+ coll.get(i).getEmail());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ public void onFailure(String message, int status) {
@Override
public void onSuccess(List<Collaborator> coll, int status) {
for (int i = 0; i < coll.size(); i++) {
names.add(coll.get(i).getFirstName() + " " + coll.get(i).getLastName());
names.add(Util.capitalize(coll.get(i).getFirstName() + " " + coll.get(i).getLastName()));
mails.add(coll.get(i).getEmail());
collab.add(coll.get(i));
}
Expand All @@ -832,17 +832,6 @@ public void onFailure(String message, int status) {
}
});

// TODO: delete after testing
/*************/
/*collab.add(new Collaborator("Name1", "Name1", "name1@name1.com"));
collab.add(new Collaborator("Name2", "Name2", "name2@name2.com"));
collab.add(new Collaborator("Name3", "Name3", "name3@name3.com"));
for (int i = 0; i < collab.size(); i++){
names.add(collab.get(i).getFirstName()+" "+collab.get(i).getLastName());
mails.add(collab.get(i).getEmail());
}*/
/*************/

TabHost.TabSpec spec4 = tabHost.newTabSpec("tab4");
spec4.setIndicator(getTabIndicator(tabHost.getContext(), R.string.by_owner, R.drawable.ic_account_24));
spec4.setContent(R.id.layout4);
Expand Down Expand Up @@ -944,7 +933,9 @@ public void onFailure(String message, int status) {
mFilesService.getFilesByOwner(mUserAccount.getUserId(), ownerId, new ServiceCallback<List<File>>() {
@Override
public void onSuccess(List<File> files, int status) {
System.out.println(" Got hits by owner *** No files");
if (files.size() > 0) {
System.out.println(" Got hits by owner");
progressDialog.dismiss();
mFilesAdapter.updateFiles(files);
Log.d(TAG, "Number of files received " + files.size());
Expand Down
108 changes: 108 additions & 0 deletions server/server_install_v0.5.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#!/bin/bash

##################################################
## Script de instalación del server ##
## Sistema operativo basado: Ubuntu 14.04 LTS ##
## Para correr este script, ejecutar: ##
## sudo chmod 777 server_install_v0.5.sh ##
## sudo ./server_install_v0.5.sh ##
##################################################

# Caso sin parámetros: Limpieza de librerías debido a posibles versiones anteriores conflictivas
if [ "$#" -eq 0 ]
then
echo "Búsqueda y limpieza de librerías RocksDB, jsoncpp, yaml-cpp y gtest existentes..."
find / -type f -name "librocksdb.a" -exec rm --force {} \;
find / -type f -name "librocksdb.so" -exec rm --force {} \;
find / -type f -name "libjsoncpp.a" -exec rm --force {} \;
find / -type f -name "libjsoncpp.so" -exec rm --force {} \;
find / -type f -name "libyaml-cpp.a" -exec rm --force {} \;
find / -type f -name "libyaml-cpp.so" -exec rm --force {} \;
find / -type f -name "libgtest.a" -exec rm --force {} \;
find / -type f -name "libgtest_main.a" -exec rm --force {} \;
find / -type f -name "libgtest.so" -exec rm --force {} \;
find / -type f -name "libgtest_main.so" -exec rm --force {} \;
echo "Fin de búsqueda..."
fi

# Instalación de dependencias y herramientas
echo "Instalación de dependencias..."
apt-get update && apt-get install -y \
build-essential \
python \
git \
cmake \
wget \
zip \
unzip \
valgrind \
tree \
vim \
nano \
libsnappy-dev \
zlib1g-dev \
libbz2-dev \
libgflags-dev \
tar \
curl \
lcov

# Instalación de librerías
echo "Instalación de librerías RocksDB, jsoncpp, yaml-cpp y gtest..."
mkdir temp_install && \
cd temp_install && \
wget https://github.com/facebook/rocksdb/archive/v3.13.1.zip && \
unzip v3.13.1.zip && \
cd rocksdb-3.13.1 && \
make static_lib && \
sudo cp librocksdb.a /usr/lib && \
cd .. && \
rm v3.13.1.zip && \
wget https://github.com/open-source-parsers/jsoncpp/archive/1.6.5.zip && \
unzip 1.6.5.zip && \
cd jsoncpp-1.6.5 && \
python amalgamate.py && \
cd dist && \
gcc -c jsoncpp.cpp && \
ar rvs libjsoncpp.a jsoncpp.o && \
sudo cp libjsoncpp.a /usr/lib && \
cd ../.. && \
rm 1.6.5.zip && \
wget https://github.com/jbeder/yaml-cpp/archive/release-0.3.0.zip && \
unzip release-0.3.0.zip && \
cd yaml-cpp-release-0.3.0 && \
mkdir build && \
cd build && \
cmake .. && \
make && \
cp libyaml-cpp.a /usr/lib && \
cd ../.. && \
rm -rf yaml-cpp-release-0.3.0 && \
rm release-0.3.0.zip && \
wget https://googletest.googlecode.com/files/gtest-1.7.0.zip && \
unzip gtest-1.7.0.zip && \
cd gtest-1.7.0 && \
./configure && \
make && \
cp -a lib/.libs/libgtest.a /usr/lib && \
cp -a lib/.libs/libgtest_main.a /usr/lib && \
cd .. && \
rm -rf gtest-1.7.0 && \
rm gtest-1.7.0.zip && \
cd .. && \
rm -rf temp_install
echo "Librerías instaladas en /usr/lib/"

# Caso sin parámetros: Bajo el código del repositorio, compilo y creo el archivo config.yml por defecto
if [ "$#" -eq 0 ]
then
echo "Obtención de código fuente..."
git clone --quiet --branch v0.5 --depth 1 https://github.com/martineq/tp7552.git tp7552

echo "Compilación del servidor..."
cd tp7552/server && mkdir build && cd build
cmake -DEXE=SI .. && make

echo "Creación de archivo de configuración..."
printf '# UDrive configuration file server\n## bindip: parameter that lets you choose in which direction the web server ip listen. Default: 0.0.0.0\nbindip: 0.0.0.0\n\n## bindport: parameter that lets you choose the server port to listen UDrive. Default: 8080\nbindport: 8080\n\n## loglevel: we want to see server. debug, warning, info, error. Default: info\nloglevel: debug\n\n## logfile: destination to send the log records. Default: "stdout"\n#logfile: messages.log\n\n## path of database\ndbpath: /tmp/testdb_Release\n\n## User quota\nmaxquotauser: 100000000\n ' > config.yml
fi

0 comments on commit 8ba17d3

Please sign in to comment.