Page 1 of 2

Question about "Inventory" module

Posted: Wed May 29, 2013 3:39 am
by staleks
Hi,

I've recently received a request to investigate a blc inventory module. I've found this sentence in README.md:
If you are including this module at the beginning of your project, simply switch to the inventory branch of DemoSite. All of the necessary changes are implemented there.


But if I go to https://github.com/BroadleafCommerce/DemoSite and I check existing branches there, I can't find mentioned branch.

I've found following branches (see attachment):


Can you please help me with this ?

Thank You

Re: Question about "Inventory" module

Posted: Wed May 29, 2013 5:20 am
by staleks
Hi all,

I've added broadleaf-inventory module into pom.xml of admin and site. As suggested I'm investigating adding "CheckAvailabilityActivity" to blAddItemWorkflow and blUpdateItemWorkflow.

Now, in order to get more familiar with initial idea behind BLC Inventory, I am inspecting Inventory and it's implementation (as entity).

Can you please explain me what is idea behind following properties:
- quantityAvailable,
- quantityOnHand and
- expectedAvailabilityDate

Thank you

Re: Question about "Inventory" module

Posted: Wed May 29, 2013 5:34 am
by staleks
Hi,

reading README.md, specially part of SQL update script that I have to execute, I must state here my concern about following SQL inserts:

Code: Select all

INSERT INTO BLC_ADMIN_PERMISSION_ENTITY (ADMIN_PERMISSION_ENTITY_ID, CEILING_ENTITY, ADMIN_PERMISSION_ID) VALUES (230, 'org.broadleafcommerce.core.inventory.domain.FulfillmentLocation', 64);


Please note that, previously ADMIN_PERMISSION_ID starts from 69 and goes to 78, while later, as you can see in previous example, ADMIN_PERMISSION_ID starts with 64 and ends with 73.

(see README.md of Inventory https://github.com/BroadleafCommerce/Inventory
Can this be a typo, or I am not getting some bigger picture how this should be related?

Thank You

Re: Question about "Inventory" module

Posted: Wed May 29, 2013 7:09 am
by staleks
Hi,

update on my findings continue:

Last 4 SQL instert's in provided SQL are:

Code: Select all

INSERT INTO BLC_ADMIN_SECTION_PERMISSION_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (15,74);
INSERT INTO BLC_ADMIN_SECTION_PERMISSION_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (15,75);
INSERT INTO BLC_ADMIN_SECTION_PERMISSION_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (15,76);
INSERT INTO BLC_ADMIN_SECTION_PERMISSION_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (15,77);


but when I try to execute them, I am getting an error that table 'BLC_ADMIN_SECTION_PERMISSION_XREF' doesn't exists.


Could it be that this is another typo in README.md file, and actually SQL should be:

Code: Select all

INSERT INTO BLC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (15,74);
INSERT INTO BLC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (15,75);
INSERT INTO BLC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (15,76);
INSERT INTO BLC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (15,77);


Am I right ?

Re: Question about "Inventory" module

Posted: Wed May 29, 2013 7:45 am
by staleks
Hi,

going further and further, I have found answer to my first question :)

Reading this line,
If you are including this module at the beginning of your project, simply switch to the inventory branch of DemoSite

I was under impression that i should look for branch in https://github.com/BroadleafCommerce/DemoSite.

Later I found out that there is separate repo on github that deals with DemoSite with included inventory.
Look for following URL: https://github.com/BroadleafCommerce/DemoSite-Inventory

Hope this helps a bit.

Re: Question about "Inventory" module

Posted: Wed May 29, 2013 8:02 am
by staleks
Also,

please do not forget to change README.md, to add following line in `messages-admin.properties` file of admin module:

Code: Select all

BLCMerchandising.Inventory=Inventory

otherwise you will end-up with some labels surrounded with ???

Thank You

Re: Question about "Inventory" module

Posted: Wed May 29, 2013 9:29 am
by staleks
Hi,

now I am trying to clone DemoSite-Inventory repo, but with no luck.

Here is the output:

Code: Select all

aleksandar@aleksandar-desktop:~/work/home/client/workspace-inventory$ git clone https://github.com/BroadleafCommerce/DemoSite-Inventory.git
Cloning into 'DemoSite-Inventory'...
remote: Counting objects: 10354, done.
remote: Compressing objects: 100% (3119/3119), done.
remote: Total 10354 (delta 5712), reused 10311 (delta 5669)
Receiving objects: 100% (10354/10354), 55.18 MiB | 185 KiB/s, done.
Resolving deltas: 100% (5712/5712), done.
warning: remote HEAD refers to nonexistent ref, unable to checkout.


Do others have same issue?

Thank You

Re: Question about "Inventory" module

Posted: Wed May 29, 2013 10:04 am
by staleks
Hi,

since git clone of `DemoSite-Inventory` is "giving me a headache", I've downloaded ZIP-ed version and imported to workspace.

While starting application I am having following issue:

Code: Select all

Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.broadleafcommerce.inventory.service.workflow.CheckAvailabilityActivity] for bean with name 'addItemCheckAvailabilityActivity' defined in resource loaded from byte array: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/broadleafcommerce/core/workflow/ModuleActivity
   at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1265)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
   at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1331)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:337)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:316)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:303)
   at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:144)
   at org.springframework.orm.jpa.EntityManagerFactoryUtils.findEntityManagerFactory(EntityManagerFactoryUtils.java:97)
   at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findNamedEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:512)
   at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:494)
   at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:659)
   at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:632)
   at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:155)
   at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:92)
   at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:340)
   ... 23 more
Caused by: java.lang.NoClassDefFoundError: org/broadleafcommerce/core/workflow/ModuleActivity
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2895)
   at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
   at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
   at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:417)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)
   at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1254)
   ... 37 more
Caused by: java.lang.ClassNotFoundException: org.broadleafcommerce.core.workflow.ModuleActivity
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
   ... 48 more


So you will notice that CheckAvailabilityActivity having a problem of instantiating as Spring-bean, due to problem with `ClassNotFoundException`of org.broadleafcommerce.core.workflow.ModuleActivity.
Then I've opened class CheckAvailabilityActivity and found that it implements ModuleActivity interface.

In import of this class you will find that this ModuleActivity is part of `core`

Code: Select all

import org.broadleafcommerce.core.workflow.ModuleActivity;


But when I hit Ctrl + Shift + T (in Eclipse that should give me list of all available Types/Classes) I can't find it.

I've looked into broadleaf-framework-2.3.0-SNAPSHOT, but there is no such (ModuleActivity) class.


Can you please put some light to this ?

Thank You

Re: Question about "Inventory" module

Posted: Wed May 29, 2013 5:31 pm
by phillipuniverse
Ok, attempting to get to all your questions today, looks like you've had a great conversation with yourself so far while we were all asleep! :)

First of all, what version of Broadleaf are you using, and what version of the inventory module are you using? For Broadleaf version, you need to be using at least version 2.2.1-SNAPSHOT for the inventory module, so I assume that you're already doing that.

Re: Question about "Inventory" module

Posted: Thu May 30, 2013 2:13 am
by staleks
Hi Phillip,

no we are not using version 2.2.1-SNAPSHOT of Broadleaf framework. Currently we are at version 2.2.0-GA of Broadleaf.
Is this an obstacle ?

To be honest I am looking at
- https://github.com/BroadleafCommerce/Inventory/blob/master/README.md and I can't find such information. Is the using 2.2.1-SNAPSHOT of Broadleaf framework prerequisite ?

Next, I've also checked the pom.xml of inventory module:
- https://github.com/BroadleafCommerce/Inventory/blob/master/pom.xml and found that dependency to BLC is

Code: Select all

     <dependency>
            <groupId>org.broadleafcommerce</groupId>
            <artifactId>broadleaf-framework</artifactId>
            <version>${blc.version}</version>
            <scope>compile</scope>
            <type>jar</type>
            <optional>true</optional>
        </dependency>

where ${blc.version} is defined in properties element of pom.xml as:

Code: Select all

<blc.version>2.2.0-SNAPSHOT</blc.version>


Am I missing something here?

Thank You for your answer