bon voilà j'ai 2 programmes java ,le premier:
import oracle.portal.provider.v1.*;
public class MyPersonalizationObject extends NameValuePersonalizationObject
{
// Key to retrieve the customized greeting.
public static final String GREETING = "mpo_greeting";
// Override the init method to provide default values for the items we wish
// to customize.
public void init(PortletReference pr)
{
// Always be sure to call super.init() first.
super.init(pr);
// Call super class method to set the default title for this portlet.
setPortletTitle("My First Portlet" );
// Write the default greeting into the data object using super class
// method.
putString(GREETING,"Welcome to My First Portlet !!" );
}
}
je compile , aucun probleme.
Voici le second programme qui se trouve dans le meme repertoire que le premier:
import java.io.*;
import oracle.portal.provider.v1.*;
import oracle.portal.provider.v1.http.*;
public class MyEditRenderer extends BaseManagedRenderer
{
public void renderBody(PortletRenderRequest pr) throws PortletException
{
try
{
// Retrieve the name of the parameter used to represent the user
// action taken on the edit form. This name was assigned by
// RenderManager but can be overridden by the portlet developer.
String actionParam = PortletRendererUtil.getEditFormParameter(pr);
// Now retrieve the value of that action parameter.
String action = pr.getParameter(actionParam);
// Retrieve the data object for later use.
MyPersonalizationObject data =
(MyPersonalizationObject)PortletRendererUtil.getEditData(pr);
// If the action was non null, then we have to save our newly
// customized data. Otherwise, we have to render the edit form.
if (action != null)
{
// Write the personalized values into the data object.
data.setPortletTitle(pr.getParameter("mfp_title" ));
data.putString(MyPersonalizationObject.GREETING,
pr.getParameter(MyPersonalizationObject.GREETING));
// Submit the data object back to the PersonalizationManager
// for storing.
PortletRendererUtil.submitEditData(pr, data);
}
else
{
// Get a writer for the edit form.
PrintWriter out = pr.getWriter();
// Render the form.
out.println("<TABLE BORDER=0 CELLSPACING=0>" );
out.println("<TR><TD>Title:</TD>" );
out.print("<TD><INPUT TYPE=\"text\" NAME=\"mfp_title\" " +
"SIZE=\"50\" VALUE=\"" + data.getPortletTitle() +
"\" </TD></TR>" );
out.println("<TR><TD>Greeting:</TD>" );
out.print("<TD><INPUT TYPE=\"text\" NAME=\"" +
MyPersonalizationObject.GREETING + "\" SIZE=\"50\" "+
"VALUE=\"" );
out.print(data.getString(MyPersonalizationObject.GREETING) +
"\" </TD></TR>" );
out.println("</TABLE>" );
}
}
catch (IOException ioe)
{
throw new PortletException(ioe);
}
}
}
[quote]
Lorsque je compile ce second programme , voilà ce que javac me renvoie:
MyEditRenderer.java:24: Class MyPersonalizationObject not found.
MyPersonalizationObject data =
^
MyEditRenderer.java:25: Class MyPersonalizationObject not found.
(MyPersonalizationObject)PortletRendererUtil.getEditData(pr);
^
MyEditRenderer.java:53: Class MyPersonalizationObject not found.
MyPersonalizationObject.GREETING + "\" SIZE=\"50\" "
^
MyEditRenderer.java:53: Undefined variable or class name: MyPersonalizationObje
t
MyPersonalizationObject.GREETING + "\" SIZE=\"50\" "
^
4 errors
[/i]
Si vous avez une idéé du probleme ,je vous remercie!!!!!!!!
[i]