Raise your hand if you've heard this before: Can I drag and drop (or paste) content from somewhere else into XMetaL? The answer is a qualified "yes" -- it can be done, but if the stuff being dropped is not already plain XML, someone has to write some script to make it happen. (That someone is you, the XMetaL customizer.) The stickiest part of the problem is transforming the dropped data into valid XML. But in addition to that, you need to know the mechanics of processing these user actions in XMetaL. In this webinar we will leave aside the "transformation" part of the problem, and focus on the XMetaL APIs for detecting and handling user drop/paste events and inspecting and accessing the user's data from the clipboard.
in this tutorial we will discuss about
exception handling in C#
Exception class
creating user-defined exception
throw keyword
finally keyword
with examples'
in this tutorial we will discuss about
exception handling in C#
Exception class
creating user-defined exception
throw keyword
finally keyword
with examples'
What is XML
• XML stands for EXtensible Markup Language
• XML was designed to carry data, not to display data
• XML developed by the World Wide Web
Consortium (www.W3C.org)
• XML like HTML is a mark up language, but
unlike HTML it doesn’t have predefined
elements
XML Versions
version XML 1.0 was initially defined in 1998
version XML 1.1 was initially published on 4th Feb 2004
Example language of xml structure
XHTML
WML AND WAP
SVG
Uses XML
WEB DEVELOPER
TRANSPORTING AND SHARING DATA
STORING DATA
DOCUMENTATION
ANDROID DEVELOPER
XML Doc Advantages
Easy data sharing, text documents are readable between any device.
Easy to learn.
Extendable.
Freedom to define tags.
Easy searching.
Disadvantages of XML
The redundancy may affect application efficiency through higher storage, transmission and processing costs.
XML Document Components
The various components of an XML document used for representing data in a hierarchical order are:
Processing Instruction (PI)
Tags
Elements
Content
Attributes
Entities
Comments
This presentation gives introduction to ADO.Net.
Basic introduction to connected & Disconnected architecture.
and explain the each every component in Ado.net
Inheritance in java is a mechanism in which one object acquires all the properties and behaviors of parent object. The idea behind inheritance in java is that you can create new classes that are built upon existing classes.
Sviluppare applicazioni con MXML
Una semplice applicazione
Creare Flex Components
Creare MXML Components
XML Namespace personalizzati
Forms, FormItems e Validators
Gestire le Forms e i FormItem
Validare le forms con i Validator
Event Handling
Gestire gli Eventi
Capture, targeting, bubbling
Listener, Dispatching, sottoclassi MouseEvent KeyBoardEvent
Data Binding
Tipi di Binding
Monitorare il Data Binding: mx.binding.utils.ChangeWatcher
Usare il metadata tag [Bindable]
Binding a funzioni collegate ad eventi
FileReference
Caricare un file sul server con FileReference
Dataproviders e Collections
Dataproviders e Dataobjects
ArrayCollection, XMLList, XMLListCollection
Sort e Filter
Datagrids, AdvancedDatagrids, TreeView
Usare la DataGrid e AdvancedDatagrids
Usare le Treeview
Estendere le Datagrids: ItemRenderer e ItemEditor
Remote Procedure Call: le classi HTTPService e WebService
URLRequest e HTTPService
WebService
RemoteObject e RemoteClass
What is XML
• XML stands for EXtensible Markup Language
• XML was designed to carry data, not to display data
• XML developed by the World Wide Web
Consortium (www.W3C.org)
• XML like HTML is a mark up language, but
unlike HTML it doesn’t have predefined
elements
XML Versions
version XML 1.0 was initially defined in 1998
version XML 1.1 was initially published on 4th Feb 2004
Example language of xml structure
XHTML
WML AND WAP
SVG
Uses XML
WEB DEVELOPER
TRANSPORTING AND SHARING DATA
STORING DATA
DOCUMENTATION
ANDROID DEVELOPER
XML Doc Advantages
Easy data sharing, text documents are readable between any device.
Easy to learn.
Extendable.
Freedom to define tags.
Easy searching.
Disadvantages of XML
The redundancy may affect application efficiency through higher storage, transmission and processing costs.
XML Document Components
The various components of an XML document used for representing data in a hierarchical order are:
Processing Instruction (PI)
Tags
Elements
Content
Attributes
Entities
Comments
This presentation gives introduction to ADO.Net.
Basic introduction to connected & Disconnected architecture.
and explain the each every component in Ado.net
Inheritance in java is a mechanism in which one object acquires all the properties and behaviors of parent object. The idea behind inheritance in java is that you can create new classes that are built upon existing classes.
Sviluppare applicazioni con MXML
Una semplice applicazione
Creare Flex Components
Creare MXML Components
XML Namespace personalizzati
Forms, FormItems e Validators
Gestire le Forms e i FormItem
Validare le forms con i Validator
Event Handling
Gestire gli Eventi
Capture, targeting, bubbling
Listener, Dispatching, sottoclassi MouseEvent KeyBoardEvent
Data Binding
Tipi di Binding
Monitorare il Data Binding: mx.binding.utils.ChangeWatcher
Usare il metadata tag [Bindable]
Binding a funzioni collegate ad eventi
FileReference
Caricare un file sul server con FileReference
Dataproviders e Collections
Dataproviders e Dataobjects
ArrayCollection, XMLList, XMLListCollection
Sort e Filter
Datagrids, AdvancedDatagrids, TreeView
Usare la DataGrid e AdvancedDatagrids
Usare le Treeview
Estendere le Datagrids: ItemRenderer e ItemEditor
Remote Procedure Call: le classi HTTPService e WebService
URLRequest e HTTPService
WebService
RemoteObject e RemoteClass
65 New Highlights of XMetaL Author Enterprise 7.0XMetaL
An overview of the new features available in the latest version of XMetaL Author Enteprise. This is the slide deck from a webinar we did. If you'd like to view the webinar recording with audio, it's available here:
http://justsystems.xmetal.com/webinar_downloads/65_New_Features_in_XMetaL_Author_Enterprise_7
XMetaL Author is an XML editor platform that is designed to be improved through customization. With small amounts of effort you can greatly enhance the usability of XMetaL, improving your customers' productivity and increasing user acceptance. In this webinar we'll highlight a few simple techniques that will help you get the most "usability return" on a small amount of "customization investment".
Using the DITA XML standard can bring enormous improvements in the efficiency of localizing documentation. Some organizations report efficiency gains of 30-50% over traditional desktop publishing systems, and use the savings to expand further into global markets. This session gives a practical set of steps and guidelines for delivering your content smoothly and quickly in multiple languages. We will cover how to mark up content, how localization affects reuse, how to work with translators, and issues in generating localized deliverables. You'll learn about the big picture of how translation works in DITA, what steps you need to include in your process in order to get high-quality results, and exactly how to avoid common pitfalls that tend to make localization tricky.
Macros are the basic unit of extensibility for XMetaL. A macro consists of some script code plus a small amount of metadata -- such as a name and hotkey -- which then becomes an executable action that XMetaL will perform for you. We will provide an introduction to XMetaL macros, including an overview of the different types of macros that you can write, and some examples of simple macros that you can use to enhance the XMetaL environment. Even though we will look at real script code, you do not need scripting/programming experience to understand this introductory webinar ... but we do secretly hope that you'll be tempted to try some afterwards!
Taking Advantage of XMetaL’s XInclude SupportXMetaL
In XMetaL Author 6.0 we introduced “Support for modular XML documents via W3C XInclude”. Beyond the checkbox on the marketing datasheet, what does this support really mean for partners and customers? As an XMetaL implementer, you can provide your end users with new content reuse capabilities. We take a look at what XMetaL allows, and what you need to do to allow your end users to take advantage of this powerful new feature.
A recording of this presentation is available here: http://tinyurl.com/2we2xee
XMetaL and DITA in the Marketing Department: Tastes Great, Less FillingXMetaL
Some say XML doesn't belong in Marketing, where design trumps structure every time. Follow along as our own JustSytems Marketing group adopts DITA to save time and money in the creation, editing and publishing of XMetaL product data sheets. We discuss the challenges faced, along with a detailed look at how we modified the DITA Open Toolkit to match the previous InDesign-produced PDFs.
A recording of this presentation is available at http://tinyurl.com/29qxzuv .
This presentation is part of the free "XMetaL in 37 Minutes" webinar series. For upcoming webinars, see http://na.justsystems.com/webinars.php .
XMetaL and DITA in the Marketing Department: Tastes Great, Less Filling
Dropping content isn't a drag!
1. in 37 minutes Episode 20 Dropping content isn’t a drag! Handling drag & drop (& paste) into XMetaL documents Tom Magliery, XML Technology Specialist 7 April 2011 Brought to you by XMetaL Technical Services
2. A common authoring requirement is to allow users to paste or drop content from other applications into XMetaL Via customization (script), you can capture and process content that is being pasted or dropped Note: This talk is for customizers working with non-DITA document types For DITA some of these techniques have already been used to customize XMetaL Introduction
3. Writing script to handle paste and drop events, and access the clipboard contents Transforming the clipboard contents into valid XML for your doctype We are focused solely on part 1 today. Two-part problem
4. When you copy something, the source application puts it on the clipboard in one or more formats When you drag something, it will be available as drop data in the same formats Some formats are defined as standard in Windows (e.g., CF_TEXT, CF_UNICODETEXT) Others are defined by the source application (e.g., Adobe Photoshop Image) Some are used by many applications (e.g., HTML Format) Background info
5. No customization (default XMetaL behavior) Handling dropped/pasted text Handling dropped/pasted other formats Handling dropped files Agenda
6. XMetaL has some simple handling of drop/paste without any script customization Text or files can be dropped/pasted into XMetaL with certain happy results Part 1: No customization required
7. If the clipboard object includes a text format: If the text is valid markup that can be pasted at the current location, then it will be pasted as markup Otherwise the full text will be pasted as text Note: There are some strange “in-between” cases that depend on the context of your paste Example 1: No customization required
8. If the clipboard contains files If any of the file(s) are images, and if your CTM file specifies an image element, then the files that are images will be pasted as image elements Other files are ignored Example 2: No customization required Excerpt from simplepaper.ctm ... <Images> <Image> <Name>Image</Name> <Source-Attribute>href</Source-Attribute> <Height-Attribute>height</Height-Attribute> <Width-Attribute>width</Width-Attribute> </Image> </Images> ...
9. Key event macro: On_Document_Before_DropText Called immediately before the drop/paste is performed Use script in the macro to manipulate the clipboard contents and drop/paste location After this macro finishes, the drop/paste is performed Part 2: Plain text
10. ActiveDocument.DropClipboardText Boolean property, returns true if the action is a paste; false if it is a drop When text is being pasted Application.Clipboard Contains other properties and methods for accessing the clipboard Application.Clipboard.Text The text contents of the clipboard Read/write property Useful APIs in On_Document_Before_DropText
11. When text is being dropped ActiveDocument.DropText The text being dropped Read/write property ActiveDocument.DropPoint A Range object representing the location at which the text is being dropped/pasted Read-only property If a different drop location is desired, use Application.MoveDropPoint(range) More useful APIs in On_Document_Before_DropText
13. Example 3: On_Document_Before_DropText Determine whether this is a drop or a paste <MACRO name="On_Document_Before_DropText" hide="false" lang="JScript"><![CDATA[ varmsg = "On_Document_Before_DropText"; if (ActiveDocument.DropClipboardText) { msg += "...pasting"; msg += "Clipboard text is:" + Application.Clipboard.Text; msg += "Being pasted inside "; } else { msg += "...dropping"; msg += "Droptext is:" + ActiveDocument.DropText; msg += "Being dropped inside "; } varrng = ActiveDocument.DropPoint; msg += "<" + rng.ContainerName + "> element."; Application.Alert(msg); ]]></MACRO> If pasting, access the Clipboard text If dropping, access the DropText Find out where the text is being dropped/pasted
14. Suppose there is a clipboard format that you know how to process into markup of your type “Declare” that format type in XMetaL and give it your own name Application.AcceptDropFormat("HTML Format", “MyHTML"); Write an event macro matching your name <MACRO name="On_Drop_MyHTML" hide="true" lang="JScript"> Drop/paste contents are available as a “DataObject” Part 3: Other formats
16. Example 4: Handling “HTML Format” <MACRO name="On_Document_Open_Complete" hide="false" lang="JScript"><![CDATA[ Application.AcceptDropFormat("HTML Format", "MyHTML"); ]]></MACRO> Tells XMetaL to watch out for “HTML Format” and that our internal name is “MyHTML”
17. Example 4 continued: Handling “HTML Format” <MACRO name="On_Drop_MyHTML" hide="false" lang="JScript"><![CDATA[ varmsg = "On_Drop_MyHTML"; if (ActiveDocument.DropDataObject == Application.Clipboard.DataObject) { msg += " ... pasting"; } else { msg += " ... dropping"; } msg += "Content to be pasted/dropped is:"; var data = ActiveDocument.DropDataObject; msg += ActiveDocument.DataObjectAsText("HTML Format", data); Application.Alert(msg); ]]></MACRO>
18. Example 4 continued: Handling “HTML Format” Event macro name matches our internal name “MyHTML” <MACRO name="On_Drop_MyHTML" hide="false" lang="JScript"><![CDATA[ varmsg = "On_Drop_MyHTML"; if (ActiveDocument.DropDataObject == Application.Clipboard.DataObject) { msg += " ... pasting"; } else { msg += " ... dropping"; } msg += "Content to be pasted/dropped is:"; var data = ActiveDocument.DropDataObject; msg += ActiveDocument.DataObjectAsText("HTML Format", data); Application.Alert(msg); ]]></MACRO> How to test whether this is a drop or a paste Get the text version of this HTML content (will include the tags)
19. You can include handlers for as many clipboard formats as you wish Example 5: Handling “Adobe Photoshop Image” <MACRO name="On_Document_Open_Complete" hide="false" lang="JScript"><![CDATA[ Application.AcceptDropFormat("HTML Format", "MyHTML"); Application.AcceptDropFormat("Adobe Photoshop Image", "MyPhotoshop"); ]]></MACRO>
20. You can include handlers for as many clipboard formats as you wish Example 5: Handling “Adobe Photoshop Image” <MACRO name="On_Document_Open_Complete" hide="false" lang="JScript"><![CDATA[ Application.AcceptDropFormat("HTML Format", "MyHTML"); Application.AcceptDropFormat("Adobe Photoshop Image", "MyPhotoshop"); ]]></MACRO> Same idea aswith “HTML Format”
21. Example 5 continued: Handling “Adobe Photoshop Image” <MACRO name="On_Drop_MyPhotoshop" hide="false" lang="JScript"><![CDATA[ Application.Alert("You pasted an image from Photoshop!"); ]]></MACRO>
22. Example 5 continued: Handling “Adobe Photoshop Image” <MACRO name="On_Drop_MyPhotoshop" hide="false" lang="JScript"><![CDATA[ Application.Alert("You pasted an image from Photoshop!"); ]]></MACRO> Not much of a “handler” at all, really :-o
23. Key event macro:On_Drop_Files Called if files are dropped into the editor Replaces built-in behavior (Contrast with On_Document_Before_DropText) Use Application.DropFileCount and Application.DropFileName properties Can get basic drop behavior on individual files with Selection.DropFile Part 4: Dropping files
24. Example 6: Handling dropped files <MACRO name="On_Drop_Files" hide="false" lang="JScript"><![CDATA[ vardp = Application.DropPoint; if (dp.ContainerName == "Para") { for (vari=1; i<=Application.DropFileCount; i++) { Application.Alert(Application.DropFileName(i)); dp.DropFile(Application.DropFileName(i)); } } ]]></MACRO>
25. Example 6: Handling dropped files Just for demo purposes we’ll do something only if we drop into a <Para> Returns a Range which represents the drop location <MACRO name="On_Drop_Files" hide="false" lang="JScript"><![CDATA[ vardp = Application.DropPoint; if (dp.ContainerName == "Para") { for (vari=1; i<=Application.DropFileCount; i++) { Application.Alert(Application.DropFileName(i)); dp.DropFile(Application.DropFileName(i)); } } ]]></MACRO> For each file, display the filename and then do a regular “drop”
26. On_Document_After_DropText Event macro for performing operations after the drop/paste has occurred Application.DropRange Property returns a range that contains the dropped/pasted content On_Drag_Over_MyFormatName Event macro that fires while dragging content that matches a particular format ActiveDocument.DropNotAllowed(); Sets the “drop not allowed” cursor (use after inspecting DropPoint during drag-over) Handling DropFiles in the workspace (i.e., not in a document) Further reading
27. XMetaL Community Forums http://forums.xmetal.com/ JustSystems Partner Center http://justpartnercenter.com/ Ask us for help (partner tech support) partnersupport-na@justsystems.com Resources