4 Replies Latest reply on Sep 17, 2004 12:23 AM by 3004

    ColdFusion & EDK

    3004
      I am playing with using the Java EDK within ColdFusion. I have gotten the EDK object insatiated, but am having trouble getting the expected result from a method call. The following code shows what I am trying to do ...
      <cfobject action="create" type="java" class="com.plumtree.remote.portlet.IPortletRequest" name="ipRequest">
      <cfoutput>#ipRequest.getClassID()#</cfoutput>
      Running this code within a portlet throws a generic 500 error. When I add in a dump command (which basically just dumps the structure of the object including a list methods and properties), I get a list of values that are all undefined.
      AggregationModeClassIDCommunityIDGatewayedHostPageURIImageServerURIInCommunityLoginTokenPageIDPortalUUIDPortletIDPortletModeProtocolVersionRemoteAPIEndpointReturnURIStylesheetURITimeZoneUserInterface
      Does anybody know ColdFusion or the EDK enough to give me a hint what is going on here? First, in this dump, I am not seeing the getClassID() method that I expected to see. Second, why are all of the properties coming back 'undefined'? Is there something special I need to do to get the edk to 'work'?
      Thanks for any pointers.-- Jeff

        • 1. re: ColdFusion & EDK
          3004
          I think the root of the original question was just that I don't fully understand how all of the pieces of the EDK fit and work together yet.
          However, I was following through one of the example Java EDK samples and the first part was declaring a new instance of the PortletContextFactory object. However, when I do this, I receive a very non-descriptive error message ....
          An exception occurred when instantiating a java object. The cause of this exception was that: com/plumtree/openfoundation/web/IXPRequest.
          Anybody have any idea what this is talking about?
          Thanks-- Jeff

          • 2. re: ColdFusion Custom tags
            3004
            To Jeff, and Attention CF People: Are you including the ColdFusion Custom tags which create structures usable by CF from the plumtree / .Net headers? That is how we proceed. Here is a update of the CFGDK cf_initgadget code that works with PT 5.x:
            <!--- CFPROCESSINGDIRECTIVE SUPPRESSWHITESPACE="Yes" --->
            <cfscript> REQUEST.adminSettings = StructNew(); REQUEST.communityGadgetSettings = StructNew(); REQUEST.gadgetSettings = StructNew(); REQUEST.userSettings = StructNew(); REQUEST.communitySettings = StructNew(); REQUEST.gatewaySpecificConfig = StructNew(); REQUEST.permissionSettings = StructNew(); // make structures to capture deltas as modify settings REQUEST.newAdminProperties = StructNew(); REQUEST.newCommunityGadgetProperties = StructNew(); REQUEST.newGadgetProperties = StructNew(); REQUEST.newUserProperties = StructNew(); REQUEST.newCommunityProperties = StructNew(); </cfscript>
            <cfif IsDefined("HTTP_CSP_GLOBAL_GADGET_PREF")> <cfloop list="#HTTP_CSP_GLOBAL_GADGET_PREF#" index="oneItem"> <cfscript> oneItem = URLDecode(oneItem); if( left(oneItem,2) IS "A_" ) prefName = right(oneItem,len(oneItem)-2); else prefName = oneItem; StructInsert( REQUEST.adminSettings, prefName, URLDecode( StructFind(Cookie, oneItem) ), TRUE ); </cfscript> </cfloop> </cfif> <cfif IsDefined("HTTP_CSP_GADGET_REALM_PREF")> <cfloop list="#HTTP_CSP_GADGET_REALM_PREF#" index="oneItem"> <cfscript> oneItem = URLDecode(oneItem); if( left(oneItem,2) IS "C_" ) prefName = right(oneItem,len(oneItem)-2); else prefName = oneItem; StructInsert( REQUEST.communityGadgetSettings, prefName, URLDecode( StructFind(Cookie, oneItem) ), TRUE ); </cfscript> </cfloop> </cfif> <cfloop list="#StructKeyList(Cookie)#" index="oneCookie"> <cfset foundOne = false> <cftry> <cfset x = StructFind(REQUEST.adminSettings, oneCookie)> <cfset foundOne = true> <cfcatch type="Any"> </cfcatch> </cftry> <cftry> <cfset x = StructFind(REQUEST.communityGadgetSettings, oneCookie)> <cfset foundOne = true> <cfcatch type="Any"> </cfcatch> </cftry> <cfscript> oneCookie = URLDecode(oneCookie); if( (left(oneCookie,2) IS NOT "A_") AND (left(oneCookie,2) IS NOT "C_") AND (NOT foundOne) ) {                 if( left(oneCookie,2) IS "G_") itemName = right(oneCookie,len(oneCookie)-2);                 else itemName = oneCookie;                 itemValue = StructFind( Cookie, oneCookie );                 StructInsert( REQUEST.gadgetSettings, itemName, URLDecode(itemValue), TRUE );                 } </cfscript> </cfloop> <cfif IsDefined("HTTP_CSP_USER_PREF")> <!--- due to a Plumtree bug in not URL encoding the CollapsedGadgets, we must remove that item from list before processing ---> <cfset startAt = FindNoCase("CollapsedGadgets", HTTP_CSP_USER_PREF)> <cfif startAt> <!--- need to more robustly look for termination of this string ---> <cfset endAt = Find(""",", HTTP_CSP_USER_PREF, startAt)> <cfif endAt> <cfset line = RemoveChars(HTTP_CSP_USER_PREF, startAt, endAt-startAt+2)> <cfelse> <cfset line = Replace( HTTP_CSP_USER_PREF, "CollapsedGadgets=,", "" )> </cfif> <cfelse> <cfset line = HTTP_CSP_USER_PREF> </cfif> <cfloop list="#line#" index="oneItem"> <cfscript> delimAt = FindOneOf("=", oneItem); if( delimAt ) { itemName = URLDecode(left(oneItem,delimAt-1)); itemValue = URLDecode(right(oneItem,len(oneItem)-delimAt)); } else { itemName = URLDecode(oneItem); itemValue = ""; } if( left(itemValue,1) IS chr(34) ) { itemValue= mid(itemValue,2,len(itemValue)-2); } StructInsert( REQUEST.userSettings, itemName, itemValue, TRUE ); </cfscript> </cfloop> </cfif> <cfif IsDefined("HTTP_CSP_REALM_PREF")> <cfset localVal="#cgi.HTTP_CSP_REALM_PREF#"> <cfset localVal=#Replace(localVal,"%","_","ALL")#> <cfloop list="#localVal#" index="oneItem"> <cfscript> delimAt = FindOneOf("=", oneItem); if( delimAt ) {      itemName = (left(oneItem,delimAt-1));      x=len(oneItem)-delimAt;     if ( x neq 0){     itemValue = (right(oneItem,len(oneItem)-delimAt));      } else { itemName = (oneItem); itemValue = ""; } } if( left(itemValue,1) IS chr(34) ) { itemValue= mid(itemValue,2,len(itemValue)-2); } StructInsert( REQUEST.communitySettings, itemName, itemValue, TRUE ); </cfscript> </cfloop> </cfif>
            <cfif IsDefined("cgi.HTTP_CSP_GATEWAY_SPECIFIC_CONFIG")> <cfset localVal="#cgi.HTTP_CSP_GATEWAY_SPECIFIC_CONFIG#"> <cfset localVal=#Replace(localVal,"%","_","ALL")#> <cfloop list="#localVal#" index="oneItem">
            <cfscript> delimAt = FindOneOf("=", oneItem); if( delimAt ) {      itemName = (left(oneItem,delimAt-1));      x=len(oneItem)-delimAt;     if ( x neq 0){     itemValue = (right(oneItem,len(oneItem)-delimAt));      } else { itemName = (oneItem); itemValue = ""; } } if( left(itemValue,1) IS chr(34) ) { itemValue= mid(itemValue,2,len(itemValue)-2); } StructInsert( REQUEST.gatewaySpecificConfig, itemName, itemValue, TRUE ); </cfscript> </cfloop>
            </cfif> <!--- <cfif IsDefined("HTTP_CSP_CAN_SET")> <cfloop list="#HTTP_CSP_CAN_SET#" index="oneItem"> <cfscript> delimAt = FindOneOf("=", oneItem); if( delimAt ) { itemName = URLDecode(left(oneItem,delimAt-1)); itemValue = URLDecode(right(oneItem,len(oneItem)-delimAt)); } else { itemName = URLDecode(oneItem); itemValue = ""; } if( left(itemValue,1) IS chr(34) ) { itemValue= mid(itemValue,2,len(itemValue)-2); } StructInsert( REQUEST.permissionSettings, itemName, itemValue, TRUE ); </cfscript> </cfloop> </cfif> --->

            • 3. re: re: ColdFusion Custom tags
              3004
              Sidney -
              Thanks for your response. I actually did not realize that the plumtree headers still existed, I thought the new CSP changed all of that.
              Either way, I was hoping to be able to utilize the Java EDK via ColdFusion so that way things should be future proof.
              Thanks for the info though.-- Jeff

              • 4. re: ColdFusion Custom tags
                3004
                Well, after playing with the latest CF GDK, I am back at this again. I am really needing some of the funcationality of the EDK - specifically, the ability to determine a current users activity rights and permissions to a given object.
                So, has anybody had any luck in getting ColdFusion to talk to the EDK? It would seem like the Java EDK should work, I just have not had much luck. Anybody?
                Thanks-- Jeff