Java Code Examples for org.apache.kylin.metadata.project.ProjectInstance#getDescription()

The following examples show how to use org.apache.kylin.metadata.project.ProjectInstance#getDescription() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProjectService.java    From kylin-on-parquet-v2 with Apache License 2.0 6 votes vote down vote up
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN)
public ProjectInstance createProject(ProjectInstance newProject) throws IOException {
    Message msg = MsgPicker.getMsg();

    String projectName = newProject.getName();
    String description = newProject.getDescription();
    LinkedHashMap<String, String> overrideProps = newProject.getOverrideKylinProps();

    ProjectInstance currentProject = getProjectManager().getProject(projectName);

    if (currentProject != null) {
        throw new BadRequestException(String.format(Locale.ROOT, msg.getPROJECT_ALREADY_EXIST(), projectName));
    }
    String owner = SecurityContextHolder.getContext().getAuthentication().getName();
    ProjectInstance createdProject = getProjectManager().createProject(projectName, owner, description,
            overrideProps);
    accessService.init(createdProject, AclPermission.ADMINISTRATION);
    logger.debug("New project created.");

    return createdProject;
}
 
Example 2
Source File: ProjectService.java    From kylin with Apache License 2.0 6 votes vote down vote up
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN)
public ProjectInstance createProject(ProjectInstance newProject) throws IOException {
    Message msg = MsgPicker.getMsg();

    String projectName = newProject.getName();
    String description = newProject.getDescription();
    LinkedHashMap<String, String> overrideProps = newProject.getOverrideKylinProps();

    ProjectInstance currentProject = getProjectManager().getProject(projectName);

    if (currentProject != null) {
        throw new BadRequestException(String.format(Locale.ROOT, msg.getPROJECT_ALREADY_EXIST(), projectName));
    }
    String owner = SecurityContextHolder.getContext().getAuthentication().getName();
    ProjectInstance createdProject = getProjectManager().createProject(projectName, owner, description,
            overrideProps);
    accessService.init(createdProject, AclPermission.ADMINISTRATION);
    logger.debug("New project created.");

    return createdProject;
}
 
Example 3
Source File: ProjectService.java    From kylin-on-parquet-v2 with Apache License 2.0 5 votes vote down vote up
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN + " or hasPermission(#currentProject, 'ADMINISTRATION')")
public ProjectInstance updateProject(ProjectInstance newProject, ProjectInstance currentProject)
        throws IOException {

    String newProjectName = newProject.getName();
    String newDescription = newProject.getDescription();
    LinkedHashMap<String, String> overrideProps = newProject.getOverrideKylinProps();

    ProjectInstance updatedProject = getProjectManager().updateProject(currentProject, newProjectName,
            newDescription, overrideProps);

    logger.debug("Project updated.");
    return updatedProject;
}
 
Example 4
Source File: ProjectService.java    From kylin with Apache License 2.0 5 votes vote down vote up
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN + " or hasPermission(#currentProject, 'ADMINISTRATION')")
public ProjectInstance updateProject(ProjectInstance newProject, ProjectInstance currentProject)
        throws IOException {

    String newProjectName = newProject.getName();
    String newDescription = newProject.getDescription();
    LinkedHashMap<String, String> overrideProps = newProject.getOverrideKylinProps();

    ProjectInstance updatedProject = getProjectManager().updateProject(currentProject, newProjectName,
            newDescription, overrideProps);

    logger.debug("Project updated.");
    return updatedProject;
}