A special case is the moving operation between views of the same table

A special case is the moving operation between views

This preview shows page 5 - 7 out of 12 pages.

A special case is the moving operation between views of the same table (DROP_MOVE_ITEM). If the target view has default values (see Default values for views ), these are applied before calling the script. The src.xxx variables contain the original values of the dropped object, and dest.xxx contain the values after the application of the view defaults. Scripts DROP_CREATE_XXX, DROP_COPY_ITEM, and DROP_MOVE_ITEM have output variable myvar.opendestdlg, by which they can determine if the new or moved object is displayed in dialog box before it is saved. The default is to show the dialog. The script can alter both the src and dest variables. If a dialog box is shown, it displays the dest values as they are after the script execution and the user is able to make further changes. If the user cancels the dialog, the values are not saved to database (in cases DROP_CREATE_XXX and DROP_COPY_ITEM this means that no new object is created). In operations that allow multiple items to be dropped, the script is executed once for each. Then the dest object is the same every time, so if the script changes its fields, the changes are cumulative. Target view information In the DnD scripts the name of the target view is available in variable myvar.view. When the view depends on values entered in a dialog box or a selection panel, or is a parameterized view , the current parameter values are available in variable myvar.viewpar. This is a “string map” table: it contains the values of parameters in string form and is “indexed” by the parameter names. All the parameter names are in lowercase. For example, if the current master document of a parameterized view has ID value 123, then myvar.viewpar["main.id"] evaluates to the string "123", and tonumber(myvar.viewpar["main.id"])
Image of page 5
Anygraaf Neo System Configuration Guide Scripting evaluates to the integer 123. Whenever the script uses a view parameter prefixed by "dialog.", "selpanel.", or "filter.", it has to correctly handle the case when the parameter is not present (see When is a variable “present”? ). The absence of a variable is indicated by a nil value. For example: if myvar.viewpar["selpanel.startDate"] ~= nil then -- do something end Mandatory scripts In the copying and moving between views of the same table (DROP_COPY_ITEM and DROP_MOVE_ITEM), a script is mandatory for the operation to succeed. By testing the value of myvar.view the script can deny copying or moving to some target views. If the script sets myvar.result to 0 for some target view, the user is given a message telling that copying of moving to that view is not possible. The same message is given if the script is empty. If copying of moving to all views is to be allowed, the script can simply consist of the single statement myvar.result = 1; Scripts DROP_LINK_ARCHIVED_ARTICLE and DROP_LINK_ARCHIVED_ARTICLE_ELEMENT for CM_TOPIC must also be written in order for these drag-and-drop operations to succeed.
Image of page 6
Image of page 7

You've reached the end of your free preview.

Want to read all 12 pages?

  • Summer '18

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors