BBjAppConfig::makeCopy

Description

In BBj 12.0 and higher, this method makes a copy of this BBjAppConfig.

Syntax

Return Value

Method

BBjAppConfig

makeCopy()

Parameters

None.

Return Values

Returns a copy of this BBjAppConfig.

Remarks

None.

Example

Click here to download a zip file containing the required files to run this sample


rem ' BBjAppConfig::makeCopy

app$ = "buisample"

bui! = bbjapi().getWebManager()

admin! = bbjapi().getAdmin("admin","admin123")

appServer! = admin!.getWebAppServer()

appConfig! = appServer!.makeEmptyAppConfig()

icon! = fnStaticResource!(dsk("")+dir("")+app$+"icon.jpg","image/jpeg")

appConfig!.setApplicationIcon(icon!)

appConfig!.setApplicationUserName("admin")

appConfig!.setBBjApplicationName("BUI Sample")

appConfig!.setClientPollInterval(50)

appConfig!.setConfigFile(dsk("")+dir("")+"config.bbx")

appConfig!.setEndAction(bui!.urlAction("https://www.basis.cloud"))

appConfig!.setErrAction(bui!.msgAction("Oops!"))

appConfig!.setInterpreterUser(System.getProperty("user.name"))

image! = fnStaticResource!(dsk("")+dir("")+app$+".jpg","image/jpeg")

appConfig!.setLoadImage(image!)

args! = bbjapi().makeVector()

args!.add("xyzzy")

appConfig!.setProgramArguments(args!)

appConfig!.setProgramName(dsk("")+dir("")+app$+".src")

appConfig!.setQuiet(1)

appConfig!.setSessionTimeout(300)

appConfig!.setShowBrowserWarning(0)

appConfig!.setShowClientConfirmationDialog(1)

css! = fnStaticResource!(dsk("")+dir("")+app$+".css","text/css")

appConfig!.setStyleSheet(css!)

appConfig!.setTerminal("T0")

appConfig!.setWorkingDirectory(dsk("")+dir(""))

print "BBjAppConfig ",app$,":"

print "getApplicationIcon: ",appConfig!.getApplicationIcon()

print "getApplicationUserName: ",appConfig!.getApplicationUserName()

print "getBBjApplicationName: ",appConfig!.getBBjApplicationName()

rem print "getClasspathName: ",appConfig!.getClasspathName()

rem print "getClientPollInterval:",appConfig!.getClientPollInterval()

print "getConfigFile: ",appConfig!.getConfigFile()

print "getEndAction: ",appConfig!.getEndAction()

print "getErrAction: ",appConfig!.getErrAction()

print "getInterpreterUser: ",appConfig!.getInterpreterUser()

print "getLoadImage: ",appConfig!.getLoadImage()

print "getProgramName: ",appConfig!.getProgramName()

rem print "getProgramArguments: ",appConfig!.getProgramArguments()

rem print "getSessionTimeout:",appConfig!.getSessionTimeout()

rem print "getSessionTimeout:",appConfig!.getSessionTimeout()

rem print "getShowBrowserWarning: ",appConfig!.getShowBrowserWarning()

rem print "getShowClientConfirmationDialog: ",appConfig!.getShowClientConfirmationDialog()

print "getStyleSheet: ",appConfig!.getStyleSheet()

print "getTerminal: ",appConfig!.getTerminal()

print "getWorkingDirectory: ",appConfig!.getWorkingDirectory()

rem print "isQuiet: ",appConfig!.isQuiet()

rem ' publish

application! = appConfig!.buildApplication(app$)

appServer!.unpublish(app$,err=*next)

appServer!.publish(application!)

print "Published ",app$

rem ' makeCopy

appCopy$ = app$ + "copy"

appConfigCopy! = appConfig!.makeCopy()

args! = bbjapi().makeVector()

args!.add("blork")

appConfigCopy!.setProgramArguments(args!)

application! = appConfigCopy!.buildApplication(appCopy$)

appServer!.unpublish(appCopy$,err=*next)

appServer!.publish(application!)

print "Published ",appCopy$

stop

def fnStaticResource!(filename$,mimetype$)

  iterator! = appServer!.getStaticResources().iterator()

  while iterator!.hasNext()

    resource! = iterator!.next()

    if resource!.getSourceFileName()<>filename$ then continue

    if resource!.getMimeType()<>mimetype$ then continue

    resource!.setSourceFileName(filename$)

    return resource!

  wend

  return appServer!.addStaticResource(filename$,mimetype$)

fnend

See Also

BBjAPI

BBjAppConfig

BBjAppServer

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.