Package org.zanata.common

Examples of org.zanata.common.ProjectType


    }

    public void init(boolean isNewInstance) {
        this.isNewInstance = isNewInstance;
        if (isNewInstance) {
            ProjectType projectType = getProject().getDefaultProjectType();
            if (projectType != null) {
                selectedProjectType = projectType.name();
            }
            if(StringUtils.isEmpty(copyFromVersionSlug)) {
                setDefaultCopyFromVersion();
            }
        } else {
            copyFromVersion = false;
            ProjectType versionProjectType = getInstance().getProjectType();
            if (versionProjectType != null) {
                selectedProjectType = versionProjectType.name();
            }
            copyFromVersionSlug = "";
        }
    }
View Full Code Here


    }

    private void updateProjectType() {
        if (!StringUtils.isEmpty(selectedProjectType)
                && !selectedProjectType.equals("null")) {
            ProjectType projectType = ProjectType.valueOf(selectedProjectType);
            getInstance().setProjectType(projectType);
        } else {
            getInstance().setProjectType(null);
        }
    }
View Full Code Here

    }

    public boolean isPoProject() {
        HProjectIteration projectIteration =
                projectIterationDAO.getBySlug(projectSlug, versionSlug);
        ProjectType type = projectIteration.getProjectType();
        if (type == null) {
            type = projectIteration.getProject().getDefaultProjectType();
        }
        return type == ProjectType.Gettext || type == ProjectType.Podir;
    }
View Full Code Here

        }
        return message;
    }

    public boolean isKnownProjectType() {
        ProjectType type =
                projectIterationDAO.getBySlug(projectSlug, versionSlug)
                        .getProjectType();
        return type != null;
    }
View Full Code Here

        HTextFlow textFlow = target.getTextFlow();
        HDocument document = textFlow.getDocument();
        HProjectIteration projectIteration = document.getProjectIteration();
        String iterationSlug = projectIteration.getSlug();
        String projectSlug = projectIteration.getProject().getSlug();
        ProjectType projectType = projectIteration.getProjectType();

        WorkspaceId workspaceId =
                new WorkspaceId(new ProjectIterationId(projectSlug,
                        iterationSlug, projectType), localeId);
        Optional<TranslationWorkspace> workspaceOptional =
View Full Code Here

            Map<String, String> downloadExtensions =
                    new HashMap<String, String>();

            HProjectIteration projectIteration = hDoc.getProjectIteration();
            ProjectType type = projectIteration.getProjectType();
            if (type == null) {
                type = projectIteration.getProject().getDefaultProjectType();
            }

            if (type == null) {
View Full Code Here

        String iterSlug = projectIteration.getSlug();
        HProject project = projectIteration.getProject();
        Boolean isProjectActive =
                projectIterationIsActive(project.getStatus(),
                        projectIteration.getStatus());
        ProjectType projectType = projectIteration.getProjectType();
        log.info(
                "Project {} iteration {} updated, status={}, isProjectActive={}, projectType={}",
                new Object[] { projectSlug, iterSlug,
                        projectIteration.getStatus(), isProjectActive,
                        projectType });
View Full Code Here

     * @param to
     * @param hProject
     */
    public static void copyProjectConfiguration(ProjectIteration from,
            HProjectIteration to, HProject hProject) {
        ProjectType projectType;
        try {
            projectType = ProjectType.getValueOf(from.getProjectType());
        } catch (Exception e) {
            projectType = null;
        }
View Full Code Here

    private static void transfer(Project from, HProject to) {
        to.setName(from.getName());
        to.setDescription(from.getDescription());
        if (from.getDefaultType() != null) {
            ProjectType projectType;
            try {
                projectType = ProjectType.getValueOf(from.getDefaultType());
            } catch (Exception e) {
                projectType = null;
            }
View Full Code Here

    }

    public void setSelectedProjectType(String selectedProjectType) {
        if (!StringUtils.isEmpty(selectedProjectType)
                && !selectedProjectType.equals("null")) {
            ProjectType projectType = ProjectType.valueOf(selectedProjectType);
            getInstance().setDefaultProjectType(projectType);
        } else {
            getInstance().setDefaultProjectType(null);
        }
    }
View Full Code Here

TOP

Related Classes of org.zanata.common.ProjectType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.