3

I am looking for information on how to import existing Worklight code into a Worklight-enabled Eclipse environment.

In addition to importing a project, it seems that it is also possible to import an app and an adapter. What subcomponents would an app and an adapter have to consist of to make them importable and re-usable? Are there any examples of such importable components on the web?

I am aware of this discussion on the IBM support page but am looking for more detail.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
Lennart
  • 69
  • 6
  • In all fairness I don't think the down votes were necessary here. The Getting Started material at http://www-01.ibm.com/software/mobile-solutions/worklight/library/ does not include instructions on how to import a Worklight project. Importing is a very common issue for Eclipse beginners, compounded when working with a platform like Worklight. – joey_g216 Aug 15 '13 at 19:34
  • @JoeGoble, we've updated the training modules (well, one of them) to contain this). – Idan Adar Dec 06 '13 at 05:56
  • @Lennart, if your question is answer, could you please mark it as such? – Idan Adar Dec 06 '13 at 05:57

1 Answers1

2

The below will export and import both apps and adapters belonging to the same project.

Export - In Eclipse, right-click a project and choose Export... choose to export the project as a zip file. Import - In Eclipse, right-click the Project Explorer view and choose Import... choose to import an existing project (your zip file).

An app is contained in the appName folder within the apps folder. And adapter is contained in the adapterName folder within the adapters folder.

There are no mechanisms to export and import the CODE of an adapter or application. You will need to copy-paste the files/folders manually and likely change many references in your files as many locations have different values based on the project name you've used.

Such an approach is highly not recommend by Worklight.


Starting Worklight 6.1, the training modules also contain a portion about how to import projects.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • The worklight automatically generate a separate android project when i add android to my environment. Is it means that i need to import both of the project (two times)? Thanks :D – Blaze Tama Jun 19 '13 at 13:13
  • No. But it does mean that you need to read the Getting Started material, from start to end: http://www-01.ibm.com/software/mobile-solutions/worklight/library/ – Idan Adar Jun 19 '13 at 14:08
  • @IdanAdar I created worklight hybrid project initially only with the iPhone envrionment and that project is there on the repository. Now if I need to import this project in a newly setup worklight envrionment how to do it? I don't have the instance of worklight from which the project was created, so I cannot export project from it. – Javal Nanda Sep 23 '14 at 03:37
  • What "repository"? What are you talking about? If you have a Worklight project and you want to import it to Eclipse - make sure you have Worklight Studio installed. After that, you just select File > Import. – Idan Adar Sep 23 '14 at 04:03