Skip to content

Commit

Permalink
Merge pull request #56 from recena/master
Browse files Browse the repository at this point in the history
[JENKINS-31162] Support for Item categorization in Jenkins 2
  • Loading branch information
jglick committed Apr 6, 2016
2 parents 40b4966 + 52ee186 commit e60b470
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 6 deletions.
Expand Up @@ -40,6 +40,18 @@ public String getDisplayName() {
return Messages.Folder_DisplayName();
}

/**
* Needed if it wants AbstractFolderDescriptor implementations are categorized in Jenkins 2.x.
*
* TODO: Override when the baseline is upgraded to 2.x
* TODO: Replace to {@code NestedProjectsCategory.ID}
*
* @return A string it represents a ItemCategory identifier.
*/
public String getCategoryId() {
return "nested-projects";
}

/**
* Properties that can be configured for this type of {@link AbstractFolder} subtype.
*/
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/com/cloudbees/hudson/plugins/folder/Folder.java
Expand Up @@ -339,6 +339,28 @@ public DescriptorImpl getDescriptor() {
@Extension
public static class DescriptorImpl extends AbstractFolderDescriptor {

/**
* Needed if it wants Folders are categorized in Jenkins 2.x.
*
* TODO: Override when the baseline is upgraded to 2.x
*
* @return A string with the Item description.
*/
public String getDescription() {
return Messages.Folder_Description();
}

/**
* Needed if it wants Folder are categorized in Jenkins 2.x.
*
* TODO: Override when the baseline is upgraded to 2.x
*
* @return A string it represents a URL pattern to get the Item icon in different sizes.
*/
public String getIconFilePathPattern() {
return "plugin/cloudbees-folder/images/:size/folder.png";
}

@Override
public TopLevelItem newInstance(ItemGroup parent, String name) {
return new Folder(parent, name);
Expand Down
Expand Up @@ -21,7 +21,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->

<?jelly escape-by-default='true'?>
<div>
${%body}
</div>
<j:jelly xmlns:j="jelly:core">
<j:out value="${it.description}"/>
</j:jelly>

This file was deleted.

@@ -1,4 +1,8 @@
Folder.DisplayName=Folder
Folder.DefaultPronoun=Item
Folder.Description=Creates a container that stores nested items in it. Useful for grouping things together. Unlike \
view, which is just a filter, a folder creates a separate namespace, so you can have multiple things of the same name \
as long as they are in different folders.

RelocateAction.permission.desc=Required to move a job from one folder (or Jenkins root) to another.
RelocateAction.displayName=Move
Binary file added src/main/webapp/images/48x48/folder.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e60b470

Please sign in to comment.