Skip to main content

Simkin Scripting Language

Simkin in Sibelius

FillMySpace.com is an online website building site.

It offers its users a webpage builder which is implemented as a Java Applet.

The applet uses Simkin for Java™/XML to provide interactive wizards to make adding features easier for the users of the builder:


Both the user interface layout, and the functionality are specified using a Simkin script which calls into the underlying Java code.

This application uses a hierarchical file format offered in the C++ version of Simkin, which is similar in style, but terser than XML.

The first part of the script describes the layout of the wizard:

Panels
{
{
Layout [BoxY]
Components {
Panel{
Components {
 Label [Please type a description for the event:]
 TextField []{
  Name [EventDesc]
  Focus [true]
  Size [20]
 }
}
}
Panel{
Components {
 Label [Please type a code-name for the event (short with no spaces):]
 TextField []{
  Name [EventName]
  Size [10]
 }
}
}

This layout is read and interpreted by a Java class which creates Java panels and components accordingly.

The behaviour is specified by some Simkin script:

nextButton [(){

// get the fields from the wizard

    eventDesc=getText("EventDesc");
    if (length(eventDesc) gt 0){
	eventName=getText("EventName");
	if (length(eventName) gt 0){

// now add some script objects to pages

	    manageEventsAdded=false;
	    if (Site.containsScript("ManageEvents")=false){
		page=Site.createPage("Manage Events","ManageEvents.html");
		page.addText("My Events Manager",100,20);
		script=page.addScript("ManageEvents",100,100);
		manageEventsAdded=true;
	    }
	    page=Site.createPage(eventName,eventName#".html");
	    page.addText("Please come to "#eventDesc,100,20);
	    script=page.addScript("JoinEvent",100,100);
	    script.setValue("event_name",eventName);

// tell the user what we've done

	    if (manageEventsAdded=true){
		message="We have added 2 pages to your site.";
	    }else{
		message="We have added a new page to your site.";
	    }
	    message=message # "called \""#eventName#"\"";
	    FinalMessage=message;
	    return false;	
	}else{
	    msgBox("Please type an event name");
	    requestFocus("EventName");
	    return true;
	}
    }else{
	msgBox("Please type an event description");
	requestFocus("EventDesc");
	return true;
    }
}
]

This code makes calls into the Java code to extract text from the prompt fields, and to add pages and elements to the site being edited within the page builder. If the user hasn't typed anything in the fields, it makes another call to show a warning message box.