Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Vilius Janulis 38 posts 79 karma points
    Aug 25, 2014 @ 13:09
    Vilius Janulis
    0

    Umbraco 7 : ucommerce application

    Hey, so for last half the day I am trying to create console application, that would connect with ucommerce.

    Have found examples here : http://www.publicvoid.dk/UsingTheUCommerce3APIInAWindowsApplication.aspx

    And it works great for umbraco 6 - tested it.

    But cant make it work for umbraco 7 - by changing few variables and etc getting many different errors, nothing in particular.

    Like : -UCommerce.Presentation.Web.Controls.Adapters.MediaControlAdapter -An invalid or incomplete configuration was used while creating a SessionFactory. -UCommerce.EntitiesV2.MappingAssemblyTag and etc.

    Maybe someone has working console application example for umbraco 7 ? or have idea how to make it work.

  • Morten Skjoldager 440 posts 1499 karma points
    Aug 26, 2014 @ 14:14
    Morten Skjoldager
    0

    Hi,

    Where exactly do you see errors?

    And what exactly are you trying to achieve with this? 

    You can clone our master class repository here:

    https://bitbucket.org/uCommerce/ucommerce-master-class

    It contains a test project that can access the database with read and write. You need to work on the session directly though. This way you avoid having the entire configuration. But this depends on the fact that you might or might not need some of the services. So to give a more exact answer, you need to explain exactly what you're trying to achieve.

    Best regards

    Morten

  • Vilius Janulis 38 posts 79 karma points
    Aug 26, 2014 @ 14:47
    Vilius Janulis
    0

    Hi,

    Thank you for your help.

    We are trying to create standalone C# windows console application that would connect to the ucommerce, and import, update,delete - categories, products, images and etc based on other data we are getting. The main issue because we want to create console application and not api call on the server, macro script or something similar, is because we had some experiences that running such scripts (to update,delete and etc with lots of data) on same server, with same application pool/solution starts to crash the solution itself, getting it slow, not finding cache and etc. that is why by wanted to avoid it we would prefer to have it like standalone application, since is going to run on some tens minute bases.

    So we decided to create an application, like this one - what Soren made year ago : http://www.publicvoid.dk/UsingTheUCommerce3APIInAWindowsApplication.aspx With download link at the bottom.

    The problem is that when we take exactly the same application, and update connection string (to umbraco 7 database) and update references of umbraco.dll and umbraco.core.dll it does not work anymore.

    I have checked you master classes example and it is not exactly what we are looking for, it uses sessions and same solution as main solution is linked to.

    Then I just with updated references to new umbraco and ucommerce dll's.

    Then it throws errors that it is missing some Casle.windrow and Castle.Core, FluentEnhibernate and nhgibernate.bytcode so i reference them from the 'old' application, since new ones does not have these. What i get is ComponentActivator: could not instantiate UCommerce.EntitiesV2.Repository`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce, Version=3.5.0.13098, Culture=neutral, PublicKeyToken=null]]

    If i try some other .net version, or some mix from old and new references. I get all kind of random errors : Like :

    -UCommerce.Presentation.Web.Controls.Adapters.MediaControlAdapter

    -An invalid or incomplete configuration was used while creating a SessionFactory.

    -UCommerce.EntitiesV2.MappingAssemblyTag and etc.

    I just need somehow to get this kind of console application - that would work with newest umbraco and ucommerce dll's. That could be run manually, via scheduled task, and etc. Any ideas ?

  • Søren Spelling Lund 1797 posts 2786 karma points
    Aug 26, 2014 @ 16:34
    Søren Spelling Lund
    0

    If you just need the data API you can set up in a simpler way that doesn't require the full config to be present.

    There's a working example at https://bitbucket.org/uCommerce/ucommerce-master-class/src/3bb3a79d4f76279fdbb9bc3e196d6f3d1794779b/src/MyUCommerceApp.Test/?at=default

  • Vilius Janulis 38 posts 79 karma points
    Aug 26, 2014 @ 18:28
    Vilius Janulis
    0

    Hi Soren,

    After some more tests and research I was able to make it work, using your suggestions - so i can get all the data - and that is great. But is it possible using the this sessions method to Create product, create category, assign product to category and save everything and etc ? Can you show some small example ?

    That is why i prefer the console application example with components.config and etc so i could use entity methods to create and save products and etc.

  • Vilius Janulis 38 posts 79 karma points
    Aug 27, 2014 @ 09:16
    Vilius Janulis
    0

    Hey guys, any ideas on this ?

  • Søren Spelling Lund 1797 posts 2786 karma points
    Aug 28, 2014 @ 09:56
    Søren Spelling Lund
    0

    Hi Villius,

    The Save and Delete methods are just there for convenience. Using the lower level APIs is still a one liner for saving or deleting something.

    You can easily save using the following method:

    var sessionProvider = GetSessionProvider();
    using (var session = sessionProvider.GetSession())
    {
    var product = new Product();
    session.SaveOrUpdate(product);
    session.Flush(); // Issue flush when you're done with all updates to issue commands to the database
    }

    Hope this helps.

  • Vilius Janulis 38 posts 79 karma points
    Aug 28, 2014 @ 10:01
    Vilius Janulis
    0

    Hey Søren,

    Thanks for your help. I am on it - will test it try it and let you know asap. Once again thanks.

  • Vilius Janulis 38 posts 79 karma points
    Aug 28, 2014 @ 15:20
    Vilius Janulis
    0

    Well quite close. How you would retrieve category definition ? I mean it works for product definitions - but does not want to work for category ones.

    Tried : session.Query

    Everything gives an error. To it seems to work for everything else. {"Invalid column name 'BuiltIn'."}

    Edit : so it seems there so some incapability between database and entities. Added that table column as bit to the database. Now i can fetch them.

  • Morten Skjoldager 440 posts 1499 karma points
    Sep 01, 2014 @ 14:18
    Morten Skjoldager
    0

    Hi Vilius, 

    Does this mean that you've sorted it out :) ? 

    The BuiltIn is a flag we've added reasonly. You need to make sure the same version of uCommerce runs both in the database and the application. Otherwise stuff like that may happen. 

  • Dulanakadam 3 posts 23 karma points
    Feb 27, 2015 @ 21:34
    Dulanakadam
    0

    hi,

    anyone know what happen this. I unable to load UCommerce. Umbraco. dll as (UCommerce version 6) a reference in visual studio 2012 or 2010. 

    Søren Spelling Lund you have any solution for this. 

    I want to Use SiteContext.Current.CatalogContext.CurrentCatalog method. But Older Commerce version in

    SiteContext.Current.CatalogContext.CurrentCatalogName this wrong. Previous method come with commerce 6

    I installed Umbraco 7.2 with commerce 6. I never change installed version and I want to immediate solution for this issue.


     

     

     

     

     

  • Jesper Nielsen 141 posts 498 karma points
    Mar 03, 2015 @ 12:47
    Jesper Nielsen
    0

    Hello,

    When you have succesfully installed the uCommerce package in Umbraco, and can access the uCommerce backend.
    Then you know that the "UCommerce.Umbraco" assembly located in the bin folder of the web-site is working.

    Please use that copy of the assembly.

    Note also, that the "uCommerce.Umbraco.dll" is for Umbraco 4 and 6, while "uCommerce.Umbraco7.dll" is for Umbraco7. Please use the one appropriate for you version of Umbraco.

    I am not quite sure what you mean by the comments regarding the CurrentCatalogName comment. But the name properties have not been part of uCommerce since version 3. You should use the CurrentCatalog property.

    Kind regards,
    Jesper

Please Sign in or register to post replies

Write your reply to:

Draft