Permalink
Browse files

Added lock state info to gallery result item list.

  • Loading branch information...
1 parent 4e3be68 commit f06116c76e641f1df14aa84f8301104623cc4ce5 @tHerrmann tHerrmann committed Oct 9, 2012
@@ -1,9 +1,9 @@
@external cms_type_icon;
/** unused classes **/
.itemAdditional, .open, .itemActive, .itemRed, .itemBlue, .itemYellow, .disabledItem, .itemTitle, .cms_type_icon,
-.cmsHovering, .buttonPanel, .permaVisible, .itemAdditionalTitle, .itemAdditionalValue, .dragging,
+.itemAdditionalTitle, .itemAdditionalValue, .dragging,
.cmsState, .cmsState-up, .cmsState-up-hovering, .cmsState-up-disabled, .cmsState-down, .cmsState-down-hovering,
-.cmsState-down-disabled, .export, .hidden, .secure, .redirect, .normal, .lockSharedOpen, .lockSharedClosed, .stateIcon, .lockOpen, .lockIcon, .lockClosed, .titleInput{}
+.cmsState-down-disabled, .export, .hidden, .secure, .redirect, .normal, .lockSharedOpen, .lockSharedClosed, .stateIcon, .lockOpen, .lockClosed, .titleInput{}
@sprite li.expired div.itemContent{
@@ -46,13 +46,22 @@
margin: 1px;
}
+.tilingList .tilingItem .lockIcon{
+ bottom: 1px;
+ right: 1px;
+ top:auto;
+ left: auto;
+}
+
.tilingList .tilingItem .cmsHovering .buttonPanel, .tilingList .tilingItem .buttonPanel.permaVisible{
gwt-image: "backgrounds.softBackground";
height: auto;
border: 1px solid value("constants.css.borderColor");
background-color: value("constants.css.backgroundColorSoft");
border-radius:2px;
display:block;
+ top: 0px;
+ right: 0px;
}
.buttonPanel.permaVisible > *{
@@ -9,6 +9,7 @@ div.previewDialog {
bottom: 0px;
display: block;
background-color: value("constants.css.backgroundColorDialog");
+ z-index: value("constants.css.zIndexInline");
}
.previewDialog * {
margin: 0;
@@ -52,6 +52,7 @@
import org.opencms.flex.CmsFlexController;
import org.opencms.gwt.CmsGwtService;
import org.opencms.gwt.CmsRpcException;
+import org.opencms.gwt.CmsVfsService;
import org.opencms.gwt.shared.CmsListInfoBean;
import org.opencms.jsp.CmsJspNavBuilder;
import org.opencms.jsp.CmsJspNavBuilder.Visibility;
@@ -668,11 +669,10 @@ private CmsResultItemBean buildSingleSearchResultItem(
bean.setType(sResult.getResourceType());
// structured id
bean.setClientId(sResult.getStructureId());
-
CmsResource resultResource = cms.readResource(
new CmsUUID(sResult.getStructureId()),
CmsResourceFilter.ONLY_VISIBLE_NO_DELETED);
-
+ CmsVfsService.addLockInfo(cms, resultResource, bean);
String permalink = CmsStringUtil.joinPaths(
OpenCms.getSystemInfo().getOpenCmsContext(),
CmsPermalinkResourceHandler.PERMALINK_HANDLER,
@@ -231,6 +231,24 @@ public static CmsListInfoBean getPageInfoWithLock(CmsObject cms, CmsResource res
throws CmsLoaderException, CmsException {
CmsListInfoBean result = getPageInfo(cms, resource);
+ addLockInfo(cms, resource, result);
+ return result;
+ }
+
+ /**
+ * Adds the lock state information to the resource info bean.<p>
+ *
+ * @param cms the CMS context
+ * @param resource the resource to get the page info for
+ * @param resourceInfo the resource info to add the lock state to
+ *
+ * @return the resource info bean
+ *
+ * @throws CmsException if something else goes wrong
+ */
+ public static CmsListInfoBean addLockInfo(CmsObject cms, CmsResource resource, CmsListInfoBean resourceInfo)
+ throws CmsException {
+
CmsResourceUtil resourceUtil = new CmsResourceUtil(cms, resource);
CmsLock lock = resourceUtil.getLock();
LockIcon icon = LockIcon.NONE;
@@ -256,16 +274,16 @@ public static CmsListInfoBean getPageInfoWithLock(CmsObject cms, CmsResource res
if ((lock.getUserId() != null) && !lock.getUserId().isNullUUID()) {
CmsUser lockOwner = cms.readUser(lock.getUserId());
iconTitle = Messages.get().getBundle().key(Messages.GUI_LOCKED_BY_1, lockOwner.getFullName());
- result.addAdditionalInfo(
+ resourceInfo.addAdditionalInfo(
Messages.get().getBundle().key(Messages.GUI_LOCKED_OWNER_0),
lockOwner.getFullName());
}
- result.setLockIcon(icon);
- result.setLockIconTitle(iconTitle);
+ resourceInfo.setLockIcon(icon);
+ resourceInfo.setLockIconTitle(iconTitle);
if (icon != LockIcon.NONE) {
- result.setTitle(result.getTitle() + " (" + iconTitle + ")");
+ resourceInfo.setTitle(resourceInfo.getTitle() + " (" + iconTitle + ")");
}
- return result;
+ return resourceInfo;
}
/**

0 comments on commit f06116c

Please sign in to comment.