Results 1 to 6 of 6

Thread: Renaming sample project

  1. #1

    Default Renaming sample project

    I want to use spring RCP for a project.
    I want to rename the project (samples/petclinic) to another name.
    What all do I have to do ? I renamed the most things I think. (.java, .xml etc)
    But now there is still a file spring-petclinic.jar in the lib/spring directory

    How do I rebuild that file to spring-myproject.jar?

    Thnx

  2. #2
    Join Date
    Aug 2004
    Location
    Switzerland
    Posts
    32

    Default

    Hi,

    spring-petclinic.jar belongs to springframework and not to spring-rich. If you want to change the buildname of this file you will have to do it on the build.xml of springframework. Or you just rename the file itself and adjust the classpath!


    siu
    Claudio

    Why rename all sample classes, just start a plain new project?

  3. #3

    Default

    how do I start a plain new project?
    I tried, but I don't now what I need and how to do it.

    I am using Eclipse 3.0.1

  4. #4
    Join Date
    Aug 2004
    Location
    Switzerland
    Posts
    32

    Default

    Hi

    try these steps:

    - Create new java project
    - Copy all libraries used for the petclinic sample appication to your lib folder.
    - Create a src file structure similar to the petclinic ( ui, ctx)
    - Copy (to the ctx package) and adjust the context files ( richclient-application-context.xml, richclient-startup-context.xml, commands-context.xml)
    - Copy (to the ctx package) and adjust the image and language resource files to the ui package( images.properties, message.properties).
    - Create your own start class (like PetClinicStandalone.java)
    - Start to programm your view

    Sample context file (replace the bold text with your own values)

    ==============================
    Richclient-application-context.xml
    ==============================
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">
    <!-- $Id: richclient-application-context.xml,v 1.20 2004/11/18 23:33:21 ohutchison Exp $ -->
    <beans>

    <bean id="application"
    class="org.springframework.richclient.application. Application">
    <constructor-arg index="0">
    <ref bean="applicationDescriptor"/>
    </constructor-arg>
    <constructor-arg index="1">
    <ref bean="myOwnLifecycleAdvisor"/>
    </constructor-arg>
    </bean>

    <bean id="myOwnLifecycleAdvisor"
    class="org.springframework.richclient.application. config.DefaultApplicationLifecycleAdvisor">
    <property name="windowCommandBarDefinitions">
    <value>path/to/your/ctx/commands-context.xml</value>
    </property>
    <property name="startingPageId">
    <value>HERE_YOU_CAN_PUT_YOUR_OWN_VIEW</value>
    </property>
    </bean>

    <bean id="applicationDescriptor" class="org.springframework.richclient.application. ApplicationDescriptor">
    <property name="version">
    <value>1.0</value>
    </property>
    <property name="buildId">
    <value>20041025001</value>
    </property>
    </bean>

    <bean id="applicationObjectConfigurer"
    class="org.springframework.richclient.application. config.DefaultApplicationObjectConfigurer">
    <constructor-arg index="0">
    <ref bean="messageSource"/>
    </constructor-arg>
    <constructor-arg index="1">
    <ref bean="imageSource"/>
    </constructor-arg>
    <constructor-arg index="2">
    <ref bean="iconSource"/>
    </constructor-arg>
    </bean>

    <bean id="applicationEventMulticaster"
    class="org.springframework.context.event.SimpleApp licationEventMulticaster"/>

    <bean id="componentFactory"
    class="org.springframework.richclient.factory.Defa ultComponentFactory">
    <property name="iconSource">
    <ref bean="iconSource"/>
    </property>
    <property name="messageSource">
    <ref bean="messageSource"/>
    </property>
    </bean>

    <bean id="lookAndFeelConfigurer"
    class="org.springframework.richclient.application. config.JGoodiesLooksConfigurer">
    <property name="theme">
    <bean class="com.jgoodies.plaf.plastic.theme.ExperienceB lue"/>
    </property>
    </bean>

    <bean id="messageSource"
    class="org.springframework.context.support.Resourc eBundleMessageSource">
    <property name="basenames">
    <list>
    <value>your.ui.package.samples.petclinic.ui.messag es</value>
    <value>org.springframework.richclient.application. messages</value>
    </list>
    </property>
    </bean>

    <bean id="imageResourcesFactory"
    class="org.springframework.context.support.Resourc eMapFactoryBean">
    <property name="locations">
    <list>
    <value>classpath:org/springframework/richclient/image/images.properties</value>
    <value>classpath:your/ui/path/images.properties</value>
    </list>
    </property>
    <property name="resourceBasePath">
    <value>images/</value>
    </property>
    </bean>

    <bean id="imageSource"
    class="org.springframework.richclient.image.Defaul tImageSource">
    <constructor-arg index="0">
    <ref bean="imageResourcesFactory"/>
    </constructor-arg>
    <property name="brokenImageIndicator">
    <value>images/alert/error_obj.gif</value>
    </property>
    </bean>

    <bean id="iconSource"
    class="org.springframework.richclient.image.Defaul tIconSource">
    <constructor-arg index="0">
    <ref bean="imageSource"/>
    </constructor-arg>
    </bean>

    <bean id="formComponentInterceptorFactory"
    class="org.springframework.richclient.form.builder .support.ChainedInterceptorFactory">
    <property name="interceptorFactories">
    <list>
    <bean class="org.springframework.richclient.form.builder .support.ColorValidationInterceptorFactory">
    <property name="errorColor">
    <value>255,245,245</value>
    </property>
    </bean>
    <bean class="org.springframework.richclient.form.builder .support.OverlayValidationInterceptorFactory"/>
    <bean class="org.springframework.richclient.text.TextCom ponentPopupInterceptorFactory"/>
    <bean class="org.springframework.richclient.list.ComboBo xAutoCompletionInterceptorFactory">
    <property name="messageSource">
    <ref bean="messageSource"/>
    </property>
    </bean>
    </list>
    </property>
    </bean>

    </beans>



    ==============================
    commands-context.xml
    ==============================
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>

    <bean id="windowCommandManager"
    class="org.springframework.richclient.application. support.ApplicationWindowCommandManager">
    <property name="sharedCommandIds">
    <list>
    <value>saveAsCommand</value>
    <value>propertiesCommand</value>
    <value>undoCommand</value>
    <value>redoCommand</value>
    <value>cutCommand</value>
    <value>copyCommand</value>
    <value>pasteCommand</value>
    <value>selectAllCommand</value>
    <value>deleteCommand</value>
    </list>
    </property>
    </bean>

    <bean id="menuBar"
    class="org.springframework.richclient.command.Comm andGroupFactoryBean">
    <property name="members">
    <list>
    <ref bean="fileMenu"/>
    <ref bean="editMenu"/>
    <ref bean="windowMenu"/>
    <ref bean="helpMenu"/>
    </list>
    </property>
    </bean>

    <bean id="toolBar"
    class="org.springframework.richclient.command.Comm andGroupFactoryBean">
    <property name="members">
    <list>
    <value>saveAsCommand</value>
    </list>
    </property>
    </bean>

    <bean id="fileMenu"
    class="org.springframework.richclient.command.Comm andGroupFactoryBean">
    <property name="members">
    <list>
    <bean class="org.springframework.richclient.command.supp ort.ExitCommand"/>
    </list>
    </property>
    </bean>



    <bean id="editMenu"
    class="org.springframework.richclient.command.Comm andGroupFactoryBean">
    <property name="members">
    <list>
    <value>undoCommand</value>
    <value>redoCommand</value>
    <value>separator</value>
    <value>cutCommand</value>
    <value>copyCommand</value>
    <value>pasteCommand</value>
    <value>separator</value>
    <value>selectAllCommand</value>
    <value>deleteCommand</value>
    </list>
    </property>
    </bean>

    <bean id="windowMenu"
    class="org.springframework.richclient.command.Comm andGroupFactoryBean">
    <property name="members">
    <list>
    <bean class="org.springframework.richclient.command.supp ort.NewWindowCommand"/>
    <value>separator</value>
    <bean class="org.springframework.richclient.command.supp ort.ShowViewMenu"/>
    </list>
    </property>
    </bean>

    <bean id="helpMenu"
    class="org.springframework.richclient.command.Comm andGroupFactoryBean">
    <property name="members">
    <list>
    <ref bean="helpContentsCommand"/>
    <value>separator</value>
    <ref bean="aboutCommand"/>
    </list>
    </property>
    </bean>

    <bean id="helpContentsCommand"
    class="org.springframework.richclient.command.supp ort.HelpContentsCommand"/>
    </beans>


    ==============================
    richclient-startup.xml
    ==============================
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">
    <!-- $Id: richclient-startup-context.xml,v 1.2 2004/10/01 14:50:11 kdonald Exp $ -->
    <beans>
    <bean id="splashScreen"
    class="org.springframework.richclient.application. SplashScreen"
    singleton="false">
    <property name="imageResourcePath">
    <value>/images/splash-screen.jpg</value>
    </property>
    </bean>
    </beans>

    hope it helps

  5. #5

    Default

    Thnx, I think it works

  6. #6
    Join Date
    Sep 2004
    Location
    Ghent, Belgium
    Posts
    224

    Default

    claudio,

    great work, could you put it on the wiki?

    thx,

    Peter

Similar Threads

  1. Replies: 3
    Last Post: Jun 22nd, 2010, 08:15 PM
  2. Cannot reference my spring config files from another project
    By lorelia in forum SpringSource Tool Suite
    Replies: 4
    Last Post: Aug 30th, 2005, 01:52 AM
  3. Contacts Sample login confusion
    By jdoklovic in forum Security
    Replies: 1
    Last Post: Mar 10th, 2005, 08:02 PM
  4. Build as Web Library Project in WSAD?
    By joeparks in forum Web
    Replies: 2
    Last Post: Nov 23rd, 2004, 06:23 AM
  5. Error during renaming in Petclinic sample
    By Patrick Vanhuyse in forum Swing
    Replies: 1
    Last Post: Oct 11th, 2004, 03:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •