String fragmentDesc = runtimeData.getParameter("fragment_desc");
String fragmentType = runtimeData.getParameter("fragment_type");
String fragmentFolder = runtimeData.getParameter("fragment_add_folder");
boolean isPushedFragment = ("pushed".equals(fragmentType))?true:false;
fragmentId = alm.createFragment(CommonUtils.nvl(funcName),CommonUtils.nvl(fragmentDesc),CommonUtils.nvl(fragmentName));
ALFragment newFragment = (ALFragment) alm.getFragment(fragmentId);
if ( newFragment != null ) {
if ( isPushedFragment )
newFragment.setPushedFragment();
else
newFragment.setPulledFragment();
// Saving the changes in the database
alm.saveFragment(newFragment);
// Saving user's layout to database
alm.saveUserLayout();
// Updating the fragments map
fragments.put(fragmentId,newFragment);
// Check if we need to create an additional folder on the fragment root
if ( "true".equals(fragmentFolder) ) {
alm.loadFragment(fragmentId);
createFolder(newFragment);
alm.saveFragment();
}
}
} else if (action.equals("save")) {
String funcName = runtimeData.getParameter("fragment_fname");
String fragmentName = runtimeData.getParameter("fragment_name");
String fragmentDesc = runtimeData.getParameter("fragment_desc");
String fragmentType = runtimeData.getParameter("fragment_type");
boolean isPushedFragment = ("pushed".equals(fragmentType))?true:false;
ALFragment fragment = (ALFragment) fragments.get(fragmentId);
if ( fragment != null ) {
if ( isPushedFragment )
fragment.setPushedFragment();
else
fragment.setPulledFragment();
fragment.setFunctionalName(CommonUtils.nvl(funcName));
fragment.setDescription(CommonUtils.nvl(fragmentDesc));
String fragmentRootId = getFragmentRootId(fragmentId);
ALNode fragmentRoot = fragment.getNode(fragmentRootId);
fragmentRoot.getNodeDescription().setName(fragmentName);
// Saving the changes in the database
alm.saveFragment(fragment);
}
} else if (action.equals("delete")) {