Permalink
Browse files

Merge feature/relooking on master

  • Loading branch information...
2 parents 222d67a + cf5808a commit 55014de480f22c15b6b7e02411092a7824c04cd4 @annb annb committed May 6, 2013
@@ -1,4 +1,5 @@
/**
- * Provides the API for data type in event manager system, contains the interfaces for object of source that is used to transfer data information between dispatcher and listener in event manager system.
+ * Provides the API for data type in event manager system.
+ * It contains the interfaces for object of source that is used to transfer data information between dispatcher and listener in event manager system.
*/
package org.exoplatform.commons.api.event.data;
@@ -1,4 +1,5 @@
/**
- * Provides the API for event manager system, contains the interfaces which are a central point of the event system (EventManager) and a generic listener (EventListener)
+ * Provides the API for event manager system.
+ * It contains the interfaces which are a central point of the event system (EventManager) and a generic listener (EventListener)
*/
package org.exoplatform.commons.api.event;
@@ -23,7 +23,6 @@
/**
* The class provides indexing API that connector implements to index it's data
- * @LevelAPI Experimental
*/
public abstract class IndexingService {
protected static final String DATE_INDEXED = "se_dateIndexed";
@@ -48,4 +47,4 @@
* @LevelAPI Experimental
*/
public abstract void delete(SearchEntryId id);
-}
+}
@@ -25,7 +25,6 @@
/**
* These class defines the Search API that a driver can implement and provides add/get methods on the connector.
- * @LevelAPI Experimental
*/
public abstract class SearchService {
private LinkedList<SearchServiceConnector> connectors = new LinkedList<SearchServiceConnector>();
@@ -9,9 +9,8 @@
import org.exoplatform.container.xml.PropertiesParam;
/**
- * This abstract class is extended by the SearchService connectors which provide search result for a specific content type
+ * This abstract class is extended by all SearchService connectors, it allow to build from configuration the list of the needed connector for the Unified Search.
*
- * @LevelAPI Experimental
*/
public abstract class SearchServiceConnector extends BaseComponentPlugin {
private String searchType; //search type name
@@ -9,7 +9,7 @@
import org.exoplatform.services.log.Log;
/**
- * Search context contains context information needed for SearchService and its connectors
+ * Search Context contains a set of data needed for SearchService and all connectors.
*
* @LevelAPI Experimental
*/
@@ -1,7 +1,7 @@
package org.exoplatform.commons.api.search.data;
/**
- * Search result returned by SearchService and all of its connectors, for rendering their search results on UI in a unified format
+ * Search result returned by SearchService and all of its connectors, for rendering their search results on UI in a unified format.
*
* @LevelAPI Experimental
*/
@@ -21,7 +21,7 @@
/**
* All possible value type stored in JCR
* @author <a href="mailto:alain.defrance@exoplatform.com">Alain Defrance</a>
- * @LevelAPI Platform
+ * @LevelAPI Experimental
*/
public class SettingValue<T extends Object> implements Serializable {
@@ -31,7 +31,7 @@
/**
* Create a setting value object with a specify value type
* @param value
- * @LevelAPI Platform
+ * @LevelAPI Experimental
*/
public SettingValue(T value) {
this.value = value;
@@ -41,7 +41,7 @@ public SettingValue(T value) {
/**
* Get value object of setting value
* @return value in specified type
- * @LevelAPI Platform
+ * @LevelAPI Experimental
*/
public T getValue() {
return value;
@@ -51,28 +51,28 @@ public T getValue() {
* create setting value object of type String
* @param value String value of setting property will be created
* @return created SettingValue object of type String
- * @LevelAPI Platform
+ * @LevelAPI Experimental
*/
public static SettingValue<String> create(String value) { return new SettingValue<String>(value); }
/**
* create setting value object of type Long
* @param value Long value of setting property will be created
* @return created SettingValue object of type Long
- * @LevelAPI Platform
+ * @LevelAPI Experimental
*/
public static SettingValue<Long> create(Long value) { return new SettingValue<Long>(value); }
/**
* create setting value object of type Double
* @param value Double value of setting property will be created
* @return created SettingValue object of type Double
- * @LevelAPI Platform
+ * @LevelAPI Experimental
*/
public static SettingValue<Double> create(Double value) { return new SettingValue<Double>(value); }
/**
* create setting value object of type Boolean
* @param value Boolean value of setting property will be created
* @return created SettingValue object of type Boolean
- * @LevelAPI Platform
+ * @LevelAPI Experimental
*/
public static SettingValue<Boolean> create(Boolean value) { return new SettingValue<Boolean>(value); }
@@ -1,4 +1,5 @@
/**
- * Provides enum type and classes for key specifications in setting service, provides support for event notification when accessing setting properties services.
+ * Provides enum type and classes for key specifications in setting service.
+ * Provides support for event notification when accessing setting properties services.
*/
package org.exoplatform.commons.api.settings.data;
@@ -1,5 +1,6 @@
/**
- * Provides the API for setting service, contains abstract class and interfaces for accessing and processing setting data stored in a data source
+ * Provides the API for setting service.
+ * It contains abstract class and interfaces for accessing and processing setting data stored in a data source
* and also dealing with synchronous notification of events during the reading and writing of setting properties.
*/
package org.exoplatform.commons.api.settings;
@@ -107,7 +107,7 @@ public void set(Context context, Scope scope, String key, SettingValue<?> value)
* @param context context with which the specified value is to be associated. The context type must be USER and context.id must be not null.
* @param scope scope with which the specified value is to be associated. The scope.id must be not null.
* @param key key with which the specified value is to be associated
- * @LevelAPI Platform
+ * @LevelAPI Experimental
*/
@Override
public void remove(Context context, Scope scope, String key) {
@@ -66,6 +66,8 @@
private boolean isShowUserSpace = true;
+ private boolean isAutoResize = false;
+
private String mySpaceLabel = null;
private String portalSpaceLabel = null;
@@ -123,6 +125,14 @@ public boolean isShowUserSpace() {
public void setShowUserSpace(boolean isShowUserSpace) {
this.isShowUserSpace = isShowUserSpace;
}
+
+ public void setAutoResize(boolean isAutoResize) {
+ this.isAutoResize = isAutoResize;
+ }
+
+ public boolean isAutoResize() {
+ return isAutoResize;
+ }
public String getUsername() {
try {
@@ -14,13 +14,14 @@
String selectSpaceAction = URLEncoder.encode(uicomponent.event(uicomponent.SELECT_SPACE_ACTION), "utf-8");
boolean isShowPortalSpace = uicomponent.isShowPortalSpace();
boolean isShowUserSpace = uicomponent.isShowUserSpace();
+ boolean isAutoResize = uicomponent.isAutoResize();
def rcontext = _ctx.getRequestContext() ;
def requireJs = rcontext.getJavascriptManager().getRequireJS();
requireJs.require("SHARED/UISpaceSwitcher", "UISpaceSwitcher");
requireJs.addScripts("UISpaceSwitcher.init('" + uicomponent.id + "','" + baseRestUrl + "','" + socialBaseRestUrl + "','" + defaultValueForTextSearch + "','" + selectSpaceAction + "'," + invalidingCacheTime + ");");
requireJs.addScripts("UISpaceSwitcher.initSpaceInfo('" + uicomponent.id + "','" + username + "','" + mySpaceLabel + "','" + portalSpaceId + "','" + portalSpaceLabel + "','" + noSpaceLabel + "','" + spaceLabel + "');");
- requireJs.addScripts("UISpaceSwitcher.initConfig('" + uicomponent.id + "'," + isShowPortalSpace + "," + isShowUserSpace + ");");
+ requireJs.addScripts("UISpaceSwitcher.initConfig('" + uicomponent.id + "'," + isShowPortalSpace + "," + isShowUserSpace + "," + isAutoResize + ");");
String currentSpaceName = uicomponent.getCurrentSpaceName();
%>
@@ -148,18 +148,30 @@ UISpaceSwitcher.prototype.initSpaceInfoAfterReady = function(uicomponentId, user
storage.spaceLabel = spaceLabel;
}
-UISpaceSwitcher.prototype.initConfig = function(uicomponentId, isShowPortalSpace, isShowUserSpace) {
+UISpaceSwitcher.prototype.initConfig = function(uicomponentId, isShowPortalSpace, isShowUserSpace, isAutoResize) {
jQuery(window).ready(function(){
var me = eXo.commons.UISpaceSwitcher;
- me.initConfigAfterReady(uicomponentId, isShowPortalSpace, isShowUserSpace);
+ me.initConfigAfterReady(uicomponentId, isShowPortalSpace, isShowUserSpace, isAutoResize);
});
}
-UISpaceSwitcher.prototype.initConfigAfterReady = function(uicomponentId, isShowPortalSpace, isShowUserSpace) {
+UISpaceSwitcher.prototype.initConfigAfterReady = function(uicomponentId, isShowPortalSpace, isShowUserSpace, isAutoResize) {
var me = eXo.commons.UISpaceSwitcher;
var storage = me.dataStorage[uicomponentId];
storage.isShowPortalSpace = isShowPortalSpace;
storage.isShowUserSpace = isShowUserSpace;
+
+ // Auto resize
+ if (isAutoResize) {
+ var spaceSwitcher = document.getElementById(uicomponentId);
+ if (spaceSwitcher) {
+ var spacePopup = jQuery(spaceSwitcher).find("ul.spaceChooserPopup")[0];
+ var dropDownButton = jQuery(spaceSwitcher).find("div.spaceChooser")[0];
+ if (spacePopup && dropDownButton) {
+ spacePopup.style.width = dropDownButton.offsetWidth + "px";
+ }
+ }
+ }
}
UISpaceSwitcher.prototype.initSpaceData = function(uicomponentId) {
@@ -218,13 +230,13 @@ UISpaceSwitcher.prototype.renderUserSpace = function(uicomponentId, containerCla
var userSpaceId = "/user/" + storage.username;
var userSpaceName = storage.mySpaceLabel;
- var spaceDiv = "<div class='spaceOption hover' id='UISpaceSwitcher_" + userSpaceId
+ var spaceDiv = "<a class='spaceOption hover' id='UISpaceSwitcher_" + userSpaceId
+ "' title='" + userSpaceName
+ "' alt='" + userSpaceName
+ "' onclick=\"eXo.commons.UISpaceSwitcher.onChooseSpace('" + userSpaceId + "', '" + uicomponentId + "')\">"
- + "<image src='/CommonsResources/skin/less/SpaceSwitcher/images/MyWiki.png' width='19px' alt='" + userSpaceName + "'/>"
- + "<span style='float:none; margin-left:6px;' >" + userSpaceName + " </span>"
- + "</div>";
+ + "<image src='/CommonsResources/skin/less/SpaceSwitcher/images/MyWiki.png' width='19' alt='" + userSpaceName + "'/>"
+ + userSpaceName +
+ "</a>";
container.innerHTML = spaceDiv;
};
@@ -238,13 +250,13 @@ UISpaceSwitcher.prototype.renderPortalSpace = function(uicomponentId, containerC
var wikiSpaceSwitcher = document.getElementById(uicomponentId);
var container = jQuery(wikiSpaceSwitcher).find('li.' + containerClazz)[0];
- var spaceDiv = "<div class='spaceOption hover' id='UISpaceSwitcher_" + storage.portalSpaceId
+ var spaceDiv = "<a class='spaceOption hover' id='UISpaceSwitcher_" + storage.portalSpaceId
+ "' title='" + storage.portalSpaceLabel
+ "' alt='" + storage.portalSpaceLabel
+ "' onclick=\"eXo.commons.UISpaceSwitcher.onChooseSpace('" + storage.portalSpaceId + "', '" + uicomponentId +"')\">"
- + "<image src='/CommonsResources/skin/less/SpaceSwitcher/images/CompanyWiki.png' width='19px' alt='" + storage.portalSpaceLabel + "'/>"
- + "<span style='float:none; margin-left:6px;' >" + storage.portalSpaceLabel + " </span>"
- + "</div>";
+ + "<image src='/CommonsResources/skin/less/SpaceSwitcher/images/CompanyWiki.png' width='19' alt='" + storage.portalSpaceLabel + "'/>"
+ + storage.portalSpaceLabel +
+ "</a>";
container.innerHTML = spaceDiv;
}
@@ -281,10 +293,11 @@ UISpaceSwitcher.prototype.processContainerHeight = function(resultLength, contai
}
UISpaceSwitcher.prototype.createSpaceNode = function(spaceId, name, uicomponentId, avatarUrl) {
- var spaceDiv = "<li style='display:block' class='spaceOption hover' id='UISpaceSwitcher_" + spaceId
- + "' onclick=\"eXo.commons.UISpaceSwitcher.onChooseSpace('" + spaceId + "', '" + uicomponentId + "')\">"
- + "<image src='" + avatarUrl + "' width='19px' alt='" + name + "'/>"
- + "<span style='float:none; margin-left:6px;' >" + name + " </span>"
+ var spaceDiv = "<li style='display:block' class='spaceOption hover' id='UISpaceSwitcher_" + spaceId + "' >"
+ + "<a onclick=\"eXo.commons.UISpaceSwitcher.onChooseSpace('" + spaceId + "', '" + uicomponentId + "')\">"
+ + "<image src='" + avatarUrl + "' width='19' alt='" + name + "'/>"
+ + name +
+ "</a>"
+ "</li>";
return spaceDiv;
}
@@ -7,7 +7,16 @@
top: 28px;
border-radius: @baseBorderRadius;
box-shadow: 0px 2px 3px rgba(0,0,0,.1);
-
+ a {
+ max-width: 100%;
+ float: none;
+ padding: 5px 10px;
+ display: block;
+ color: #333333;
+ }
+ a:hover {
+ color: white;
+ }
.title {
line-height: 30px;
border-bottom: 1px solid @tableBorder;
@@ -24,8 +33,8 @@
}
.spaceOption {
line-height: 20px;
- padding: 5px 10px;
color: #333;
+
}
.spaceSearch {
line-height: 20px;
@@ -37,6 +46,7 @@
padding: 0px 5px;
border: 1px solid @tableBorder;
border-radius: @borderRadiusSmall;
+ margin: 0px;
}
}
.focus {
@@ -55,6 +65,12 @@
border-bottom: 1px solid @tableBorder;
font-weight: bold;
box-shadow: 0 -15px 17px #F1F1F1 inset;
+ padding: 5px 0 5px 9px;
+ }
+
+ img {
+ width: 19px;
+ margin-right: 6px;
}
}
.hover:hover{
@@ -64,6 +80,7 @@
color: white;
text-shadow: none;
}
+
}

0 comments on commit 55014de

Please sign in to comment.