logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
judy at Web2Market  
#1 Posted : Tuesday, September 8, 2020 11:53:26 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 286

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
I'm trying to access new tables in the database via class files I have created and put into the code folder- the class, Repository,IRepository, and hbm.xml file with Embed property set and entry in Windsor.config. I'm getting various errors, but with one that doesn't throw an error, it doesn't pull any data either. Do these files actually need to be made into a dll or is it possible to use them in the code folder? Do you have any example code?
Thanks

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

Naveed Ashraf  
#2 Posted : Tuesday, September 8, 2020 12:49:16 PM(UTC)
Naveed Ashraf

Rank: Advanced Member

Groups: Admin, Administrators, Developers, Registered, HelpDesk, Authorized User
Joined: 7/31/2019(UTC)
Posts: 77

Was thanked: 8 time(s) in 8 post(s)
For .hbm files, right click in your Visual Studio solution explorer, and click "Properties". Update the following properties:

Build Action: Embedded Resource
Copy to Output Directory: Do not Copy.

I hope it will solve the missing mapping file issues if you have correctly implemented the hbm files.
Thanks for your support!
Naveed Ashraf
Ablecommerce.com
Developer Assistance Available
shari  
#3 Posted : Tuesday, September 8, 2020 1:05:27 PM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 703

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
You can also try to create a plugin instead of creating a repository in the Ablecommerce Code folder.

A working example of a plugin which makes use of a repository, creating and accesing new tables from database and widgets can be seen in this example.
https://github.com/AbleCommerce/AC9-Samples
judy at Web2Market  
#4 Posted : Wednesday, September 9, 2020 7:56:47 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 286

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
Thanks, Shari. The classes are marked Embedded Resource, Do Not Copy
I tried making a plugin and it shows up to install, but after that, I don't seem to be able to call the class. There is no admin page and the tables were already in the database so I didn't have that code in the plugin. Your sample plugin code doesn't really explain much about what all is necessary and it is really cumbersome to make a plugin because of that. If there is no admin page, do we need a route.config? Does the dll need a .config file? Is it really possible to use the class & hbm.xml files in 9.0.2? I could use it in earlier versions.
Thanks again for your help- just frustrated here.
judy at Web2Market  
#5 Posted : Wednesday, September 9, 2020 8:35:21 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 286

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
I finally got it without creating a plugin. I was using the namespace AbleCommerce.Code and I hadn't added <mapping assembly="AbleCommerce"/> to the nHibernate.config file.
For some of our uses, creating a plugin is a pain and overkill since we have never done a site yet where we had to compile the WAP project anyway.
Users browsing this topic
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.