Skip to content

Instantly share code, notes, and snippets.

@eduardolundgren
Created August 31, 2011 05:04
Show Gist options
  • Save eduardolundgren/1182855 to your computer and use it in GitHub Desktop.
Save eduardolundgren/1182855 to your computer and use it in GitHub Desktop.
<%--
/**
* Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
*
* 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.
*/
--%>
<%@ include file="/init.jsp" %>
<%
List<WorkflowDefinition> workflowDefinitions = WorkflowDefinitionManagerUtil.getActiveWorkflowDefinitions(company.getCompanyId(), 0, 100, null);
for (WorkflowDefinition definition : workflowDefinitions) {
StringBundler sb = new StringBundler(7);
sb.append("javascript:Liferay.Util.getOpener().");
sb.append(portletDisplay.getNamespace());
sb.append("selectWorkflowDefinition('");
sb.append(definition.getName() + StringPool.AT + definition.getVersion());
sb.append("', '");
sb.append(definition.getName() + " (" + LanguageUtil.format(locale, "version-x", definition.getVersion()) + ")");
sb.append("', Liferay.Util.getWindow());");
%>
<aui:a href="<%= sb.toString() %>"><%= definition.getName() + " (" + LanguageUtil.format(locale, "version-x", definition.getVersion()) + ")" %></aui:a>
<button onclick="Liferay.Util.getOpener().Liferay.Util.openKaleoDesignerPortlet({ name: '<%= definition.getName() %>', version: <%= definition.getVersion() %>, saveCallback: '<portlet:namespace />saveCallback' });">Edit on Kaleo Designer</button>
<br />
<br />
<%
}
%>
<button onclick="Liferay.Util.getOpener().Liferay.Util.openKaleoDesignerPortlet({ saveCallback: '<portlet:namespace />saveCallback' });">Add Kaleo Draft Designer</button>
<aui:script>
Liferay.Util.getOpener().<portlet:namespace />saveCallback = function(name, version, draftVersion) {
console.log(arguments);
};
</aui:script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment