On 10/20/2017 11:14 AM, ptown wrote:
> That was helpful. I didn't understand that I needed an image object.
> It reminds me of working with dates. I took your advice and switched to
> using the resize function. Here is my rule:
> <rule>
> <description>New Photo</description>
> <conditions>
> <and>
> <if-op-attr name="jpegPhoto" op="available"/>
> <if-attr mode="nocase" name="TYPE" op="equal">0</if-attr>
> </and>
> </conditions>
> <actions>
> <do-set-dest-attr-value direct="true" name="jpegPhoto">
> <arg-dn>
> <token-local-variable name="varDN"/>
> </arg-dn>
> <arg-value type="octet">
> <token-op-attr name="jpegPhoto"/>
> </arg-value>
> </do-set-dest-attr-value>
> <do-set-local-variable name="varJpeg" notrace="true" scope="policy">
> <arg-string>
> <token-op-attr name="jpegPhoto"/>
> </arg-string>
> </do-set-local-variable>
> <do-set-dest-attr-value direct="true" name="photo">
> <arg-dn>
> <token-local-variable name="varDN"/>
> </arg-dn>
> <arg-value type="octet">
> <token-xpath expression="es:resize($varJpeg, 90, 120)"/>
> </arg-value>
> </do-set-dest-attr-value>
> </actions>
> </rule>
> There were a couple of errors along the road to success. I had to
> remark out all references to trace. I had to remove extra spaces and
> some capitalization errors. Aside from that, IT WORKS!!

Thank-you for sharing your results, as this is an interesting and simple
use of ECMAScript and Java for something fairly practical that a fair
number of customers use in one way or another.

One last thing: prior to eDirectory 9.x having a non-stream attribute with
a value larger than about 63 KiB was not possible because of NCP
limitations. With eDirectory 9.x that limitation should be removed, but
only among eDirectory 9.x systems. As a result, many of my clients extend
schema to use a Stream (vs. Octet String) attribute which can be just
about any realistic size to work around pesky limitations like this. If
you have users importing data into photo/jpegphoto/ldapphoto directly, be
sure you keep an eye on how huge those get in some versions or problems
could arise (replication stops).

Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the
forum as I do not use the web interface often.