The File Chooser Widget provides a way of updating the installation files/software from the desktop. This widget is based on the Prototype JavaScript library.
- Allows users to update installed applications
Add this code to the head section of the page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<style type="text/css" title="currentStyle" media="screen">
@import '<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "theme","app","css.jsp?externalApp=true")%>';
</style>
<script src='/dekohportal/dwr/engine.js'></script>
<script src='/dekohportal/dwr/util.js'></script>
<script type="text/javascript" src="<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "common",null,"JSlibrary.jsp")%>"></script>
<script type='text/javascript' src='<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "widget","updateChooser","updateChooser.js")%>'>
</script>
<script type="text/javascript" src="<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "widget","dialog","dialog.js")%>">
</script>
Include the following code where you want to invoke the File Chooser in page:
<input type="button" value="Find Updates" onclick="new UpdateChooser();"/>
None
| Options | Since | Description | Default |
| className | V1.0 | The style class | Dekoh |
| title | V1.0 | Set the title here | ‘Update Chooser’ |
| topMessage | V1.0 | The top message on the dialog | 'Pick a template that suits your collection' |
| resizable | V1.0 | Allow the dialog to resize value is set to true or false | false |
| width | V1.0 | Width of the dialog | 520 |
| height | V1.0 | Height of the dialog | 400 |
| xPos | V1.0 | Specify the x position of the dialog in the document | 0 |
| yPos | V1.0 | Specify the y position of the dialog in the document | 0 |
| minimizable | V1.0 | Works with resizable value set to ‘true’. The value defined for this is ‘true’ or ‘false’ depends on whether you want to make dialog minimized | False |
| maximizable | V1.0 | Works with resizable value set to ‘true’. The value defined for this is ‘true’ or ‘false’ depends on whether you want to make dialog maximized | False |
| isModal | V1.0 | Specify whether the dialog is modal or not | true | - |
| Function | Parameters | Description |
| findComponents | - | Get the components installed on the system |
| displayComponents | - | Display all the components of the desktop |
| checkUpdates | - | Finds all the update on the installed apps |
| enableDekohRestart | - | Enable the restart button |
| disableDekohRestart | - | Disable the restart button |
| findNoUpdates | - | Find all the app list which are not to be updated |
| showAll | - | Show all the app in the dialog |
| progressBar | Id, Name, progressWidth, percent | Set the progress bar for the software getting installed |
| displayUpdates | - | Display all the updates |
| chkDownload | id | Check whether the app is downloaded or not and find the dependencies |
| componentProgress | id | Check the components which are dependent on the parent app |
| DependentsProgress | Id, progid | Get the progress of the dependent components |
| showDependents | - | Show the dependent component |
| shutdown | - | Shutdown the server | |
The DWR method mapping XML is provided in the web.xml file.
<init-param>
<param-name>config-updatechooser</param-name>
<param-value>widgets/updateChooser/dwr-updateChooser.xml</param-value>
</init-param>
<!DOCTYPE dwr PUBLIC
"-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
"http://www.getahead.ltd.uk/dwr/dwr10.dtd">
<dwr>
<allow>
<create creator="new" javascript="updatechooser">
<param name="class" value="dekoh.portal.widget.updatechooser.UpdateChooserUtil"/>
<include method="initUpdateChooser"/>
<include method="getPercentage"/>
<include method="getUpdates"/>
<include method="findInstalledApps"/>
<include method="getDependencies"/>
<include method="updateComponent"/>
<include method="updateDependency"/>
<include method="findpendingApps"/>
<include method="findOngoingApps"/>
<include method="getComponentDependencyProgress"/>
<include method="getComponentProgress"/>
<include method="getNoUpdatesList"/>
<include method="resetNoUpdatesList"/>
<include method="updateChooserClose"/>
</create>
<convert converter="bean" match="dekoh.portal.widget.updatechooser.UpdateObject"/>
<convert converter="bean" match="dekoh.portal.widget.updatechooser.ComponentObject"/>
<convert converter="bean" match="dekoh.portal.widget.updatechooser.DependencyDataObject"/>
<convert converter="bean" match="dekoh.portal.widget.updatechooser.ResolvedResult"/>
</allow>
</dwr>
We need to ensure that all the parameters can be converted. Many of the types provided by the JDK are enabled for you, but you need to give DWR permission to convert your own bean. Generally this means that JavaBean parameters will need a <convert ...> entry.
- Convert-class: dekoh.portal.widget.updatechooser.UpdateObject
- Description: JavaBean to holding the information about the updatable component information.
- Convert-class: dekoh.portal.widget.updatechooser.ComponentObject
- Description: JavaBean to holding the information about the current updating component.
- Convert-class: dekoh.portal.widget.updatechooser.DependencyDataObject
- Description: JavaBean to holding the information about the component dependencies.
- Convert-class: dekoh.portal.widget.updatechooser.ResolvedResult
- Description: JavaBean to holding the information about the component resolvable dependencies.
Each class on which we execute methods, needs a <create ...> entry. There are several types of creator. The most common ones use either the 'new' keyword or the Spring framework. For more information, see the Creator documentation.
- ClassName: dekoh.portal.widget.updatechooser.UpdateChooserUtil
- Description: Class will provide the functionality to find and update installed components on dekoh.
| Method Name | Functionality |
| findInstalledApps | Gets the list all installed components on the accessing dekoh desktop. |
| findpendingApps | Gets the all pending components to be installed. |
| getUpdates | Gets the available updates to the given component. |
| getDependencies | Gets the list of dependencies available on the given component else empty resolve set. |
| setUserViewPreference | Sets the user viewing preference (list or thumb nail view). |
| updateDependency | Updates the dependencies to the given component. |
| updateComponent | Updates the given component. |
| GetComponentProgress | Gets the current update progress status for the given component. |
| GetComponentDependencyProgress | Gets the current update progress status of dependencies of the given component. |
Dekoh Portal Ver 0.4.2 or later.