Saturday, October 25, 2008

Cloud Computing

"Cloud Computing" をキーワードにして、google で検索してみた(そもそもどのような説明が辞書に載っているかを意味を調べるため)

上位表示のtop2は↓だった。

1位 salesforce
2位 google

おそるべし

Thursday, October 23, 2008

Dashboard on Salesforce Android

Let's see how to describe dashboard widgets on Salesforce Android. At a glance, they seem different (a bit). This is actually coming from google chart api component.


[salesforce original dashboard]


[Salesforce Android dashboard]

Wednesday, October 22, 2008

Android Source Code Avaiable

What is it going on Salesforce Android with Android itself source code?

I'm thinking that Main big of salesforce android change goes to Visualforce component. As all know, the android uses webkit componenet as default web browser. This is so powerful to render html/javascript smoothly.

Running webkit every clicking hyperlink within salesforce android - every cloud computing starts from salesforce android at first.

Saturday, October 18, 2008

How cook dashboard/report data?

The apps processes to show dashboard data by analyzing, dashboard metadata, report data of the dashbaord, understand fields of the metadata for query, and then issue a query call.

Wednesday, October 15, 2008

Analyzing Report Metadata

At a glace, some value of report metadata xml element, they dont have completely muching element comparing to api names of salesforce like "ADDRESS1_STATE". Gee this'll take time to grab all and do much without causing errors upon querying for desribing report as same as report on salesforce server.

API reference does not mention about this...

Monday, October 13, 2008

Got Dashboard/Report via MetaData API 14.0

I've got dashboard/report setting by salesforce meta data api 14.0 that has come out just now with Salesforce winter09.

1. login with starndard api url
2. get session id and metadata login url from the result of #1
3. access to the metadata url with the session id (with metadata namespce, of course) at the Header element and a metadata method at the Body element of SOAP message.
4. Issue a retrieve() metadata method.
5. does this following a way from Salesforce Metadata API direction. Metadata API Reference


--- qte ---
To retrieve packaged or unpackaged components:
5-1. Issue a retrieve() call to start the asynchronous retrieval. An AsyncResult object is returned. If the call is completed, the done field contains true. Most often, the call is not completed quickly enough to be noted in the result. If it is completed, note the value in the id field returned and skip the next step.

5-2. If the call is not complete, issue a checkStatus() call in a loop using the value in the id field of the AsyncResult object returned by the retrieve() call in the previous step. Check the AsyncResult object returned, until the done field contains true. The time taken to complete a retrieve() call depends on the size of the zip file being deployed, so a longer wait time between iterations should be used as the size of the zip file increases.

5-3. Issue a checkRetrieveStatus() call to obtain the results of the retrieve() call, using the id value returned in the first step.

6. get element result of retrieve method from the RerieveResult Object.
7. decode value of as base64
8. unzip the result of #7.
9. Success!



Fig1. folder upon unziping


Fig2. dashboard metadata as xml


The next step is to give it a thought how to delopy this dashboard on the Salesforce Android app.

Friday, October 10, 2008

Visualforce, Use Repeat Tag


Visualforce では、Controller とバインドして Salesforce から取得したデータなどを動的にページへ反映させることもできます。{!xxx} という差し込み項目と同じフォーマットで値を反映させることができますが、タグを利用し、繰り返しの処理を行うことで表の中に Salesforce から取得してきたデータを反映させることできます。たとえば、下記のように < apex:repeat >タグを使って商談名を縦に表示できます。


< !-- visualforce -- >
< apex:repeat value="{!deals}" var="opp" >
< p >"{!opp.name}"< /p >
< /apex:repeat >

< !-- controller -- >
public class MatrixCreator{
/** queries Opportunity data and return them */
public Opportunity[] getDeals() {
Opportunity[] opps = [ SELECT Id, Name FROM Opportunity ];
return opps;
}
}


Visualforce タグが誕生する前は、ajax にて select の返り値の result.size() 文だけ for 文などのループを回す必要がありました。Visualforce タグにより、コードが簡潔になるだけでなく、クライアントサイドの ajax の処理がなくなるため、パフォーマンスが一定に近づきます。


さらに、html のテーブル(table, tr, td)も書けるのですが、ここでは google chart api を呼び出すサンプルとします。

< !-- Visualforce Page -- >
< apex:page showheader="false" controller="MatrixCreator">
< script type="text/javascript" src="http://www.google.com/jsapi">< /script>

< script type="text/javascript">
google.load("visualization", "1", {packages:["table"]});
google.setOnLoadCallback(drawTable);

function drawTable() {
var gdata = new google.visualization.DataTable();
gdata.addColumn('string', 'Name');
gdata.addColumn('number', 'Amount');
gdata.addColumn('string', 'Phase');
gdata.addColumn('string', 'Account');
gdata.addRows({!size});

var i = 0;


gdata.setCell(i, 0, "{!opp.name}");
gdata.setCell(i, 1, {!opp.amount}, '¥' + new Number("{!opp.amount}"));
gdata.setCell(i, 2, "{!opp.stagename}");
gdata.setCell(i++, 3, "{!opp.account.name}");


var table = new google.visualization.Table(document.getElementById('opp_amount_ranking'));
table.draw(gdata, {showRowNumber: true});
google.visualization.events.addListener(table, 'select', function() {
var row = table.getSelection()[0].row;
alert(gdata.getValue(row, 0));
});
}
< /script>
< /apex:page>

< !-- controller -- >
public class MatrixCreator{
/** queries Opportunity data and return them */
public Opportunity[] getDeals() {
Opportunity[] opps = [ SELECT Id, Name, Amount, StageName, CloseDate, Probability, OwnerId, AccountId, Account.Name FROM Opportunity ORDER BY amount DESC NULLS LAST Limit 10 ];
return opps;
}
}

Wednesday, October 08, 2008

Its Architecture - Salesforce Google Android

The image bellow is showing the salesforce android briefly. It consists of 2 components mainly, Salesforce part and Google part. The current version is well progress rather than Google part. But step by step, I'm going to give my time to focus on the Google part and other parts.

Tuesday, October 07, 2008

Steps for growing on Salesforce platform

Summing up plans about the Salesforce Android for coming these 2 months

1. Adding salesforce custom objects by analyzing data table relationship between standard objects and cutom objects dynamically.

2. Making speed of analyzing soap faster.

3. Establishing stable database(SQLite) component.

4. Working on Visualforce with developing Webkit if necessary.

5. Getting more user-friend ui.

Saturday, October 04, 2008

Let's conquer the world!

Shall we conquer the world? I've post and shared this salesforce android application code. Have a look at the app!

Project Home at Google Code.

Discussion Board at Google Group

Highly level conecpts of this fantastic project are:

1. Conquer the world
2. Maintain social justice
3. Achieve a primary balance surplus

Join in the project if you agree with these 3 concepts!