Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Orion/Coding conventions"

m (Orion/Naming conventions moved to Orion/Coding conventions: Broader scope of page)
Line 28: Line 28:
  
 
Provisional API packages use the x-internal or x-friends manifest attribute, and do '''not''' have <tt>internal</tt> as a segment in the package name. Use of PDE API tools is highly recommended to ensure you are using supported API.
 
Provisional API packages use the x-internal or x-friends manifest attribute, and do '''not''' have <tt>internal</tt> as a segment in the package name. Use of PDE API tools is highly recommended to ensure you are using supported API.
 +
 +
= Copyrights =
 +
 +
The Orion server source code is licensed under the [http://eclipse.org/org/documents/epl-v10.php Eclipse Public License]. The standard Eclipse [http://eclipse.org/legal/copyrightandlicensenotice.php copyright header] should be used for these source files.
 +
 +
The Orion client code (HTML, CSS, JavaScript), is licensed under both the [http://eclipse.org/org/documents/epl-v10.php Eclipse Public License] and the [http://eclipse.org/org/documents/edl-v10.php Eclipse Distribution License]. Here is a sample copyright header to use in JavaScript source files:
 +
 +
/*******************************************************************************
 +
  * Copyright (c) 2011 <contributor name> and others All rights reserved. This
 +
  * program and the accompanying materials are made available under the terms of
 +
  * the Eclipse Public License v1.0 (http://www.eclipse.org/legal/epl-v10.html), and the
 +
  * Eclipse Distribution License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
 +
  *
 +
  * Contributors: <contributor name> - initial API and implementation
 +
  ******************************************************************************/
  
 
[[Category:Orion|Naming Conventions]]
 
[[Category:Orion|Naming Conventions]]

Revision as of 11:54, 26 April 2011

This is a draft work in progress. If you have suggestions on good naming practices for JavaScript, CSS, and HTML, please raise a discussion on the Orion mailing list.

JavaScript

All member variables starting with an underscore ('_') or having the @private jsdoc tag, are internal and should not be referenced by clients. Such variables are subject to change or removal at any time.

Library Objects

API library objects all fall under the 'orion' namespace. For example a library object for managing bookmarks might be called orion.Bookmarks.

Services

The DOM location of service objects is not defined. All services must be accessed via the service registry using the service's symbolic id. While concrete service implementations may be found in the DOM, such object names are not API and are subject to change at any time. Service symbolic ids follow the Reverse DNS naming convention (like Java packages).

JSON

Server requests and responses are represented by default as JSON objects. Object member names use title case ("Name", "ChildrenLocation", etc).

HTML

None of the HTML in Orion is API. The existence and contents of any HTML file is subject to change at any time. If you see something in Orion's HTML files that you need in your application, make your own copy.

CSS

Java

Java code on the server follows the standard Eclipse Naming Conventions. The project short name is 'orion', so all server bundles and packages start with org.eclipse.orion.

Provisional API packages use the x-internal or x-friends manifest attribute, and do not have internal as a segment in the package name. Use of PDE API tools is highly recommended to ensure you are using supported API.

Copyrights

The Orion server source code is licensed under the Eclipse Public License. The standard Eclipse copyright header should be used for these source files.

The Orion client code (HTML, CSS, JavaScript), is licensed under both the Eclipse Public License and the Eclipse Distribution License. Here is a sample copyright header to use in JavaScript source files:

/******************************************************************************* 
 * Copyright (c) 2011 <contributor name> and others All rights reserved. This 
 * program and the accompanying materials are made available under the terms of 
 * the Eclipse Public License v1.0 (http://www.eclipse.org/legal/epl-v10.html), and the 
 * Eclipse Distribution License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: <contributor name> - initial API and implementation 
 ******************************************************************************/

Back to the top