{{Obsolete}}
NOTE - This page refers to an SDK which is now deprecated and might be dropped in the future. The official developer documentation for Alfresco 5.0 is here: http://docs.alfresco.com/5.0/concepts/dev-for-developers.html
Welcome to the Alfresco SDK on NetBeans Guide
From v1.3 onwards, Alfresco provides a developer oriented download bundle, known as the Alfresco SDK (Software Development Kit) to complement the Alfresco release bundle.
This page outlines the steps required to start developing with the Alfresco SDK using NetBeans. Please refer the pages pointed to by hyperlinks for more information on the topics.
Some people claim that the SDK should not contain the source code (See comments in Alfresco forum http://forums.alfresco.com/en/viewtopic.php?f=10&t=12045)
The Alfresco SDJK is available for Developers looking to customise the Alfresco platform. It's main Use Cases are as follows:
More information about the purpose of the Alfresco can be found here
Alfresco developer reference documentation is available in the Developer Guide section of the Alfresco WIKI.
For bug and issue reporting, use the Alfresco Bug and Issue Tracking Application.
To discuss any aspect of Alfresco with the community, use the Alfresco Forums.
For any other information start with the Alfresco Developer Website.
For details on how to download and install the Alfresco SDK see the Downloading and Installing the SDK section of the Alfresco SDK page. A full list of the SDK contents is available in the SDK Contents section of the same page
This section explains how to setup your NetBeans environment for use with the Alfresco SDK
There are 2 possible scenarios:
An Alfresco developer on eclipse who is looking to migrate to NetBeans:
A developer new to Alfresco who is looking to build Alfresco using NetBeans:
◠This requires an additional step to the process described above. You need to create a pseudo eclipse workspace to make use of the “eclipse project importer plugin†in NetBeans by creating the following directory structure: (A zip file containing the below mentioned resources is available here. Unzip it in the correct location)
[SDK_ROOT]
|
samples
|
.metadata
|
.plugins
|
org.eclipse.core.resources
|
.projects
org.eclipse.core.runtime
|
.settings
File name : org.eclipse.jdt.launching.prefs
Content :
org.eclipse.jdt.launching.PREF_VM_XML=<vmSettings defaultVM\=''>\r\n<vmType id\=''>\r\n<vm id\='' name\='java' path\=''/>\r\n</vmType>\r\n</vmSettings>\r\n
File name : org.eclipse.jdt.core.prefs
Content : Empty file
NOTE: The value of org.eclipse.jdt.launching.PREF_VM_XML should be a on single line, check this if you cut and paste from the above text as some systems might insert additional line feeds
While importing the SDK projects into NetBeans, the classpath libraries of “SDK AlfrescoEmbedded†and “SDK AlfrescoRemote†are not exported to the dependent projects. To solve this problem you have to create 2 libraries manually and link them to the projects. Here is how you do it:
1. Create a library called “AlfrescoEmbeddedâ€(Tools->Libraries->New Library) of type “Class librariesâ€
2. Unjar the contents of [SDK_ROOT]/lib/server/config.jar. Add the config directory to “AlfrescoEmbedded†library through the 'Add Jar/Folder..' button
3. Now, select all the jars found in [SDK_ROOT]/samples/server directory. Remember to exhaustively select all the jars by recursively traversing each of the sub-directories
4. Create a library called “AlfrescoRemoteâ€(Tools->Libraries->New Library) of type “Class librariesâ€
5. Select all the jars found in SDK_ROOT/samples/remote directory. Remember to exhaustively select all the jars by recursively traversing each of the sub-directories
6. You can optionally associate source and javadoc for the both the libraries as it is useful to have access to Alfresco's source code and Java documentation while developing. First, unzip *-src.zip files in the [SDK_ROOT]/src directory. Now, click on the 'Sources' tab in the library manager window and using the 'Add jar/folder' button, select the java directory under each of the unzipped src directories. Similarly add javadocs through the 'javadocs' tab. Using the “Add Zip/folder†button, select *-doc.zip files in [SDK_ROOT]/doc/api
7. Now add the libraries to each of the SDK projects that depend on them (Project Properties->Libraries->Add Library). Add 'AlfrescoEmbedded' library to a project if â€SDK AlfrescoEmbedded – dist/SDK_AlfrescoEmdedded.jar†is its compile-time library. Similarly, add 'AlfrescoRemote' library to a project if â€SDK AlfrescoRemote – dist/SDK_AlfrescoRemote.jar†is its compile-time library. Typically, the webservice projects will need AlfrescoRemote library and the rest will need the AlfrescoEmbedded library
Find any fixes necessary to get the SDK to work:
http://issues.alfresco.com/secure/IssueNavigator.jspa?reset=true&mode=hide&pid=10011&component=10102
There are two projects of particular importance:
Each of the sample projects depends on one of the above:
The Existing Alfresco SDK Wiki page has a number of additional steps that it's easier to link to. Here's a step by step list of links for your reference: