Passing beans across JSR Portlet Requests

I'm new to portlet development and having trouble getting my head around the following...
All I wan't to do is display a simple form, process the data and display some results.
I would expect to do this through a combination of processAction method and a doView method, however it seems incredibly difficult to get the data created in processAction method into my JSP.
If I was writing a servlet I'd simply create a bean and store it as an attribute in the request scope, but this doesn't seem posible within portlets.
The sun examples use setRenderParameter(), but this only takes strings.
I'd could add the bean to the PortletScope but would rather not as
1. The bean will hang around for the lifetime of the portlet rather than the lifetime of the request
2. The Portlet Specification stes that "Attributes stored in the PORTLET_SCOPE are not protected from other web components of the portlet application.
Surely it can't be this hard to create a bean in the processAction method and access it from the JSP. Please tell me I'm missing something!

I have the same problem with WebLogic Portal, so I
think there's a problem of clarification with the spec, and I
hope this will be clarified once theres a new version of
the portlet API.
If attributes set in ActionRequest cannot be seen in
the render() methods, I simply see no point in defining
setAttribute() and getAttribute() methods on the base
PortletRequest interface ( from which both
RenderRequest and ActionRequest inherit ).
I've checked JSR 168 and PLT3.1 states that
"Attributes set in the portlet request are
available in the included servlet request", but
from the above it seems that this is only true of
renderRequests. Is this a bug in my Portal server
(Vignette 7 Trial Edition)?

Similar Messages

  • Can't pass bean or request attribute from servlet to JSP

    Hi,
    I have a web app that starts with a file upload page that uses commons io fileUpload, passes the info on to a servlet. Then the servlet passes its info on to a JSP.
    I can upload the file onto the web app successfully. I also can call that uploaded file directly from the JSP (i.e. bypassing the servlet) without problem. But if I try to chain all 3 together while passing the url for the file directly as an attribute or as a bean containing file's url, I get premature end of file or can't find the property in the bean. I'm not sure what I'm doing wrong.
    the error message:
    org.apache.jasper.JasperException: javax.servlet.jsp.JspException: Premature end of file.
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         servlet.UploadServlet.processRequest(UploadServlet.java:329)
         servlet.UploadServlet.doPost(UploadServlet.java:363)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    root cause
    javax.servlet.ServletException: javax.servlet.jsp.JspException: Premature end of file.
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:854)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
         org.apache.jsp.clinTrialsEditor_jsp._jspService(clinTrialsEditor_jsp.java:144)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         servlet.UploadServlet.processRequest(UploadServlet.java:329)
         servlet.UploadServlet.doPost(UploadServlet.java:363)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    root cause
    org.xml.sax.SAXParseException: Premature end of file.
         org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
         org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
         org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSource(ParseSupport.java:227)
         org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSourceWithFilter(ParseSupport.java:193)
         org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseReaderWithFilter(ParseSupport.java:199)
         org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseStringWithFilter(ParseSupport.java:206)
         org.apache.taglibs.standard.tag.common.xml.ParseSupport.doEndTag(ParseSupport.java:138)
         org.apache.jsp.clinTrialsEditor_jsp._jspx_meth_x_parse_0(clinTrialsEditor_jsp.java:189)
         org.apache.jsp.clinTrialsEditor_jsp._jspService(clinTrialsEditor_jsp.java:88)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         servlet.UploadServlet.processRequest(UploadServlet.java:329)
         servlet.UploadServlet.doPost(UploadServlet.java:363)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    Code from the servlet:
    String dName = "http://localhost:8084/fileUploadApp/faces/";
    url = dName + fileName;
    beans.FileInfo.setFileName(fileName);
    request.setAttribute("fileInfo", new FileInfo());
    beans.FileInfo.setDName(dName);
    beans.FileInfo.setDirName(dirName);
    beans.FileInfo.setUrl(url);
    File saveTo = new File(dirName + fileName);
    //if I use the next 2 lines I get "can't resolve symbol - create field, local var or parameter FileInfo"
    FileInfo fileInfo = new beans.FileInfo();
    request.setAttribute("fileInfo", FileInfo); //error here
    request.setAttribute("myUrl", url);
    RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/clinTrialsEditor.jsp");
    dispatcher.forward(request, response);
    on JSP
    <jsp:useBean id="fileInfo" class="beans.FileInfo" scope="request"/>
    <jsp:setProperty name="fileInfo" property="*"/>
    <%--<c:import url="http://localhost:8084/fileUploadApp/faces/lowVision.xml" var="url" /> --%> <c:import url="${myUrl}" var="url" />
    <x:parse xml="${url}" var="clin" />
    etc...x:set with xpath expressions
    Can anyone spot my error(s)?
    Thanks for the help!

    Thanks for your reply, Ram.
    I made the change but I get an error "Unable to find a value for "fileName" in bean of type beans.FileInfo"
    Here's the bean:
    package beans;
    public class FileInfo {
    private static String fileName;
    private static String dirName;
    private static String dName;
    private static String url;
    /** Creates a new instance of FileInfo */
    public FileInfo() {
    public static void setFileName(String fn){
    fileName = fn;
    public static String getFileName(){
    return fileName;
    public static void setDirName(String dn){
    dirName = dn;
    public static String getDirName(){
    return dirName;
    public static void setDName(String d){
    dName = d;
    public static String getDName(){
    return dName;
    public static void setUrl(String u){
    url = u;
    public static String getUrl(){
    return url;
    Pertinent parts of servlet:
    String dirName = "C:/MyNBProjects/fileUploadApp/web/"; //save file to web app then convert to url so it can be called to show it on next page
    String dName = "http://localhost:8084/fileUploadApp/faces/";
    url = dName + fileName;
    FileInfo fileInfo = new FileInfo();
    fileInfo.setFileName("fileName");
    fileInfo.setDName("dName");
    fileInfo.setDirName("dirName");
    fileInfo.setUrl("url");
    request.setAttribute("fileName", fileName);
    request.setAttribute("url", url);
    request.setAttribute("fileInfo", fileInfo);
    RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/clinTrialsEditor.jsp");
    dispatcher.forward(request, response);
    jsp:
    <jsp:useBean id="fileInfo" class="beans.FileInfo" scope="request"/>
    <jsp:setProperty name="fileInfo" property="*"/>
    url = <c:out value="${url}" />
    //works; not part of bean
    fileName = <c:out value="${fileName}" />
    //works; not part from the bean
    fileInfo.fileName = <jsp:getProperty name="fileInfo" property="fileName" />
    //doesn't work
    <%--fileName = <c:out value="${fileInfo.fileName}" /> //doesn't work
    Can you spot the error(s)?
    Thanks for your help.

  • How can I pass information from one portlet to another?

    First, some background...
    I am using Portal 5.0.2 and developing portlets using JSP/Java on a remote server.
    I need to pass information from a portlet on pageA to another portlet on pageB, but I can't do it using the traditional methods, such as query string, session, cookies, etc. due to either portal framework limitations or because of functional constraints (basically, a user will not necessarily be logged in to the portal, but he can view anything available to the GUEST user). Here are the different ways I've considered using to save state and their limitations:
    Query string: can't use this because portlets on remote servers don't have access to it
    Cookies: if user disables cookies, code will not function properly
    Session variables: limited to one user's connection with one portlet (i.e., can't access a session variable set in portletA from portletB)
    Application variables: because the user may not be logged in, I have no way of uniquely naming variables, which is a necessity in order to maintain state for EACH user
    User Settings: again, the user may not be logged in, so I can't use these
    PCC: can't access client-side variables because server-side JSP executes first
    Are my assumptions above correct? Has anyone had any success using one of these methods given the same constraints, or does anyone have an alternative solution? I'd certainly appreciate any help anyone could provide.
    Thanks,
    Jose

    One possibility would be to use a Login PEI to set a unique UserInfo Name/Value for the user. I think in 5.0 each guest session is unique, so would have unique UserInfo. Then you could pass this value to your portlet (by specifying it in the web service) and use it as a key into a Application-scoped hashmap where you store your info. In other words, your Application variables option, but you have a way of uniquely naming your variables via PEI-set UserInfo.

  • How do I pass parameter to different portlet regions from another page?

    How do I pass parameter to different portlet regions from
    another page?
    I have a page that with two regions. Each region has a report
    that uses the same information to generate its report.
    Individually running the reports, I can use p_arg_names and
    p_arg_values to get what I want. However, when I run the page
    that has both portlets, my .show is gone and I cannot get it to
    use the p_arg_names, etc. Do you have any idea how to overcome
    this? Thanks for any help.

    How do I pass parameter to different portlet regions from
    another page?
    I have a page that with two regions. Each region has a report
    that uses the same information to generate its report.
    Individually running the reports, I can use p_arg_names and
    p_arg_values to get what I want. However, when I run the page
    that has both portlets, my .show is gone and I cannot get it to
    use the p_arg_names, etc. Do you have any idea how to overcome
    this? Thanks for any help.

  • How to pass authentication token with the request. Error in executing

    Hi,
    I am trying to do a service call.  This service is provided by a third party.  I used SOAP UI tester to test the service and it gives proper response for a request.
    I tried to create a client proxy and execute the method call, but it fails.  In SICF recorder, I found that the request that goes into the service does not contain the authentication token.  But in the SOAP UI tool when I input the WSDL file, it created a sample request, with authentication token in header section.
    But the proxy class generated in the system, contains a input structure, which does not have this authentication structure in it.
    Please guide me if there is any different method used to pass this authentication information.  The structure of authentication structure is
    <web:licenseKey>?</web:licenseKey>
            <web:password>?</web:password>
            <web:username>?</web:username>
    I thought that this authentication information should be given in settings of logical port.  But the logical port has only user name and password.  There is no place holder for License key.
    In summary: My query is that, there is no structure generated for SOAP header where I can pass authentication information, hence the request that goes into the service from SAP does not contain the authentication token.  This results in a error non-soap message/error type 500.
    Sample request that worked in SOAP UI tester is
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.smc.com">
       <soapenv:Header>
          <web:AuthenticationToken>
             <web:licenseKey>XYZA</web:licenseKey>
            <web:password>ABC123</web:password>
            <web:username>suresh<AT>gmail<DOT>com</web:username>
          </web:AuthenticationToken>
       </soapenv:Header>
       <soapenv:Body>
          <web:isReady/>
       </soapenv:Body>
    </soapenv:Envelope>
    The request that goes out of the SAP system does not contain, the AuthenticationToken part.
    Thanks and best regards,
    Suresh.

    You would need to write a webservice handler for your physical data service to implement the security.
    http://download.oracle.com/docs/cd/E13162_01/odsi/docs10gr3/datasrvc/How%20To%20Create%20SOAP%20Handlers%20for%20Imported%20WSDLs.html

  • How to pass bean variable to resourceID for Document Explorer ?

    Hello experts,   I have added  WebCenter document explorer  task flow in my ADF which as  parameter called resourceId.   I want to pass  bean variable to this parameter since  the Content IDs (doc Name or Ids) are  decided dynamically.
    When I provide ${'UCM57Server#dDocName:1379596941565_CONTACT_OPTREGI'}  as  resourceId  in the expression, it is working very fine.    But   samething  if I assign to a  bean variable and assign  bean variable  as  ${sessionScope.MyBean.docName},   it is  evaluating  the  bean variable  as ${'UCM57Server#dDocName:1379596941565_CONTACT_OPTREGI'}   and then throws  below exception :
    [2013-10-02T14:34:50.369-04:00] [DefaultServer] [WARNING] [WCS-07219] [oracle.webcenter.doclib.internal.view.backing.ContentProvider] [tid: [ACTIVE].ExecuteThread: '10' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: anonymous] [ecid: d50192415c689920:-7d97126c:1417a5d6a49:-8000-000000000000008a,0] [APP: CreateContactWSProxy] Invalid parameter combination: the connection name specified by resourceId = ${'UCM57Server#dDocName:1379596941565_CONTACT_OPTREGI'} is not the same as specified in parameter connectionName = UCM57Server.
    Bean variable is defined as :
    private String docName="${'UCM57Server#dDocName:1379596941565_CONTACT_OPTREGI'} ";
    Please provide me some guidance to pass  value to  resourceId  dynamically  through bean variable.
    thank you.

    Document explorer is not the way to go in order to view multiple documents of your choice, the Resource ID field is just a starting path. Check this link for all parameters about Documents Explorer
    If you want to view multiple documents, you should use Content Presenter and specify the query that these documents falls under. Check this link for add Documents Task Flows

  • JSR Portlets , removing minimize and maximize

    How can we remove the minmize and maximzie icons for JSR portlets ?
    In weblogic portlets , we can set that in properties can minimize and can maximize,
    But I did not see anything for JSR 168 portlets

    Add the following in your weblogic-portlet.xml file
    <portlet>
    <portlet-name>your_portlet_name</portlet-name>
    <supports>
    <mime-type>text/html</mime-type>
    <excluded-window-state>minimized</excluded-window-state>
    <excluded-window-state>maximized</excluded-window-state>
    </supports>
    </portlet>
    Note that, by default, all Java portlets have normal, minimized and
    maximized states. By adding the above, you can exclude
    minimized/maximized states.
    Subbu
    Srinivas Surapaneni said the following on 02/04/2004 12:02 PM:
    How can we remove the minmize and maximzie icons for JSR portlets ?
    In weblogic portlets , we can set that in properties can minimize and can maximize,
    But I did not see anything for JSR 168 portlets

  • Unhandled Exception: System.TimeoutException: The request channel timed out while waiting for a reply after 00:01:59.9139778.Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding.

    Hi, 
    I created a simple plugin and since i wanted to use Early Binding i added Xrm.cs file to my solution.After i tried registering the plugin (using the Plugin Registration Tool) the plugin does not gets registered and i get the below mentioned Exception.
    Unhandled Exception: System.TimeoutException: The request channel timed out while waiting for a reply after 00:01:59.9139778. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this
    operation may have been a portion of a longer timeout.
    Server stack trace: 
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.Xrm.Sdk.IOrganizationService.Update(Entity entity)
       at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.UpdateCore(Entity entity)
       at Microsoft.Crm.Tools.PluginRegistration.RegistrationHelper.UpdateAssembly(CrmOrganization org, String pathToAssembly, CrmPluginAssembly assembly, PluginType[] type)
       at Microsoft.Crm.Tools.PluginRegistration.PluginRegistrationForm.btnRegister_Click(Object sender, EventArgs e)
    Inner Exception: System.TimeoutException: The HTTP request to 'https://demoorg172.api.crm.dynamics.com/XRMServices/2011/Organization.svc' has exceeded the allotted timeout of 00:01:59.9430000. The time allotted to this operation may have been a portion of a
    longer timeout.
       at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
       at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
    Inner Exception: System.Net.WebException: The operation has timed out
       at System.Net.HttpWebRequest.GetResponse()
       at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
    And to my Surprise after i remove the Xrm.cs file from my solution the Plugin got registered!
    Not understanding what exactly is the issue.
    Any Suggestions are highly appreciated.
    Thanks,
    Shradha
      

    Hello Shardha,
                            I really appreciate that you have faced this issue.This is really very strange issue and basically it occurs because of big size of your early bound class and slow internet
    connection.
                            I would strictly recommend you to reduce the file size of your early bound class and then register.By default early bound class is created for all the entities which are
    present in CRM(System entities as well custom entities).Such kind of early bound classes takes lots of time to register on server and hence timeout exception comes.
                            There is some standard define to reduce the size of early bound class.Please follow the link to get rid from big size of early bound class.
    Create a new C# class library project in Visual Studio called SvcUtilFilter.
    In the project, add references to the following:
    CrmSvcUtil.exe(from sdk)   This exe has the interface we will implement.
    Microsoft.Xrm.Sdk.dll  (found in the CRM SDK).
    System.Runtime.Serialization.
      Add the following class to the project:
    using System;
    using System.Collections.Generic;
    using System.Xml.Linq;
    using Microsoft.Crm.Services.Utility;
    using Microsoft.Xrm.Sdk.Metadata;
    namespace SvcUtilFilter
        /// <summary>
        /// CodeWriterFilter for CrmSvcUtil that reads list of entities from an xml file to
        /// determine whether or not the entity class should be generated.
        /// </summary>
        public class CodeWriterFilter : ICodeWriterFilterService
            //list of entity names to generate classes for.
            private HashSet<string> _validEntities = new HashSet<string>();
            //reference to the default service.
            private ICodeWriterFilterService _defaultService = null;
            /// <summary>
            /// constructor
            /// </summary>
            /// <param name="defaultService">default
    implementation</param>
            public CodeWriterFilter( ICodeWriterFilterService defaultService )
                this._defaultService = defaultService;
                LoadFilterData();
            /// <summary>
            /// loads the entity filter data from the filter.xml file
            /// </summary>
            private void LoadFilterData()
                XElement xml = XElement.Load("filter.xml");
                XElement entitiesElement = xml.Element("entities");
                foreach (XElement entityElement in entitiesElement.Elements("entity"))
                    _validEntities.Add(entityElement.Value.ToLowerInvariant());
            /// <summary>
            /// /Use filter entity list to determine if the entity class should be generated.
            /// </summary>
            public bool GenerateEntity(EntityMetadata entityMetadata, IServiceProvider services)
                return (_validEntities.Contains(entityMetadata.LogicalName.ToLowerInvariant()));
            //All other methods just use default implementation:
            public bool GenerateAttribute(AttributeMetadata attributeMetadata, IServiceProvider services)
                return _defaultService.GenerateAttribute(attributeMetadata, services);
            public bool GenerateOption(OptionMetadata optionMetadata, IServiceProvider services)
                return _defaultService.GenerateOption(optionMetadata, services);
            public bool GenerateOptionSet(OptionSetMetadataBase optionSetMetadata, IServiceProvider services)
                return _defaultService.GenerateOptionSet(optionSetMetadata, services);
            public bool GenerateRelationship(RelationshipMetadataBase relationshipMetadata, EntityMetadata otherEntityMetadata, IServiceProviderservices)
                return _defaultService.GenerateRelationship(relationshipMetadata, otherEntityMetadata, services);
            public bool GenerateServiceContext(IServiceProvider services)
                return _defaultService.GenerateServiceContext(services);
    This class implements the ICodeWriterFilterService interface.  This interface is used by the class generation
    utility to determine which entities, attrributes, etc. should actually be generated.  The interface is very simple and just has seven methods that are passed metadata info and return a boolean indicating whether or not the metadata should be included
    in the generated code file.   
    For now I just want to be able to determine which entities are generated, so in the constructor I read from an XML
    file (filter.xml) that holds the list of entities to generate and put the list in a Hashset.  The format of the xml is this:
    <filter>
      <entities>
        <entity>systemuser</entity>
        <entity>team</entity>
        <entity>role</entity>
        <entity>businessunit</entity>
      </entities>
    </filter>
    Take a look at the methods in the class. In the GenerateEntity method, we can simply check the EntityMetadata parameter
    against our list of valid entities and return true if it's an entity that we want to generate.
    For all of the other methods we want to just do whatever the default implementation of the utility is.  Notice
    how the constructor of the class accepts a defaultService parameter.  We can just save a reference to this default service and use it whenever we want to stick with the default behavior.  All of the other methods in the class just call the default
    service.
    To use our extension when running the utility, we just have to make sure the compiled DLL and the filter.xml file
    are in the same folder as CrmSvcUtil.exe, and set the /codewriterfilter command-line argument when running the utility (as described in the SDK):
    crmsvcutil.exe /url:http://<server>/<org>/XrmServices/2011/Organization.svc /out:sdk.cs  /namespace:<namespace> /codewriterfilter:SvcUtilFilter.CodeWriterFilter,SvcUtilFilter
    /username:[email protected] /password:xxxx
    That's it! You now have a generated sdk.cs file that is only a few hundred kilobytes instead of 5MB. 
    One final note:  There is actually a lot more you can do with extensions to the code generation utility. 
    For example: if you return true in the GenerateOptionSet method, it will actually generated Enums for each CRM picklist (which it doesn't normally do by default).
    Also, the source code for this SvcUtilFilter example can be found here. 
    Use at your own risk, no warranties, etc. etc. 
    Please mark as a answer if this post is useful to you.

  • RE: passing UserWindow across partitions

    The "partition" reference is a red-herring. What I mean is, the fact
    that you are running across partitions has nothing to do with the error
    you are receiving. Consider the error. It says either one of two
    things is going wrong. Either:
    #1) You are trying to serialize a pointer, or
    #2) You are trying to send a pointer across a partition.
    You are, most manifestly, NOT receiving an error saying "serialized data
    cannot be sent across partitions." In your case, the correct
    interpretation of your situation is error #1). That is, you are trying
    to serialize a pointer (indirectly).
    In short, I have tried to do what you are doing, and the unfortunate
    answer to your problem is: you cannot serialize a window. Since the
    window contains pointers, and pointers cannot be serialized, windows
    cannot be serialized. Sorry...
    From: [email protected]
    To: [email protected]
    Subject: passing UserWindow across partitions
    Date: Tuesday, February 25, 1997 4:43PM
    I'm trying to pass a UserWindow object as a parameter to a method on a
    service object in a separate partition. The idea is to be able to store
    the window object on a server and retrieve it (and display it, etc.)
    later
    from a client. Works great in test mode, but when I run it in
    distributed
    mode, I get the error:
    Attempt to serialize a pointer value or to send a pointer value
    between
    partitions. Values of type 'pointer' can neither be serialized nor
    sent
    from one partition to another.
    I'm guessing this has something to do with the UserWindow.window
    attribute
    having attributes that are pointers to system-specific resources. For
    what
    it's worth, it doesn't work even if I haven't opened the window yet. In
    other words, the following code causes the same error:
    tempWin: someWindowClass = new();
    myServiceObject.takeThisWindow(tempWin);
    Has anyone ever tried this kind of thing before and succeeded?

    Maybe, just maybe, you can use gparted to move the excess space in your new partition which is above your existing partition size after first identifying it as swap.  Then move it to the end of the drive, leaving space for a new partition which is the same size as your existing partition.
    That, maybe, will accept the dd transfer since the partition size is identical.  After all is done, delete the swap.
    I hope I made sense.....

  • Jsr portlets - remove title bar

    How to remove title bar of a JSR portlet. (portlet.xml or weblogic.portlet.xml?). I have imported few java portlets into my portal and I want to remove the title bar. weblogic.portlet.xml file does not have any entries apart from </weblogic-portlet-app> tag..
    Like for the JPF portlets we can set the refreshAction how to control the initial action for a java portlet.
    thanks

    Sorry, no.
    In fact Apple put them at the top by popular demand!

  • 3230 Mobile Access Router not Passing Traffic across WMICs

    I'm unable to pass traffic across the WMICs. I've assigned the BVIs ip addresses in the same subnet and I'm seeing the devices associated. I attached the configurations.
    Thanks,

    A ruggedized router in a flexible and compact design, ideally suited to create mobile networks in and around vehicles.
    Here is the URL for the furthere information for grounding in the vehicales and description :
    http://www.cisco.com/en/US/prod/collateral/routers/ps272/prod_presentation0900aecd802948c0.pdf
    http://www.cisco.com/en/US/products/hw/routers/ps272/ps4375/index.html

  • MVC2.0-- how to pass bean object to jsp

    Hi All,
    Anybody please tell me how to pass bean class object from controller to jsp ?
    I am developing an application in MVC2.0.
    I am creating an object of bean class in controller servlet and want to pass this object to jsp so anybody please tell how to pass this object to jsp.
    ControllerServlet--
    Bean obj = new Bean();
    Bean --
    public String aMethod() {
    return data;
    I have to use this method in my jsp and I am creating an object of this bean in controller servlet.
    Please help
    Thanks
    Please reply soon

    Hi,
    Thanks for your response. I knew it is possible with session objects. But I want to perform this operation with out using session objects. Is there a way to accomplish this with out using Session objects.
    Please help.
    Thanks

  • Ungatewayed portlet requests have no portal settings

    Hello,
    I'm getting the following error when hitting search to search in our staff directory. Anyone know what's going on?
    Ungatewayed portlet requests have no portal settings.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: Plumtree.Remote.Portlet.NotGatewayedException: Ungatewayed portlet requests have no portal settings.
    Source Error:
    Line 48: context = PortletContextFactory.CreatePortletContext(HttpContext.Current.Request, HttpContext.Current.Response)
    Line 49: groupID = CInt(context.GetRequest.GetSettingValue(SettingType.Admin, GROUPNAME))
    Source File: xxxxxxxx\AppPage.vb Line: 49
    Stack Trace:
    [NotGatewayedException: Ungatewayed portlet requests have no portal settings.]
    Plumtree.Remote.Portlet.PortletRequestWrapper.GetSettingValue(SettingType type, String name) +204
    xxx.PTL.StaffDirectory.Web.AppPage.isAdmin() in xxxxxx\xxx.PTL.StaffDirectory.Web\AppPage.vb:49
    xxx.PTL.StaffDirectory.Web.StaffSearch.AddIncludeTerminatedRow(Int32 controlIndex) in xxxxxxxx\StaffSearch.aspx.vb:285
    xxx.PTL.StaffDirectory.Web.StaffSearch.LoadLOVs() in xxxxxxxx\StaffSearch.aspx.vb:188
    xxx.PTL.StaffDirectory.Web.StaffSearch.Page_Load(Object sender, EventArgs e) in xxxxxxxx\StaffSearch.aspx.vb:76
    System.EventHandler.Invoke(Object sender, EventArgs e) +0
    System.Web.UI.Control.OnLoad(EventArgs e) +127
    System.Web.UI.Control.LoadRecursive() +92
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3360
    Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3614

    Hello and thank you for your response. This is a custom application through a remote portlet. It is a popup window where this error occurs. The weird thing is that it works on another server but not this particular one where I need to get it working on.
    The Gateway URL Prefixes are all set to the application server. I'm sure that this is correct as it is working like this on our production environment. The difference is that the app was .NET 1.1 on Portal 6.1 and now it is .NET 2.0 on Portal 10.3.
    Is it possible that something was missed during the Portal upgrade to 10.3? If yes, do you have any idea what it could be?

  • Passing bean as attribute to servlet in request scope

    Hello,
    I want to pass a bean from a jsp to my controller servlet. As I understood, as long as I can give the bean 'request' scope, then I should be abble to access the bean, as an attribute in the doPost / doGet method of my servlet. However, when I try to get the bean in the servlet, its always null.
    I am aware that request scope beans don't loose their values when passing to other JSP's , but what about passing to servlets?
    I dont want to use a session scoped bean as I believe this should be possible with a request scoped variable.
    <%-- vwLogon.jsp --%>
    <jsp:useBean id="viewBean" class="com.alto.common.ViewBean" scope="request">
         <jsp:setProperty name="viewBean" property="viewName" value="/vwLogon"/>
    </jsp:useBean>
    <html>
    <body>
    <h2>Enter Name</h2>
    <form method="GET" action="controller">
         Enter your name:<input type="text" name="vwLogon_User_txt" value=""/>
         Enter your password:<input type="secret" name="vwLogon_Password_txt" value=""/>
    <input type="submit" name="vwLogon_Logon_Btn" value="Logon"/>
    </form>
    </body>
    </html>
    ------------------------------- controller servlet
    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    ViewBean viewBean = (ViewBean)req.getAttribute("viewBean");
    String strURL = new String("");
    if (!(viewBean==null)) {
    strURL = viewBean.getViewName();

    A request/response pair is one communication between the client browser and the web server. A submit form action generates a new request.
    In this instance you have two requests:
    1 - load login page
    2 - submit login page
    The point of being able to give a bean request scope, is so that you can use jsp:forward, or jsp:include to pass on the request, and the bean as well.
    In your case, a session bean is probably called for, as you have 2 request/responses in your session.
    Hope this clears things up a little.
    Cheers,
    evnafets

  • Keeping the values in Request bean across more than 2 pages

    Hi...,
    I have created a Bean with request scope & want to access it across 3 different pages.
    From the 1st page once I submit the values , I do a forward (redirect=no) to the second page where I can print the values . From the 2nd page I then do a forward to the 3rd page (redirect=no) & I loose the values.
    How do I keep the request bean active across multiple pages. But I don't want to make it session as this is a form to enter values & our users might open multiple forms as the same time.
    Regards,
    Praveen

    Hi....Balu,
    We are having a issue when using ajax on top of JSF . Setting the variable hidden is somehow not working.
    Secondly, what is requestMap & where can I find the information.
    Regards,
    Praveen

Maybe you are looking for

  • Routing issue to 12.183.19.0/27

    I can't access servers in the 12.183.19.0/27 subnet, nor can I access my server from the servers located in that range. I can access any other Internet addresses from either location though. I'm able to access both locations from my phone (T-mobile).

  • Jdeveloper 11.1.2.4.0 - EJBModule exception

    After upgrading to Jdeveloper 11.1.2.4.0 ,I am getting the below exception on generating the webservice for a database procedure api. It works fine with the previous version. <Failure occurred in the execution of deployment request with ID '136794437

  • Apple magic mouse

    I have just purchased the new Apple magic mouse.My operating system is Tiger version 10.4.1 The booklet with the mouse says you need to have an Apple version of 10.5.8 or later and to install the wireless mouse software update. Has any one installed

  • Can I use Imovie 6 to combine edit songs and combine them?

    I would like to import some songs, cut some of them in half, and make them into one big song.  Can I use iMove or is there a better free program for that?

  • My ipod touch 3rd generation jumps hrough tracks whilst streaming music over bluetooth to a sony device how can I fix this?

    When streaming music over bluetooth from my 3rd generation ipod touch to a sony device it jumps every 10 seconds and not just when moving or anything other devices do not do this just the ipod how can I fix this?