Skip to content

Commit

Permalink
Initial project setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
tHerrmann committed Sep 14, 2016
0 parents commit 3c858d2
Show file tree
Hide file tree
Showing 11 changed files with 330 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
7 changes: 7 additions & 0 deletions workplace-tools/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry exported="true" kind="con" path="org.springsource.ide.eclipse.gradle.classpathcontainer"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
3 changes: 3 additions & 0 deletions workplace-tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/bin/
/.gradle/
/.settings/
18 changes: 18 additions & 0 deletions workplace-tools/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>workplace-tools</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.springsource.ide.eclipse.gradle.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
24 changes: 24 additions & 0 deletions workplace-tools/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apply plugin: 'java'

sourceCompatibility = 1.7
version = '1.0'
buildDir = '../../buildWorkplaceTools'

repositories {
mavenLocal()
jcenter()
mavenCentral()
maven {
url "http://maven.vaadin.com/vaadin-addons"
}
}

dependencies {
compile group: 'org.opencms', name: 'opencms-core', version: '10.5.0'
}

jar {
manifest {
attributes 'Implementation-Title': 'OpenCmsDays workplace tools', 'Implementation-Version': version
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* File : $Source$
* Date : $Date$
* Version: $Revision$
*
* This library is part of OpenCms -
* the Open Source Content Management System
*
* Copyright (C) 2002 - 2008 Alkacon Software (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* For further information about Alkacon Software, please see the
* company website: http://www.alkacon.com
*
* For further information about OpenCms, please see the
* project website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

package org.opencmsdays.workshop;

import org.opencms.ui.apps.I_CmsAppCategory;

import java.util.Locale;

public class AppCategoryTest implements I_CmsAppCategory {

public static final String CATEGORY_ID = "Test";

public String getId() {

return CATEGORY_ID;
}

public String getName(Locale locale) {

return "Test";
}

public int getOrder() {

return 0;
}

public String getParentId() {

return null;
}

public int getPriority() {

return 0;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/*
* This library is part of OpenCms -
* the Open Source Content Management System
*
* Copyright (c) Alkacon Software GmbH (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* For further information about Alkacon Software, please see the
* company website: http://www.alkacon.com
*
* For further information about OpenCms, please see the
* project website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

package org.opencmsdays.workshop;

import org.opencms.file.CmsObject;
import org.opencms.ui.apps.CmsAppVisibilityStatus;
import org.opencms.ui.apps.I_CmsAppButtonProvider;
import org.opencms.ui.apps.I_CmsWorkplaceApp;
import org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration;

import java.util.Locale;

import com.vaadin.server.FontAwesome;
import com.vaadin.server.Resource;

public class AppConfiguration implements I_CmsWorkplaceAppConfiguration {

public String getAppCategory() {

return AppCategoryTest.CATEGORY_ID;

}

public I_CmsWorkplaceApp getAppInstance() {

return null;
}

public String getButtonStyle() {

return I_CmsAppButtonProvider.BUTTON_STYLE_RED;
}

public String getHelpText(Locale locale) {

return null;
}

public Resource getIcon() {

return FontAwesome.AMBULANCE;
}

public String getId() {

return "MyApp";
}

public String getName(Locale locale) {

return "MyApp";
}

public int getOrder() {

return 0;
}

/**
* @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getPriority()
*/
public int getPriority() {

return I_CmsWorkplaceAppConfiguration.DEFAULT_PRIORIY;
}

/**
* @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getVisibility(org.opencms.file.CmsObject)
*/
public CmsAppVisibilityStatus getVisibility(CmsObject cms) {

// TODO Auto-generated method stub
return new CmsAppVisibilityStatus(true, true, "visible");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/*
* File : $Source$
* Date : $Date$
* Version: $Revision$
*
* This library is part of OpenCms -
* the Open Source Content Management System
*
* Copyright (C) 2002 - 2008 Alkacon Software (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* For further information about Alkacon Software, please see the
* company website: http://www.alkacon.com
*
* For further information about OpenCms, please see the
* project website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

package org.opencmsdays.workshop;

import org.opencms.file.CmsObject;
import org.opencms.file.CmsResource;
import org.opencms.ui.I_CmsDialogContext;
import org.opencms.ui.contextmenu.I_CmsContextMenuItem;
import org.opencms.ui.contextmenu.I_CmsContextMenuItemProvider;
import org.opencms.workplace.explorer.menu.CmsMenuItemVisibilityMode;

import java.util.Arrays;
import java.util.List;
import java.util.Locale;

import com.vaadin.ui.Notification;

public class MenuItemProvider implements I_CmsContextMenuItemProvider {

public List<I_CmsContextMenuItem> getMenuItems() {

return Arrays.<I_CmsContextMenuItem> asList(new I_CmsContextMenuItem() {

public void executeAction(I_CmsDialogContext context) {

Notification.show("Menu item was clicked");
}

public String getId() {

// TODO Auto-generated method stub
return "testitem";
}

public float getOrder() {

// TODO Auto-generated method stub
return 3000;
}

public String getParentId() {

// TODO Auto-generated method stub
return null;
}

public int getPriority() {

// TODO Auto-generated method stub
return 0;
}

public String getTitle(Locale locale) {

// TODO Auto-generated method stub
return "Test menu item";
}

public CmsMenuItemVisibilityMode getVisibility(CmsObject cms, List<CmsResource> resources) {

// TODO Auto-generated method stub
return CmsMenuItemVisibilityMode.VISIBILITY_ACTIVE;
}

public CmsMenuItemVisibilityMode getVisibility(I_CmsDialogContext context) {

// TODO Auto-generated method stub
return CmsMenuItemVisibilityMode.VISIBILITY_ACTIVE;
}

public boolean isLeafItem() {

return true;
}
});
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.opencmsdays.workshop.AppCategoryTest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.opencmsdays.workshop.AppConfiguration
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.opencmsdays.workshop.MenuItemProvider

0 comments on commit 3c858d2

Please sign in to comment.