View Javadoc

1   package de.orangecafe.amazonrcp;
2   
3   import org.apache.commons.logging.Log;
4   import org.apache.commons.logging.LogFactory;
5   import org.springframework.richclient.application.ApplicationLauncher;
6   
7   /**
8    * @author Torsten Strasser
9    */
10  public class AmazonRCP {
11      private static final Log logger = LogFactory.getLog(AmazonRCP.class);
12  
13      /**
14  	 * @param args
15  	 */
16  	public static void main(String[] args) {
17          logger.info("AmazonRCP starting up");
18  
19          // In order to launch the platform, we have to construct an
20          // application context that defines the beans (services) and
21          // wiring. This is pretty much straight Spring.
22          //
23          // Part of this configuration will indicate the initial page to be
24          // displayed.
25  
26          // The startup context defines elements that should be available
27          // quickly such as a splash screen image.
28  
29          String startupContextPath = "/amazonrcp-startup-context.xml";
30          String richclientApplicationContextPath = "/amazonrcp-application-context.xml";
31  
32          // The ApplicationLauncher is responsible for loading the contexts,
33          // presenting the splash screen, initializing the Application
34          // singleton instance, creating the application window to display
35          // the initial page.
36          try {
37              new ApplicationLauncher(startupContextPath, new String[] { richclientApplicationContextPath });
38          } catch (RuntimeException e) {
39              logger.error("RuntimeException during startup", e);
40          }
41  
42  
43  
44  /*
45          ClassPathResource resource = new ClassPathResource("service-beans.xml");
46  		BeanFactory factory = new XmlBeanFactory(resource);
47  
48  		IAmazonService client = (IAmazonService) factory.getBean("client");
49  
50          String keyword = "activityspaces";
51  
52          ItemSearchRequest request = (ItemSearchRequest) factory.getBean("itemSearchRequest");
53          request.setKeywords(keyword);
54          request.setSearchIndex("Books");
55          request.getResponseGroup().add("Small");
56  
57          List<Item> items = client.search(request);
58  
59          for (Item item : items) {
60              ItemAttributes itemAttributes = item.getItemAttributes();
61  
62              System.out.print(itemAttributes.getTitle() + ": ");
63  
64              List<String> authorList = itemAttributes.getAuthor();
65  
66              for (String author : authorList) {
67                  System.out.print(author);
68              }
69  
70              System.out.println();
71          }
72  */
73      }
74  }