-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3c858d2
Showing
11 changed files
with
330 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/bin/ | ||
/.gradle/ | ||
/.settings/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
workplace-tools/src/main/java/org/opencmsdays/workshop/AppCategoryTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
} |
100 changes: 100 additions & 0 deletions
100
workplace-tools/src/main/java/org/opencmsdays/workshop/AppConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} | ||
} |
107 changes: 107 additions & 0 deletions
107
workplace-tools/src/main/java/org/opencmsdays/workshop/MenuItemProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
}); | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
workplace-tools/src/main/resources/META-INF/services/org.opencms.ui.apps.I_CmsAppCategory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.opencmsdays.workshop.AppCategoryTest |
1 change: 1 addition & 0 deletions
1
...s/src/main/resources/META-INF/services/org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.opencmsdays.workshop.AppConfiguration |
1 change: 1 addition & 0 deletions
1
.../main/resources/META-INF/services/org.opencms.ui.contextmenu.I_CmsContextMenuItemProvider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.opencmsdays.workshop.MenuItemProvider |