Cwe
December 2, 2016, 8:45am
1
Enonic version: 6.8
OS: Linux
So I made a service which sorta belongs to a content-type. Since the content-type is in a lib, I felt like putting the service in the lib aswell. But that does not work. If I copy the service into the app, it works just fine.
Should it be possible for services to exist in libs?
srs
December 2, 2016, 9:59am
2
No, it’s not possible to have services in libs yet. It’s planned, but we cannot do that currently.
srs
December 2, 2016, 10:13am
3
Sorry, I just answered about Java services. When it comes to services
in JavasScript it will work from a lib too.
1 Like
srs
December 2, 2016, 10:13am
4
Where’s your services located? Under /site
or just on the root?
tsi
December 2, 2016, 10:13am
5
Hmm… services/ should work fine in libs shouln’t they? @srs are you talking about Java service maybe?
Cwe
December 2, 2016, 10:15am
6
Not in site, but in src/main/resources/services/serviceName/serviceName.js
srs
December 2, 2016, 10:17am
7
Should work, but let me just verify it. It’s designed to work, but maybe it’s a bug somewhere.
srs
December 2, 2016, 10:19am
8
Can you try to move it under a site and try it again to see if it works?
Cwe
December 2, 2016, 10:23am
9
When I move it to site, it works.
srs
December 2, 2016, 10:24am
10
Ok, then I will report this as a bug. It will be fixed in 6.9.
Cwe
December 2, 2016, 10:25am
11
Don’t know whether it’s relevant, but the service is in a lib inside another lib
srs
December 2, 2016, 10:32am
12
Oh, so you bundle a lib inside another lib? Why? Or is it just dependencies?
Cwe
December 2, 2016, 10:36am
13
Because library L uses stuff from library M.
Library M has very few dependencies.
Library L has many dependancies.
App A uses library M (and thus L).
App B only uses library L.
srs
December 2, 2016, 10:42am
14
So it’s just dependencies, right? It’s not that LibL includes LibM (like inside the jar file)?
Cwe
December 2, 2016, 10:56am
15
libL “includes” libM via build.gradle dependencies runtime files(’…/libFolder/build/libs/libName.jar’)
Cwe
December 2, 2016, 10:57am
16
Application A does not include lib L as it gets it via lib M.