[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 379: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4505: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4507: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4508: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4509: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
From Flames To Fork, Comes Freedom • View topic - Aladdin Magic Plugin

Aladdin Magic Plugin

The migration of Adempiere modules to iDempiere

Aladdin Magic Plugin

Postby red1 » Sat Feb 20, 2016 8:25 am

After some years doing the same things over and over for each new plugin in iDempiere (which is already amazing) but the refactoring spirit can be used to shorten the whole process even more amazingly. Introducing a Module Creator that is a sample plugin with stubs and a new menu and window template ready for reuse. But that is not all. It has fantastic goodies inside.

PluginModuleTemplate.png
PluginModuleTemplate.png (37.33 KiB) Viewed 29230 times
This is a ready to use template. The menu can be renamed to intended menu. But here is where the manual drudgery ends.

WindowStub.png
WindowStub.png (65.22 KiB) Viewed 29230 times
All the developer needs to do is key in a new name and a Callout does the rest. A new copy of the window will be created under the new name! The template window remains as it is and is not accessible on Client side. The created window is not accessible on System side. The compulsory 7 Columns and Elements are created and synched with the Database!

All the developer or user need to do is to continue adding columns and fields, and then synch to database. Help guidelines are also given in the Comments tips.

ModelGenerator.png
ModelGenerator.png (83.3 KiB) Viewed 29205 times
The greatest magic will happen here. The developer can generate the X and I classes model without lifting another window. Just check the options including Model Factory to be placed in the new plugin in the source. (Thus this plugin is preferably run from source IDE for continous working.) And imagine you can then pack out the whole new menu without lifting another mouse and the resultant 2Pack will be nicely placed in the plugin's META-INF!

All the developer has to do in the end is just click on Save and the event validator goes to work.

A new process stub can also be defined here and the plugin.xml and new java implementing SvrProcess will be created! The same goes for creating a sub-table!

This concept took one whole day since yesterday here in chilling North Vietnam with Hiep LQ brainstorming how to make the best ERP in the world also the fastest to code in. I couldn't put the thought down after making some sketches in the app last night, i continued up in bed since 3am and its now 7am when i finally completed the concept design and ready to code them in the following rest of the month here before returning to Malaysia with my son.
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Sat Feb 20, 2016 9:48 am

The concept model above is all packed out in a 2Pack and uploaded here http://sourceforge.net/projects/red1/fi ... uleCreator. Like to add that this idea is not new. I have always suspected that Jorg Janke, the original creator of Compiere did not grasp the power of his own creation. It is not an ERP per se but a powerful app creator as i wrote many years ago http://www.adempiere.com/ADempiere_Rapid_Development.
It is also something which others particularly Nicolas Micoud has put forth an effort on http://idempiere.atlassian.net/browse/IDEMPIERE-1847
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby nmicoud » Sat Feb 20, 2016 3:25 pm

Nice feature, congrats red1, hiep and naseem !

BTW, my name Micoud (with a 'i' between M and c) ;)

Regards,

Nicolas
nmicoud
Regular
 
Posts: 137
Joined: Fri Oct 07, 2011 6:19 pm

Re: Module Creator!

Postby red1 » Sat Feb 20, 2016 3:45 pm

Bonjour Nicolas,
Merci et pardon et oui, I have corrected the name. And i just incorporated a large portion of my method calls from your AddTable during my events and resting a while before pushing the button. Hope it does not explode :D
(I learned alot from your code and would have taken a lot of time if I haven't been told by Hiep here to look at it)
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Module Creator!

Postby red1 » Sat Feb 20, 2016 11:48 pm

Submitted version 0.1. Credits and thanks also to Nicolas Micoud's contribution. Only New Window is functioning. Change its name to your new table name, save it, and it will automatically create a menu with window with tab of that name and all its compulsory fields and columns and elements created. Also synchronized with database.
Official TableName will be hardset to 'MY_<tablename>'.
You can then proceed to add columns and synch right away, use the Tab Editor to layout nicely and drag the new item into the New Menu. Then login as Client and input data into your new window and of course you can print out on the fly too. Source is at http://bitbucket.org/red1/org.my.erp. Binary with 2Pack included at http://sourceforge.net/projects/red1/fi ... leCreator/ org.my.erp<timestamp>.jar

Future version will make creating new columns also painless (no need to create corresponding elements). And yes, I will work at the Model Designer soon.
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Sun Feb 21, 2016 7:31 am

Now i have made any new Column creation a smoother ride down to minimal 2 steps. The element field is automatically created! The datatype Reference is defaulted to String with FieldLength of 22! You can change to another and then SynchroniseColumn to Database. Not only that. If you are creating a column that has an existing Element such as PriceList, it will automatically pull the Element ID and set it! (That also obtain its datatype Reference and FieldLength as a previous feature.) If FieldLength is ever zero it will just default it to 22 to avoid saving error.

What is more fantastic is that now after saving your new column, you can go to the Window, Tab > Tab Editor and see your new field inserted there!

(However the other details in the Element are not set for Centralised Maintenance magic. I will solve later by pushing back the first-time creation from the Column side!)

Try the plugin from the sourceforge link or the source from bitbucket link.

I made a movie here:

red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Mon Feb 22, 2016 4:00 pm

Now starting a new model is even more automated! With a new ColumnSet field, you can enter new String type columns without going to the Table and Column window to do that. A sample is prepared for you to just add in one more column name and press Save. Note the Comment/Help and HowTo tips.

ColumnSet.png
ColumnSet.png (108.77 KiB) Viewed 29099 times
Then go to the GardenWorld client and start entering data and print preview it! So this is a fantastic and amazing kick start in building any model into the ERP. From there you can then put in more fields particularly those that are non-string type. You can also leave the ColumnSet blank and build each column as shown in previous movie. I updated a new movie for this here:

red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Tue Feb 23, 2016 7:39 am

Now the X and I model interface is automatically generated. Easier than I thought. Thanks to good source code from others for me to reuse. Note that this can be done from a binary instance and need not be in Eclipse.

GenerateModel.png
GenerateModel.png (246.09 KiB) Viewed 29082 times
To make this happen, go to the Model Design window (under SystemAdmin) and pull down your newly created Table from the list (only U/serDefined tables will be listed) and check the HasChanged box. Then press Save. Define your plugin source location. The generated code will be placed there. If it is not correct the system will prompt you while saving. If saved without error, go to your source location and the classes will be there.

TableModelGenerateSet.png
TableModelGenerateSet.png (45.48 KiB) Viewed 29082 times

I just uploaded the new binary plugin with the data changes in embedded 2Pack and also to bitbucket the source. I am breaking off for travel to Hanoi by rail and meetup with a fan there for a tour. So if there is any issue/error I appreciate you send me an email red1org@gmail.com or post here or in googlegroup thread where i announced this.

Tomorrow early morning I be flying back to Malaysia. From there, after some rest, I will continue (or maybe i scratch the itch on board the flight) to finish off auto generating of ModelFactory.. and then an auto window-sub-tab-table creation (definitely when i touched down).
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Fri Feb 26, 2016 2:21 pm

After 2 days of coding, finally made a total production of plugin artifacts (select the boxes for GenerateModel and GenerateModelFactory in the Model Design window and press Save):

GeneratedFiles.png
GeneratedFiles.png (90.03 KiB) Viewed 28928 times
Only the last bit of updating the MANIFEST.MF has to be manually done by pasting advice from MANIFEST.txt (append to the existing Service-Component:)

GeneratedSource.png
GeneratedSource.png (58.47 KiB) Viewed 28870 times
I tried doing two models, and they worked, their generated code jive well. As I enter data, their PO modelfactory is stated:

ModelsWorking.png
ModelsWorking.png (22.07 KiB) Viewed 28925 times
Further adding of columns will also now be possible by saving again new columns (of same table). So is the use of pre existing element such as PriceList, tried below and it is accepted.

ExistingElementPriceList.png
ExistingElementPriceList.png (34.1 KiB) Viewed 28926 times
I am freezing at this juncture on datatype setting (though the stubs are created in code) is not really that important since one can reuse so many pre-existing elements such as Description, Help, Qty, Date. Later i will look at the making of sub tab table creation.
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Sat Feb 27, 2016 7:21 pm

Now, a Master-Detail can be generated with a sub-tab! And it can be recalled back at the New Window enter the same table name, and specify in the columnlist whatever columns you want to add to it. I created the following Master-Detail window in just 1 minute!

MasterDetail.png
MasterDetail.png (94.53 KiB) Viewed 28852 times
From there you can build any myriad just by specifying in Model Designer the main TableName and the Master-Detail (sub-table) name. It will be generated with the parent FK and tab level one level below it, with the parent link made so that it manages all children data nicely.

DesignPage.png
DesignPage.png (101.66 KiB) Viewed 28852 times
From here, i will revisit the DataType parsing described earlier. For now, users can collect both source and SF binary to test. Note in the above screen that we can now use lookup IDs such as C_BPartner_ID, C_Location_ID and M_Product_ID and it will be a search or TableDirect access lookup. Be very exact when spelling them in the ColumnSet of NewWindow. Also do not use the same names without IDs such as C_Location will cause a clash. Note also the use of 'Value' as column name will map to the commonly known Search Key field.
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Sun Feb 28, 2016 4:48 am

Attachments
DataTypeResult.png
DataTypeResult.png (41.95 KiB) Viewed 28805 times
DataTypeSetting.png
DataTypeSetting.png (14.96 KiB) Viewed 28805 times
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Module Creator!

Postby red1 » Mon Feb 29, 2016 12:48 am

Now you can enter column that reference List on the fly! Using the L#Week etc you get the Weekdays list. You can then go to Window,Tab&Field to change the displayed label if you want. The L# is parsed in a Like 'columnname%' script so you need not spell the whole length of the Reference Value. Remember this is for List validation only at the moment. Below is the setting and after that is the result.

NewWindowWeekdays.png
NewWindowWeekdays.png (37.26 KiB) Viewed 28767 times
Note that you can use direct ID lookup, normal unhashed String type and the other types.

DataEntryWeekdays.png
DataEntryWeekdays.png (25.65 KiB) Viewed 28767 times
Works like a charm! Everything committed and uploaded for you to try it out now!
(Note: Logs showed some DB synch errors. The Text Description is not added to Window,Tab which has to be manually done. This means there is a conflict of reference as Description is a pre-existing element. So advice will be to avoid same elements or just use it as pre-defined without the T#. Also the code for some reason not able to synch D#End. Using D#Ending seems OK.
To correct mistakes - removing the D#End:
1. Go to Window,Tab&Field, delete the field
2. Go to Table and Column, delete the column
3. Do Cache Reset at the ClientAdmin.
Then return to the NewWindow and at the same table, columnset only D#Ending and save.)

Made a movie to wrap this edition since the last movie -

red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Tue Mar 01, 2016 8:31 am

Now I am going to show you how to do something really cool as in real life as in making an Accessories tab to the present Sales Order on the fly. You get to peek more under the powerful AD engine at the same time. First we go to the Validation Rule window and change in the ValidationCode space, the 'U' to 'D'.

ValidationRule.png
ValidationRule.png (52.28 KiB) Viewed 28153 times
Then go straight to the ModelCreator window as the C_Order (Table for the Sales Order Window) can now be accessed.

C_OrderSubTabCreation.png
C_OrderSubTabCreation.png (98.99 KiB) Viewed 28686 times
Then just uncheck the other script creation and just have MasterDetail value = 'Accessories'. After save, go to the NewWindow and give your Accessories some columns:

AccessoriesColumnsCreation.png
AccessoriesColumnsCreation.png (72.58 KiB) Viewed 28686 times
After save, you are all done! Just change role to your client Sales Order and see the magic!

AccessoriesTab.png
AccessoriesTab.png (76.16 KiB) Viewed 28686 times
Another additional feature I made along the way is that now, you can also join any previously created table to any table in Master-Detail relationship!
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Thu Mar 03, 2016 12:11 am

Attachments
TranslateOnlyNewTab.png
TranslateOnlyNewTab.png (87.26 KiB) Viewed 28563 times
Translated.png
Translated.png (42.58 KiB) Viewed 28599 times
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Fri Mar 04, 2016 4:00 pm

Now i made it able to translate without need of the usual language pack import. This is particularly useful for those who wants to save the hassle of looking for the language pack or is using the Aladdin Magic ERP plugin for new windows on the fly. Just go to your Language window, choose desired language, and check two boxes: Login Locale and System Language:

LanguageMaintenance.png
LanguageMaintenance.png (38.15 KiB) Viewed 28497 times
Then press the Language Maintenance button so that it creates all the Trl_ records. Then login with the example of Thai as Language:

ThaiLogin.png
ThaiLogin.png (25.91 KiB) Viewed 28497 times
Then go to the Model Designer with the checked PackOut and save it. The window fields are now translated.

TranslatedThai.png
TranslatedThai.png (29.89 KiB) Viewed 28497 times
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Module Creator!

Postby johnbendi » Sun Mar 06, 2016 3:42 am

When does the process with the Module Creator kick off? After the database table must have been created?

And also why is the table prefix a constant MY? Can it not be made configurable?

Sorry! A lot of questions I know. Pardon me.
johnbendi
 
Posts: 2
Joined: Fri Mar 04, 2016 9:48 pm

Re: Aladdin Magic Plugin

Postby red1 » Mon Mar 07, 2016 8:22 am

Hi JohnBendi, No problem, questions is what makes the forums go round. I answered in the forum some of the answers but i will answer again for the benefit of readers here:
1. I am looking at other priorities besides the Process which is more developer oriented rather than newbie oriented. My primary objective when designing this 'Aladdin Plugin' is to address absolute simpleton ERP first timers who just want to see some fast stuff - a window, translation, applying to their business. That is why I am currently now these few days looking closely as some business rules apps such as . I also need to form a strategic picture of the idea, similar to how i did it for the rest. So you can help by adding your imagination to it. How would you really want the Process generation to accomplish? We can certainly discuss and when it hits my itch, it be out sooner than you think! :)

2. The MY_ prefix is to really avoid messing up as i said when used by first timer newbies. After a person is an expert s/he can easily work with the code and modify them. My main concern is to start of very clean, lean and mean but ending up heavy and complicated which is breaking the principle of been user friendly. But again, later, when i have made the other priority of business rules (the OpenL is a killer been excel based appeals to a real big crowd of accountants and SMEs out there) i can then look at wrapping into a nice toolset. Again i need imaginary feedback from users as most of my killer work is a result from others discussing about issues and clumsiness when using complex app as in ERP.

Meanwhile thank you so much for your good questions.
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Mon Mar 07, 2016 6:08 pm

I put in some tough code (took some hours to get it tested coming out right) and now you can use your own prefix as shown in the main and sub tab setting below. The resulting effect will be used only in AD_Table setting for TableName but the other values will be smartly parsed - prefix removed and leading caps spaced out for Window and TabName. You can also leave out any prefix and the code won't use any. I.e. WonderfulStatistics alone will be set as TableName.

PrefixControl.png
PrefixControl.png (29.33 KiB) Viewed 28391 times
Just use leading caps without spaces and name setting will be automatically spaced, i.e. BigStore will become Big Store.

PrefixResults.png
PrefixResults.png (58.3 KiB) Viewed 28391 times
I put in a Spanish test to make sure that GenerateTranslation is not broken. I replaced that to the earlier PackOut stub.

SpanishTranslation.png
SpanishTranslation.png (38.91 KiB) Viewed 28391 times
Another tip is that PackOutFormat is automatically prepared in Pack Out window. Just go there and it is set to pack out NewMenu again. You can first drag your created windows into the New Menu
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Wed Mar 16, 2016 5:22 pm

I have made the Sub Tab able to choose its own preferred ParentLink Column. It is specified by the columnname after the split character '>'

ParentLinkColumn.png
ParentLinkColumn.png (21.34 KiB) Viewed 28198 times
The result shows the new column linked to the parent's corresponding column. In this case it is not a new column but a core model R_Request.C_BPartner_ID linked to a new parent, 'SL_SalesLeadManagement. So this shows how perfect the code handle such real life cases.

TabChosenLink.png
TabChosenLink.png (47.29 KiB) Viewed 28198 times
I did that so that the Sales Lead Management main tab that has a C_BPartner_ID will have its sub-tab be only those Requests that are of the same Business Partner as more requests may be made by that same BPartner. Later we can have a further sub-tab below the Requests such as its RequestHistory.
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Thu Mar 24, 2016 12:50 am

Attachments
InfoWindow.png
InfoWindow.png (131.32 KiB) Viewed 28016 times
GeneratedInfoItem.png
GeneratedInfoItem.png (28.65 KiB) Viewed 28078 times
InfoWindowCreation.png
InfoWindowCreation.png (27.27 KiB) Viewed 28078 times
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Thu Mar 24, 2016 10:42 am

Now we can have Reference List creation on the fly! Just use for example L#House=Double/Flat/Single/Studio where L# says this is a list, and House is the ListName, and if exist, it will add on. If not, will be created. The = values separated by / will be inserted into the Ref-List only those not existing before. If you hit unique constraint error, you can break down your column and list values into batches. i.e. L#House=Double/Flat. After save: L#House=Studio.

ReferenceListCreation.png
ReferenceListCreation.png (23.53 KiB) Viewed 28031 times
This is an example, after save you can see the reference created:

ReferenceListCreated.png
ReferenceListCreated.png (53.39 KiB) Viewed 28031 times
It will take the first two characters as key values, so you cannot have two similar key values. If your value length is 1 it will just take 1 as key value.

Login into GardenAdmin client will show it working beautifully.

ListWorking.png
ListWorking.png (55.11 KiB) Viewed 28031 times
It can also work for pure single digit numbers. Using L#Counter=1/2/3/4/5

NumberListing.png
NumberListing.png (73.43 KiB) Viewed 28031 times
But there is some reference mixup thinking that this is a number. So just go into your column and change reference from Integer back to Listing and call that counter list.
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Fri Mar 25, 2016 4:04 pm

You can use the ColumnSet in the multi-tables definition for InfoWindow on the fly. Ensure the columns are existing ones by checking in the Element window.

InfoColumnSet.png
InfoColumnSet.png (42.6 KiB) Viewed 27930 times
It is done in a flash.

FullInfo.png
FullInfo.png (54.53 KiB) Viewed 27930 times
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Tue Apr 19, 2016 8:54 pm

A recent change https://idempiere.atlassian.net/browse/IDEMPIERE-3058 breaks the 2Pack during Pack In. This seemed to be caused by new models such as AD_New and AD_ModelDesign not been committed before it is loaded for SQL insert (no POInfo error). To solve this, you have to set in the System Config window, at the 2PackCommitDDL to Y. Then you can install the plugin.

2PackCommitDDL.png
2PackCommitDDL.png (50.88 KiB) Viewed 27501 times
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Tue Apr 26, 2016 9:19 pm

Generate Process can now be done on the fly! Not only that, you can add in the Parameters together and not only that, you can attach the Process to the Toolbar at the same time!

First call up the Model Design window.

GenerateProcess.png
GenerateProcess.png (43.52 KiB) Viewed 27392 times
Note that if you do not want to use it, replace ** at the beginning of the GenerateProcess field or leave it entirely blank. Then fill in any parameters you want in the Comment/Help box. Note that it should be existing elements. If your parameters are incorrect, it will just throw an error and you can edit it until it is correct. Error will not result in any process generated.

GeneratedFiles.png
GeneratedFiles.png (23.06 KiB) Viewed 27392 times
You will see in your sourcecode, 2 files generated and written there. The process.java itself and a plugin.txt advice. Take the xml snip inside and append to the plugin.xml.

ExtensionPluginXML.png
ExtensionPluginXML.png (54.22 KiB) Viewed 27392 times
Check from the Extensions tab that the process definition works when you click on the process.java class to check that the code is OK and without error. You can then add in your logic straight away to test it.

ADProcess.png
ADProcess.png (61.15 KiB) Viewed 27392 times
Inside your SystemAdmin, in the Report and Process window you will see your new Process defined into the database. Logout and login back as ClientAdmin. You will see in the Menu tree your new Process.

NewProcessInMenu.png
NewProcessInMenu.png (23.07 KiB) Viewed 27392 times
Click on it and it comes out well.

ProcessFromMenu.png
ProcessFromMenu.png (35.6 KiB) Viewed 27392 times
Now we try something amazing. Go back to the SystemAdmin and call up the Model Designer again. Leave the GenerateProcess alone as Aladdin will detect the process already exist and not create it again. But select a table and Aladdin will append that process to its Toolbar! (You can do this together on the first try.)

ProcessWithTable.png
ProcessWithTable.png (51.92 KiB) Viewed 27392 times
Relogin into your Client and see the magic.

AttachedToolBar.png
AttachedToolBar.png (51.01 KiB) Viewed 27392 times
Click on the gear icon and you will see your process attached there. You can click on it, and enter the parameters to see its working.

ProcessFromToolBar.png
ProcessFromToolBar.png (78.54 KiB) Viewed 27392 times
When you click OK, your generated code will work if you put a break in your debug mode as shown.

ProcessJava.png
ProcessJava.png (68.18 KiB) Viewed 27392 times
Mouse over the parameters and they do fetch the values from your selection. Aladdin Magic Plugin now removes yet more grunt work from another important developer task.
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Aladdin Magic Plugin

Postby red1 » Wed Apr 27, 2016 4:58 pm

Made movie to show how the fantastic the Process generation works:

red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Next

Return to iDempiere

Who is online

Users browsing this forum: No registered users and 1 guest

cron