-added annotations
-added link to projects -removed unused files -removed useless message
Esse commit está contido em:
@@ -0,0 +1 @@
|
|||||||
|
Felipe ,felipe,laptop,24.03.2011 15:39,file:///home/felipe/.openoffice.org/3;
|
||||||
Arquivo binário não exibido.
@@ -47,6 +47,8 @@ class En {
|
|||||||
$this->messages['analyseFirst'] = "You will need to analyze the project. It has not been analyzed yet.Execute the 'analyze' command.\n";
|
$this->messages['analyseFirst'] = "You will need to analyze the project. It has not been analyzed yet.Execute the 'analyze' command.\n";
|
||||||
$this->messages['permissionDenied'] = Mind::message("Permission denied to change/create/delete files.\nPlease, allow the system to change files in mind's root directory", '[Fail]', false);;
|
$this->messages['permissionDenied'] = Mind::message("Permission denied to change/create/delete files.\nPlease, allow the system to change files in mind's root directory", '[Fail]', false);;
|
||||||
$this->messages['additionalCounterCol'] = "This field was automatically added to allow an insertion of a new tuple using repeated values for the other keys.";
|
$this->messages['additionalCounterCol'] = "This field was automatically added to allow an insertion of a new tuple using repeated values for the other keys.";
|
||||||
|
$this->messages['commitChanged'] = Mind::message("VCS: Commited to version %s", '[Ok]', false);
|
||||||
|
$this->messages['commitUnchanged'] = Mind::message("VCS: Nothing to commit. Still in version %s", '[Ok]', false);
|
||||||
|
|
||||||
$this->messages['http_invalid_requisition'] = <<<MESSAGE
|
$this->messages['http_invalid_requisition'] = <<<MESSAGE
|
||||||
Invalid HTTP requisition.
|
Invalid HTTP requisition.
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ class pt {
|
|||||||
$this->messages['sourceFileNotFound'] = Mind::message("O arquivo fonte '%s' não foi encontrado para o projeto atual.", '[Fail]', false);
|
$this->messages['sourceFileNotFound'] = Mind::message("O arquivo fonte '%s' não foi encontrado para o projeto atual.", '[Fail]', false);
|
||||||
$this->messages['permissionDenied'] = Mind::message("Permissão negada pra acessar, criar, alterar ou excluir um arquivo.\nPor favor, libere acesso ao sistema para o diretório raíz do Mind.\n", '[Fail]', false);
|
$this->messages['permissionDenied'] = Mind::message("Permissão negada pra acessar, criar, alterar ou excluir um arquivo.\nPor favor, libere acesso ao sistema para o diretório raíz do Mind.\n", '[Fail]', false);
|
||||||
$this->messages['additionalCounterCol'] = "Campo adicionado automaticamente, a ser usado como diferencial para cada tupla, a fim de possibilizar um novo registro utilizando as mesmas demais chaves.";
|
$this->messages['additionalCounterCol'] = "Campo adicionado automaticamente, a ser usado como diferencial para cada tupla, a fim de possibilizar um novo registro utilizando as mesmas demais chaves.";
|
||||||
|
$this->messages['commitChanged'] = Mind::message("VCS: Consignado para versão %s", '[Ok]', false);
|
||||||
|
$this->messages['commitUnchanged'] = Mind::message("VCS: Nada a consignar. Ainda na versão %s", '[Ok]', false);
|
||||||
|
|
||||||
$this->messages['http_invalid_requisition'] = <<<MESSAGE
|
$this->messages['http_invalid_requisition'] = <<<MESSAGE
|
||||||
Requisição HTTP inválida.
|
Requisição HTTP inválida.
|
||||||
|
|||||||
@@ -1,14 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
/*
|
* This file is part of TheWebMind 3rd generation.
|
||||||
* To change this template, choose Tools | Templates
|
*
|
||||||
* and open the template in the editor.
|
* Notice that, these packages are being used only for documentation,
|
||||||
|
* not to organize the classes.
|
||||||
|
*
|
||||||
|
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
|
||||||
|
* @license licenses/mind3rd.license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace DAO;
|
namespace DAO;
|
||||||
/**
|
/**
|
||||||
* Description of Project
|
* Deals with the SQLite to retrieve or interact with project's information.
|
||||||
|
* It deals a lot with version control of the current project.
|
||||||
*
|
*
|
||||||
|
* @package VCS
|
||||||
|
* @subpackage DAO
|
||||||
* @author felipe
|
* @author felipe
|
||||||
*/
|
*/
|
||||||
class Project{
|
class Project{
|
||||||
@@ -19,6 +25,14 @@ class Project{
|
|||||||
public $originalCode= '';
|
public $originalCode= '';
|
||||||
public $framework= '';
|
public $framework= '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the list of entities in the current version of the analyzed project.
|
||||||
|
* It returns an array with all the entity's name, id and version.
|
||||||
|
*
|
||||||
|
* @param integer $vs
|
||||||
|
* @return Array An array with all the entities for the project in the curret
|
||||||
|
* or passed(if passed) version.
|
||||||
|
*/
|
||||||
public function getCurrentEntities($vs=false)
|
public function getCurrentEntities($vs=false)
|
||||||
{
|
{
|
||||||
$qr= "SELECT entity.name as name,
|
$qr= "SELECT entity.name as name,
|
||||||
@@ -36,6 +50,15 @@ class Project{
|
|||||||
return $entities;
|
return $entities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inserts the passed property into the SQLite database.
|
||||||
|
* It inserts the passed property as a property of the table with the
|
||||||
|
* id equals to the passed $enKey.
|
||||||
|
*
|
||||||
|
* @param \MindProperty $prop
|
||||||
|
* @param integer $enKey
|
||||||
|
* @return boolean True if everything went ok, an error otherwise
|
||||||
|
*/
|
||||||
public function insertProperty(\MindProperty $prop, $enKey)
|
public function insertProperty(\MindProperty $prop, $enKey)
|
||||||
{
|
{
|
||||||
$refs= "";
|
$refs= "";
|
||||||
@@ -69,9 +92,17 @@ class Project{
|
|||||||
".$enKey.",
|
".$enKey.",
|
||||||
'".$refs."'
|
'".$refs."'
|
||||||
)";
|
)";
|
||||||
$this->db->execute($qr);
|
return $this->db->execute($qr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all the properties of the passed entity.
|
||||||
|
* It returns an associative array(with the property name in each index) of
|
||||||
|
* all the properties the passed entity has.
|
||||||
|
*
|
||||||
|
* @param array $entity
|
||||||
|
* @return Array
|
||||||
|
*/
|
||||||
public function getProperties(Array $entity)
|
public function getProperties(Array $entity)
|
||||||
{
|
{
|
||||||
$qr= "select pk_property,
|
$qr= "select pk_property,
|
||||||
@@ -97,6 +128,14 @@ class Project{
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marks an entity as changed from the last version.
|
||||||
|
* It updates the entity's status to changed, in the previous version,
|
||||||
|
* the new version will have it with the OK flag.
|
||||||
|
*
|
||||||
|
* @param array $en
|
||||||
|
* @return boolean True in case of success, otherwise, generates an error
|
||||||
|
*/
|
||||||
public function markAsChanged(Array $en)
|
public function markAsChanged(Array $en)
|
||||||
{
|
{
|
||||||
$qr= "UPDATE entity
|
$qr= "UPDATE entity
|
||||||
@@ -105,6 +144,14 @@ class Project{
|
|||||||
return $this->db->execute($qr);
|
return $this->db->execute($qr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marks an entity as dropped from the last version.
|
||||||
|
* The next version has not the passed entity, so, it will be marked
|
||||||
|
* as dropped, in the previous version.
|
||||||
|
*
|
||||||
|
* @param array $en
|
||||||
|
* @return boolean True in case of success, otherwise, generates an error
|
||||||
|
*/
|
||||||
public function markAsDopped(Array $en)
|
public function markAsDopped(Array $en)
|
||||||
{
|
{
|
||||||
$qr= "UPDATE entity
|
$qr= "UPDATE entity
|
||||||
@@ -113,6 +160,12 @@ class Project{
|
|||||||
return $this->db->execute($qr);
|
return $this->db->execute($qr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inserts a new version into the SQLite database.
|
||||||
|
* It also starts the versonId variable to the next version.
|
||||||
|
*
|
||||||
|
* @return boolean True in case of success, otherwise, generates an error
|
||||||
|
*/
|
||||||
public function addNewVersion()
|
public function addNewVersion()
|
||||||
{
|
{
|
||||||
$this->data['version']++;
|
$this->data['version']++;
|
||||||
@@ -149,6 +202,16 @@ class Project{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inserts an entity into the SQLite database.
|
||||||
|
* Adds an entity into the database, marking it with the passed status
|
||||||
|
* and version.
|
||||||
|
*
|
||||||
|
* @param \MindEntity $entity
|
||||||
|
* @param integer $vs
|
||||||
|
* @param integer $status
|
||||||
|
* @return integer the inserted entity id(the primary key, itself)
|
||||||
|
*/
|
||||||
public function insertEntity(\MindEntity $entity,
|
public function insertEntity(\MindEntity $entity,
|
||||||
$vs=1,
|
$vs=1,
|
||||||
$status=\COMMIT_STATUS_OK)
|
$status=\COMMIT_STATUS_OK)
|
||||||
@@ -177,6 +240,9 @@ class Project{
|
|||||||
return $enKey;
|
return $enKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The constructor.
|
||||||
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->db= new \MindDB();
|
$this->db= new \MindDB();
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
/*
|
* This file is part of TheWebMind 3rd generation.
|
||||||
* This file is part of theWebMind Project.
|
*
|
||||||
* It offers features to deal with the project table into the database
|
* Notice that, these packages are being used only for documentation,
|
||||||
|
* not to organize the classes.
|
||||||
|
*
|
||||||
|
* @author Felipe Nascimento de Moura <felipenmoura@gmail.com>
|
||||||
|
* @license licenses/mind3rd.license
|
||||||
*/
|
*/
|
||||||
namespace DAO;
|
namespace DAO;
|
||||||
/**
|
/**
|
||||||
* TableFactory: will work with the DAO\Table class
|
* ProjectFactory: will work with the DAO\Project class.
|
||||||
|
* This class will deal with the SQLite database to check for Project's
|
||||||
|
* changes.
|
||||||
*
|
*
|
||||||
* @package VCS
|
* @package VCS
|
||||||
* @subpackage DAO
|
* @subpackage DAO
|
||||||
@@ -14,6 +20,13 @@ namespace DAO;
|
|||||||
*/
|
*/
|
||||||
class ProjectFactory extends Project{
|
class ProjectFactory extends Project{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns if the entity from the SQLite is the same as the entity in the Memory
|
||||||
|
*
|
||||||
|
* @param array $entity1
|
||||||
|
* @param \MindEntity $entity2
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
public function areDifferent(Array $entity1, \MindEntity $entity2)
|
public function areDifferent(Array $entity1, \MindEntity $entity2)
|
||||||
{
|
{
|
||||||
$props= $this->getProperties($entity1);
|
$props= $this->getProperties($entity1);
|
||||||
@@ -55,6 +68,15 @@ class ProjectFactory extends Project{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Saves the current entities
|
||||||
|
*
|
||||||
|
* It will persist the current entities into the SQLite database.
|
||||||
|
* This will also verifies the changes in the previous version and
|
||||||
|
* make the necessary changes.
|
||||||
|
*
|
||||||
|
* @param Array &$currentEntities
|
||||||
|
*/
|
||||||
public function saveEntities(&$currentEntities)
|
public function saveEntities(&$currentEntities)
|
||||||
{
|
{
|
||||||
$enKey= null;
|
$enKey= null;
|
||||||
@@ -86,21 +108,25 @@ class ProjectFactory extends Project{
|
|||||||
foreach($currentEntities as $en)
|
foreach($currentEntities as $en)
|
||||||
{
|
{
|
||||||
$commited= true;
|
$commited= true;
|
||||||
echo "DROPPING ".$en['name']."\n";
|
|
||||||
$this->markAsDopped($en);
|
$this->markAsDopped($en);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($commited)
|
if($commited)
|
||||||
echo "VCS: Commited to version ".$this->data['version']."\n";
|
\Mind::write('commitChanged', true, $this->data['version']);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->data['version']--;
|
$this->data['version']--;
|
||||||
echo "VCS: Nothing to commit...still in version ".
|
\Mind::write('commitUnchanged', true, $this->data['version']);
|
||||||
$this->data['version']."\n";
|
|
||||||
}
|
}
|
||||||
$this->changed= $commited;
|
$this->changed= $commited;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the data from the current version.
|
||||||
|
*
|
||||||
|
* @param integer $vs
|
||||||
|
* @return Array The current version id, version and the project's creator
|
||||||
|
*/
|
||||||
public function getCurrentVersion($vs= false)
|
public function getCurrentVersion($vs= false)
|
||||||
{
|
{
|
||||||
$qr_newProj= "SELECT pk_version,
|
$qr_newProj= "SELECT pk_version,
|
||||||
@@ -121,6 +147,12 @@ class ProjectFactory extends Project{
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Commits the current data to the SQLite database.
|
||||||
|
* It will commit the analyzed structure to the databse into a
|
||||||
|
* new version of the current project, or return a message
|
||||||
|
* of "unchanged"
|
||||||
|
*/
|
||||||
public function commit()
|
public function commit()
|
||||||
{
|
{
|
||||||
$this->changed= false;
|
$this->changed= false;
|
||||||
@@ -141,6 +173,12 @@ class ProjectFactory extends Project{
|
|||||||
$this->db->execute("COMMIT");
|
$this->db->execute("COMMIT");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The DAO\ProjectFactory constructor
|
||||||
|
* It calls the DAO\Project's constructor
|
||||||
|
* @param array $projectData
|
||||||
|
* @param integer $vs
|
||||||
|
*/
|
||||||
public function __construct(Array $projectData, $vs=false)
|
public function __construct(Array $projectData, $vs=false)
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* To change this template, choose Tools | Templates
|
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace DAO;
|
|
||||||
/**
|
|
||||||
* Description of Table
|
|
||||||
*
|
|
||||||
* @author felipe
|
|
||||||
*/
|
|
||||||
class Table extends \MindDB{
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* To change this template, choose Tools | Templates
|
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
|
||||||
namespace DAO;
|
|
||||||
/**
|
|
||||||
* Description of TableFactory
|
|
||||||
*
|
|
||||||
* @author felipe
|
|
||||||
*/
|
|
||||||
class TableFactory extends Table{
|
|
||||||
//put your code here
|
|
||||||
}
|
|
||||||
@@ -82,8 +82,8 @@ abstract class Normal {
|
|||||||
MindRelation &$relation)
|
MindRelation &$relation)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* excluir a relação entre a mais forte e a mais fraca
|
* removes the relation between the stronger to the weaker
|
||||||
* marcar a fk como pk
|
* marks the weaker fks as pks
|
||||||
*/
|
*/
|
||||||
Analyst::unsetRelation( Analyst::$relations[$rel->name.
|
Analyst::unsetRelation( Analyst::$relations[$rel->name.
|
||||||
PROPERTY_SEPARATOR.
|
PROPERTY_SEPARATOR.
|
||||||
|
|||||||
@@ -292,6 +292,8 @@
|
|||||||
->setRefTo($relation->focus, $pk);
|
->setRefTo($relation->focus, $pk);
|
||||||
if(!$entity->selfRef)
|
if(!$entity->selfRef)
|
||||||
$fk->setRequired(true);
|
$fk->setRequired(true);
|
||||||
|
if($relation->linkType == 'must')
|
||||||
|
$fk->setRequired (true);
|
||||||
if($relation->uniqueRef)
|
if($relation->uniqueRef)
|
||||||
{
|
{
|
||||||
if(!$entity->linkTable||
|
if(!$entity->linkTable||
|
||||||
|
|||||||
@@ -6,7 +6,14 @@ aos
|
|||||||
que
|
que
|
||||||
bem
|
bem
|
||||||
também
|
também
|
||||||
|
tambem
|
||||||
tanto
|
tanto
|
||||||
somente
|
somente
|
||||||
por
|
por
|
||||||
em
|
em
|
||||||
|
no
|
||||||
|
na
|
||||||
|
mínimo
|
||||||
|
máximo
|
||||||
|
minimo
|
||||||
|
maximo
|
||||||
Link simbólico
+1
@@ -0,0 +1 @@
|
|||||||
|
mind3rd/projects/
|
||||||
Referência em uma Nova Issue
Bloquear um usuário