Fórum

Use Localized option in Service Builder

thumbnail
Randy Parsons, modificado 9 Anos atrás.

Use Localized option in Service Builder

Junior Member Postagens: 33 Data de Entrada: 04/01/11 Postagens Recentes
I'm attempting to use the 'Localized' option on a field set in the service.xml file, but unfortunately, when I open the jsp page utilizing this field, I always get an error. (Yes, I always rebuild using the Build Services tool in the IDE.)
FYI - I'm using 6.1.3 Liferay Portal with all the most current patches and the 1.6.3 IDE.

Code in service.xml
...
<column name="article" type="String" localized="true" />
...

Code in jsp page
...
<aui:form action="<%= editURL %>" name="<portlet:namespace/>fm" method="POST">
	<aui:fieldset>
		<aui:input name="redirect" type="hidden" value="<%= redirect %>" />
		<aui:input name="caId" type="hidden" value="<%= announcement == null ? &quot;&quot; : announcement.getCaId() %>" />
		<aui:input name="headline" />
		<aui:input name="article" />		
		...		
	</aui:fieldset>

	<aui:button-row>
		<aui:button type="submit" />		
		<aui:button onClick="<%= viewURL %>" type="cancel" />
	</aui:button-row>	
</aui:form>

As soon as the page is opened I get the following error.
Error:
13:35:57,415 ERROR [http-bio-8080-exec-2][MinifierUtil:111] 203: 79: missing ) after argument list
13:35:57,420 ERROR [http-bio-8080-exec-2][MinifierUtil:111] 1: 0: Compilation produced 1 syntax errors.
13:35:57,422 ERROR [http-bio-8080-exec-2][MinifierUtil:88] JavaScript Minifier failed for__// __				Liferay.Portlet.onLoad(_					{_						canEditTitle: true,_						columnPos: 0,_						isStatic: 'end',_						namespacedId: 'p_p_id_160_',_						portletId: '160',_						refreshURL: '\x2fc\x2fportal\x2frender_portlet\x3fp_l_id\x3d10175\x26p_p_id\x3d160\x26p_p_lifecycle\x3d0\x26doAsGroupId\x3d10180\x26refererPlid\x3d10183\x26p_t_lifecycle\x3d0\x26p_p_state\x3dnormal\x26p_p_mode\x3dview\x26p_p_col_id\x3d\x26p_p_col_pos\x3d0\x26p_p_col_count\x3d0\x26p_p_isolated\x3d1\x26currentURL
...
, fieldRules: [__					__				]_			__			_		}_	);__	_})();});_// _ [Sanitized]

And, if I remove the 'Localized' option, rebuild the services, everything starts to work again.

Can anyone please lead me in the right direction.
thumbnail
Randy Parsons, modificado 9 Anos atrás.

RE: Use Localized option in Service Builder

Junior Member Postagens: 33 Data de Entrada: 04/01/11 Postagens Recentes
Has no one run into this issue?

I have completely rebuilt my IDE environment / portlet and the issue continues the moment I open the form. What exactly is the JavaScript Minifier doing in this scenario?

Any assistance would greatly be appreciated.
Oliver Bayer, modificado 9 Anos atrás.

RE: Use Localized option in Service Builder

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
Hi Randy,

given the code and stacktrace snippet you've provided I don't think this error is related to the service builder. The JavaScript Minifier tries to -as the name indicates- shrink javascripts and is catching a syntax error. So my guess would be that either your portlet or your theme is including some js which isn't perfectly correct. You can try to remove all custom js (for debugging purpose) and just use the ootb js of Liferay.

HTH Oli
thumbnail
Randy Parsons, modificado 9 Anos atrás.

RE: Use Localized option in Service Builder

Junior Member Postagens: 33 Data de Entrada: 04/01/11 Postagens Recentes
Hi Oli,

Thanks for the reply. When you are mentioning the removal of all custom js code, are you inferring in the JSP page in question? The only code I had was a standard <aui:script> (see below) which I will remove and test based on your recommendation. I do agree with your comment
don't think this error is related to the service builder
since when the form loads, it is showing the localized button next to the field in question. Just that nothing works when attempting to click on it.

<aui:script>
	Liferay.provide(
	window,
	'<portlet:namespace />updatePage',
	function(){		
		submitForm(document.<portlet:namespace />fm);
		}
	)
</aui:script>

My purpose of the code above was to refresh the page so new values selected in drop downs provide new fields to be populated. Still trying to fully understand how to do that, but that is second to my first issue.

Update: I have removed the code above and retried with no success. Any other thoughts?
Oliver Bayer, modificado 9 Anos atrás.

RE: Use Localized option in Service Builder

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
Hi Randy,

...removal of all custom js code, are you inferring in the JSP page in question?

Yes but not only there. Javascripts can be included in several different ways in Liferay and JSP is only one of them. If you've deployed a custom theme check these files. Also you should check other plugins, hooks etc. Another way of including custom js is overriding the properties "javascript.barebone.files" and/ or "javascript.everything.files" within the portal-ext.properties.

If you don't find any other custom js at the mentioned places you can try if deleting the "work" and "temp" folder (assuming you are using tomcat) and restarting the server will work. As a last try you can set up a plain Liferay (without any code changes) to see if the deploy is working there.

Oli
thumbnail
Randy Parsons, modificado 9 Anos atrás.

RE: Use Localized option in Service Builder

Junior Member Postagens: 33 Data de Entrada: 04/01/11 Postagens Recentes
Hi Oli,

Been away on vacation emoticon.

I do all my testing in a vanilla instance of Liferay Portal using classic default theme, so I have no custom js files thru hooks, plugins, etc. I also delete my Temp and Work directories quite often as I have found before this can cause issues - especially with CSS changes.

Not sure what else to try at this point. I've been trying to follow the code with other Liferay portlets but no such luck as they seem to do things a little different with each one. Unfortunately documentation is so scarce on anything beyond the basics.

Appreciate your comments.
Randy