Cross-product architecture
103
■
The
release
operation informs the server that the client has finished working on the
specified object. A
release
request must specify only an
obj
attribute and no
subelements. In the following example, the client tells the server that it is has finished
working on the object with ID 1:
<release obj="1" />
Object IDs
RPC clients reference objects on the server by their object IDs. Because all functionality is
exposed by means of objects, every client request must contain a valid object ID. When an
object that can be accessed through RPC is created, it is assigned a unique object ID. The
object retains that ID for its entire lifetime. This happens for all RPC server objects, whether
they are created directly by an RPC call or by an internal Fireworks function. The object IDs
can be reused after the corresponding object is destroyed.
Fireworks has the following four reserved object IDs:
■
"0"
This is the Invalid Object ID, used for nonexistent or invalid objects. It is not frequently
used for the RPC client, but it is used in several places for the RPC server.
"fw"
is the Fireworks Application Object ID. The Fireworks Application Object ID
references the main application object in Fireworks and is of the Fireworks class.
This object is used to open and create documents. In JavaScript, it is the object referenced
by
App
or
fw
.
"smartShape"
is the SmartShape Object ID. This object id references the global
JavaScript variable
smartShape
and is used to create an manipulate Auto Shapes.
"Document"
is the Fireworks Document Compatibility Object ID (it is deprecated, like
its JavaScript counterpart). It was used in Fireworks 2 for cleaning up file paths, and is
included here only for completeness.
"Errors"
is the Fireworks Errors Object ID, used mainly for reporting and determining
when errors occur in Fireworks. Its JavaScript counterpart is
Errors
.
All other object IDs are generated when the object is created, and may or may not have the
same IDs between application invocations.
NO
TE
Each type of request requires an
obj
attribute, and all but the
release
request require a
name
attribute. Requests can be only of types
get
,
set
,
func
, or
release
. The RPC
server rejects all other types.
NO
TE
The object ID number should be treated as a string data type that
could
contain non-
numbers, (do not treat the object ID as an integer data type).
Summary of Contents for FIREWORKS 8-EXTENDING FIREWORKS
Page 1: ...Extending Fireworks ...
Page 4: ...4 Contents ...
Page 358: ...358 Fireworks JavaScript API ...
Page 372: ...372 Index ...