Bug 253860 - [fiximprove]: workspace level Symbol Set import/export/duplicate
Summary: [fiximprove]: workspace level Symbol Set import/export/duplicate
Status: CLOSED FIXED
Alias: None
Product: MTJ (Archived)
Classification: Tools
Component: UI (show other bugs)
Version: 0.9   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.9.1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, core, ui
Depends on:
Blocks:
 
Reported: 2008-11-04 22:20 EST by Feng(Marvin) Wang CLA
Modified: 2008-12-30 14:13 EST (History)
4 users (show)

See Also:


Attachments
Patch to import SymbolDefinitionsSet (26.88 KB, patch)
2008-11-24 04:19 EST, Ales Milan CLA
no flags Details | Diff
Patch to import SymbolDefinitionsSet (35.95 KB, text/plain)
2008-11-29 03:09 EST, Ales Milan CLA
no flags Details
cleanup with MTJ cleanup template (69.02 KB, application/octet-stream)
2008-12-01 23:17 EST, Feng(Marvin) Wang CLA
wgp010: iplog+
wgp010: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Feng(Marvin) Wang CLA 2008-11-04 22:20:38 EST
Overview: 
Add workspace level symbol set import/export/duplicate functionality will make it easier for user to manage their manually defined symbol sets. 

It also nice if project leval symbol set have import/export/duplicate functionality.
Comment 1 Ales Milan CLA 2008-11-05 03:26:19 EST
1) If user define path to antenna.jar library in Window->Preferencies->Java ME(tab)->Antenna JAR, then plugin could be automatically load device.xml and groups.xml file from antenna.jar file. 
Devices DB from these files could be present in combobox Definition Set on tab Symbol Set Definition.

2) Import/Export Definition Set. Import definition set from XML file. For first step maybe we could import file coming from j2mepolish.org site. There is possibilty to download complete devices DB.

Example of this file:
<devices>
  <device>

    <identifier>HTC Touch Diamond P3700/HTC Touch Diamond P3700</identifier>

    <capability name="alphalevels" value="256" />

    <capability name="canvas.isdoublebuffered" value="true" />

    <capability name="canvassize" value="480x536" />

    <capability name="colors" value="65536" />

    <capability name="font.default" value="17" />

    <capability name="font.large" value="19" />

    ...
  <device>
  ...
<devices>


Comment 2 Ales Milan CLA 2008-11-24 04:19:46 EST
Created attachment 118568 [details]
Patch to import SymbolDefinitionsSet

Hi Guys,
please could you have look on my first patch. I had to learn a lot of about eclipse-me source code and eclipse platform dev as well :)
There is basic import functionality. 
Changes:
- added import button in symbol definitions set wizard page
- import dialog with import functionality
- changed SymbolDefinitionSetRegistry especialy IPersistance implementation of SymbolDefinitionSet. Backward compatibility for loading is supported. Finally I didn't change XMLPersistence provider. I used storeProperties func. to store symbols.

I think, this is not final patch. I want to read comments from you and after that I'll be continue... I want to know if am I on right way..
thanks
Comment 3 Gang(Allen) Ma CLA 2008-11-24 21:20:28 EST
Hi Ales,

Thanks for your contribution, only one comment about UI:

I think the "Symbol Set Definitions" preference page should be similar to the "Device Manangement" page, list all the symbol set in a table, and with "Add", "Edit", "Remove", "Import", "Export", "Duplicate" such buttons on the right.

(In reply to comment #2)
> Created an attachment (id=118568) [details]
> Patch to import SymbolDefinitionsSet
> Hi Guys,
> please could you have look on my first patch. I had to learn a lot of about
> eclipse-me source code and eclipse platform dev as well :)
> There is basic import functionality. 
> Changes:
> - added import button in symbol definitions set wizard page
> - import dialog with import functionality
> - changed SymbolDefinitionSetRegistry especialy IPersistance implementation of
> SymbolDefinitionSet. Backward compatibility for loading is supported. Finally I
> didn't change XMLPersistence provider. I used storeProperties func. to store
> symbols.
> I think, this is not final patch. I want to read comments from you and after
> that I'll be continue... I want to know if am I on right way..
> thanks

Comment 4 Feng(Marvin) Wang CLA 2008-11-25 01:15:52 EST
Hi Ales,
I tried out your patch, it works fine. Thank you for the contribution.
Here is my comments:
1. You may use massage bundle for the UI string. There are many examples in mtj.ui plugin about this.

2. It's better to add some description (using setDescription(String) method) on the SymbolDefinitionsImportWizardPage, to instruct user what the dialog do.

3. Add this statement "registryMap.clear();" in SymbolDefinitionSetRegistry#loadUsing(IPersistenceProvider) method, like this:
    public void loadUsing(IPersistenceProvider persistenceProvider)
            throws PersistenceException {
        if (registryMap != null) {
            registryMap.clear();
.....
}
This will make SymbolDefinitionSetRegistry restore when user click "cancel" on preference page.

4. Remove "SymbolDefinitionSetRegistry.singleton.store(); " in SymbolDefinitionsImportWizard#importFromJ2MEPolishFormat(InputStream, InputStream) method. Because it will stroe when user click "OK" on preperfence page, not the "Finish" button on the SymbolDefinitionsImportWizard.

5. Bucause device.xml will grow big and big, display a progress monitor will be necessary after click "Finish" button on the SymbolDefinitionsImportWizard.

6. Exception should be handle. SymbolDefinitionsPreferencePage#handleException(String, Throwable) is a example.

7. Add your name in the copy right section of source code.

(In reply to comment #2)
> Created an attachment (id=118568) [details]
> Patch to import SymbolDefinitionsSet
> 
> Hi Guys,
> please could you have look on my first patch. I had to learn a lot of about
> eclipse-me source code and eclipse platform dev as well :)
> There is basic import functionality. 
> Changes:
> - added import button in symbol definitions set wizard page
> - import dialog with import functionality
> - changed SymbolDefinitionSetRegistry especialy IPersistance implementation of
> SymbolDefinitionSet. Backward compatibility for loading is supported. Finally I
> didn't change XMLPersistence provider. I used storeProperties func. to store
> symbols.
> 
> I think, this is not final patch. I want to read comments from you and after
> that I'll be continue... I want to know if am I on right way..
> thanks
> 

Comment 5 Ales Milan CLA 2008-11-29 03:09:40 EST
Created attachment 119066 [details]
Patch to import SymbolDefinitionsSet

Updated patch for import SymbolDefinitionSet.
I confirm all previous comments, new patch is available.

I suggest add this patch to version 0.9.1. This is basic functionality for import SymbolDefinitionSet from J2me polish files format. 
To next release I'll add functionality for export management. And I'll change import/export management similar like Device Import management as said Gang(Allen) Ma.

One more thing  what i changed in this patch, I move import functionality from ImportWizard dialog to mtj.core to class DeviceSymbolDefinitionSetFactory.
Comment 6 Feng(Marvin) Wang CLA 2008-12-01 23:17:40 EST
Created attachment 119238 [details]
cleanup with MTJ cleanup template

Hi All,

Ales has create a patch to import workspace scope symbol sets from Antenna.jar or J2ME Polish files(devices.xml and groups.xml). It's a nice feature and I test the patch, it works well.

I just modify the patch to add some missing copyright announcement and move strings from MTJStrings to a package resource bundle.

If you thinks it's OK, I will commit the code to SVN to make this feature available in 0.9.1.

Thanks,
Feng
Comment 7 Gustavo de Paula CLA 2008-12-02 06:51:57 EST
+1 to commit the feature. great job ales and thanks for your effort on that. mtj community will definitely like this feature a lot

ales,

can you please answer the below question? they are necessary in order to keep track of all external contributions on mtj and we need them before commiting the code (

1. If this is the first time the contributor makes a contribution: Contact information for IP records - Name, Company, E-Mail, Office address, Office phone.
2. Did you write the contribution yourself?
3. Did you reference any 3rd party material?
3.1 If yes, under what terms (license) did you receive this material?
3.2 Are you authorized by your employer to make the contribution?

thanks again and if you have some question, please let me know

:)
gustavo

PS.: feng, please make sure you update mtj iplog after the code is commited and the bug resolved. iplog is on mtj cvs. if you have problems to do it, please let me know and i can do it for you:
/cvsroot/org.eclipse
www/dsdp/mtj
files: /ipLog.php and /development/mtj-log.csv

(In reply to comment #6)
> Created an attachment (id=119238) [details]
> cleanup with MTJ cleanup template
> 
> Hi All,
> 
> Ales has create a patch to import workspace scope symbol sets from Antenna.jar
> or J2ME Polish files(devices.xml and groups.xml). It's a nice feature and I
> test the patch, it works well.
> 
> I just modify the patch to add some missing copyright announcement and move
> strings from MTJStrings to a package resource bundle.
> 
> If you thinks it's OK, I will commit the code to SVN to make this feature
> available in 0.9.1.
> 
> Thanks,
> Feng
> 

Comment 8 Ales Milan CLA 2008-12-02 08:11:40 EST
Hi Gustavo,

I'm glad that i could contribute. I hope that it's not my last post.

Here are answers for your questions
1)    Ales Milan, 
    Inlogic Software ltd.
    amilan at inlogic dot sk, 
    Partizanska cesta 97, Banska Bystrica, 974 01, Slovakia
    +421 55 642 47 53
2)    yes
3)    no
Comment 9 Gustavo de Paula CLA 2008-12-02 08:35:37 EST
hi ales,

thanks for your prompt reply. i also hope that you can continue to contribute. 

about the last question. 

3.2 Are you authorized by your employer to make the contribution?

can you please confirm that? this is important since some companies do not allow their employees to contribute to open source projects. Eclipse foundation then requests that we confirm that your employer is ok with you contributing to an open source project (or don't care about what you do on your weekend :))

regards,
gustavo

(In reply to comment #8)
> Hi Gustavo,
> 
> I'm glad that i could contribute. I hope that it's not my last post.
> 
> Here are answers for your questions
> 1)    Ales Milan, 
>     Inlogic Software ltd.
>     amilan at inlogic dot sk, 
>     Partizanska cesta 97, Banska Bystrica, 974 01, Slovakia
>     +421 55 642 47 53
> 2)    yes
> 3)    no
> 

Comment 10 Ales Milan CLA 2008-12-02 08:55:01 EST
Hi Gustavo,

3.2 yes, i'm co-founder :)
Comment 11 Gustavo de Paula CLA 2008-12-02 08:59:41 EST
:D. thanks for your answers.

since feng did all review, i will wait for him to commit the code, it will be on Friday's nightly build

:)
gustavo


(In reply to comment #10)
> Hi Gustavo,
> 
> 3.2 yes, i'm co-founder :)
> 

Comment 12 Feng(Marvin) Wang CLA 2008-12-02 21:29:11 EST
Hi gep,

Patch integrated to svn.

But I find that I have no committer access to the cvs project which contains ip log file. So ip log not updated. Could you help me to create a account for ip log update?

Thanks,
Feng

(In reply to comment #11)
> :D. thanks for your answers.
> 
> since feng did all review, i will wait for him to commit the code, it will be
> on Friday's nightly build
> 
> :)
> gustavo
> 
> 
> (In reply to comment #10)
> > Hi Gustavo,
> > 
> > 3.2 yes, i'm co-founder :)
> > 
> 

Comment 13 Gustavo de Paula CLA 2008-12-03 06:19:40 EST
ok. i will do that. 

thanks
gustavo

(In reply to comment #12)
> Hi gep,
> 
> Patch integrated to svn.
> 
> But I find that I have no committer access to the cvs project which contains ip
> log file. So ip log not updated. Could you help me to create a account for ip
> log update?
> 
> Thanks,
> Feng
> 
> (In reply to comment #11)
> > :D. thanks for your answers.
> > 
> > since feng did all review, i will wait for him to commit the code, it will be
> > on Friday's nightly build
> > 
> > :)
> > gustavo
> > 
> > 
> > (In reply to comment #10)
> > > Hi Gustavo,
> > > 
> > > 3.2 yes, i'm co-founder :)
> > > 
> > 
> 

Comment 14 Gustavo de Paula CLA 2008-12-03 06:25:30 EST
Comment on attachment 119238 [details]
cleanup with MTJ cleanup template

patch reviewed and approved
Comment 15 Gustavo de Paula CLA 2008-12-03 06:27:50 EST
code integrated. it will be available on next build.

thanks for your contributuion!

ales, would you mind if we add your company name to the list of mtj contributors? we would need the company name and website and them i will update mtj website with that information.

regards,
gustavo
Comment 16 Ales Milan CLA 2008-12-05 08:53:31 EST
Hi Gustavo, 
yes of course.

Inlogic Software ltd
www.inlogic.eu
Comment 17 Gustavo de Paula CLA 2008-12-30 14:13:39 EST
bug released into 0.9.1