• Carl H
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
hi,

May i know why the outputText in visualforce page will show unmarked value from encrypted field?

FYI, i did changed my profile to disabled the view encrypted field and also confirmed
(via eclipse) that the selected record in my custom field is marked with XXXX. But when i display the record on visualforce page with outputText, it show unmarked value. It seems like the profile control doesn't work with the outputText.

And when i change the outputText to outputField, it shows marked data correctly. It is the encrypted field only work with outputField?
  • August 21, 2008
  • Like
  • 0
Hi all,

I'd like to get salesforce URL (https://na2.salesforce.com) inside Apex class, may i know what is the syntax.
i tried the "ApexPages.currentPage().getParameters()" but it only return me the parameters at behind, how to get the host name?
Hi all,

I'm trying to make a connection to google Spreadsheet with the example provided in (http://wiki.apexdevnet.com/index.php/Google_Data_Authentication)
And i'm able to get the session token but then when i trying to get the spreadsheets list with the following code

string token = ApexPages.currentPage().getParameters().get('token');
string sessToken = AuthSubUtil.exchangeForSessionToken(token);

SpreadsheetService service = new SpreadsheetService();
service.setAuthSubToken(sessToken);
GoogleData sheets = service.getSpreadsheets();

But the system return me this error = "Illegal character(s) in message header value: AuthSub token="CJm1yZSmDhDemoas-f____8B "" and the "CJm1yZSmDhDemoas-f____8B" actually is my session token return from AuthSubUtil.exchangeForSessionToken(token)

string token = ApexPages.currentPage().getParameters().get('token');
string sessToken = AuthSubUtil.exchangeForSessionToken(token);

SpreadsheetService service = new SpreadsheetService();
service.setAuthSubToken(sessToken);

Then i removed the "service.getSpreadsheets()" line (as above) and print the content of service and it return me below are the message


SpreadsheetService:[
canCallout=null,
debug=null,
response=null,
service=GoogleService:[AuthSubToken=CJm1yZSmDhDCwv-BAw ,canCallout=null,debug=0,gsessionid=null,response=null,responseXml=null,slug=null],
spreadsheets=null,
spreadsheetsfeed=null]


I don't really understand what is the problem why i'm unable to get the spreadsheet list from my Google Account. Does anyone can help me please???

Below is the javascript code to make the token request from google side. FYR

var scope = 'http://spreadsheets.google.com/feeds/spreadsheets/private/full/';
var forceReDirect = '/_ui/core/google/GoogleAuthSubCallback—url=' ;
var googleRedir = 'https://www.google.com/accounts/AuthSubRequest–next=';

var myApp = encodeURIComponent(window.location.pathname + "˜id={!$CurrentPage.parameters.id}" );
var nextUrl = window.location.protocol + '//' + window.location.host + forceReDirect + myApp ;
var tokenRequestUrl = googleRedir + encodeURIComponent( nextUrl ) + "&session=1&secure=0&scope="+ scope;

 



Message Edited by Carl H on 06-27-2008 05:53 AM

Message Edited by Carl H on 06-27-2008 06:12 AM
Hi all,

I'd like to get salesforce URL (https://na2.salesforce.com) inside Apex class, may i know what is the syntax.
i tried the "ApexPages.currentPage().getParameters()" but it only return me the parameters at behind, how to get the host name?
Hi all,

I'm trying to make a connection to google Spreadsheet with the example provided in (http://wiki.apexdevnet.com/index.php/Google_Data_Authentication)
And i'm able to get the session token but then when i trying to get the spreadsheets list with the following code

string token = ApexPages.currentPage().getParameters().get('token');
string sessToken = AuthSubUtil.exchangeForSessionToken(token);

SpreadsheetService service = new SpreadsheetService();
service.setAuthSubToken(sessToken);
GoogleData sheets = service.getSpreadsheets();

But the system return me this error = "Illegal character(s) in message header value: AuthSub token="CJm1yZSmDhDemoas-f____8B "" and the "CJm1yZSmDhDemoas-f____8B" actually is my session token return from AuthSubUtil.exchangeForSessionToken(token)

string token = ApexPages.currentPage().getParameters().get('token');
string sessToken = AuthSubUtil.exchangeForSessionToken(token);

SpreadsheetService service = new SpreadsheetService();
service.setAuthSubToken(sessToken);

Then i removed the "service.getSpreadsheets()" line (as above) and print the content of service and it return me below are the message


SpreadsheetService:[
canCallout=null,
debug=null,
response=null,
service=GoogleService:[AuthSubToken=CJm1yZSmDhDCwv-BAw ,canCallout=null,debug=0,gsessionid=null,response=null,responseXml=null,slug=null],
spreadsheets=null,
spreadsheetsfeed=null]


I don't really understand what is the problem why i'm unable to get the spreadsheet list from my Google Account. Does anyone can help me please???

Below is the javascript code to make the token request from google side. FYR

var scope = 'http://spreadsheets.google.com/feeds/spreadsheets/private/full/';
var forceReDirect = '/_ui/core/google/GoogleAuthSubCallback—url=' ;
var googleRedir = 'https://www.google.com/accounts/AuthSubRequest–next=';

var myApp = encodeURIComponent(window.location.pathname + "˜id={!$CurrentPage.parameters.id}" );
var nextUrl = window.location.protocol + '//' + window.location.host + forceReDirect + myApp ;
var tokenRequestUrl = googleRedir + encodeURIComponent( nextUrl ) + "&session=1&secure=0&scope="+ scope;

 



Message Edited by Carl H on 06-27-2008 05:53 AM

Message Edited by Carl H on 06-27-2008 06:12 AM
I'm unable to upload package wich contains application with  VisualForce tabs.
I'm getting the following error : "Your upload failed. You will receive an e-mail containing additional information".

I asked this question couple of days ago. But this post has more precise definition.

Thank you in advance.