-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplet.py_prep_Python
More file actions
73 lines (51 loc) · 1.96 KB
/
applet.py_prep_Python
File metadata and controls
73 lines (51 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permission.
#
#
#
__all__ = ['GeneralAppletWdg', 'PerforceAppletWdg']
from pyasm.common import TacticException
from pyasm.web import WebContainer, Widget, HtmlElement
class GeneralAppletWdg(Widget):
APPLET_ID = "general_applet"
APPLET_JAR = "Upload-latest.jar"
APPLET_CLASS = "upload.GeneralApplet"
def get_applet_id(cls):
return cls.APPLET_ID
get_applet_id = classmethod(get_applet_id)
def init(my):
#print "DEPRECATED"
#raise TacticException("Use of GeneralAppletWdg is Deprecated")
# it's generated thru JS in IE
if WebContainer.get_web().is_IE():
return
context_url = WebContainer.get_web().get_context_url()
print "-"*20
print my.APPLET_CLASS
# create applet
applet = HtmlElement("applet")
applet.set_attr("code", my.APPLET_CLASS)
applet.set_attr("codebase", "%s/java" % context_url.get_url() )
applet.set_attr("archive", my.APPLET_JAR)
applet.set_attr("width", "1")
applet.set_attr("height", "1")
applet.set_attr("id", my.APPLET_ID)
# create param for applet
param = HtmlElement("param")
param.set_attr("name","scriptable")
param.set_attr("value","true")
applet.add(param)
my.add(applet)
#ticket = WebContainer.get_security().get_ticket_key()
#my.add(HtmlElement.script("document.%s.set_ticket('%s')" \
# %(my.APPLET_ID, ticket)) )
class PerforceAppletWdg(GeneralAppletWdg):
APPLET_ID = "perforce_applet"
APPLET_JAR = "Perforce-latest.jar"
APPLET_CLASS = "perforce.PerforceApplet"