5 Replies Latest reply on Feb 11, 2008 2:29 AM by HowardTreisman

    Getting current user

    AlvinPearson1 Level 1
      Hi

      How do see who(wich user) completed a process if the PDF was sent to a group?

      Alvin
        • 1. Re: Getting current user
          Jasmin Charbonneau Level 4
          In the User step that contains the group assignment, under the Form Data Mapping section, there is a "Complete User ID" field you can leverage.

          Jasmin
          • 2. Re: Getting current user
            AlvinPearson1 Level 1
            Thanks Jasmin

            But now my problem is witch user is it as I get :53D46EAB-A7BA-8DD5-1556-7BED7DCD4EA2 as a result

            Alvin
            • 3. Re: Getting current user
              AlvinPearson1 Level 1
              Hi
              I found out that the id is in edcprincipalentity in the adobe DB
              now I am trying to call a webservice(Diffrent Process) from my PDF and it doesn't want to gives an error.
              In that process is a Foundation - jdbcservice Service.

              So I tried doing it from flex as have made a successful call to a process soap endpoint which used a renderPDFForm service.
              This code works:
              <?xml version="1.0" encoding="utf-8"?>
              <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns="*"
              creationComplete="iFrame.visible=true"
              viewSourceURL="srcview/index.html">
              <mx:WebService id="myWeb" wsdl="http://Adobe1:8080/soap/services/StatementImportXML?wsdl" useProxy="false"
              result="response(event)" showBusyCursor="true"/>
              <mx:Script>
              <![CDATA[
              import mx.core.ByteArrayAsset;
              import mx.rpc.events.ResultEvent;
              import mx.controls.Alert;

              public function Des():void{
              //myWeb.setCredentials("Administrator","password");
              var xml:String =
              "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
              "<xfa:datasets xmlns:xfa=\"http://www.xfa.org/schema/xfa-data/1.0/\">"+
              "<xfa:data>"+
              "<form1>"+
              " <emailto>edwin@egis-software.com</emailto>"+
              " <subject>Credit Card Statement for period</subject>"+
              " <Flow>"+
              " <Header>"+
              " <Name>Edwin Woolf</Name>"+
              " <Period>2007-12-01 to 2007-12-31</Period>"+
              " <AvailableBalance>R 28 378.10</AvailableBalance>"+
              " <CurBalance>-R 6 992.90</CurBalance>"+
              " <AccNo>5471209024145019</AccNo>"+
              " </Header>"+
              " <DetailFlow>"+
              " <DetailFixed>"+
              " <Date>2007-12-08</Date>"+
              " <Description>M#AFRICAN CHILDRENS FEED BRAAMFONTEIN ZA"+
              "75414127341735465425371</Description>"+
              " <Amount>-46.00</Amount>"+
              " </DetailFixed>"+
              " </Flow>"+
              " </form1>"+
              "</xfa:data>"+
              "</xfa:datasets> ";
              myWeb.getOperation("invoke").send(xml);
              iFrame.visible = false;
              wait1.visible = true;
              wait2.visible = true;
              }
              public function Jan():void{
              //myWeb.setCredentials("Administrator","password");
              var xml:String =
              "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
              "<xfa:datasets xmlns:xfa=\"http://www.xfa.org/schema/xfa-data/1.0/\">"+
              "<xfa:data>"+
              "<form1>"+
              " <emailto>edwin@egis-software.com</emailto>"+
              " <subject>Credit Card Statement for period</subject>"+
              " <Flow>"+
              " <Header>"+
              " <Name>Edwin Woolf</Name>"+
              " <Period>2008-01-01 to 2008-01-31</Period>"+
              " <AvailableBalance>R 28 378.10</AvailableBalance>"+
              " <CurBalance>-R 6 992.90</CurBalance>"+
              " <AccNo>5471209024145019</AccNo>"+
              " </Header>"+
              " <DetailFlow>"+
              " <DetailFixed>"+
              " <Date>2008-01-08</Date>"+
              " <Description>M#AFRICAN CHILDRENS FEED BRAAMFONTEIN ZA"+
              "75414127341735465425371</Description>"+
              " <Amount>-46.00</Amount>"+
              " </DetailFixed>"+
              " </DetailFlow>"+
              " </Flow>"+
              " </form1>"+
              "</xfa:data>"+
              "</xfa:datasets> ";
              myWeb.getOperation("invoke").send(xml);
              iFrame.visible = false;
              wait1.visible = true;
              wait2.visible = true;
              }
              public function response(event:ResultEvent):void{
              var b:ByteArrayAsset = new ByteArrayAsset();
              b.writeObject(myWeb.getOperation("invoke").lastResult);

              var temp:String = b.toString();
              //Alert.show(temp);
              var result:String = temp.substr(temp.indexOf("http://"));
              iFrame.source = (result.toString());
              iFrame.visible = true;
              wait1.visible = false;
              wait2.visible = false;
              }
              ]]>
              </mx:Script>
              <mx:HBox width="100%" height="100%">
              <mx:Panel width="200" height="100%" title="Statement for">
              <mx:Button label="December 07" click="{Des();}"/>
              <mx:Button label="Januarie 08" click="{Jan();}"/>
              <!--mx:TextArea height="100%" width="100%" id="txtXml"/>
              <mx:TextInput id="txtUrl" bottom="10" width="100%" change="iFrame.source = (txtUrl.text.toString());" visible="true"/>
              <mx:Button click="iFrame.source = (txtUrl.text.toString());" label="get PDF" visible="false"/-->
              </mx:Panel>
              <mx:Panel width="100%" height="100%" title="Content" paddingTop="1" paddingBottom="1" paddingLeft="1" paddingRight="1" id="iPanel" >
              <mx:Label text="Generating PDF ..." visible="false" id="wait1" fontSize="20"/>
              <IFrame id="iFrame" source="http://www.adobe.com/devnet/flex/" width="100%" height="100%" />
              <mx:ControlBar visible="false">
              <mx:CheckBox id="cbVisible" label="IFrame Visible" selected="true" click="iFrame.visible=cbVisible.selected"/>
              </mx:ControlBar>
              <mx:Label text="Generating PDF ..." visible="false" id="wait2" fontSize="20"/>
              </mx:Panel>
              </mx:HBox>
              </mx:Application>

              Now this code does not work:
              <?xml version="1.0" encoding="utf-8"?>
              <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
              <mx:WebService id="myWeb" wsdl="http://Adobe1:8080/soap/services/GetUserName?WSDL" useProxy="false"
              result="response(event)" showBusyCursor="true" fault="fault(event)"/>
              <mx:Script>
              <![CDATA[
              import mx.rpc.events.FaultEvent;
              import mx.core.ByteArrayAsset;
              import mx.rpc.events.ResultEvent;
              import mx.controls.Alert;
              public function response(event:ResultEvent):void{
              /// var b:ByteArrayAsset = new ByteArrayAsset();
              /// b.writeObject(myWeb.getOperation("invoke").lastResult);

              //var temp:String = b.toString();
              Alert.show(myWeb.getOperation("invoke").lastResult+"");
              }
              public function fault(event:FaultEvent):void{

              Alert.show(event.toString());
              }
              public function clickMe():void{
              var userId:String;
              userId = "53D46EAB-A7BA-8DD5-1556-7BED7DCD4EA2";
              //Alert.show(myWeb.canLoadWSDL()+"");


              //myWeb.setRemoteCredentials("Administrator","password");
              myWeb.getOperation("invoke").send(userId);


              }
              ]]>
              </mx:Script>
              <mx:Button x="285" y="181" label="Button" click="clickMe()"/>

              </mx:Application>
              It gives the following error:
              [FaultEvent fault=[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://adobe1:8080/soap/services/GetUserName"]. URL: http://adobe1:8080/soap/services/GetUserName"] messageId="607193D8-ED94-8DA7-D592-F45445759C33" type="fault" bubbles=false cancelable=true eventPhase=2]
              • 4. Re: Getting current user
                Jasmin Charbonneau Level 4
                You can use the jdbc service and perform the following statement:

                SELECT uidstring FROM edcprincipaluserentity where refprincipalid ='53D46EAB-A7BA-8DD5-1556-7BED7DCD4EA2'

                Jasmin
                • 5. Re: Getting current user
                  HowardTreisman Level 1
                  We have a LookupUser component which simplifies all this.
                  Download a free copy for dev/test use here:
                  http://www.avoka.com/apps/checkcookie?qpac=y&qpac_code=avoka7qpacs&location=%2Fapps%2Fqpac download

                  Docs are:
                  http://avoka.dnsalias.com/confluence/display/Public/Lookup+DSC
                  and
                  http://avoka.dnsalias.com/confluence/display/Public/Find+Out+Details+About+the+Last+Form+U ser

                  Hope this helps...
                  Howard
                  http://www.avoka.com