Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHE-1146 Factory jpa integration and structural refactoring #1926

Merged
merged 1 commit into from
Jul 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*******************************************************************************
* Copyright (c) 2012-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.api.core.model.factory;

import java.util.Map;

/**
* Defines the contract for the factory action instance.
*
* @author Anton Korneta
*/
public interface Action {

/**
* Returns the IDE specific identifier of action e.g. ('openFile', 'editFile')
*/
String getId();

/**
* Returns properties of this action instance
*/
Map<String, String> getProperties();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*******************************************************************************
* Copyright (c) 2012-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.api.core.model.factory;

/**
* Defines the contract for the factory creator instance.
*
* @author Anton Korneta
*/
public interface Author {

/**
* Identifier of the user who created factory, it is mandatory
*/
String getUserId();

/**
* Creation time of factory, set by the server (in milliseconds, from Unix epoch, no timezone)
*/
Long getCreated();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*******************************************************************************
* Copyright (c) 2012-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.api.core.model.factory;

/**
* Defines factory button.
*
* @author Anton Korneta
*/
public interface Button {

enum Type {
LOGO {
@Override
public String toString() {
return "logo";
}
},
NOLOGO {
@Override
public String toString() {
return "nologo";
}
}
}

/**
* Returns type of this button instance
*/
Type getType();

/**
* Returns attributes of this button instance
*/
ButtonAttributes getAttributes();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*******************************************************************************
* Copyright (c) 2012-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.api.core.model.factory;

/**
* Defines factory button attributes.
*
* @author Anton Korneta
*/
public interface ButtonAttributes {

/**
* Returns factory button color
*/
String getColor();

/**
* Returns factory button counter
*/
Boolean getCounter();

/**
* Returns factory button logo
*/
String getLogo();

/**
* Returns factory button style
*/
String getStyle();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*******************************************************************************
* Copyright (c) 2012-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.api.core.model.factory;

import org.eclipse.che.api.core.model.workspace.WorkspaceConfig;

/**
* Defines the contract for the factory instance.
*
* @author Anton Korneta
*/
public interface Factory {

/**
* Returns the identifier of this factory instance,
* it is mandatory and unique.
*/
String getId();

/**
* Returns the version of this factory instance,
* it is mandatory.
*/
String getV();

/**
* Returns a name of this factory instance,
* the name is unique for creator.
*/
String getName();

/**
* Returns creator of this factory instance.
*/
Author getCreator();

/**
* Returns a workspace configuration of this factory instance,
* it is mandatory for every factory instance.
*/
WorkspaceConfig getWorkspace();

/**
* Returns restrictions of this factory instance.
*/
Policies getPolicies();

/**
* Returns factory button for this instance.
*/
Button getButton();

/**
* Returns IDE for this factory instance.
*/
Ide getIde();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*******************************************************************************
* Copyright (c) 2012-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.api.core.model.factory;

/**
* Defines the contract for the factory IDE instance.
*
* @author Anton Korneta
*/
public interface Ide {

/**
* Returns configuration of IDE on application loaded event
*/
OnAppLoaded getOnAppLoaded();

/**
* Returns configuration of IDE on application closed event
*/
OnAppClosed getOnAppClosed();

/**
* Returns configuration of IDE on projects loaded event
*/
OnProjectsLoaded getOnProjectsLoaded();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*******************************************************************************
* Copyright (c) 2012-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.api.core.model.factory;

import java.util.List;

/**
* Defines IDE look and feel on application closed event.
*
* @author Anton Korneta
*/
public interface OnAppClosed {

/**
* Returns actions for current event.
*/
List<? extends Action> getActions();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*******************************************************************************
* Copyright (c) 2012-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.api.core.model.factory;

import java.util.List;

/**
* Defines IDE look and feel on application loaded event.
*
* @author Anton Korneta
*/
public interface OnAppLoaded {

/**
* Returns actions for current event.
*/
List<? extends Action> getActions();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*******************************************************************************
* Copyright (c) 2012-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.api.core.model.factory;

import java.util.List;

/**
* Defines IDE look and feel on project opened event.
*
* @author Anton Korneta
*/
public interface OnProjectsLoaded {

/**
* Returns actions for current event.
*/
List<? extends Action> getActions();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*******************************************************************************
* Copyright (c) 2012-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.api.core.model.factory;

/**
* Defines the contract for the factory restrictions.
*
* @author Anton Korneta
*/
public interface Policies {

/**
* Restrict access if referer header doesn't match this field
*/
String getReferer();

/**
* Restrict access for factories used earlier then author supposes
*/
Long getSince();

/**
* Restrict access for factories used later then author supposes
*/
Long getUntil();

/**
* Re-open project on factory 2-nd click
*/
String getMatch();

/**
* Workspace creation strategy
*/
String getCreate();
}
Loading