• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

bjmorse
#1 Posted : Tuesday, June 19, 2007 10:32:38 PM(UTC)
bjmorse

Rank: Member

Joined: 6/2/2004(UTC)
Posts: 24

I've just started to look into plug-ins with BVC5. This seems to be a great way to customize the code.



Is there any relation with the bvc_Component_setting table and plug-ins?



I looked at the CheckForPriceBelowCost.vb class in the app_code folder which is added as a plug-in in the [2]LoadProductTasks method. [/2]Also, I was looking at the BVSoftware.Bvc5.Core.BusinessRules.ProductTasks.OverRidePriceWithText class which is also loaded by [2]LoadProductTasks [/2]and had to wonder why I could not find the "OverrideText" setting for this class in the table.



The article on plug-ins by in this forum was good, but did not mention anything about this table. So, maybe the does not need to be an entry in this table.



Could anyone help me out on what this table is and how it is used?



Also, anything else on plug-ins would be helpful.



Thanks!
bvuser
#2 Posted : Wednesday, June 20, 2007 1:38:37 PM(UTC)
bvuser

Rank: Member

Joined: 4/10/2006(UTC)
Posts: 462

Essentially, both the Component_setting and the ComponentList_setting tables are fairly generic tables that any developer can store data in for the plug-ins that are designed. You could alternative create your own tables, etc, however bvc5 has a nice built in api that makes saving your plug-in settings and retrieving the settings from those tables extremely easy. My suggestion would be to use the tables unless you are designing something that is outside of the scope of the capability of those tables.
Netriplex Corporation<br />
bjmorse
#3 Posted : Wednesday, June 20, 2007 4:34:46 PM(UTC)
bjmorse

Rank: Member

Joined: 6/2/2004(UTC)
Posts: 24

Thanks for your reply.

I was especially interested in what the GUIDs are that are stored in the Component_Setting table.

It would be great is someone could lead me through the OverRidePriceWithText class and how it interacts with the table and the plugin loader.

Thanks!
Andy Miller
#4 Posted : Wednesday, June 20, 2007 6:11:02 PM(UTC)
Andy Miller

Rank: Member

Joined: 11/5/2003(UTC)
Posts: 2,136

Was thanked: 1 time(s) in 1 post(s)
Use the API (ComponentSettingsManager)...don't access the table directly. That way if BV Software makes an underlying table change in a future release your code will remain compatible.
Andy Miller
Structured Solutions

Shipper 3 - High Velocity Shipment Processing
bjmorse
#5 Posted : Thursday, June 21, 2007 10:56:57 AM(UTC)
bjmorse

Rank: Member

Joined: 6/2/2004(UTC)
Posts: 24

Thanks Andy. I'm working to understand the plug-in object model and how the plug-ins get/set data in the database.

Does anyone know if this is documented anywhere?

Thanks.
bvuser
#6 Posted : Thursday, June 21, 2007 11:27:10 AM(UTC)
bvuser

Rank: Member

Joined: 4/10/2006(UTC)
Posts: 462

No documentation as you basically get the full source code to disect it yourself. The function names are very easy to understand and it only took me about 30 minutes to disect how everything worked with a little help from intellisense.
Netriplex Corporation<br />
bjmorse
#7 Posted : Thursday, June 21, 2007 11:55:54 AM(UTC)
bjmorse

Rank: Member

Joined: 6/2/2004(UTC)
Posts: 24

Thanks. But, I thought that someone that has been through this excersise could give some helpful hints from experience.
bvuser
#8 Posted : Thursday, June 21, 2007 1:00:08 PM(UTC)
bvuser

Rank: Member

Joined: 4/10/2006(UTC)
Posts: 462

I don't really know what type of hints you are looking for, the function names basically say it all.

I am restraining from posting detailed core info on the forum as I don't know what is supposed to be posted for people without a developer copy, however some functions are

GetSetting,
SaveSetting, etc

All Very self-explanatory.
Netriplex Corporation<br />
bvuser
#9 Posted : Thursday, June 21, 2007 1:09:59 PM(UTC)
bvuser

Rank: Member

Joined: 4/10/2006(UTC)
Posts: 462

If you give an example of what you mean by a hint, I can try to help you.
Netriplex Corporation<br />
Andy Miller
#10 Posted : Thursday, June 21, 2007 1:34:26 PM(UTC)
Andy Miller

Rank: Member

Joined: 11/5/2003(UTC)
Posts: 2,136

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: "Brad" Go to Quoted Post

Thanks Andy. I'm working to understand the plug-in object model and how the plug-ins get/set data in the database.

Does anyone know if this is documented anywhere?

Thanks.
Like bvuser wrote, it is not documented anywhere but there are several examples. Each type of plug-in is slightly different, but let's say you wanted to write a new product task. Using OverridePriceWithText as an example, you would need to complete the following steps:
<OL>
<LI>Create a new class that inherits from BVSoftware.Bvc5.Core.BusinessRules.ProductTask.
<LI>Override TaskName to return a name for your task when it appears in the list of possible tasks.
<LI>Override TaskId to return a unique ID up to 36 characters long (which is long enough for a GUID).
<LI>Override Execute to peform your task.
<LI>Override Rollback to roll back your task.
<LI>Override Clone to return a new copy of your task.
* Optionally override StepName to return the step name of your task when it appears within a workflow.
</OL>
When your class is contructed the base class will create a new ComponentSettingsManager for you, which you can access using the SettingsManager property of your class. To retrieve a specific setting you would use GetSetting (or GetBooleanSetting, etc). For example, SettingsManager.GetSetting("Step Name").

If you create an editor for your task (see my article "How to Create a BVC5 Order Workflow Task" for an example of how to create an editor for a task), then you will want to set specific settings using SaveSetting (or SaveBooleanSetting, etc).
Andy Miller
Structured Solutions

Shipper 3 - High Velocity Shipment Processing
Jazzsingh
#11 Posted : Sunday, July 29, 2007 4:10:33 PM(UTC)
Jazzsingh

Rank: Member

Joined: 10/28/2003(UTC)
Posts: 168

Thanks Andy, couldnt have done it without you.

It took me few hours to figure it out , between your instructions, article and playing around.

BV - you need to document workflows. one paragraph of description dosent cut it. I will try to post a blog too.
Jazz Singh
SEO, Ecommerce, BVSoftware Development, Database Development, SQL Scripts,

www.DesignMarketSEO.com

www.sequent-tech.com
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012