Parameters

Attribute Description Required
antfile the buildfile to use. Defaults to "build.xml". This file is expected to be a filename relative to the dir attribute given. No
dir the directory to use as a basedir for the new Ant project. Defaults to the current project's basedir, unless inheritall has been set to false, in which case it doesn't have a default value. This will override the basedir setting of the called project. No
target the target of the new Ant project that should be executed. Defaults to the new project's default target. No
output Filename to write the ant output to. This is relative to the value of the dir attribute if it has been set or to the base directory of the current project otherwise. No
inheritAll If true, pass all properties to the new Ant project. Defaults to true. No
inheritRefs If true, pass all references to the new Ant project. Defaults to false. No

Parameters specified as nested elements

property

See the description of the property task.
These properties become equivalent to properties you define on the command line. These are special properties and they will always get passed down, even through additional <*ant*> tasks with inheritall set to false (see above).
Note that the refid attribute points to a reference in the calling project, not in the new one.

reference

Used to choose references that shall be copied into the new project, optionally changing their id.

Attribute Description Required
refid The id of the reference in the calling project. Yes
torefid The id of the reference in the new project. No, defaults to the value of refid.

propertyset

You can specify a set of properties to be copied into the new project with propertysets.

since Ant 1.6.

target

You can specify multiple targets using nested <target> elements instead of using the target attribute. These will be executed as if Ant had been invoked with a single target whose dependencies are the targets so specified, in the order specified.

Attribute Description Required
name The name of the called target. Yes

since Ant 1.6.3.

Basedir of the new project

The basedir value of the new project is affected by the two attributes dir and inheritall, see the following table for details:

dir attribute inheritAll attribute new project's basedir
value provided true value of dir attribute
value provided false value of dir attribute
omitted true basedir of calling project (the one whose build file contains the <ant> task).
omitted false basedir attribute of the <project> element of the new project

Examples

<ant antfile="subproject/subbuild.xml" target="compile"/>

<ant dir="subproject"/>

<ant antfile="subproject/property_based_subbuild.xml">
<property name="param1" value="version 1.x"/>
<property file="config/subproject/default.properties"/>
</ant>

<ant inheritAll="false" antfile="subproject/subbuild.xml">
<property name="output.type" value="html"/>
</ant>

These lines invoke the same build file:

<ant antfile="sub1/sub2/build.xml" />
<ant antfile="sub2/build.xml" dir="sub1" />
<ant antfile="build.xml" dir="sub1/sub2" />

The build file of the calling project defines some <path> elements like this:

<path id="path1">
...
</path>
<path id="path2">
...
</path>

and the called build file (subbuild.xml) also defines a <path> with the id path1, but path2 is not defined:

<ant antfile="subbuild.xml" inheritrefs="true"/>

will not override subbuild's definition of path1, but make the parent's definition of path2 available in the subbuild.

<ant antfile="subbuild.xml"/>

as well as

<ant antfile="subbuild.xml" inheritrefs="false"/>

will neither override path1 nor copy path2.

<ant antfile="subbuild.xml" inheritrefs="false">
<reference refid="path1"/>
</ant>

will override subbuild's definition of path1.

<ant antfile="subbuild.xml" inheritrefs="false">
<reference refid="path1" torefid="path2"/>
</ant>

will copy the parent's definition of path1 into the new project using the id path2.

이올린에 북마크하기(0) 이올린에 추천하기(0)

Trac 소스 브라우저에서 소스를 컬러풀 하게 보려면
클라이언트의 설정을 손봐야 한다

해당 되는 내용은 여기에 있고 5번 항목에서 설정해야 하는 값을 정리해보았습니다.

아래와 같이 하면 왠만한 java 기반의 프로젝트에서는 컬러풀하게 볼수 있을 것입니다.

*.java = svn:mime-type=text/x-java
*.jsp = svn:mime-type=text/x-java
*.htm = svn:mime-type=text/html
*.html = svn:mime-type=text/html
*.js = svn:mime-type=text/javascript
*.xml = svn:mime-type=text/xml

이올린에 북마크하기(0) 이올린에 추천하기(0)

WEBLOGIC SERVER와 SPRING 통합

이올린에 북마크하기(0) 이올린에 추천하기(0)

개인적으로는 EJB 사용을 그리좋아 하지 않는다.
장점으로 내세우는 점이 실제로 그렇게 와닿지 않아서 그런듯하다. 특히나 최근들어서는..(대체 기술들이 계속 나오고 있으니..)

그런 논지가 있다.(실은 만구 내생각인지도..ㅋㅋ)

겪어 보면 혹은, 겪어봐야 해당 기술의 장점을 뼈져리게 느끼고 파고들고 많이 사용하게 된다는..

근데 그걸 솔직히 느껴보질 못했다.

아무튼 스프링의 대가인 토비(이일민)님의 블로그에서 좋은글이 있어 링크를 걸어둔다.
스프링의 아빠인 로드 존슨의 J2EE Development without EJB 이라는 책을 읽으면서 느낀점을 써주신거 같다.
저책은 유명한데 저책에서 로드 존슨이 샘플 어플리케이션을 작성하면서 확장이 된것이 오늘의 스프링으로 알고 있다.

완전 퍼오고 싶지만 예의상 도리가 아닌거 같다.
대신 해당글 지우시면 안되요 토비님.. ^^;;

자.. 나간다..

J2EE Development without EJB (1) - Why "J2EE Without EJB"?

J2EE Development without EJB (2) - Goal

J2EE Development without EJB (3) - Architecture

J2EE Development without EJB (4) - The Simplicity Dividened

J2EE Development without EJB (5) - EJB, Five Years On

J2EE Development without EJB (6) - Lightweight Container & IoC

J2EE Development without EJB 정리는 이만



이올린에 북마크하기(0) 이올린에 추천하기(0)

최근데 Trac 을 적용하다가 소스 브라우저에서 Syntax Highlight 가 안되었다.
그냥 넘어가도 되는데 내가 소스는 절대로 Syntax Highlight 가 되어야 한다든 고집이 있어서리..

그래서 보니까 svn:mime-type 이 그냥 text/plain 으로 저정이 되어있었다..

svn:mime-type 이 text/x-java 로 되면 되는건데 매번 커밋하고 다시 또 바꿔주고 하는것도 번거롭고
이클립스에서 한번에 Set Property 하는것도 괜찮긴 하지만 번거롭긴 마찬가지고 쓸데없이
리비젼 넘버만 늘어난다. 그래서 구글링 하다 보니 좋은 방법을 알아냈다.

우선

~/.subversion/config  파일에서
[miscellany] 영역enable-auto-props = yes 부분의 주석을 풀어주고

하단의 [auto-props] 영역에 *.java = svn:mime-type=text/x-java 이런식으로 달아주면 된다.
나머지 파일들도 마찬가지이다.

이렇게 각각 파일에 맞게 세팅해주면 Trac 은 내부적으로 enscript 나 Silvercity 같은 소스코드의 Syntax Highlight 라이브러리를 이용한 기능을 지원하므로 소스 브라우저에서 소스가 컬러풀 하게 보여지게 된다.

이상... 다음에는 삽질 하지 말자..

첨언 : 혹시나.. 이 설정은 서버에 하는것이 아니라 클라이언트에 하는 것입니다. 혹시나 헷갈릴수도 있으므로..(제가 그랬음..ㅠㅠ)
이올린에 북마크하기(0) 이올린에 추천하기(0)

  • 하드디스크가 맛탱이가 갔다. 살려보려고 하루 반을 노력했건만.. 결국 운명하셨다.. 아씨.. 내 주말을 돌리도~~~~~~ (하드디스크 깨짐 주말 아까버 열받어) 2008-05-13 09:32:15
  • 시게이트 하드 교환 받았다.. 이게 두번째로 쓰는 시게이트 하드인데.. 예전에도 맛이가서 교환했었는데 또 그러네.. 나랑은 악연이구먼.. (하드디스크 오류 시게이트 교환 악연) 2008-05-13 16:58:21
  • 스프링 공부 다시 시작. 써먹을데가 있어서.. (Spring Framework java 공부) 2008-05-13 16:59:40

이 글은 nuno님의 2008년 5월 13일의 미투데이 내용입니다.


간만에 포스팅인데.. 짜증을 좀 낼꺼 같다..

얼마전에 회사 자기계발비로 PC 를 하나 장만했다.
사양은 아주 좋지는 않지만.. 괜찮은 편이다..
기존에는 하고 싶어도 못했던 3D 게임도 잘되고.. (근데 막상 할만한 게임이 없넹.. 시간도 없고..)

WindowsXP 를 설치를 했다. 근데 메모리가 4G 인데 3.25 밖에 안잡힌다..
알아보니 32bit 로 XP 를 설치 하면 그렇게 밖에 안잡힌다네..

4G 를 Full 로 쓰려면 Vista 64bit 를 설치 하란다..쩝..

그래서 다시 설치를 했었다.. 몇몇 프로그램이 안깔리거나 오작동하는거 말고는 그런데로 쓸만한거 같다
어차피 32bit 어플리케이션은 WOW(Window on Window) 로 지원하니까 크게 불편한거는 없었다..

그런데.....

그런데 미뤄뒀던 개발 환경을 세팅하려고 하다 보니 쫌 짜증이 나는군...

왠만한건 64bit 로 맞출려고 해서 JDK 도 64bit 로 설치를 했는데 톰캣은 64bit 용이 없더군.. 그래서 일단은
실행을 해봤는데 아니나 다를까 내부적으로 JNI 로 jvm.dll 모듈을 로딩하다가 에러가 나는거 같다..
아쉽지만 JDK 를 32bit 로 복귀.. 그러니까 톰캣도 제대로 잘 돌아간다.
MySQL 은 64bit 로 잘돌아 가는군..

문제는 이클립스... 아효..

이클립스 유로파를 설치 했는데.. 머 걍 코딩 하고 컴파일 하고 하는거에는 별 상관이 없는데
파일 인코딩을 바꿀려고 프로퍼티로 가니깐.. 이건머.. 글이 안나온다..
이걸 어케설명해야 하나.. 암튼.. 먼가를 할수 없을 정도로 화면이 이상하게 나온다..쩝..

혹시나 구글링을 해보니 나랑 비슷한 사람들이 있다..

그래서 그냥 이클립스를 3.4 M7 WPF 지원 버전을 설치 했다..
그러니까 이제 나오기는 제대로 나온다..
J2EE & Dynamic Web Project 를 위해서 WTP 를 설치 했다..

아직 정식 버전이 아니라서 그런지.. 약간의 버그도있는거 같고.. 또 몇몇 변경되거나 추가된 기능도 보인다.
한글 폰트도 비스타용 폰트라 그런지 약간은 어색하기도 하고..

어쨋든 오늘 삽질 꽤나 했다..

결론은 아직은.. PC 환경으로는 64bit 는 아직 멀은거 같다..

이올린에 북마크하기(0) 이올린에 추천하기(0)

<sql /> 이라는 Element 를 사용한 것인데 꽤 괜찮은 기능이다..
예제는 다음과 같음.
조금만 살펴 보면 알수 있다.

<sql id="select-order">
 select * from order
</sql>

<sql id="select-count">
 select count(*) as value from order
</sql>

<sql id="where-shipped-after-value">
 <![CDATA[
  where shipDate > #value:DATE#
 ]]>
</sql>

<select
 id="getOrderShippedAfter"
 resultClass="map">
 <include refid="select-order" />
 <include refid="whre-shipped-after-value" />
</select>

<select
 id="getOrderCountShipped-after-value"
 resultClass="int">
 <include refid="select-count" />
 <include refid="whre-shipped-after-value" />
</select>

이올린에 북마크하기(0) 이올린에 추천하기(0)

출처 : http://openframework.or.kr/JSPWiki/Wiki.jsp?page=QueryForMapExample

SqlMapConfig.xml

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE sqlMapConfig      
    PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"      
    "http://ibatis.apache.org/dtd/sql-map-config-2.dtd">

<sqlMapConfig>

  <!-- Configure a built-in transaction manager.  If you're using an
       app server, you probably want to use its transaction manager
       and a managed datasource -->
  <transactionManager type="JDBC" commitRequired="false">
    <dataSource type="SIMPLE">
      <property name="JDBC.Driver" value="com.mysql.jdbc.Driver"/>
      <property name="JDBC.ConnectionURL" value="jdbc:mysql://localhost/ibatis_sample"/>
      <property name="JDBC.Username" value="root"/>
      <property name="JDBC.Password" value="root"/>
    </dataSource>
  </transactionManager>  
  <!-- List the SQL Map XML files. They can be loaded from the
       classpath, as they are here (com.domain.data...) -->
  <sqlMap resource="com/mydomain/data/Account.xml"/>
</sqlMapConfig>

SimpleExample

package com.mydomain.data;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;
import com.ibatis.common.resources.Resources;
import com.mydomain.domain.Account;

import java.io.Reader;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.sql.SQLException;

public class SimpleExample {

  private static SqlMapClient sqlMapper;

  static {
    try {
      Reader reader = Resources.getResourceAsReader("com/mydomain/data/SqlMapConfig.xml");
      sqlMapper = SqlMapClientBuilder.buildSqlMapClient(reader);
      reader.close();
    } catch (IOException e) {
      // Fail fast.
      throw new RuntimeException("Something bad happened while building the SqlMapClient instance." + e, e);
    }
  }
 
............

  public static Map selectAccountMap() throws SQLException {
    return sqlMapper.queryForMap("selectAllAccounts", null, "id");
  }
 
  public static Map selectAccountMapValue() throws SQLException {
    return sqlMapper.queryForMap("selectAllAccounts", null, "id", "emailAddress");
  }
}

Account.java

package com.mydomain.domain;

public class Account {

  private int id;
  private String firstName;
  private String lastName;
  private String emailAddress;

  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  public String getFirstName() {
    return firstName;
  }

  public void setFirstName(String firstName) {
    this.firstName = firstName;
  }

  public String getLastName() {
    return lastName;
  }

  public void setLastName(String lastName) {
    this.lastName = lastName;
  }

  public String getEmailAddress() {
    return emailAddress;
  }

  public void setEmailAddress(String emailAddress) {
    this.emailAddress = emailAddress;
  }

}

Account.xml

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE sqlMap      
    PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"      
    "http://ibatis.apache.org/dtd/sql-map-2.dtd">

<sqlMap namespace="Account">

  <!-- Use type aliases to avoid typing the full classname every time. -->
  <typeAlias alias="Account" type="com.mydomain.domain.Account"/>

  <!-- Result maps describe the mapping between the columns returned
       from a query, and the class properties.  A result map isn't
       necessary if the columns (or aliases) match to the properties
       exactly. -->
  <resultMap id="AccountResult" class="Account">
    <result property="id" column="ACC_ID"/>
    <result property="firstName" column="ACC_FIRST_NAME"/>
    <result property="lastName" column="ACC_LAST_NAME"/>
    <result property="emailAddress" column="ACC_EMAIL"/>
  </resultMap>

  <!-- Select with no parameters using the result map for Account class. -->
  <select id="selectAllAccounts" resultMap="AccountResult">
    select * from ACCOUNT
  </select>
</sqlMap>

설명

queryForMap() 메소드를 메소드 인자의 형태에 따라 두가지가 제공된다.
- queryForMap(String id, Object parameterObject, String keyProp)
- queryForMap(String id, Object parameterObject, String keyProp, String valueProp)

queryForMap(String id, Object parameterObject, String keyProp)

예제 소스의 SimpleExample에 보면 다음처럼 사용한 경우가 있다.

public static Map selectAccountMap() throws SQLException {
  return sqlMapper.queryForMap("selectAllAccounts", null, "id");
}

여기서 인자를 순서대로 보면 첫번째 인자는 Account.xml에서 "selectAllAccounts" 라는 id를 가리키는 것으로 다음 쿼리문을 실행하도록 지정하는 셈이다.

select * from ACCOUNT

두번째 인자는 parameter객체를 나타내는 것으로 현재 예제에서는 일단 전체 레코를 가져오는 것이라 조회조건을 나타내기 위한 파라미터 객체가 없다. 그래서 null로 지정했다. 조건문을 만들고자 할때는 이 객체를 적절히 셋팅해서 전달하면 된다.

세번째 인자는 queryForMap() 메소드 호출로 인해 반환되는 Map에서 key역할을 담당하는 것으로 여기서 반환되는 객체는 Account라는 객체를 가지는 Map객체이다. 현재 데이터가 다음과 같다면 두개의 Account객체가 넘어오는데 여기서 id가 1인 Account와 2인 Account를 구별하기 위한 Map의 키 역할을 담당할 칼럼을 지정하는 의미라고 보면 이해가 빠를듯 하다. 하지만 여기서 주의할 점은 세번째 인자의 값을 칼럼명이 아닌 해당 칼럼에 대응되는 Account객체의 변수명을 지정해줘야 한다는 것이다.

mysql> select * from account;
+--------+----------------+---------------+------------------+
| ACC_ID | ACC_FIRST_NAME | ACC_LAST_NAME | ACC_EMAIL        |
+--------+----------------+---------------+------------------+
| 1      | DongGuk        | Lee           | fromm0@gmail.com |
| 2      | DongGuk        | Lee           | fromm0@gmail.com |
+--------+----------------+---------------+------------------+
2 rows in set (0.00 sec)

이론적으로는 이렇게 실제 테스트 코드를 돌려보자.

Map map = SimpleExample.selectAccountMap();
System.out.println("# Map 정보 \n"+map);
     
account = (Account) map.get(1);
System.out.println("# id : " + account.getId());
System.out.println("# emailAddress : " + account.getEmailAddress());
System.out.println("# firstName : " + account.getFirstName());
System.out.println("# lastName : " + account.getLastName());

결과는 다음과 같다

# Map 정보
{2=com.mydomain.domain.Account@3eca90, 1=com.mydomain.domain.Account@64dc11}
# id : 1
# emailAddress : fromm0@gmail.com
# firstName : DongGuk
# lastName : Lee

queryForMap(String id, Object parameterObject, String keyProp, String valueProp)

예제 소스의 SimpleExample에 보면 다음처럼 사용한 경우가 있다.

public static Map selectAccountMapValue() throws SQLException {
  return sqlMapper.queryForMap("selectAllAccounts", null, "id", "emailAddress");
}

인자는 네번째를 제외하고는 앞의 예제와 동일하다. 네번째 인자는 Account객체에서 어떤값만 반환받을지는 결정하는 값이라고 보면 된다. 여기서는 selectAccountMapValue() 메소드에서 볼수 있듯이 emailAddress만을 반환받고자 했다.

이론적으로는 이렇게 실제 테스트 코드를 돌려보자.

map = SimpleExample.selectAccountMapValue();
System.out.println("# Map 정보 \n"+map);
String email = (String) map.get(1);      
System.out.println("# 반환값 : " + email);

결과는 다음과 같다.

# Map 정보
{2=fromm0@gmail.com, 1=fromm0@gmail.com}
# 반환값 : fromm0@gmail.com
이올린에 북마크하기(0) 이올린에 추천하기(0)

내가 딱 원하던 기능이다..ㅎㅎ
대충 이런식으로 job을 설정이 가능하다..

<?xml version='1.0' encoding='utf-8'?>

<quartz>

<job>
<job-detail>
<name>ScanDirectory</name>
<group>DEFAULT</group>
<description>
A job that scans a directory for files
</description>
<job-class>
org.cavaness.quartzbook.chapter3.ScanDirectoryJob
</job-class>
<volatility>false</volatility>
<durability>false</durability>
<recover>false</recover>
<job-data-map allows-transient-data="true">
<entry>
<key>SCAN_DIR</key>
<value>c:\quartz-book\input</value>
</entry>
</job-data-map>
</job-detail>

<trigger>
<simple>
<name>scanTrigger</name>
<group>DEFAULT</group>
<job-name>ScanDirectory</job-name>
<job-group>DEFAULT</job-group>
<start-time>2005-06-10 6:10:00 PM</start-time>
<!-- repeat indefinitely every 10 seconds -->
<repeat-count>-1</repeat-count>
<repeat-interval>10000</repeat-interval>
</simple>
</trigger>

</job>
</quartz>

이올린에 북마크하기(0) 이올린에 추천하기(0)

'IT 관련 > Java' 카테고리의 다른 글

iBatis 꽤 맘에 드는