Arquivo

Arquivo de abril, 2010

SVN, Eclipse, Linux

23, abril, 2010 6 comentários

Salve pessoal gente boa !

Hoje quero passar aqui para dar uma ajuda quem vai instalar o SVN no linux e poder sincronizar com o Eclipse no seu windows ou linux e afins.

bem vamos la partindo do principio que o seu linux esta cabaço (virgem da silva).

subversion: Controlador de versão.

libapache2-svn: Biblioteca de integração entre apache e subversion.

apache2: Servidor Web Apache

entao no seu console digite

# sudo apt-get install subversion libapache2-svn apache2

depois de ter instalado o apache agora é mandar brasa no resto.

seguindo

# sudo apt-get install subversion libapache2-svn

Quando terminar de instalar vamos configurar o arquivo do svn seja com o seu joe ou vi
Observe que criei uma pasta no /var a pasta svn (mkdir svn apliquei as permissoes chmod 0777 na pasta).

Supondo que você esteja na pasta /var

# mkdir svn

Depois

# chmod 0777 /var/svn -R
# sudo joe /etc/apache2/mods-enabled/dav_svn.conf
# dav_svn.conf - Example Subversion/Apache configuration
#
# For details and further options see the Apache user manual and
# the Subversion book.
#
# NOTE: for a setup with multiple vhosts, you will want to do this
# configuration in /etc/apache2/sites-available/*, not here.
 
# <Location URL> ... </Location>
# URL controls how the repository appears to the outside world.
# In this example clients access the repository as http://hostname/svn/
# Note, a literal /svn should NOT exist in your document root.
<Location /svn>
 
  # Uncomment this to enable the repository
  DAV svn
 
  # Set this to the path to your repository
  #SVNPath /var/lib/svn
  # Alternatively, use SVNParentPath if you have multiple repositories under
  # under a single directory (/var/lib/svn/repo1, /var/lib/svn/repo2, ...).
  # You need either SVNPath and SVNParentPath, but not both.
  SVNParentPath /var/svn
 
  # Access control is done at 3 levels: (1) Apache authentication, via
  # any of several methods.  A "Basic Auth" section is commented out
  # below.  (2) Apache <Limit> and <LimitExcept>, also commented out
  # below.  (3) mod_authz_svn is a svn-specific authorization module
  # which offers fine-grained read/write access control for paths
  # within a repository.  (The first two layers are coarse-grained; you
  # can only enable/disable access to an entire repository.)  Note that
  # mod_authz_svn is noticeably slower than the other two layers, so if
  # you don't need the fine-grained control, don't configure it.
 
  # Basic Authentication is repository-wide.  It is not secure unless
  # you are using https.  See the 'htpasswd' command to create and
  # manage the password file - and the documentation for the
  # 'auth_basic' and 'authn_file' modules, which you will need for this
  # (enable them with 'a2enmod').
  AuthType Basic
  AuthName "Subversion Repository"
  AuthUserFile /etc/apache2/dav_svn.passwd
 
  # To enable authorization via mod_authz_svn
  #AuthzSVNAccessFile /etc/apache2/dav_svn.authz
 
  # The following three lines allow anonymous read, but make
  # committers authenticate themselves.  It requires the 'authz_user'
  # module (enable it with 'a2enmod').
  #<LimitExcept GET PROPFIND OPTIONS REPORT>
    #Require valid-user
  #</LimitExcept>
</Location>

Pronto, só falta adicionar os usuários, para isso utilize o comando abaixo:

# sudo htpasswd -cm /etc/apache2/dav_svn.passwd seu_usuario

Vai pedir a senha e repetir a senha você segue normalmente os passos até finalizar o procedimento.

Próximo passo é criar um repositorio.

# sudo svnadmin create /var/svn/teste

Reinicie o apache dessa forma

# sudo /etc/init.d/apache2 force-reload

Se aparecer isso você instalou com sucesso.
“Revision 0″

Importando seu projeto para o repositorio.

# svn import /pasta/seuprojeto http://localhost/svn/teste

Baixando o Svn para fazer checkout no Eclipse.
Com o Eclipse aberto va em Help/Software Update

Na aba Avaiable Software
Add Site

Adicione http://subclipse.tigris.org/update_1.4.x e Ok.

Espere carregar e Desmarque o Mylyn

e depois clique em Install ao final reinicie a IDE ( ele pede se você quer reiniciar a IDE clique OK )

Depois de intalado… com o Eclipse aberto va em File / New / Other / Svn / Checkout Projects from SVN

Next

Create new Repository

adicione o endereco http://localhost/svn/teste ( ou o ip do seu servidor svn no lugar de localhost )

Next

Selecione a linha do http e Finish. pronto tera seu projeto do svn no Eclipse.

Ate o proximo post onde explicarei como desfrutar do SVN, controle de Versoes, Revisoes.

Felipe o/

Share on Facebook
Categories: Eclipse, Linux Tags:

Alert, Informação, Erro, Confirmação Flex Action Script

17, abril, 2010 7 comentários

Boa Tarde !

Galera vou postar um Código de um extends de um Alert do flex disponivel em mx.controls.Alert;
O mesmo tem um estilo css com tres funcoes staticas par uso.

Vamos ao codigo do extends do Alert

package br.com.fborella
{
	import mx.controls.Alert;
 
	public class HAlert extends Alert
	{		
		[Embed(source="img/alert_error.gif")]
		private static var ErrorIcon:Class;
 
		[Embed(source="img/alert_info.gif")]
		private static var InfoIcon:Class;
 
		[Embed(source="img/alert_confirm.gif")]
		private static var ConfirmIcon:Class;
 
		public function HAlert(){
			super();
		}
 
		public static function informacao(message:String, closehandler:Function=null):void{
			show(message, "Informação", Alert.OK, null, closehandler, InfoIcon);
		}
 
		public static function erro(message:String, closehandler:Function=null):void{
			show(message, "Erro", Alert.OK, null, closehandler, ErrorIcon);
		}
 
		public static function confirmacao(message:String, closehandler:Function=null):void{
			show(message, "Confirmação", Alert.YES | Alert.NO, null, closehandler, ConfirmIcon);
		}
	}
}

Tambem nas minhas aplicações costumo usar um serviço de mensagens padrão onde defino as mensagens constantes e depois só uso no decorrer da aplicação.

package br.com.fborella
{
	import mx.utils.StringUtil;
 
	public class HMensagens{
 
		public static const Requerido:String = "Este campo é requerido!";
		public static const Numeros:String = "Apenas números são permitidos!";
		public static const ShortString:String = "Informe {0} caracteres ou mais para este campo!";
		public static const LongString:String = "Informe {0} caracteres ou menos para este campo!";
		public static const ErroExcluir:String = 'O registro não pode ser excluído.' + 
									'\nSe o problema persistir contate o administrador do sistema';
		public static const ErroSalvar:String = 'O registro não pode ser salvo.' + 
									'\nSe o problema persistir contate o administrador do sistema';									
		public static const TituloMensagem:String = 'Holma Software';
		public static const SucessoExcluido:String = 'Resitro excluido com sucesso!';
		public static const ConfirmaExcluir:String = 'Confirma a exclusão do registro?';
		public static const ConsultaEmBranco:String = 'Não foi encontrado nenhum registro';
		public static const TelaNaoPodeSerFechada:String = 'Alteração ou inserção não concluída, ' + 
									'\na tela não pode ser fechada';
		public static const SelecioneAlterar:String = 'Selecione um(a) registro para alterar';									
		public static const SelecioneExcluir:String = 'Selecione um(a) registro para excluir';		
	}
 
}

O resultado de tudo isso junto é o código a seguir.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
	backgroundColor="#333333" width="100%" height="250">
	<mx:Style source="css/estilo.css"/>
 
	<mx:Script>
		<![CDATA[
			import mx.events.CloseEvent;
			import br.com.fborella.HMensagens;
			import br.com.fborella.HAlert;
			import mx.controls.Alert;
 
			private function excluir():void
			{
				HAlert.confirmacao(HMensagens.ConfirmaExcluir,confirmaExcluir);
			}
 
			private function confirmaExcluir(event:CloseEvent):void
			{
				if (event.detail == Alert.YES)	
				{
					HAlert.informacao(HMensagens.SucessoExcluido);
				}
			}			
		]]>
	</mx:Script>
	<mx:Button x="37" y="36" label="Confirmacao" width="200"
		click="excluir()"/>
 
	<mx:Button x="37" y="66" label="Erro" width="200"
		click="HAlert.erro(HMensagens.ErroExcluir);"/>
 
	<mx:Button x="37" y="96" label="Informacao" width="200"
		click="HAlert.informacao(HMensagens.SelecioneAlterar);"/>
 
</mx:Application>

O fonte esta disponivel aqui.

Projeto rodando.

era isso ai abraço

Felipe.

Share on Facebook
Categories: Profissional Tags: