Skip to content

Commit

Permalink
Checking in beta
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbirk committed Feb 1, 2012
1 parent c42f536 commit 4caf5f3
Show file tree
Hide file tree
Showing 262 changed files with 759 additions and 39,164 deletions.
2 changes: 2 additions & 0 deletions Commands/Apex Reference.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ echo "<script>window.location.href='http://www.salesforce.com/us/developer
</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>~@f</string>
<key>name</key>
<string>Apex Reference</string>
<key>output</key>
Expand Down
3 changes: 2 additions & 1 deletion Commands/Build All.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
echo "&lt;div style='width:100%;background-image: -webkit-linear-gradient(left , rgb(76,142,255) 12%, rgb(105,199,250) 56%, rgb(255,255,255) 78%);'&gt;&lt;h2&gt;Build All&lt;/h2&gt;&lt;/div&gt;"
cd "$TM_PROJECT_DIRECTORY"
. build.properties
if [ ! -f "new.properties" ]
then
if [ ${usekeychainaccess} == 'enabled' ]
then
cp build.properties build.bak
shellpassword=$(~/Library/Application\ Support/TextMate/Bundles/ForceDotBundle.tmbundle/Tools/keychain.sh ${password})
shellpassword=$("${TM_BUNDLE_SUPPORT}/keychain.sh" ${password})
sed "s/${password}/${shellpassword}/" build.properties &gt; new.properties
cp new.properties build.properties
fi
Expand Down
53 changes: 37 additions & 16 deletions Commands/Build File.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,75 @@
<string>echo "&lt;style&gt;body { margin: 0px; padding: 0px; background-color:#efefef }&lt;/style&gt;"
echo "&lt;div style='width:100%;background-image: -webkit-linear-gradient(left , rgb(76,142,255) 12%, rgb(105,199,250) 56%, rgb(255,255,255) 78%);'&gt;&lt;h2&gt;Build File: ${TM_FILENAME%.*}&lt;/h2&gt;&lt;/div&gt;"
if [ ${TM_FILENAME##*.} == 'xml' ]
then
echo 'Meta files are deployed with the normal files.'
fi
#dir=pwd
cd "$TM_PROJECT_DIRECTORY"
api=22 #default
. build.properties
if [ ! -f "${TM_FILENAME%.*}.${TM_FILENAME##*.}-meta.xml" ]
then
if [ ${TM_FILENAME##*.} == 'cls' ]
then echo '&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"&gt;&lt;apiVersion&gt;22.0&lt;/apiVersion&gt;&lt;status&gt;Active&lt;/status&gt;&lt;/ApexClass&gt;' &gt; "${TM_FILENAME%.*}.${TM_FILENAME##*.}-meta.xml"
then
cd classes
if [ ! -f "${TM_FILENAME%.*}.${TM_FILENAME##*.}-meta.xml" ]
then
echo "&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;
&lt;ApexClass xmlns=\"http://soap.sforce.com/2006/04/metadata\"&gt;
&lt;apiVersion&gt;${api}.0&lt;/apiVersion&gt;
&lt;status&gt;Active&lt;/status&gt;
&lt;/ApexClass&gt;" &gt; "${TM_FILENAME%.*}.${TM_FILENAME##*.}-meta.xml"
fi
fi
if [ ${TM_FILENAME##*.} == 'page' ]
then echo "&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;
then
cd pages
if [ ! -f "${TM_FILENAME%.*}.${TM_FILENAME##*.}-meta.xml" ]
then
echo "&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;
&lt;ApexPage xmlns=\"http://soap.sforce.com/2006/04/metadata\"&gt;
&lt;apiVersion&gt;22.0&lt;/apiVersion&gt;
&lt;apiVersion&gt;${api}.0&lt;/apiVersion&gt;
&lt;label&gt;${TM_FILENAME%.*}&lt;/label&gt;
&lt;/ApexPage&gt;" &gt; "${TM_FILENAME%.*}.${TM_FILENAME##*.}-meta.xml"
fi
fi
if [ ${TM_FILENAME##*.} == 'component' ]
then echo "&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;
then
cd components
if [ ! -f "${TM_FILENAME%.*}.${TM_FILENAME##*.}-meta.xml" ]
then
echo "&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;
&lt;ApexComponent xmlns=\"http://soap.sforce.com/2006/04/metadata\"&gt;
&lt;apiVersion&gt;22.0&lt;/apiVersion&gt;
&lt;apiVersion&gt;${api}.0&lt;/apiVersion&gt;
&lt;label&gt;${TM_FILENAME%.*}&lt;/label&gt;
&lt;/ApexComponent&gt;" &gt; "${TM_FILENAME%.*}.${TM_FILENAME##*.}-meta.xml"
fi
fi
if [ ${TM_FILENAME##*.} == 'trigger' ]
then echo '&lt;?xml version="1.0" encoding="UTF-8"?&gt;
then
cd triggers
if [ ! -f "${TM_FILENAME%.*}.${TM_FILENAME##*.}-meta.xml" ]
then
echo '&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;ApexTrigger xmlns="http://soap.sforce.com/2006/04/metadata"&gt;
&lt;apiVersion&gt;22.0&lt;/apiVersion&gt;
&lt;apiVersion&gt;${api}.0&lt;/apiVersion&gt;
&lt;status&gt;Active&lt;/status&gt;
&lt;/ApexTrigger&gt;' &gt; "${TM_FILENAME%.*}.${TM_FILENAME##*.}-meta.xml"
fi
fi
cd "$TM_PROJECT_DIRECTORY"
. build.properties
if [ ! -f "new.properties" ]
then
if [ ${usekeychainaccess} == 'enabled' ]
then
cp build.properties build.bak
shellpassword=$(~/Library/Application\ Support/TextMate/Bundles/ForceDotBundle.tmbundle/Tools/keychain.sh ${password})
shellpassword=$("${TM_BUNDLE_SUPPORT}/keychain.sh" ${password})
sed "s/${password}/${shellpassword}/" build.properties &gt; new.properties
cp new.properties build.properties
fi
Expand Down
3 changes: 2 additions & 1 deletion Commands/Build Latest.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<key>command</key>
<string>cd "$TM_PROJECT_DIRECTORY"
. build.properties
echo "&lt;style&gt;body { margin: 0px; padding: 0px; background-color:#efefef }&lt;/style&gt;"
echo "&lt;div style='width:100%;background-image: -webkit-linear-gradient(left , rgb(76,142,255) 12%, rgb(105,199,250) 56%, rgb(255,255,255) 78%);'&gt;&lt;h2&gt;Building Latest&lt;/h2&gt;&lt;/div&gt;"
Expand All @@ -15,7 +16,7 @@ if [ ! -f "new.properties" ]
if [ ${usekeychainaccess} == 'enabled' ]
then
cp build.properties build.bak
shellpassword=$(~/Library/Application\ Support/TextMate/Bundles/ForceDotBundle.tmbundle/Tools/keychain.sh ${password})
shellpassword=$("${TM_BUNDLE_SUPPORT}/keychain.sh" ${password})
sed "s/${password}/${shellpassword}/" build.properties &gt; new.properties
cp new.properties build.properties
fi
Expand Down
3 changes: 2 additions & 1 deletion Commands/Build Sequential.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
<key>command</key>
<string>cd "$TM_PROJECT_DIRECTORY"
. build.properties
if [ ! -f "new.properties" ]
then
if [ ${usekeychainaccess} == 'enabled' ]
then
cp build.properties build.bak
shellpassword=$(~/Library/Application\ Support/TextMate/Bundles/ForceDotBundle.tmbundle/Tools/keychain.sh ${password})
shellpassword=$("${TM_BUNDLE_SUPPORT}/keychain.sh" ${password})
sed "s/${password}/${shellpassword}/" build.properties &gt; new.properties
cp new.properties build.properties
fi
Expand Down
2 changes: 2 additions & 0 deletions Commands/Custom Labels.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
echo "&lt;script&gt;window.location.href='https://${pod}.salesforce.com/101'&lt;/script&gt;"</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>~@f</string>
<key>name</key>
<string>Custom Labels</string>
<key>output</key>
Expand Down
2 changes: 2 additions & 0 deletions Commands/Debug Logs.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
echo "&lt;script&gt;window.location.href='https://${pod}.salesforce.com/setup/ui/listApexTraces.apexp'&lt;/script&gt;"</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>~@f</string>
<key>name</key>
<string>Debug Logs</string>
<key>output</key>
Expand Down
2 changes: 1 addition & 1 deletion Commands/Get Latest.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -f "new.properties" ]
if [ ${usekeychainaccess} == 'enabled' ]
then
cp build.properties build.bak
shellpassword=$(~/Library/Application\ Support/TextMate/Bundles/ForceDotBundle.tmbundle/Tools/keychain.sh ${password})
shellpassword=$("${TM_BUNDLE_SUPPORT}/keychain.sh" ${password})
sed "s/${password}/${shellpassword}/" build.properties &gt; new.properties
cp new.properties build.properties
fi
Expand Down
61 changes: 33 additions & 28 deletions Commands/Get Object.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -11,63 +11,68 @@ echo "&lt;div style='background-color: white; border:1px solid #999; font-family
echo "&lt;pre id='output_pre'&gt;"
cd "$TM_PROJECT_DIRECTORY"
api=22 #default
. build.properties
if [ ${usekeychainaccess} == 'enabled' ]
then
password=$(~/Library/Application\ Support/TextMate/Bundles/ForceDotBundle.tmbundle/Tools/keychain.sh ${password})
password=$("${TM_BUNDLE_SUPPORT}/keychain.sh" ${password})
fi
cd ~/Library/Application\ Support/TextMate/Bundles/ForceDotBundle.tmbundle/Tools
dir=$(pwd)
session=0
#determine session
if [ -f ".session" ]
then
session=$(cat .session)
if [ ! -n "${consumerkey+x}" ]
then
echo "SOAP Login..."
session=$(echo ${username}:${password} | php -q ./loginasme.php)
else
echo "OAUTH Login..."
json=$(curl -d "grant_type=password&amp;client_id=${consumerkey}&amp;client_secret=${privatekey}&amp;username=${username}&amp;password=${password}" https://login.salesforce.com/services/oauth2/token)
IFS=':' read -ra data &lt;&lt;&lt; "$json"
session1=${data[7]}
session0=${session1:1}
session=${session0/\"\}/}
fi
echo $session &gt; .session
fi
#make REST callout
echo "data = " &gt; data.json
data=$(curl -s https://${pod}.salesforce.com/services/data/v20.0/sobjects/${TM_SELECTED_TEXT}/describe -H "Authorization: OAuth ${session}" -H "X-PrettyPrint:1")
echo "data = " &gt; "${TM_BUNDLE_SUPPORT}/data.json"
data=$(curl -s https://${pod}.salesforce.com/services/data/v{$api}.0/sobjects/${TM_SELECTED_TEXT}/describe -H "Authorization: OAuth ${session}" -H "X-PrettyPrint:1")
echo $data
echo $data &gt;&gt; data.json
echo $data &gt;&gt; "${TM_BUNDLE_SUPPORT}/data.json"
#check to see if session expired
sessioncheck=$(grep -ic "INVALID_SESSION" "data.json")
sessioncheck=$(grep -ic "INVALID_SESSION" "${TM_BUNDLE_SUPPORT}/data.json")
if [ "$sessioncheck" != "0" ]
then
rm data.json
rm .session
session=$(echo ${username}:${password} | php -q ./loginasme.php)
if [ ! -n "${consumerkey+x}" ]
then
echo "Retrying SOAP Login..."
data=$(curl -s -d "&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;&lt;soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:enterprise.soap.sforce.com\"&gt;&lt;soapenv:Body&gt;&lt;urn:login&gt;&lt;urn:username&gt;${username}&lt;/urn:username&gt;&lt;urn:password&gt;${password}&lt;/urn:password&gt;&lt;/urn:login&gt;&lt;/soapenv:Body&gt;&lt;/soapenv:Envelope&gt;" -H "Content-Type: text/xml; charset=utf-8" -H "SOAPAction:'' " ${serverurl}/services/Soap/u/11.1)
echo $data &gt; response.xml
session=$(sed -n -e 's/.*&lt;sessionId&gt;\(.*\)&lt;\/sessionId&gt;.*/\1/p' response.xml)
rm response.xml
else
echo "Retrying OAUTH Login..."
json=$(curl -d "grant_type=password&amp;client_id=${consumerkey}&amp;client_secret=${privatekey}&amp;username=${username}&amp;password=${password}" ${serverurl}/services/oauth2/token)
IFS=':' read -ra data &lt;&lt;&lt; "$json"
session1=${data[7]}
session0=${session1:1}
session=${session0/\"\}/}
fi
echo $session &gt; .session
#make REST callout
echo "data = " &gt; data.json
data=$(curl -s https://${pod}.salesforce.com/services/data/v22.0/sobjects/${TM_SELECTED_TEXT}/ describe -H "Authorization: OAuth ${session}" -H "X-PrettyPrint:1")
echo $data &gt;&gt; data.json
data=$(curl -s https://${pod}.salesforce.com/services/data/v20.0/sobjects/${TM_SELECTED_TEXT}/describe -H "Authorization: OAuth ${session}" -H "X-PrettyPrint:1")
echo $data
echo $data &gt;&gt; "${TM_BUNDLE_SUPPORT}/data.json"
fi
sleep 1
#move to HTML widget
echo "&lt;/pre&gt;&lt;/div&gt;&lt;script&gt;window.location = 'file://${dir}/objectinfo.html'&lt;/script&gt;"
echo "&lt;/pre&gt;&lt;/div&gt;&lt;script&gt;window.location = 'file://${TM_BUNDLE_SUPPORT}/objectinfo.html'&lt;/script&gt;"
#cleanup
sleep 1
rm data.json
rm "${TM_BUNDLE_SUPPORT}/data.json"
</string>
<key>input</key>
Expand Down
3 changes: 3 additions & 0 deletions Commands/Logout.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<string>cd "$TM_PROJECT_DIRECTORY"
. build.properties
cd "${TM_BUNDLE_SUPPORT}"
rm .session
echo "&lt;script&gt;window.location.href='https://${pod}.salesforce.com/secur/logout.jsp'&lt;/script&gt;"
</string>
<key>input</key>
Expand Down
2 changes: 2 additions & 0 deletions Commands/New Custom Object.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
echo "&lt;script&gt;window.location.href='https://${pod}.salesforce.com/01I/e?setupid=CustomObjects'&lt;/script&gt;"</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>~@f</string>
<key>name</key>
<string>New Custom Object</string>
<key>output</key>
Expand Down
2 changes: 2 additions & 0 deletions Commands/New Debug Log.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
echo "&lt;script&gt;window.location.href='https://${pod}.salesforce.com/p/setup/layout/AddApexDebugLogUser'&lt;/script&gt;"</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>~@f</string>
<key>name</key>
<string>New Debug Log</string>
<key>output</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
echo "&lt;script&gt;window.location.href='https://${pod}.salesforce.com/_ui/common/apex/debug/ApexCSIPage'&lt;/script&gt;"</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>~@f</string>
<key>name</key>
<string>Execute/Debug Apex</string>
<string>Open Dev Console</string>
<key>output</key>
<string>showAsHTML</string>
<key>uuid</key>
Expand Down
2 changes: 1 addition & 1 deletion Commands/Production Deploy.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -f "new.properties" ]
if [ ${usekeychainaccess} == 'enabled' ]
then
cp build.properties build.bak
shellpassword=$(~/Library/Application\ Support/TextMate/Bundles/ForceDotBundle.tmbundle/Tools/keychain.sh ${prodpassword})
shellpassword=$("${TM_BUNDLE_SUPPORT}/keychain.sh" ${prodpassword})
sed "s/${prodpassword}/${shellpassword}/" build.properties &gt; new.properties
cp new.properties build.properties
fi
Expand Down
2 changes: 1 addition & 1 deletion Commands/Production Test.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -f "new.properties" ]
if [ ${usekeychainaccess} == 'enabled' ]
then
cp build.properties build.bak
shellpassword=$(~/Library/Application\ Support/TextMate/Bundles/ForceDotBundle.tmbundle/Tools/keychain.sh ${prodpassword})
shellpassword=$("${TM_BUNDLE_SUPPORT}/keychain.sh" ${prodpassword})
sed "s/${prodpassword}/${shellpassword}/" build.properties &gt; new.properties
cp new.properties build.properties
fi
Expand Down
Loading

0 comments on commit 4caf5f3

Please sign in to comment.