Forums de discussion

Extending iframe portlet

Ben Shuey, modifié il y a 12 années.

Extending iframe portlet

New Member Publications: 2 Date d'inscription: 29/08/11 Publications récentes
Hello all,

Running into an issue with trying to extend the iframe portlet. Basically, given the standard OOTB iframe portlet, we need to add a boolean to check if it's a special type of portlet. We need to store this boolean, and it should be configurable from the standard iframe configuration screen. I've got eclipse setup with the liferay ide, running the bundled tomcat as the app server.

Two methods have been attempted: a hook and the ext-plugin environment. Starting with the hook, the view and configuration jsps were overrode, with the config having an extra checkbox to set the boolean, and the view just displaying the current value of it. Hitting Save didn't save the actual variable, so I figured there was an issue with the Configuration Implementation class. Trying to override this class was a complete failure.

Tried to do the same thing in the ext environment. Was once again able to get the view and config jsps overwritten, but whenever I tried to add in the custom java class, the system throws event errors.

Basically, what is the correct way to extend the ConfigurationActionImpl.java class for the OOTB iframe portlet?

Also, I'm assuming the java class needs to be extended, but does there need to be extra db tables? I've noticed that exporting the pages as LAR, and that all of the preferences are stored in the preferences.xml file.

Thanks,

Ben
thumbnail
jelmer kuperus, modifié il y a 12 années.

RE: Extending iframe portlet

Liferay Legend Publications: 1191 Date d'inscription: 10/03/10 Publications récentes
You would define your ExtConfigurationActionImpl in ext-impl,

Then you create a file called liferay-portlet-ext.xml in ext-web/docroot/WEB-INF/

which looks like this

<!--?xml version="1.0"?-->


<liferay-portlet-app>

	<portlet>
		<portlet-name>48</portlet-name>
		<icon>/html/icons/default.png</icon>
		<struts-path>iframe</struts-path>
		<configuration-action-class>com.yourcompany.ExtConfigurationActionImpl</configuration-action-class>
		<use-default-template>false</use-default-template>
		<instanceable>true</instanceable>
		<remoteable>true</remoteable>
		<private-request-attributes>false</private-request-attributes>
		<private-session-attributes>false</private-session-attributes>
		<render-weight>50</render-weight>
		<header-portlet-css>/html/portlet/iframe/css/main.jsp</header-portlet-css>
		<css-class-wrapper>portlet-iframe</css-class-wrapper>
	</portlet>

</liferay-portlet-app>


notice that i changed the default configuration-action-class to one of your own.
Ben Shuey, modifié il y a 12 années.

RE: Extending iframe portlet

New Member Publications: 2 Date d'inscription: 29/08/11 Publications récentes
OK so I've added that code in, and added an iframe portlet to a page.

Now, after the portlet is added, I attempt to access the configuration page, and get an error from Tomcat saying that it can't find the configuration.jsp file. I try adding all of iframe jsp files under the MYIframe-ext/docroot/WEB-INF/ext-web/docroot/html/... and nothing seems to work. I also try overriding the files by adding a hook with a custom jsp directory. Either way, it says that I'm missing that configuration.jsp file.

Thank you for the help btw, I hope I'm just missing something small!