spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column49


Using JavaScript in HomeSite 4.0, Part II

Developer News
Mandrake Linux Founder Back, Virtually
Amazon: We're a Technology Company
Sun Expands MySQL With Closed Source

Manipulating Projects, Part I

In this page we'll teach you how to use HomeSite's Projects via JavaScript. First, familiarize yourself with the Project concept. A project is a collection of files. You can add to and remove files from a project. Files belonging to a certain project need not reside in the same directory and a single file can belong to several projects. The advantage of using projects is that you can operate on a project as a single entity. One of the most powerful command is the Upload Project that allows you to upload all project's files to a server with a single command. The Project configuration file has an extension of .apj. All Project-related commands are in the Project menu. You can also access your projects through the Projects window, reachable from the Project Tab:

Once you created your projects, you can activate one of them via the pulldown menu at the top of the Projects Window. The three buttons next to the pulldown menu are for creating a new project, opening an existing project, and for uploading a project to a server:

Right clicking on the active project opens the Project menu from which you can access many immediate commands such as adding files to the project, opening all its files, etc. Now that you are familiar with HomeSite's Projects, the following Application Object's property and methods will be more intuitive.

ActiveProjectFileString

This property returns the currently-active project. If the current project is column49proj as shown above in the pulldown menu, then the following JavaScript line:

app.MessageBox(app.ActiveProjectFile, "test", 0);

will yield the following window:

AddFileToProject(fileName)Boolean

Adds the given file (fileName) to the active project. The file must reside in the project folder or in one of its subfolders. Returns a true value when successful, a false value otherwise. When successful, you will see immediately the new file in the Projects window.

CloseProject(CloseFilesFlag)Boolean

Closes the active project. It also closes all open files if the given flag (CloseFilesFlag) is true (regardless if they belong to the active project.) Returns a true value if successful, a false value otherwise. You will be prompted for each modified file whether to save its changes or not. Hitting the Cancel button on this prompt will return a false value from this method.

OpenProject(projectFileName)Boolean

Opens a given project. The parameter should include the full file name, as in the following example:

app.OpenProject("U:\\Yehuda\\column49\\column49proj.apj")

You can also pass an empty string as a parameter to this method and force the Open Project dialog.

http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Crucial Triples Up With New Three-Channel DDR3 Kits · Meet the Finalists: Excellence in Technology Awards · Tealeaf Offers Insight to Mobile Customer Behavior


Created: September 27, 1999
Revised: September 27, 1999

URL: http://www.webreference.com/js/column49/projects1.html