Message Boards

extending service.js (servicebuilder)

Stewart Cambridge, modified 16 Years ago.

extending service.js (servicebuilder)

New Member Posts: 18 Join Date: 7/30/07 Recent Posts
Dear Liferay and community,

With regard to the following two issues:
Extension environment's exp-ejb/build.xml's build-service doesn't pass correct # of
and
Make everything.js smaller, minimize http requests
I would like to ask the question:
How do I extend a service built in ext so that it works through javascript? How do I extend service.js?

What I am observing is this:
  • The service builder creates a file called:/ext/ext-web/docroot/html/js/ext/service.js
  • That the deployed script is NOT merged with /portal/portal-web/docroot/html/js/liferay/service.js
  • That adding ext/service.js,\ to portal-ext.properties blocks liferay/service.js from functioning.
  • That adding <header-javascript>/html/js/liferay/service_packed.js</header-javascript> to liferay-portal-ext.xml does not help.


What's the definitive word on this please? I'm chasing my tail here.

Thanks,

Stewart
Stewart Cambridge, modified 16 Years ago.

RE: extending service.js (servicebuilder)

New Member Posts: 18 Join Date: 7/30/07 Recent Posts
Ok, how does this sound for a solution?

The first few lines of the generated ext/service.js contains this:
Liferay.Service.Portal = {
	servicePackage: "com.sgl.portal.service.http."
};


Thus, when we have in portal-ext.properties this:
        liferay/service.js,\
        ext/service.js,\


then these opening lines of ext/service.js wipe out almost all the javascript defined in liferay/service.js.

The solution is to delete these three lines from ext/service.js.

DOH!

emoticon
thumbnail
Roman Hoyenko, modified 16 Years ago.

RE: extending service.js (servicebuilder)

Liferay Master Posts: 878 Join Date: 10/8/07 Recent Posts
I think it is being replaced, not merged. So you need to include all the service.js plus your changes to make it work.