saurabh
I'm new here

I need your help to get a script for First Sprit Internet Project from which i can get all the packages of the project for which we excute the script.and all objects contains by each package

Jump to solution

I need your help to get a script for First Sprit Internet Project from which i can get all the packages of the project for  which we excute the script.

and all objects contains by each package. Please see the screen shot.

1 Solution

Accepted Solutions
pavone
I'm new here

Hello,

here is a script that should help you getting started (not fully tested):

import de.espirit.firstspirit.access.packagepool.PackageManager;

import de.espirit.firstspirit.access.packagepool.Package;

import de.espirit.firstspirit.access.Connection;

import de.espirit.firstspirit.access.project.Project;

import de.espirit.firstspirit.access.store.IDProvider;

Connection connection = context.getConnection();

Project currentProject = connection.getProjectByName("<PROJECT_NAME>"); // Insert your project name

PackageManager packageManager = (PackageManager) connection.getService(PackageManager.SERVICE_NAME);

// Get packages

packages = packageManager.getPackages(currentProject);

for (Package p : packages) {

  // Get elements in package

  startNodes = p.getStartNodes();

  // Do whatever you want with the packages and the elements

}

Please note that you have to replace <PROJECT_NAME> with the name of your project.

This script is only meant to show you how to access the packages and the elements inside the packages. How you use them of course depends on your use cae.

I hope this will help you.

Best regards

Tim

View solution in original post

0 Kudos
4 Replies
pavone
I'm new here

Hello,

here is a script that should help you getting started (not fully tested):

import de.espirit.firstspirit.access.packagepool.PackageManager;

import de.espirit.firstspirit.access.packagepool.Package;

import de.espirit.firstspirit.access.Connection;

import de.espirit.firstspirit.access.project.Project;

import de.espirit.firstspirit.access.store.IDProvider;

Connection connection = context.getConnection();

Project currentProject = connection.getProjectByName("<PROJECT_NAME>"); // Insert your project name

PackageManager packageManager = (PackageManager) connection.getService(PackageManager.SERVICE_NAME);

// Get packages

packages = packageManager.getPackages(currentProject);

for (Package p : packages) {

  // Get elements in package

  startNodes = p.getStartNodes();

  // Do whatever you want with the packages and the elements

}

Please note that you have to replace <PROJECT_NAME> with the name of your project.

This script is only meant to show you how to access the packages and the elements inside the packages. How you use them of course depends on your use cae.

I hope this will help you.

Best regards

Tim

0 Kudos

Hello,

do you need further help or did Tims reply already help you? If so it would be great, if you mark his answer as "correct answer". If you have already found a solution by yourself, it would by kind of you, if you posted it here.

Best regards

Michaela

Thanks for support

Hi,

This script is sufficient thanks for support.