Class ProjectServerManager

Class ProjectServerManager

Nombre del espacio: Aspose.Tasks Asamblea: Aspose.Tasks.dll (25.4.0)

La clase que proporciona los métodos para leer y realizar operaciones sobre proyectos en la cuenta Project Online especificada oen la instancia de Project Server especificada en adelante (se soportan las versiones de Project Server 2016 y 2019).

public sealed class ProjectServerManager

Inheritance

object ProjectServerManager

Miembros heredados

object.GetType() ,y, object.ToString() ,y, object.Equals(object?) ,y, object.Equals(object?, object?) ,y, object.ReferenceEquals(object?, object?) ,y, object.GetHashCode()

Constructors

ProjectServerManager(ProjectServerCredentials)

Inicia una nueva instancia de la clase Aspose.Tasks.ProjectServerManager.

public ProjectServerManager(ProjectServerCredentials credentials)

Parameters

credentials ProjectServerCredentials

Credenciales utilizados para conectarse a la cuenta de Project Online.

Examples

Este ejemplo muestra cómo crear una instancia de ProjectServerManager para acceder a la instancia de préstamo de Project Server.

string site = "http://project_server_instance.local/";
var windowsCredentials = new NetworkCredential("Administrator", "my_password", "DOMAIN");
var projectServerCredentials = new ProjectServerCredentials(site, windowsCredentials);
ProjectServerManager manager = new ProjectServerManager(projectServerCredentials);

Este ejemplo muestra cómo crear un ejemplo de ProjectServerManager para acceder a una cuenta en el servicio de Project Online.

var credentials = new ProjectServerCredentials("https://xxxxxx.sharepoint.com", "yyyyy@xxxxxxx.onmicrosoft.com", "password");
ProjectServerManager manager = new ProjectServerManager(projectServerCredentials);

Methods

CreateNewProject(Project)

Crea un nuevo proyecto en la instancia Project Server\Project Online utilizando las opciones de almacenamiento por defecto.

public void CreateNewProject(Project project)

Parameters

project Project

El proyecto para guardar en la instancia Project Server\Project Online.

Examples

En este ejemplo, el proyecto se carga desde el archivo .mpp y se salva en la cuenta de Project Online.

var credentials = new ProjectServerCredentials("https://xxxxxx.sharepoint.com", "yyyyy@xxxxxxx.onmicrosoft.com", "password");
var project = new Project(@"sample.mpp");
ProjectServerManager manager = new ProjectServerManager(credentials);
manager.CreateNewProject(project);

Exceptions

ProjectOnlineException

En caso de error o error de comunicación devuelto por un servidor.

CreateNewProject(Proyecto, ProjectServerSaveOptions)

Crea un nuevo proyecto en la instancia Project Server\Project Online utilizando las opciones de almacenamiento especificadas.

public void CreateNewProject(Project project, ProjectServerSaveOptions saveOptions)

Parameters

project Project

El proyecto para guardar en la instancia Project Server\Project Online.

saveOptions ProjectServerSaveOptions

Instancia de Aspose.Tasks.ProjectServerSaveOptions clase.

Examples

En este ejemplo, el proyecto se carga desde el archivo .mpp y se salva en la cuenta de Project Online.

var credentials = new ProjectServerCredentials("https://xxxxxx.sharepoint.com", "yyyyy@xxxxxxx.onmicrosoft.com", "password");
var project = new Project(@"sample.mpp");
ProjectServerManager manager = new ProjectServerManager(credentials);
manager.CreateNewProject(project, new ProjectServerSaveOptions
{
    ProjectName = "My new project"
});

Exceptions

ProjectOnlineException

En caso de error o error de comunicación devuelto por un servidor.

GetProject(Guid)

Obtenga el proyecto con la guía especificada desde la cuenta Project Online \ Project Server instancia.

public Project GetProject(Guid projectGuid)

Parameters

projectGuid Guid

Guía del proyecto para leer.

Returns

Project

Instancia de la clase Aspose.Tasks.Project que representa la lectura del proyecto de Project Online \ Project Server.

GetProjectList()

Obtenga la lista de proyectos de la tienda ‘Working’ de la cuenta actual Project Online \ Project Server instancia.

public IEnumerable<projectinfo> GetProjectList()

Returns

IEnumerable &ylt; ProjectInfo >

Una lista de proyectos en la cuenta actual Project Online \ Project Server instancia.

GetProjectRawData(Guid)

Obtenga los datos binarios del proyecto para fines de resolución de problemas.

public Stream GetProjectRawData(Guid projectGuid)

Parameters

projectGuid Guid

Guía del proyecto para leer.

Returns

Stream

El flujo que contiene los datos del proyecto crudo.

Examples

In this example the debug info for the specific project is retrieved. You can pass the resulting "debug.zip" to the support team for troubleshooting purposes.
[C#]
var credentials = new ProjectServerCredentials("https://xxxxxx.sharepoint.com", "yyyyy@xxxxxxx.onmicrosoft.com", "password");
// Guid of project you are trying to get.
var projectGuid = new Guid("e0294bfb-5657-45c8-9cc5-82169fb95d69");
ProjectServerManager manager = new ProjectServerManager(credentials);
using (var fileStream = File.OpenWrite(@"c:\debug.zip"))
{
    using (var stream = manager.GetProjectRawData(projectGuid))
    {
        stream.CopyTo(fileStream);
    }
}

UpdateProject(Project)

Actualizar el proyecto existente en la instancia Project Server\Project Online utilizando las opciones de almacenamiento por defecto.

public void UpdateProject(Project project)

Parameters

project Project

El proyecto para guardar en la instancia Project Server\Project Online.

Examples

En este ejemplo, el proyecto se carga de la cuenta de Project Online, se modifica y se salva de vuelta a la cuenta de Project Online.

var credentials = new ProjectServerCredentials("https://xxxxxx.sharepoint.com", "yyyyy@xxxxxxx.onmicrosoft.com", "password");
ProjectServerManager manager = new ProjectServerManager(credentials);
var projectList = manager.GetProjectList();
var projectGuid = projectList.First().Id;
var project = manager.GetProject(projectGuid);
var task = project.RootTask.Children.Add("New task");
manager.UpdateProject(project);

Remarks

La propiedad de Project ‘project.Get(Prj.Guid)’ debe ser una guía válida de un proyecto que existe en la cuenta de Project Server \ Project Online.

Exceptions

ProjectOnlineException

En caso de error o error de comunicación devuelto por un servidor.

UpdateProject(Proyecto, ProjectServerSaveOptions)

Actualizar el proyecto existente en la instancia Project Server\Project Online utilizando las opciones de almacenamiento especificadas.

public void UpdateProject(Project project, ProjectServerSaveOptions saveOptions)

Parameters

project Project

El proyecto para guardar en la instancia Project Server\Project Online.

saveOptions ProjectServerSaveOptions

Instancia de Aspose.Tasks.ProjectServerSaveOptions clase.

Examples

En este ejemplo, el proyecto se carga de la cuenta de Project Online, se modifica y se salva de vuelta a la cuenta de Project Online.

var credentials = new ProjectServerCredentials("https://xxxxxx.sharepoint.com", "yyyyy@xxxxxxx.onmicrosoft.com", "password");
ProjectServerManager manager = new ProjectServerManager(credentials);
var projectList = manager.GetProjectList();
var projectGuid = projectList.First().Id;
var project = manager.GetProject(projectGuid);
var task = project.RootTask.Children.Add("New task");
manager.UpdateProject(project, new ProjectServerSaveOptions
{
    ProjectGuid = projectGuid
});

Remarks

saveOptions.ProjectGuid debe configurarse para una guía de un proyecto que existe en la instancia Project Server\ Project Online.

Exceptions

ProjectOnlineException

En caso de error o error de comunicación devuelto por un servidor.

ExecutingWebRequest

Un evento que se crea cuando la solicitud web se envía a la API web de Project Server.

public event EventHandler<webrequesteventargs> ExecutingWebRequest

Tipo de evento

EventHandler &ylt; WebRequestEventArgs >

 Español