Package org.libreplan.business.common.entities

Examples of org.libreplan.business.common.entities.Connector


    /**
     * Returns true if jira is Activated. Used to show/hide Jira edit window
     */
    public boolean isJiraActivated() {
        Connector connector = connectorDAO
                .findUniqueByName(PredefinedConnectors.JIRA.getName());
        if (connector == null) {
            return false;
        }
        return connector.isActivated();
    }
View Full Code Here


     *
     * @return TypeOfWorkHours for JIRA connector
     * @throws ConnectorException
     */
    private TypeOfWorkHours getTypeOfWorkHours() throws ConnectorException {
        Connector connector = connectorDAO
                .findUniqueByName(PredefinedConnectors.JIRA.getName());
        if (connector == null) {
            throw new ConnectorException(_("JIRA connector not found"));
        }

        TypeOfWorkHours typeOfWorkHours;
        String name = connector.getPropertiesAsMap().get(
                PredefinedConnectorProperties.JIRA_HOURS_TYPE);

        if (StringUtils.isBlank(name)) {
            throw new ConnectorException(
                    _("Hours type should not be empty to synchronine timesheets"));
View Full Code Here

    private SynchronizationInfo synchronizationInfo;

    @Override
    @Transactional(readOnly = true)
    public List<SynchronizationInfo> exportTimesheets() throws ConnectorException {
        Connector connector = getTimConnector();
        if (connector == null) {
            throw new ConnectorException(_("Tim connector not found"));
        }
        if (!connector.areConnectionValuesValid()) {
            throw new ConnectorException(
                    _("Connection values of Tim connector are invalid"));
        }

        synchronizationInfo = new SynchronizationInfo(_("Export"));
View Full Code Here

        }
        if (order == null) {
            throw new ConnectorException(_("Order should not be empty"));
        }

        Connector connector = getTimConnector();
        if (connector == null) {
            throw new ConnectorException(_("Tim connector not found"));
        }

        if (!connector.areConnectionValuesValid()) {
            throw new ConnectorException(
                    _("Connection values of Tim connector are invalid"));
        }

        exportTimesheets(productCode, order, connector);
View Full Code Here


    @Override
    @Transactional
    public List<SynchronizationInfo> importRosters() throws ConnectorException {
        Connector connector = connectorDAO
                .findUniqueByName(PredefinedConnectors.TIM.getName());
        if (connector == null) {
            throw new ConnectorException(_("Tim connector not found"));
        }

        if (!connector.areConnectionValuesValid()) {
            throw new ConnectorException(
                    _("Connection values of Tim connector are invalid"));
        }

        Map<String, String> properties = connector.getPropertiesAsMap();
        String url = properties.get(PredefinedConnectorProperties.SERVER_URL);

        String userName = properties
                .get(PredefinedConnectorProperties.USERNAME);
View Full Code Here

    private IJiraTimesheetSynchronizer jiraTimesheetSynchronizer;

    @Override
    @Transactional(readOnly = true)
    public List<String> getAllJiraLabels() throws ConnectorException {
        Connector connector = getJiraConnector();
        if (connector == null) {
            throw new ConnectorException(_("JIRA connector not found"));
        }

        String jiraLabels = connector.getPropertiesAsMap().get(
                PredefinedConnectorProperties.JIRA_LABELS);

        String labels;
        try {
            new URL(jiraLabels);
View Full Code Here

    @Override
    @Transactional(readOnly = true)
    public List<IssueDTO> getJiraIssues(String label) throws ConnectorException {

        Connector connector = getJiraConnector();
        if (connector == null) {
            throw new ConnectorException(_("JIRA connector not found"));
        }

        if (!connector.areConnectionValuesValid()) {
            throw new ConnectorException(
                    _("Connection values of JIRA connector are invalid"));
        }

        return getJiraIssues(label, connector);
View Full Code Here

    }

    @Override
    @Transactional
    public List<SynchronizationInfo> syncOrderElementsWithJiraIssues() throws ConnectorException {
        Connector connector = getJiraConnector();
        if (connector == null) {
            throw new ConnectorException(_("JIRA connector not found"));
        }
        if (!connector.areConnectionValuesValid()) {
            throw new ConnectorException(
                    _("Connection values of JIRA connector are invalid"));
        }

        List<OrderSyncInfo> orderSyncInfos = orderSyncInfoDAO
View Full Code Here

     * @param connectorName
     *            the connector to check for activated
     * @return true if activated
     */
    private boolean isConnectorActivated(String connectorName) {
        Connector connector = connectorDAO.findUniqueByName(connectorName);
        if (connector == null) {
            return false;
        }
        return connector.isActivated();
    }
View Full Code Here

        private void addHyperlink(final OrderElement orderElement) {
            String code = orderElement.getCode();
            A hyperlink = new A(code);

            Connector connector = connectorDAO
                    .findUniqueByName(PredefinedConnectors.JIRA.getName());
            if (connector == null) {
                return;
            }

            String jiraUrl = connector.getPropertiesAsMap().get(
                    PredefinedConnectorProperties.SERVER_URL);

            String codeWithoutPrefix = StringUtils.removeStart(code,
                    PredefinedConnectorProperties.JIRA_CODE_PREFIX);
            codeWithoutPrefix = StringUtils.removeStart(codeWithoutPrefix,
View Full Code Here

TOP

Related Classes of org.libreplan.business.common.entities.Connector

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.