Skip to main content
June 9, 2009
Question

Send ratings to online System

  • June 9, 2009
  • 1 reply
  • 1206 views

Hi!

I'm a webdeveloper.

Till now I had no contact w Bridge but I have a client who is photograher.

I'm designing a tool for him to administrate his orders etc..

We are looking for a solution to get rated images into my online tool.

What I'm thinking of is to use the rating function of Bridge.

It should work like that:

He is selecting images using the rating function.

Perfect would be if bridge can call a weblink when rating every image.

The Link should contain the image data as variables, like that:

http://pos.domain.com?order=[dirname]&file=[filename]&rating=[rating]

dirname = Name of directory

filename = Name of rated image

rating = Rating

Would be thankful for any input.

Cheers Philipp

This topic has been closed for replies.

1 reply

Paul Riggott
Inspiring
June 10, 2009

I have nothing to test this with, but worth a try. Should send details of selected documents. "Send Ratings" command will be in the right click menu.

#target bridge
   if( BridgeTalk.appName == "bridge" ) { 
sendRating = new MenuElement("command", "Send Ratings", "at the end of Thumbnail");
}
sendRating.onSelect = function () {
   sendData();
   }
function sendData(){
var sels = app.document.selections; 
for (var i = 0; i < sels.length; i++){
var md = sels.synchronousMetadata;
    md.namespace = "http://ns.adobe.com/xap/1.0/"
httpGet("http://pos.domain.com?order=["+sels.spec +"]&file=["+sels.name +"]&rating=[" +md.Rating+"]");
}
}

function httpGet(url, port){
   if(url.substr(0,7)=="http://") url=url.substr(7); // removing http:// from domain
   if(!port) port=80; // set to default port if missing

   var domain=url.split("/")[0]+":"+port;
   var call="GET ";
   if(url.indexOf("/")<0){
      call+="/";
   }else{
      call+=url.substr(url.indexOf("/"));
   }
   call+=" HTTP/1.0\n\n";
   
   var reply = new String();
   var conn = new Socket();
   if (conn.open (domain)) {
      conn.write (call);
      reply = String(conn.read(999999));
      reply = reply.substr(reply.indexOf("\n\n")+2); // Removing header
      conn.close();
   }else{
      alert("CONNECTION TO DATABASE FAILED");
      reply = "";
   }
   return reply;
}

June 10, 2009

HI!!!!

THX a lot for ur reply!

I spent the last night learning the Adobe SDK and I'm more then impressed by bridge!

I ended up learning how to create an additional WebTabbedPalette calling a webpage and

I learned how to send the file (note) data to this Palette which is perfect.

I'm planning to play around with that.

One more question:

     I saw in the SDK Examples that it's possible to call a webpage in the content area.

     Is it also posible to have a link in the WebTabbedPalette calling an other Webpage

     in the Content Area???

THX

Cheers Philipp