• No results found

Using SAP HANA Projects

In document hana_dev_en (Page 37-42)

Status of Development Objects

4 Setting Up Your Application

4.2 Using SAP HANA Projects

Projects group together all the artifacts you need for a specific part of the application-development environment.

Before you can start the application-development workflow, you must create a project, which you use to group together all your application-related artifacts. However, before you create a project, you must create a repository workspace, which enables you to synchronize changes in local files with changes in the repository. As part of the project-creation process, you perform the following tasks:

1. Create a development workspace.

The workspace is the link between the SAP HANA repository and your local filesystem, where you work on project-related objects.

2. Create a project.

Create a new project for a particular application or package; you can use the project to collect in a convenient place all your application-related artifacts.

3. Share a project.

Sharing a project enables you to ensure that changes you make to project-related files are visible to other team members and applications. Shared projects are available for import by other members of the application-development team.

4. Import a project.

Import a project (and its associated artifacts) that has been shared by another member of the application-development team.

Related Links

Create a Development Workspace [page 39]

A workspace is a local directory that you map to all (or part) of a package hierarchy in the SAP HANA

repository. When you check out a package from the repository, SAP HANA copies the contents of the package hierarchy to your workspace, where you can work on the files..

Create a New Project [page 40]

Before you can start the application-development workflow, you must create a project, which you use to group all your application-related artifacts.

Share a Project [page 40]

Before you can start working on files associated with a new project, you must share the project; sharing a project enables you to track and synchronize local changes with the repository.

Import a Project [page 41]

Before you can start the application-development workflow, you must either create a new project and share it (with the repository), or import a shared project from the repository into your workspace. Importing a project enables you to track and synchronize local changes with the colleagues working on the objects in the imported project.

4.2.1 SAP HANA Repository: Workspaces

The place where you work on project-related objects is called a repository workspace. A workspace is an environment that maps a local directory to all (or part) of a package hierarchy in the SAP HANA repository.

In SAP HANA studio, the repository tools enable you to view and browse the entire hierarchy of design-time objects stored in the repository. However, when you checkout a package from the repository, SAP HANA copies the contents of the package hierarchy to your workspace, where you can work on the files in your local file system.

Note: Before you can create a workspace you must maintain connection information in the SAP HANA database user store.

To start development work with SAP HANA studio, for example, to checkout the contents of a package, you must create a repository workspace. The workspace contains a system folder with metadata and package folders for the repository content. The file-system folders and their subfolders reflect the package hierarchy in the

repository; the repository client ensures that changes are synchronized. You can use SAP HANA studio to perform the following workspace-related actions in the repository:

Checkout folders and files from the repository

Commit changes to the repository

Activate the committed changes

Revert inactive changes to the previously saved version

The commit operation detects all changes in packages that you configure SAP HANA studio tool to track and writes the detected changes back to the repository. The repository client tools also support synchronization with changes on the server, including conflict detection and merging of change. All workspace-related repository actions are available as context-sensitive menu options in SAP HANA studio. For example, if you right click a repository object at the top of the package hierarchy in the Project Explorer in SAP HANA studio, you can commit and activate all changed objects within the selected hierarchy.

Note: If you create a new project using SAP HANA studio, you can assign the new project to an existing workspace.

4.2.2 Creating a Repository Workspace

A workspace is a local directory that you map to all (or part) of a package hierarchy in the SAP HANA repository.

When you check out a package from the repository, SAP HANA copies the contents of the package hierarchy to your workspace, where you can work on the files..

Before you can start work on the development of the application, you need to set up a workspace, where you store checked-out copies of your application’s source-code files.

To create a new workspace in the SAP HANA studio, perform the following steps:

1. Open the SAP HANA studio.

2. Open the SAP HANA Development perspective.

3. Choose the SAP HANA Repositories view.

4. Choose Create Workspace…

The Create Workspace… button is located in the top right-hand corner of the SAP HANA Repositories view.

5. Specify the workspace details. In the Create New Repository Workspace dialog, enter the following information and choose Finish:

a) Specify the SAP HANA system, for which you want to create a new workspace.

b) Enter a workspace name, for example the name of the SAP HANA system where the repository is located.

To avoid the potential for confusion, it is recommended to associate one workspace with one repository.

c) Specify where the workspace root directory should be located on your local file system, for example: C:

\users\username\workspaces

The new workspace is displayed in the SAP HANA Repositories view.

Note: Although the packages and objects in the chosen repository are visible in the SAP HANA Repositories view, you cannot open or work on the objects here. To work on objects, you must create a project and use the Project Explorer view.

4.2.3 SAP HANA Studio Projects

Before you can start the application-development workflow, you must create a project, which you use to group all your application-related artifacts.

Projects group together all the artifacts you need for a specific part of the application-development environment.

A basic project contains folders and files. More advanced projects are used for builds, version management, sharing, and the organization and maintenance of resources.

Projects enable multiple people to work on the same files at the same time. By committing project-related files to the repository and activating them, you enable team members to see the latest changes.

You can share and unshare projects. Sharing a project associates it with a particular package in the repository linked to a particular workspace. The act of sharing the project sets up a link between the workspace and the repository and enables you to track and synchronize local changes with the versions of the objects stored in the repository. When a project is shared, it becomes available to other people with authorization to access to the repository, for example, colleagues in an application-development team. Team members can import a shared project and see and work on the same files as the creator of the project.

Note: Always unshare a project before deleting it.

In the SAP HANA studio you can create a project at any package level, which enables a fine level of control of the artifacts that may (or may not) be exposed by sharing the project.

4.2.4 Creating a Project for SAP HANA XS

Before you can start the application-development workflow, you must create a project, which you use to group all your application-related artifacts.

Projects group together all the artifacts you need for a specific part of your application-development environment.

Depending on the type of project you are working on, the project can include build tools, too. A basic project contains folders and files. More advanced projects are used for builds, version management, sharing, and the organization and maintenance of resources.

To create a new project in the SAP HANA studio, perform the following steps:

1. Open the SAP HANA studio.

2. Open the SAP HANA Development perspective.

3. Choose the Project Explorer view.

4. Right-click the white space in the Project Explorer view and choose New > Project… in the popup menu.

The type of project you create determines the details you have to provide in the New Project dialog that appears.

a) Enter a project name that describes what the project is about, for example: XS_JavaScript, XS_OData or XS_SAPUI5.

b) Click Finish to create the new project.

The new project is displayed in the Project Explorer view.

Note: The contents of the project depend on the type of project you create. For example, a general project is empty immediately after creation; a JavaScript project contains all the resource files associated with a JavaScript project, such as libraries and build-environment artifacts.

4.2.5 Sharing a Project for SAP HANA XS

Before you can start working on files associated with a new project, you must share the project; sharing a project enables you to track and synchronize local changes with the repository.

When you share a project, you set up a connection to the SAP HANA repository associated with a particular SAP HANA instance. Sharing the project enables you to ensure that changes you make to project-related files are visible to other team members and applications. Other developers can import a shared project and work on the same files.

Note: Use the Project Explorer view in the SAP HANA studio to check if a project is shared. In addition to the project name, a shared project displays the SAP HANA system ID of the repository where the shared artifacts are located, a SAP HANA user name, and the path to the repository package to which the shared project is assigned, for example. "

XSJS_myproject [SID (dbusername,

'sap.hana.xs.app1')]

.

To share a project in the SAP HANA studio, perform the following steps:

1. Open the SAP HANA studio

2. Open the SAP HANA Development perspective.

3. Open the Project Explorer view.

4. Share the project

Right-click the project you want to share and choose Team > Share Project… in the pop-up menu.

5. Select the repository type.

The Share Project dialog displays a list of all available repository types; choose SAP HANA Repository and choose Next.

6. Select the repository workspace where the project should be located.

7. Specify the package that you want to associate the shared project with.

The Share Project dialog displays the suggested location for the shared project in the New Project location screen area. The default location is the name of the workspace with the name of the project you want to share. Choose Browse... to locate the package you want to associate the shared project with. The selected package is displayed in the Path to package text box.

Note: The Keep project folder option appends the name of the project you are sharing to the name of the workspace in which you are sharing the project and creates a new package with the name of the shared project under the workspace location displayed. Use this option only if you want to create multiple projects for a selected package, for example, if you are creating a root project in your root application package.

8. Click Finish to complete the project-sharing procedure.

9. Add new files as required

At this point you can start adding project-specific files to the shared project. These artifacts can then be committed to the repository, where they reside as inactive objects until they are activated, for example, using the Team Activate option in the context-sensitive menus available in the Project Navigator view.

Note: The Project Explorer view decorates the file icons to indicate the current state of the repository files, for example: local (not yet committed), committed (inactive), and active (available for use by others).

10. Make the project available for import, for example, so that others can join it and make changes to project content.

The project-sharing procedure creates some artifacts (for example, the .project file) that must be committed to the repository and activated so that other team members can import the project more easily into their workspace. The .project file is used in several dialogs to populate the list of available projects.

Note: Use the SAP HANA Repositories view to import projects (and checkout project content).

Related Links

Importing a Project in SAP HANA XS [page 41]

Before you can start the application-development workflow, you must either create a new project and share it (with the repository), or import a shared project from the repository into your workspace. Importing a project enables you to track and synchronize local changes with the colleagues working on the objects in the imported project.

4.2.6 Importing a Project in SAP HANA XS

Before you can start the application-development workflow, you must either create a new project and share it (with the repository), or import a shared project from the repository into your workspace. Importing a project

enables you to track and synchronize local changes with the colleagues working on the objects in the imported project.

To import an existing project from the repository into your workspace, perform the following steps.

1. Open the SAP HANA studio

2. Open the SAP HANA Development perspective.

3. Choose the HANA Repositories view.

4. Right-click the package where the project you want to import is located and choose Checkout and Import Projects... in the popup menu.

Projects can be assigned to a package at any level of the package hierarchy. If you know where the project is located, browse to the package first before choosing the Checkout and Import Projects... option. This reduces the amount of files to checkout and download to your local file system.

Note: The existence of a .project file in a package identifies the package as being associated with a project.

The SAP HANA studio checks out the content of the selected package and displays any projects it finds in the Projects screen area.

5. Select the projects to import.

If multiple projects are available for import, select the projects you want to import.

6. Choose Finish to import the selected projects.

You can add the imported project to your Working Sets.

Note: A working set is a concept similar to favorites in a Web browser, which contain the objects you work on most frequently.

In document hana_dev_en (Page 37-42)