PropertyEventMethodIndex
WebSquare.util - 5.0_4.4547B.20211124.201933

WebSquare.util Package

Type

engine

Property Summary

Event Summary

Method Summary

appendingPathComponent( starturl , endurl )
Appends an additional path to the URL path. Handles abnormal functioning depending on whether / exists or not.
clearInterval( key , force )
WebSquare
clearPage( )
Refreshes the browser.
clearTimeout( key , force )
WebSquare
closePopup( id )
Closes the pop-up of the corresponding ID.
createPopup( id , type , popupName , style , useIFrame , modal , srcORurl , srcData , destData , xml )
Creates a pop-up according to the specified properties.
dbltoHexacode( dbl )
Converts the integer into hexa code for RGB.
deleteLocale( url )
Deletes the language pack in the client.
encodeParameter( )
Encrypts the parameter contained in the URI when the encodeParameter option is enabled in the config.xml file.
first( elem )
Returns the first child node of the specified HTML element.
getBoolean( boolstr )
Returns true for "true", or false for "false".
getChildNodeAt( obj , idx )
Returns the child node of the corresponding index in the object.
getChildren( component , options )
Returns child components of a certain component as an array.
getComponentById( id )
Returns the WebSquare5 component of the corresponding ID.
getData( key )
Gets the data of the specified key.
getDate( str )
Removes the slash (/) from the date string.
getDocumentSize( sizeName )
Gets the width of height of the document not including the scroll bar size.
getEventTarget( this )
Returns the information of the component that triggered the corresponding event.
getGlobalFunction( str )
Gets a global function even from inside an object.
getIntervalKeyList( )
WebSquare
getKeyCode( comp , e )
Receives the component object with a key event and the event object, and returns a keyCode or unicode.
getMetaValue( key )
Returns the value corresponding to the meta key defined in the head area.
getNumber( str )
Removes the comma from the string, and returns parseInt/parseFloat result.
getPopup( id )
Returns the pop-up component of the corresponding ID.
getPopupParam( )
Returns the string of xmlDocument parameter of the pop-up.
getPopupWindow( id )
Returns the pop-up window of the corresponding ID.
getStringByteSize( str , ignoreChar )
Returns the byte size of the string.
getSubmissionURL( url )
Reads the submission URL.
getTextNodeValue( element )
Returns the Text node of the HTML element.
getTime( str )
Removes colons from the time string.
getTimeoutKeyList( )
WebSquare
hexacodetoDbl( hexa )
Converts the hexa code into an integer.
isEmptyObject( obj )
If an empty object is received as a parameter, true will be returned. Otherwise, false will be returned.
isHybrid( )
Judges whether the browser is running in the mobile hybrid app or not.
isInteger( num )
Checks whether the number is an integer or not.
isMobile( )
Checks whether the current device is mobile or not.
isNull( value )
Checks whether the entered value is null or not.
isNumber( value )
Checks whether the entered value is numeric data or not.
isOdd( num )
Checks whether the given integer is an odd number or not.
isPopup( )
Checks whether the current window is a pop-up or not. If it is a pop-up, returns true. Otherwise, returns false.
isString( value )
Checks whether the entered value is a string.
js( scriptUrl , callback )
Controls the sequence of loading multiple external scripts.
last( elem )
Returns the last child node of the HTML element.
loadLocale( url )
Loads the language JS file for the client.
multipleDataListDownload( options , infoArr )
Saves the DataList data as an Excel file.
multipleExcelDownload( options , infoArr )
Saves the grid data as an Excel file.
next( elem )
Returns the next node that is not a Text node.
openPopup( url , options , params , target )
Creates a pop-up according to the specified properties.
parent( elem , num )
Returns the node of the parent node as high as the given number in the HTML element.
parseFloat( str , defaultValue )
Calls parseFloat.
parseInt( str , defaultValue )
Calls parseInt.
prev( elem )
Returns the previous node that is not a Text node.
reinitialize( refresh )
Reloads the page without refreshing the browser, or refreshes the browser.
removeData( key )
Removes the data of the corresponding key.
setData( key , data )
Set the data with a certain key.
setDate( str )
Adds / to the date string.
setDisabled( obj )
Disables the objects under the component.
setDocumentLang( lang )
Sets the language code in the HTML tag.
setDomain( domain )
Sets a domain to uspport cross-domainon frames and pop-ups.
setFullView( zoomResolve )
Sets the fullview feature in the current screen.
setInterval( func , options )
Registers a function and regularly executes the function.
setNumber( str )
Converts to a string by adding a comma to the entered number.
setTime( str )
Adds : to the time string.
setTimeout( func , options )
Registers a function and executes the function after time-out.
toHexColor( rgb )
Receives rgb (r, g, b) string and returns the color code in #RRGGBB format.
url( w2xPath , options )
Passes only the w2xPath instead of the entire URL upon a page change.

Property Detail

Event Detail

Method Detail

appendingPathComponent( starturl , endurl )
Appends an additional path to the URL path. Handles abnormal functioning depending on whether / exists or not.
case 1 : "/hoyoon/" + "/inswave.xml" = "/hoyoon/inswave.xml" (Remove / from //.)
case 2 : "/hoyoon" + "/inswave.xml" = "/hoyoon/inswave.xml" (Add.)
case 3 : "/hoyoon/" + "inswave.xml" = "/hoyoon/inswave.xml" (Add.)
case 4 : "/hoyoon" + "inswave.xml" = "/hoyoon/inswave.xml" (Add /.)
degenerating case : If the latter component is followed by :// (an absolute path including the protocol), only the latter part will be returned.
Parameter
nametyperequireddescription
starturlStringYStarting URL to append
endurlStringYEnding URL to append
Return
typedescription
StringAppended URL
clearInterval( key , force )
Clears the execution interval of the function registered by WebSquare.util.setInterval.
Parameter
nametyperequireddescription
keyStringYValue of the key set by options.key of WebSquare.util.setInterval
forceBooleanNWhether to execute the function registered by setInterval again or not. The default is false.
Sample
WebSquare.util.clearInterval("timer1");
clearPage( )
Refreshes the browser. Used by the onpageunload event when the browser needs to be initialized in the SPA mode. Add onpageunload event and call this function in the components that have memory leak issue in the SPA mode such as Editor or Chart. WebSquare.util.url(WebSquare.baseURI + "blank.xml", {"spa":true, "forceReload":true}); // Same as calling the function.
Sample
<body> <script type="javascript" ev:event="onpageunload"><![CDATA[ WebSquare.util.clearPage(); // 브라우저를 갱신하여 초기상태로 되돌린다. 이 경우 웹스퀘어 엔진 및 리소스를 새로 로딩하게 된다. ]]></script> </body>
clearTimeout( key , force )
Clears time-out of the function registered by WebSquare.util.setTimer.
Parameter
nametyperequireddescription
keyStringYValue of the key set by options.key of WebSquare.util.setTimer
forceBooleanNWhether to execute the setTimer function or not. The default is false.
Sample
WebSquare.util.clearTimeout("timer1");
closePopup( id )
Closes the pop-up of the corresponding ID.
Parameter
nametyperequireddescription
idStringYPopup ID
Sample
WebSquare.util.closePopup("popup1");
createPopup( id , type , popupName , style , useIFrame , modal , srcORurl , srcData , destData , xml )
Creates a pop-up according to the specified properties.
Parameter
nametyperequireddescription
idStringYPopup object ID
typeStringNPopup object type (litewindow, window, browser)
popupNameStringNPopup object name to be displayed on the popup frame
styleStringNPopup object style
useIFrameStringNtrue or false.
true : Uses IFrame. false: Uses window.open.
modalStringNtrue or false.
true : Not to use the background component of the pop-up object. false: To use the background component of the pop-up object.
srcORurlStringYSource to display on the screen.
When the popup object type is litewindow or window : displayed name of the WebSquare XML When the popup object type is browser: displayed web site address.
srcDataStringNXPath to get from the parent when the pop-up object type is window
destDataStringNXPath to set in the pop-up when the pop-up object type is window
xmlArrayNXML document to be applied to the pop-up object
Sample
WebSquare.util.createPopup("popup1", "window", "People Profile", "width:600px;height:350px;top:100px;left:100px;", "true", "true", "WebSquare1.xml", peopleNode, "map", peopleNode);
dbltoHexacode( dbl )
Converts the integer into hexa code for RGB.
Parameter
nametyperequireddescription
dblNumberYRGB value in the integer type
Return
typedescription
StringConversion result into hexa code
Sample
WebSquare.util.dbltoHexacode(16777215);
deleteLocale( url )
Deletes the language pack in the client.
Parameter
nametyperequireddescription
urlStringYURL of the multi-language JS file to delete.
encodeParameter( )
Encrypts the parameter contained in the URI when the encodeParameter option is enabled in the config.xml file.
Return
typedescription
StringEncrypts the string and returns the encryption result.
first( elem )
Returns the first child node of the specified HTML element.
Parameter
nametyperequireddescription
elemObjectYThe object to check the child nodes
Return
typedescription
ObjectThe first child node of the element
Sample
WebSquare.util.first( xmlDoc);
getBoolean( boolstr )
Returns true for "true", or false for "false".
Parameter
nametyperequireddescription
boolstrStringYboolean string
Return
typedescription
Booleantrue for "ture", and false for "false".
Sample
WebSquare.util.getBoolean("true");
getChildNodeAt( obj , idx )
Returns the child node of the corresponding index in the object.
Parameter
nametyperequireddescription
objObjectYObject to check the child nodes
idxNumberYIndex of the child node
Return
typedescription
ObjectChild node of the corresponding index in the object
Sample
WebSquare.util.getChildNodeAt( xmlDoc, 1 );
getChildren( component , options )
Returns child components of a certain component as an array.
Parameter
nametyperequireddescription
componentObjectNParent component. When properties are not specified, the component means the body component.
optionsObjectNOptions are as shown below.
<boolean:N> obj.recursive : Whether to include descendant. The default is false. In case of the body component, false will be applied regardless of the option settings. <boolean:N> obj.excludeInnerComp : Whether to include the inner components created inside a component. The default is false. <String:N> obj.excludeId : ID of the component to exclude. If there are multiple IDs, use space as a separator. <String:N> obj.excludePlugin : Plug-in of the component to exclude. If there are multiple IDs, use space as a separator. <String:N> obj.includePlugin : Name of the component plugin to include. If there are multiple inputs, use space as a separator.
Return
typedescription
ObjectArray of components
Sample
(ex1) WebSquare.util.getChildren(); or WebSquare.util.getChildren(null, {recursive:true}); => Returns all immediate child components of the body. In case of body, recursive option will be ignored. (Due to performance issues, recursive checking of the child nodes is not allowed.) (ex2) WebSquare.util.getChildren (group1, {excludePlugin : "trigger output", recursive : true}); => Returns all except the trigger and the output among the descendants of the group1. (ex3) WebSquare.util.getChildren(group2, {excludePlugin : "trigger input", excludeId : "treeview1_tooltip windowContainer1_tooltip"); => Returns all except the trigger, the input, and the components of which ID is treeview1_tooltip or widnowContainer1_tooltip among the immeidate children of the group1. (ex4) WebSquare.util.getChildren (group1, {includePlugin : "trigger output", recursive : true}); => Returns only trigger and output among all descendants of the group1. (ex5) WebSquare.util.getChildren (group1, {includePlugin : "trigger output", excludePlugin : "trigger"}); => Returns only the output among all descendants of the group1.
getComponentById( id )
Returns the WebSquare5 component of the corresponding ID.
Parameter
nametyperequireddescription
idStringYID of the WebSquare5 component
Return
typedescription
ObjectWebSquare component object
Sample
var output1 = WebSquare.util.getComponentById("output1");
getData( key )
Gets the data of the specified key.
Parameter
nametyperequireddescription
keyStringYKey of the data to get
Return
typedescription
ObjectData of the specified key
Sample
var itemList = WebSquare.util.getData("item1").itemList;
getDate( str )
Removes the slash (/) from the date string.
Parameter
nametyperequireddescription
strStringYDate String
Return
typedescription
StringEntered string without /
Sample
var data = WebSquare.util.getDate("2012/01/01"); date : 20120101
getDocumentSize( sizeName )
Gets the width of height of the document not including the scroll bar size.
Parameter
nametyperequireddescription
sizeNameStringY"width" or "height" in string
Return
typedescription
NumberDocument size
Sample
WebSquare.util.getDocumentSize("width");
getEventTarget( this )
Returns the information of the component that triggered the corresponding event.
Parameter
nametyperequireddescription
thisObjectYthis object for the function
Return
typedescription
ObjectReturns the name, the component ID, and the full ID of the WebSquare component.
Sample
(Example) var info = WebSquare.util.getEventTarget(this); (Returned Info) { "pluginName": "Component name", "id": "component ID" }
getGlobalFunction( str )
Gets a global function even from inside an object. Gets a global function even from inside an object.
Parameter
nametyperequireddescription
strStringYString indicating the function
Return
typedescription
FunctionFunction to return
Sample
var func = WebSquare.util.getGlobalFunction("obj.formatter");
getIntervalKeyList( )
Returns all keys registered by WebSquare.util.setIntervalKey as an array.
Return
typedescription
ObjectKeys registered by getIntervalKey
Sample
var IntervalKeyList = WebSquare.util.getIntervalKeyList(); for(var i = 0; i &lt; IntervalKeyList.length; i++) { WebSquare.util.clearInterval(IntervalKeyList[i]); } // Clear all timers.
getKeyCode( comp , e )
Receives the component object with a key event and the event object, and returns a keyCode or unicode.
When a keyCode is generated, the keyCode will be returned as a decimal value. If no keyCode is not generated, the unicode will be returned as a decimal value.
Parameter
nametyperequireddescription
compObjectYComponent object
eEventYevent object
Return
typedescription
NumberReturns the keyCode or uniCode.
Sample
var returnValue = WebSquare.util.getKeyCode(input1,e);
console.log("returnValue="+returnValue);
getMetaValue( key )
Returns the value corresponding to the meta key defined in the head area.
Parameter
nametyperequireddescription
keyStringYMeta data key
getNumber( str )
Removes the comma from the string, and returns parseInt/parseFloat result.
Parameter
nametyperequireddescription
strStringYNumeric data as a string
Return
typedescription
NumberNumeric data converted from the inputted string
Sample
var data = WebSquare.util.getNumber("2,000"); data : 2000
getPopup( id )
Returns the pop-up component of the corresponding ID.
Parameter
nametyperequireddescription
idStringYPopup ID
Return
typedescription
ObjectPopup component
Sample
var popObj = WebSquare.util.getPopup("popup1");
getPopupParam( )
Returns the string of xmlDocument parameter of the pop-up.
Return
typedescription
StringxmlDocument string
Sample
var dataStr = WebSquare.util.getPopupParam();
getPopupWindow( id )
Returns the pop-up window of the corresponding ID.
Parameter
nametyperequireddescription
idStringYPopup ID
Return
typedescription
ObjectPopup window
Sample
var popObj = WebSquare.util.getPopupWindow("popup1");
getStringByteSize( str , ignoreChar )
Returns the byte size of the string.
Parameter
nametyperequireddescription
strStringYString to get the byte size
ignoreCharStringNCharacters to ignore in the byte size checking
Return
typedescription
Numberbyte size
Sample
var data = WebSquare.util.getStringByteSize("websquare"); data : 9
getSubmissionURL( url )
Reads the submission URL. Uses appendingPathComponent.
Parameter
nametyperequireddescription
urlStringYDefault URL address
Return
typedescription
StringSubmission URL
getTextNodeValue( element )
Returns the Text node of the HTML element.
Parameter
nametyperequireddescription
elementObjectYhtml element
Return
typedescription
Stringtext node string
Sample
WebSquare.util.getTextNodeValue( xmlDoc);
getTime( str )
Removes colons from the time string.
Parameter
nametyperequireddescription
strStringYTime String
Return
typedescription
StringEntered string without ':'
Sample
var data = WebSquare.util.getTime("11:23"); data : 1123
getTimeoutKeyList( )
Returns all keys registered by WebSquare.util.setTimer as an array.
Return
typedescription
ObjectKeys registered by setTimer
Sample
var timeoutKeyList = WebSquare.util.getTimeoutKeyList(); for(var i = 0; i &lt; timeoutKeyList.length; i++) { WebSquare.util.clearTimeout(timeoutKeyList[i]); } // Clear all timers.
hexacodetoDbl( hexa )
Converts the hexa code into an integer.
Parameter
nametyperequireddescription
hexaStringYhexa code value
Return
typedescription
NumberConversion result in integer
Sample
WebSquare.util.hexacodetoDbl("A0D39C");
isEmptyObject( obj )
In case an empty object is received as a parameter, true will be returned. Otherwise, false will be returned.
Parameter
nametyperequireddescription
objObjectYObject to check whether it is empty or not=
Return
typedescription
BooleanTrue if it is empty, or false.
Sample
var A = {"x":100}; WebSquare.util.isEmptyObject(A); // false delete A.x; WebSquare.util.isEmptyObject(A); // true WebSquare.util.isEmptyObject(null); // false (An empty object is {}, not null.)
isHybrid( )
Judges whether the browser is running in the mobile hybrid app. Note that the browser is in the general mobile browser app, “false” will be returned.
Return
typedescription
Boolean“true” will be returned in case of the browser being running in the hybrid app. Or, “false” will be returned.
isInteger( num )
Checks whether the number is an integer or not.
Parameter
nametyperequireddescription
numStringYNumber or Number String
Return
typedescription
BooleanTrue for an integer, or false.
Sample
WebSquare.util.isInteger(10)
isMobile( )
Checks whether the current device is mobile or not. Supported devices include iPhone, iPad, iPodTouch, Android, and Blackberry.
Return
typedescription
Booleantrue is returned for mobile devices, or false.
isNull( value )
Checks whether the entered value is null or not.
Parameter
nametyperequireddescription
valueObejctYValue to check
Return
typedescription
BooleanTrue for null, or false.
isNumber( value )
Checks whether the entered value is numeric data or not.
Parameter
nametyperequireddescription
valueObejctYValue to check
Return
typedescription
BooleanTrue for number type, or false.
Sample
var data = WebSquare.util.isNumber("12"); data : false
isOdd( num )
Checks whether the given integer is an odd number or not.
Parameter
nametyperequireddescription
numStringYNumber String
Return
typedescription
BooleanTrue for an odd number, or false.
Sample
WebSquare.util.isOdd(11);
isPopup( )
Checks whether the current window is a pop-up or not. If it is a pop-up, returns true. Otherwise, returns false.
Return
typedescription
booleanChecks whether the current window is a pop-up or not.
Sample
var ispopup = WebSquare.util.isPopup();
isString( value )
Checks whether the entered value is a string.
Parameter
nametyperequireddescription
valueObejctYValue to check
Return
typedescription
BooleanTrue for the string type, or false.
Sample
var data = WebSquare.util.isString("12"); data : true
js( scriptUrl , callback )
Controls the sequence of loading multiple external scripts. Loads the scripts in parallel, but runs them in a sequential manner. If the last received parameter is a function, execute the function after script loading. (callback)
Parameter
nametyperequireddescription
scriptUrlStringYjavascript url. The parameter count is not fixed. When there are multiple scripts to load, as man script URLs as the script count will be received.
callbackFunctionNIf the last received type is a function, the function will be executed after all scripts are executed. A callback function.
Sample
WebSquare.util.js("/common/js/common.js", "/common/js/test1.js", "/common/js/test2.js", function(){alert("all done");} // common.js, test1.js, and test2.js will be loaded in parallel, but they will be executed in the receive order (common.js -> test1.js -> test2.js.) // The callback function will be executed after test2.js is loaded. Then, alert("all done"); will be executed.
last( elem )
Returns the last child node of the HTML element.
Parameter
nametyperequireddescription
elemObjectYThe object to check the child nodes
Return
typedescription
ObjectLast child node
Sample
WebSquare.util.last(xmlDoc);
loadLocale( url )
Loads the language JS file for the client.
Parameter
nametyperequireddescription
urlStringYURL of the multi-language JS file.
multipleDataListDownload( options , infoArr )
Saves the DataList data as an Excel file. The sheetName must be unique. (Supported for JDK 1.5 and higher versions.)
Parameter
nametyperequireddescription
optionsObjectYDownloading options defined in the JSON format.
File information <String:N> options.fileName : File name. [default: excel.xls] <String:N> options.multipleSheet : Use separates sheets for each of DataList. [default: true] <String:N> options.dataListId : ID of the DataList to download. <String:N> options.wframeId : WFrame ID that contains the DataList to download. [default: N/A] Excel file <String:N> options.sheetName : Sheet name in the Excel file to save each DataList. (Must be unique.) [default: sheet] <String:N> options.removeColumns : Column number to remove from the Excel file (Use comma for multiple inputs.) [default: N/A] <String:N> options.foldColumns : Column number to fold in the Excel file (Use comma for multiple inputs.) [default: N/A] <Number:N> options.startRowIndex : Row number from which the DataList data starts in the Excel file (including the header.) [default: 0] <Number:N> options.startColumnIndex : Column number from which the DataList data starts in the Excel file (including the header.) [default: 0] <String:N> options.headerColor : Header color in the Excel file for the GridView. [default: #33CCCC] <String:N> options.headerFontName : Header font in the Excel file for the GridView. [default: N/A] <String:N> options.headerFontSize : Header font size in the Excel file for the GridView. [default: 10] <String:N> options.headerFontColor : Header font color in the Excel file for the GridView. [default: N/A] <String:N> options.bodyColor : Body color in the Excel file for the GridView. [default: #FFFFFF] <String:N> options.bodyFontName : Body font in the Excel file for the GridView. [default: N/A] <String:N> options.bodyFontSize : Body font size in the Excel file for the GridView. [default: 10] <String:N> options.bodyFontColor : Body font color in the Excel file for the GridView. [default: N/A] Printing <Object:N> options.printSet : Print-related settings (save in JSON format) <String:N> options.printSet.fitToPage : Fits to the page when printing. [default: false] <String:N> options.printSet.landScape : Landscape printing. [default: false] <String:N> options.printSet.fitWidth : Printing width. [default: 1] <String:N> options.printSet.fitHeight : Printing height. [default: 1] <String:N> options.printSet.scale : Printing scale. [default: 100] When using the scaling ratio for printing, fitToPage must be false. <String:N> options.printSet.pageSize : Page size. [default: A4] (Example: "A3", "A4", "A5", "B4") Valid when fitToPage: true. Other options <Boolean:N> options.showProcess : Whether to show the process or not. [default: true] <String:N> options.processMsg : Text to display on the process window in case of showProcess="true". [default: composing excel data...] <String:N> options.dataProvider : Provider package to process the user data and large-volume data. [default: N/A] <String:N> options.providerRequestXml : XML string for internal uses by the provider. [default: N/A] <String:N> options.userDataXml : Reserved for the developers to send data when developing server modules. [default: N/A] <Boolean:N> options.bodyWordwrap : Changes the line in the body. [default: false] <String:N> options.useEuroLocale : Applies Euro locale. (Use . instead of , and vice versa.) [default: false] <String:N> options.useHeader : Displays header. [default: true] (true to display, and false not to display.) <String:N> options.separator : Data separator when sending the data to the server. [default: ,] <String:N> options.freezePane : Coordinates and coordinate offset to freeze the pane (Example) freezePane="3,4" Fix to 3 on X and 4 on Y. freezePane="0,1,0,5" Fix to 0 on X and 5 on Y from 0 on X and 1 on Y. <String:N> options.autoSizeColumn : Automatic width adjustment. [default: false] <String:N> options.displayGridlines : Displays gridlines. [default: false] <String:N> options.useDataFormat : When the dataList dataType is “text”, displays “text” as format in the Excel file. [default: N/A] ( "true" is to display “text”.)
infoArrObjectNArray containing DataList information.
<Number:N> infoArr.rowIndex : Row index to display text <Number:N> infoArr.colIndex : Row index to display text <Number:N> infoArr.rowSpan : Number of the rows to merge <Number:N> infoArr.colSpan : Number of columns to merge <String:N> infoArr.text : Text to display <String:N> infoArr.textAlign : Alignment (left, center, right) <String:N> infoArr.fontSize : Font size. (Example: "20px" ) <String:N> infoArr.fontName : Font. <String:N> infoArr.color : Font color. (Red: "red" ) <String:N> infoArr.fontWeight : Font weight. (Example: "bold" ) <String:N> infoArr.drawBorder : Cell border. (Example: true ) <String:N> infoArr.wordWrap : Word wrapping in the cell. (Example: "true" )
Sample
// There are five columns - a, b, c, d, e - in the DataList. var options = { common: { fileName : "user.xls", showProcess : true, multipleSheet : true, printSet : { landScape : "true", fitToPage : "true", fitWidth : "1", fitHeight : "1", scale : "222" } }, excelInfo: [ { dataListId : "dataList1", sheetName : "First sheet", removeColumns : "1,3", foldColumns : "2", startRowIndex : 3, startColumnIndex : 0, headerColor : "#DBEEF3", bodyColor : "#92CDDC", wframeId : "wframe1", infoArr : [ { rowIndex : 1, colIndex : 3, rowSpan : 1, colSpan : 2, text : "Data Display" , textAlign : "center" } ] }, { dataListId : "dataList2", sheetName : "Second sheet", removeColumns : "1,3", foldColumns : "2", startRowIndex : 3, startColumnIndex : 0, headerColor : "#DBEEF3", bodyColor : "#92CDDC", wframeId : "wframe1", infoArr : [ { rowIndex : 1, colIndex : 3, rowSpan : 1, colSpan : 2, text : "Data Display" , textAlign : "center" } ] } ] }; WebSquare.util.multipleDataListDownload( options ); (First sheet) A || C D E F ┌──────────────┐┌──────────┬──────┬──────┬──── 1 | || | | | | || ┌──────┴──────┐ 2 | || | Data Display | | || └──────┬──────┘ 3 | || | | | 4 | a || e | | | -> Grid Header. 5 | Renaissance || 20111231 | | | -> Grid Data. 6 | ... (Omitted.) (Second sheet) A || C D E F ┌──────────────┐┌──────────┬──────┬──────┬──── 1 | || | | | | || ┌──────┴──────┐ 2 | || | Data Display | | || └──────┬──────┘ 3 | || | | | 4 | a || e | | | -> Grid Header. 5 | Renaissance || 20111231 | | | -> Grid Data. 6 | ... (Omitted)
multipleExcelDownload( options , infoArr )
Saves the grid data as an Excel file. The sheetName must be unique. (Supported for JDK 1.5 and higher versions.)
Parameter
nametyperequireddescription
optionsObjectYDownloading options for the grid data (stored in JSON format) as an Excel file
File information <String:N> options.fileName : [default: excel.xls] Name of the file to download. <String:N> options.multipleSheet : [default: true] Separate downloading of each GridView on different sheets. <String:N> options.gridId : [default: true] ID of the GridView to download. <String:N> options.wframeId : [default: true] ID of the WFrame in which the DataList to download is contained. Excel file <String:N> options.sheetName : [default: sheet] Excel sheet name. <String:N> options.rowsByN : [default: 100] Maximum number of the rows to download (Example: If this value is "1000", not more than 1000 rows can be downloaded.) <String:N> options.type : [default: 0] When “type” is 0, actual data is used while “1” is to use displayed data and “2” is to use inputted data. (Filtering will be ignored, and the expression-type cell will not be displayed.) <String:N> options.removeColumns : [default: N/A] Column number to remove from the Excel file (Use comma for multiple inputs.) <String:N> options.removeHeaderRows : [default: N/A] Row index of the header to remove from the Excel file. (Use comma for multiple inputs.) <String:N> options.foldColumns : [default: N/A] Columns to fold in the Excel file. (Use comma for multiple inputs.) <Number:N> options.startRowIndex : [default: 0] Row index from which the GridView data starts in the Excel file (including the header.) <Number:N> options.startColumnIndex : [default: 0] Column index from which the GridView data starts in the Excel file (including the header.) <String:N> options.headerColor : [default: #33CCCC] Header color in the Excel file for the GridView. <String:N> options.headerFontName : [default: N/A] Header font name in the Excel file for the GridView. <String:N> options.headerFontSize : [default: 10] Header font size in the Excel file for the GridView. <String:N> options.headerFontColor : [default: N/A] Header font color in the Excel file for the GridView. <String:N> options.bodyColor : [default: #FFFFFF] Body color in the Excel file for the GridView. <String:N> options.bodyFontName : [default: N/A] Body font in the Excel file for the GridView. <String:N> options.bodyFontSize : [default: 10] Body font size in the Excel file for the GridView. <String:N> options.bodyFontColor : [default: N/A] Body font color in the Excel file for the GridView. <String:N> options.subTotalColor : [default: #CCFFCC] Subtotal color in the Excel file for the GridView. <String:N> options.subTotalFontName : [default: N/A] Subtotal font in the Excel file for the GridView. <String:N> options.subTotalFontSize : [default: 10] Subtotal font size in the Excel file for the GridView. <String:N> options.subTotalFontColor : [default: N/A] Subtotal font color in the Excel file for the GridView. <String:N> options.footerColor : [default: #008000] Footer color in the Excel file for the GridView. <String:N> options.footerFontName : [default: N/A] Footer font in the Excel file for the GridView. <String:N> options.footerFontSize : [default: 10] Font size of the footer <String:N> options.footerFontColor : [default: N/A] Footer font color in the Excel file for the GridView. Printing <Object:N> options.printSet Print-related settings (saved in JSON format) <String:N> options.printSet.fitToPage : [default: false] Fits to the page when printing. <String:N> options.printSet.landScape : [default: false] Landscape printing <String:N> options.printSet.fitWidth : [default: 1] Paper width when printing <String:N> options.printSet.fitHeight : [default: 1] Paper height when printing <String:N> options.printSet.scale : [default: 100] Scale. fitToPage must be false, when a scale is defined. <String:N> options.printSet.pageSize : [default: A4] Page Size (Example: "A3", "A4", "A5", "B4") Valid when fitToPage: true. Other options <Boolean:N> options.showProcess : [default: true] Whether to show the process or not. <String:N> options.dataProvider : [default: N/A] Provider package to process the user data. <String:N> options.providerRequestXml : [default: N/A] XML string for internal uses by the provider <String:N> options.userDataXml : [default: N/A] Reserved for the developers to send data when developing server modules. <Boolean:N> options.bodyWordwrap : [default: false] Changes the line in the body. <String:N> options.useEuroLocale : [default: false] Applies Euro locale. (Use . instead of , and vice versa.) <String:N> options.useHeader : [default: true] Displlays header. (true to display, and false not to display.) <String:N> options.useSubTotal : [default: false] Displays the SubTotal. (true to display, and false not to display.) Supports avg, sum, min, max, targetColValue, and number when an expression is used. <String:N> options.useFooter : [default: true] Displays the footer. (true to display, and false not to display.)) <String:N> options.separator : [default: ,] Data separator required for data transmission to the server. The default is comma. <Number:N> options.subTotalScale : [default: -1] Ses the decimal points for the subTotal average. <String:N> options.subTotalRoundingMode : [default: N/A] Rounding mode for subTotal average. ("CEILING","FLOOR","HALF_UP") <String:N> options.useStyle : [default: false] Whether to apply the style not including CSS to the excel (such as background and font). <String:N> options.freezePane : [default: ""] Coordinates and coordinate offset to freeze the pane (Example) freezePane="3,4" Fix to 3 on X and 4 on Y. freezePane="0,1,0,5" Fix to 0 on X and 5 on Y from 0 on X and 1 on Y. <String:N> options.autoSizeColumn : [default: false] Whether to automatically adjust the width or not. <String:N> options.displayGridlines : [default: false] Whether to display gridline on the Excel sheet. <String:N> options.colMerge : [default: false] Whether to merge the columns for which colMerge has been executed for display. <String:N> options.useDataFormat : [default: N/A] Whether to display the data in Text format when the dataType of the grid is Text. (In case of true, display in Text format. Otherwise, display in a general format.)
infoArrObjectNAn array of GridView information to show it in another cell
<Number:N> infoArr.rowIndex : Row index to display text <Number:N> infoArr.colIndex : Column index to display contents <Number:N> infoArr.rowSpan : Number of the rows to merge <Number:N> infoArr.colSpan : Number of columns to merge <String:N> infoArr.text : Text to display <String:N> infoArr.textAlign : Alignment (left, center, right) <String:N> infoArr.fontSize : font size (Example) "20px" <String:N> infoArr.fontName : font name <String:N> infoArr.color : font color (Example) "red" <String:N> infoArr.fontWeight : font weight (Example) "bold" <String:N> infoArr.drawBorder : cell border (Example) true <String:N> infoArr.wordWrap : Line change in the cell (Example) "true"
Sample
// Grid with five columns with IDs of a, b, c, d, and e. var options = { common: { fileName : "user.xls", showProcess : true, multipleSheet : true, printSet : { landScape : "true", fitToPage : "true", fitWidth : "1", fitHeight : "1", scale : "222" } }, excelInfo: [ { gridId : "grid1", sheetName : "First sheet", type : "1", removeColumns : "1,3", foldColumns : "2", startRowIndex : 3, startColumnIndex : 0, headerColor : "#DBEEF3", bodyColor : "#92CDDC", dataProvider : "com.provider.Provider1", providerRequestXml : "<info><key value='TEST'/><info>", infoArr : [ { rowIndex : 1, colIndex : 3, rowSpan : 1, colSpan : 2, text : "Data Display" , textAlign : "center" } ] }, { gridId : "grid2", sheetName : "Second sheet", type : "1", removeColumns : "1,3", foldColumns : "2", startRowIndex : 3, startColumnIndex : 0, headerColor : "#DBEEF3", bodyColor : "#92CDDC", dataProvider : "com.provider.Provider1", providerRequestXml : "<info><key value='TEST'/><info>", infoArr : [ { rowIndex : 1, colIndex : 3, rowSpan : 1, colSpan : 2, text : "Data Display" , textAlign : "center" } ] } ] }; WebSquare.util.multipleExcelDownload( options ); (First sheet) A || C D E F ┌──────────────┐┌──────────┬──────┬──────┬──── 1 | || | | | | || ┌──────┴──────┐ 2 | || | Data Display | | || └──────┬──────┘ 3 | || | | | 4 | a || e | | | -> Grid Header. 5 | Renaissance || 20111231 | | | -> Grid Data. 6 | ... (Omitted.) (Second sheet) A || C D E F ┌──────────────┐┌──────────┬──────┬──────┬──── 1 | || | | | | || ┌──────┴──────┐ 2 | || | Data Display | | || └──────┬──────┘ 3 | || | | | 4 | a || e | | | -> Grid Header. 5 | Renaissance || 20111231 | | | -> Grid Data. 6 | ... (Omitted)
next( elem )
Returns the next node that is not a Text node.
Parameter
nametyperequireddescription
elemObjectYObject to check the next node
Return
typedescription
ObjectNext node
Sample
WebSquare.util.next(xmlDoc);
openPopup( url , options , params , target )
Opens a pop-up of the corresponding property. Functions same as createPopup although using different properties.
Parameter
nametyperequireddescription
urlStringYPop-up window URL
optionsObjectYPopup options. (width, height, etc.)
<String:N> options.id : [default: ppo1] popup id <String:N> options.type : [default: browserPopup] Type of the pop-up. Available options are iframePopup (for IFrame component of WebSquare5), wframePopup (for WFrame component of WebSquare5), and browserPopup (for browser-native window). (Replaces old properties - frameMode and useIFrame.) <String:N> options.width : [default: 500px] Popup width <String:N> options.height : [default: 500px] Popup height <String:N> options.top : [default: 100px] Top position of the pop-up. Top position of the pop-up. In case of IFrame or WFrame pop-up, the position is calculated based on the browser, and in case of the browser-native window, the position is calculated basd on the monitor. <String:N> options.left : [default: 100px] Left-position of the popup. When the pop-up is IFrame or WFrame, the position will be calculated based on the browser, or when the pop-up is a browser-native window, the position will be calculated based on the monitor. <String:N> options.popupName : [default: WebSquarePopup] Name of the popup object. To be displayed on the popup frame. <String:N> options.modal : [default: false] Uses the modal and disables the background. In case of false, the components on the background can be used. <String:N> options.useModalStack : [default: false] Activates only the last pop-up when multiple pop-ups are opened. (true: Activates the last popup only. false: Activates all popups.) <String:N> options.style : [default: ""] Style values of the popup If defined, left, top, width, height settings will not be applied. <String:N> options.srcData : [default: null] Xpath to give to the parent when the popup object type is window. <String:N> options.destData : [default: null] XPath to set in the popup when the popup object type is window. <Object:N> options.dataObject An object containing the data type, data, and the parameter name to set in the popup. (Example) { type: ["xml","string","json","array"], data: "Data" , name :"Parameter name"} <String:N> options.xml : [default: null] xmlDocument string for the popup. Use WebSquare.uiplugin.popup.getPopupParam() to get it from the popup. <String:N> options.resizable : [default: false] Resizes the pop-up. (When the pop-up is IFrame or WFrame.) <String:N> options.status : [default: false] Status display. (Valid when the pop-up is on the browser-native window.) <String:N> options.menubar : [default: false] Menu-bar display. (Valid when the pop-up is on the browser-native window.) <String:N> options.scrollbars : [default: false] Scroll bar display. (Valid when the pop-up is on the browser-native window.) <String:N> options.title : [default: false] Title display (Valid when the pop-up is on the browser-native window.) <String:N> options.useMaximize : [default: true] Maximizes the pop-up upon the end user’s double-clicking the title area when the pop-up is IFrame or WFrame. <String:N> options.closeAction : [default: ""] Name of the customized function to be called upon the end user’s clicking the Close button. Valid when the pop-up is IFrame or WFrame. Closes the popup if the user-defined function returns true. <String:N> options.className : [default: ""] Changes the design of the pop-up when the pop-up is IFrame or WFrame. <String:N> options.fullscreen : [default: false] opens the pop-upon full screen (fullscreen: true). (For IE only.) <String:N> options.useControl : [default: false] useControl: true is to use Min, Max, and Close buttons. <String:N> options.foldOnMinimized : [default: false] “foldOnMinimized: true” is to fold the pop-up instead of minimizing the pop-up. <Object:N> options.controls : [default: { minimize: false, maximize: false, close: false }] controls: Shows or hides certain control buttons. (Valid when useControl is true.) <Object:N> options.foldSize : [default: { width: 500 }] Sets the popup size for “foldSize: minimize(fold)”. ( <Object:N> options.useATagBtn : [default: false] “useATagBtn:true” is to use a tag for the Close button, and “useATagBtn:false” is to use div tag for the Close button. <Object:N> options.disableCloseButton : [default: false] “disableCloseButton:true” is to disable the Close button when the popup-up type is window or litewindow. “disableCloseButton:false” is to use the Close button. <Object:N> options.alwaysOnTop : [default: true] “alwaysOnTop:true” is to display the existing pop-up always on the top when the pop-up type is window or litewindow. In case of “alwaysOnTop:false” setting, the Close button will be used. <Object:N> options.popupUrl : [default: "popup.html"] URL of the popup page. The default is popup.html. <Object:N> options.windowDragMove : [default: false] Generates animation effects of a window moving when the user drags the popup window.
paramsObjectNParameter to send to the popup
targetObjectNwindow object. The default is window.
Sample
requires("uiplugin.popup"); // Must be added to create a popup. // Define data to pass to the new popup (through dataObject.) // Define the actual data to pass. var rowJSON = { "Personal Info" : { "Name": "Lee", "Age": 50, "Married" : false}, "Region": "Seoul", "Carrier": true }; var dataObject = { "type" : "json", // Data type. "json" is recommended. "name" : "paramTest", // Key to get the data. The newly created popup can access the passed data through $p.getParameter( "paramTest" ). "data" : rowJSON // Actual data to pass. }; // Popup creation options. var options = { id : "popup1", type : "wframePopup", width: "230px", height: "250px", top: "130px", left: "200px", popupName : "testPopup", modal : true, resizable : true, status : true, menubar : false, scrollbars : false, title : false, dataObject : dataObject }; // Create a popup. WebSquare.util.openPopup("/ComponentTest/innerPopup1.xml", options ); // (Example) The new popup accesses the passed data. // // var paramData = $p.getParameter("paramTest"); // var data = JSON.stringify(paramData); // alert(data); //
parent( elem , num )
Returns the node of the parent node as high as the given number in the HTML element.
Parameter
nametyperequireddescription
elemObjectYObject to check the parent node
numNumberNNumber of the times to check the parent nodes
Return
typedescription
ObjectParent node
Sample
WebSquare.util.parent( xmlDoc, 1)
parseFloat( str , defaultValue )
Calls parseFloat. defaultValue will be given. If the result is NaN, the defaultValue will be returned.
Parameter
nametyperequireddescription
strStringYNumber string
defaultValueNumberNThe default value to return when the result is NaN.
Return
typedescription
NumberNumeric value converted from the string
Sample
var data = WebSquare.util.parseFloat(num, 0);
parseInt( str , defaultValue )
Calls parseInt. defaultValue will be given. If the result is NaN, the defaultValue will be returned.
Parameter
nametyperequireddescription
strStringYNumber string
defaultValueNumberNThe default value to return when the result is NaN.
Return
typedescription
NumberNumeric value converted from the string
Sample
var data = WebSquare.util.parseInt(num, 0);
prev( elem )
Returns the previous node that is not a Text node.
Parameter
nametyperequireddescription
elemObjectYObject to check the previous nodes
Return
typedescription
ObjectPrevious node
Sample
WebSquare.util.prev( xmlDoc);
reinitialize( refresh )
Reloads the page without refreshing the browser, or refreshes the browser.
Parameter
nametyperequireddescription
refreshBooleanNWhether to refresh the browser or not. (The defatul is false.)
Sample
Load the page without refreshing the browser.
WebSquare.util.reinitialize(true); // Refreshes the browser.
removeData( key )
Removes the data of the corresponding key. The lower objects of the data will be removed.
Parameter
nametyperequireddescription
keyStringYKey of the data to delete
Return
typedescription
ObjectData of the specified key
Sample
var itemList = WebSquare.util.getData("item1").itemList;
setData( key , data )
Set the data with a certain key.
The data will be registered as a global variable of WebSquare5.
In the SPA mode, both the key and the data will be automatically cleared.
Parameter
nametyperequireddescription
keyStringYValue of the key to control the registered data
dataObjectYData to register
Sample
window["common"] = {}; common.itemList = []; common.func = function(){}; WebSquare.util.setData("item1", common);
setDate( str )
Adds / to the date string.
Parameter
nametyperequireddescription
strStringYDate String
Return
typedescription
StringEntered string with '/' added.
Sample
var data = WebSquare.util.setDate ("20120101"); data : 2012/01/01
setDisabled( obj )
Disables the objects under the component.
Parameter
nametyperequireddescription
objObjectYdisabled parameter
<String:N> obj.componentId : Component ID. If empty, body. <boolean:Y> obj.disabled : disabled flag &lt;Array<String>:N> obj.excludeIdList : List of component IDs to exclude. (If not specified, all will be excluded.) &lt;Array<String>:N> obj.includeIdList : List of component IDs to include. (If not specified, all will be included.)
Return
typedescription
Objectobject
<String> object.doneComponents List of the completed components <String> object.skipComponents List of the skipped components because they are already disabled
Sample
WebSquare.util.setDisabled({"componentId":"", "disabled":true}); // All disabled. WebSquare.util.setDisabled({"componentId":"", "disabled":false}); // All enabled. WebSquare.util.setDisabled({"componentId":"", "disabled":true, "excludeIdList": ["output10"]}); // All but output10 disabled. WebSquare.util.setDisabled({"componentId":"", "disabled":true, "includeIdList": ["output1","output2"]}); // Only output1 and output2 disabled.
setDocumentLang( lang )
Sets the language code in the HTML tag.
Parameter
nametyperequireddescription
langStringYLanguage code. (Example) xml:lang="ko"
Sample
WebSquare.util.setDocumentLang("ko");
setDomain( domain )
Sets a domain to support cross-domain on frames and pop-ups.
Parameter
nametyperequireddescription
domainStringYCommon domain
setFullView( zoomResolve )
Sets the fullview feature in the current screen. fullview is to control the zoom feature by calculating the ratio between the reference width/height and the browser width/height.
Parameter
nametyperequireddescription
zoomResolveFunctionYReturns an object containing baseWidth and baseHeight, or a zoom value.
Sample
scwin.zoomResolve = function() { var width = window.innerWidth || document.body.clientWidth; var height = window.innerHeight || document.body.clientHeight; var ratio = height / width; var baseRatio = 0.5625; // In case of 16:9, the ratio between the width and the height is 0.5625. if(ratio > baseRatio) { wrapper.addClass("hideWidget"); return {"baseWidth" : 1440, "baseHeight" : 979}; } else { wrapper.removeClass("hideWidget"); return {"baseWidth" : 1920, "baseHeight" : 979}; } } WebSquare.util.setFullView(zoomResolve);
setInterval( func , options )
Registers a function and regularly executes the function. Upon the end user's changing pages in the SPA mode, the timer registered by setInterval will be cleared.
Parameter
nametyperequireddescription
funcFunctionYFunction to execute
optionsObjectNOptions are as shown below.
<String:N> options.key : timer key If not specified, func.toString().slice(0,30) will be used. <Number:N> options.delay : Second argument of setInterval. The function is executed after the delay time. The default is 1. <Object:N> options.caller : Changes this into Caller within the function. <Object:N> options.args : Arguments of the "func" in the array format. <function:N> options.before_call : The function to be executed right before func. Receives data as arguments. <function:N> options.callback : The function to be executed right after func. Receives the func return as arguments.
Sample
WebSquare.util.setInterval("function(){alert(this.id);}", {caller:grid1, delay:2000, key:"interval1"});
setNumber( str )
Converts to a string by adding a comma to the entered number.
Parameter
nametyperequireddescription
strStringYNumber string
Return
typedescription
StringEntered string with commas
Sample
var data = WebSquare.util.setNumber ( 1234652 ); data : 1,234,652
setTime( str )
Adds : to the time string.
Parameter
nametyperequireddescription
strStringYTime String
Return
typedescription
StringEntered string with ':' added.
Sample
var data = WebSquare.util.setTime ("1123"); data : 11:23
setTimeout( func , options )
Registers a function and executes the function after time-out. Upon the end user's changing pages in the SPA mode, the timer added by this function will be cleared.
Parameter
nametyperequireddescription
funcFunctionYFunction to execute
optionsObjectNOptions are as shown below.
<String:N> options.key : timer key If not specified, func.toString().slice(0,30) will be used. <Number:N> options.delay : The second argument of setTimer. func will be executed after delay time. The default is 1. <Object:N> options.caller : Changes this into Caller within the function. <Object:N> options.args : Arguments of the "func" in the array format. <function:N> options.before_call : The function to be executed right before func. Receives data as arguments. <function:N> options.callback : The function to be executed right after func. Receives the func return as arguments.
Sample
WebSquare.util.setTimeout(function(){alert(this.id);}, {caller:grid1, delay:200, key:timer1});
toHexColor( rgb )
Receives rgb (r, g, b) string and returns the color code in #RRGGBB format.
Parameter
nametyperequireddescription
rgbStringYrgb (r, g, b) string
Return
typedescription
StringColor code in #RRGGBB format
Sample
WebSquare.util.toHexColor("rgb(17,59,158)");
url( w2xPath , options )
Passes only the w2xPath instead of the entire URL upon a page change.
Add additional arguments in the options to use the SPA mode.
Parameter
nametyperequireddescription
w2xPathStringYXML file path
optionsObjectNOptions are as shown below.
<Boolean:N> options.spa : When spa is true, w2xPath will be sent as hash (#) upon the end user's changing the pages. Otherwise, w2xPath will be sent as search (?). If SPA option is not specifed, config.xml setting will be used. If SPA setting is not specified in config.xml, SPA setting will be considered as false. <Boolean:N> options.forceReload : Whether to force reloading of the browser after page changing. Relevant only when SPA optionis true. Accumulated page changing on the SPA mode may result in memory leak. In this case, set forceReload as true to reload the browser upon page changing and to initialize the global resources. <Boolean:N> options.replaceHistory : Whether to replace the browser history. When this is true, location.replace will be called. Otherwise, location.assign will be called. <Object:N> options.param : Upon page changing, additional parameters will be set as an array. The object value must be string. <Boolean:N> options.shortURL : Whether to send the w2xPath URL or the entire path starting with http://. If not specified, the WebSquare5 Engine will decide. <String:N> options.transition : Page transition effects upon moving between pages. [fadeout , slideup] <String:N> options.urlHashText : In case of spa = true, the URL can display the hash part in a different way. Note, however, that three characters (?, &amp;, and #) must not be included.
Sample
var param1 = { "name" = "123", "ID"= "asdf" }; var param2 = { "addr" = "abcd", "PW"= "dddx" }; WebSquare.util.url("/folder1/bar.xml", {"spa" : true, "replaceHistory" : true, "param" : param1}); // Send name and ID while moving from bar.xml on SPA. WebSquare.util.url("/folder1/bar.xml", {"spa" : true, "forceReload" : true, "param" : param2}); // Reload the browser and send addr and PW upon moving from bar.xml on SPA. WebSquare.util.url("/folder1/bar.xml", {"spa" : true, "forceReload" : true, "param" : param2,"transition":"fadeout"}); // Move to bar.xml in SPA and reload the browser. Send the addr and PW and create the fading-out effects. WebSquare.util.url("/folder1/bar.xml", {"spa" : true, "urlHashText" : "pId=bar"}); // After page changing in the SPA mode, the URL will be displayed as http://xxx/websquare.html#pId=bar.