And then OMC engine executes a command with ID "omc.app.handle-url", passing the whole URL to the command as $OMC_OBJ_TEXT. It gives the flexibility ot add any URL handler to the applet. The problem is that the responsibility for parsing the whole percent escaped string is delegated to the command.
The idea is to add a way to add a specialized protocol to execute chosen commands with given context just by opening a URL. This helps integrating an applet with other apps or web services.
The design for URL query by example:
myapp://exe?commandID=my.text.command.id&text=some%20text%20context
myapp://exe?commandID=my.file.command.id&file=file1.txt&file=file2.txt
"myapp": unique protocol word which needs to be specified per applet in its Info.plist
"exe": predefined query part which OMC recognizes as special case to execute a command
"text" value becomes $OMC_OBJ_TEXT
"file" value becomes $OMC_OBJ_PATH - one or more paths would be supported
OMC 3.2 has limited support for custom app URL handling You can add the custom URL in applet Info.plist:
And then OMC engine executes a command with ID "omc.app.handle-url", passing the whole URL to the command as $OMC_OBJ_TEXT. It gives the flexibility ot add any URL handler to the applet. The problem is that the responsibility for parsing the whole percent escaped string is delegated to the command. The idea is to add a way to add a specialized protocol to execute chosen commands with given context just by opening a URL. This helps integrating an applet with other apps or web services. The design for URL query by example: myapp://exe?commandID=my.text.command.id&text=some%20text%20context myapp://exe?commandID=my.file.command.id&file=file1.txt&file=file2.txt
"myapp": unique protocol word which needs to be specified per applet in its Info.plist "exe": predefined query part which OMC recognizes as special case to execute a command "text" value becomes $OMC_OBJ_TEXT "file" value becomes $OMC_OBJ_PATH - one or more paths would be supported