Changeset 30540 for main/trunk
- Timestamp:
- 2016-05-16T14:24:50+12:00 (8 years ago)
- Location:
- main/trunk/greenstone3
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/PageAction.java
r28964 r30540 26 26 27 27 public Node process(Node message_node) 28 28 29 { 29 30 Element message = GSXML.nodeToElement(message_node); … … 92 93 Document doc = XMLConverter.newDOM(); 93 94 95 94 96 UserContext userContext = new UserContext(request); 95 97 // first, get the message router info 96 98 Element info_message = doc.createElement(GSXML.MESSAGE_ELEM); 97 Element coll_list_request = GSXML.createBasicRequest(doc, GSXML.REQUEST_TYPE_DESCRIBE, "", userContext); 98 info_message.appendChild(coll_list_request); 99 Element info_request = GSXML.createBasicRequest(doc, GSXML.REQUEST_TYPE_DESCRIBE, "", userContext); 100 //Create param list 101 Element param_list_element = doc.createElement(GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER); 102 info_request.appendChild(param_list_element); 103 //Describe params without collectionlist. Collectionlist provided by CollectionGroup service 104 GSXML.addParameterToList(param_list_element, GSXML.SUBSET_PARAM, GSXML.CLUSTER_ELEM + GSXML.LIST_MODIFIER); 105 GSXML.addParameterToList(param_list_element, GSXML.SUBSET_PARAM, GSXML.SERVICE_ELEM + GSXML.LIST_MODIFIER); 106 GSXML.addParameterToList(param_list_element, GSXML.SUBSET_PARAM, GSXML.SITE_ELEM + GSXML.LIST_MODIFIER); 107 GSXML.addParameterToList(param_list_element, GSXML.SUBSET_PARAM, GSXML.METADATA_ELEM + GSXML.LIST_MODIFIER); 108 info_message.appendChild(info_request); 109 //Send request to message router 99 110 Element info_response_message = (Element) this.mr.process(info_message); 111 //Check if it is not null 100 112 if (info_response_message == null) 101 113 { … … 103 115 return null; 104 116 } 117 //Check if it is not null 105 118 Element info_response = (Element) GSXML.getChildByTagName(info_response_message, GSXML.RESPONSE_ELEM); 106 119 if (info_response == null) … … 108 121 logger.error("couldn't query the message router!"); 109 122 return null; 123 } 124 125 Element resp_service_list = (Element) GSXML.getChildByTagName(info_response, GSXML.SERVICE_ELEM + GSXML.LIST_MODIFIER); 126 127 if (resp_service_list == null) { 128 logger.error("No services available. Couldn't query the message router!"); 129 return null; 130 } 131 Element groupInfoService = GSXML.getNamedElement(resp_service_list, GSXML.SERVICE_ELEM, GSXML.TYPE_ATT, 132 GSXML.SERVICE_TYPE_GROUPINFO); 133 if (groupInfoService != null) { 134 // Prepare request for CollectionGroup service to get current 135 // collections and groups list 136 Element group_info_message = doc.createElement(GSXML.MESSAGE_ELEM); 137 Element group_info_request = GSXML.createBasicRequest(doc, GSXML.TO_ATT, 138 groupInfoService.getAttribute(GSXML.NAME_ATT), userContext); 139 group_info_message.appendChild(group_info_request); 140 //Append group request if exists 141 Element paramList = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER); 142 if (paramList != null) { 143 group_info_request.appendChild(doc.importNode(paramList, true)); 144 } 145 Element group_info_response_message = (Element) this.mr.process(group_info_message); 146 Element group_info_response = (Element) GSXML.getChildByTagName(group_info_response_message, 147 GSXML.RESPONSE_ELEM); 148 Element collection_list = (Element) GSXML.getChildByTagName(group_info_response, 149 GSXML.COLLECTION_ELEM + GSXML.LIST_MODIFIER); 150 // Add Collection List from CollectionGroup Service to response 151 // from message router 152 info_response = (Element) doc.importNode(info_response, true); 153 if (collection_list != null) { 154 info_response.appendChild(doc.importNode(collection_list, true)); 155 } 156 Element group_list = (Element) GSXML.getChildByTagName(group_info_response, 157 GSXML.GROUP_ELEM + GSXML.LIST_MODIFIER); 158 if (group_list != null) { 159 info_response.appendChild(doc.importNode(group_list, true)); 160 } 161 // Send message to groupInfoType Services 162 } else { 163 // If no service with type SERVICE_TYPE_GROUPINFO could be provided 164 // request message router for all available collections 165 GSXML.addParameterToList(param_list_element, GSXML.SUBSET_PARAM, 166 GSXML.COLLECTION_ELEM + GSXML.LIST_MODIFIER); 167 info_response_message = (Element) this.mr.process(info_message); 168 169 if (info_response_message == null) { 170 logger.error(" couldn't query the message router!"); 171 return null; 172 } 173 info_response = (Element) GSXML.getChildByTagName(info_response_message, GSXML.RESPONSE_ELEM); 174 if (info_response == null) { 175 logger.error("couldn't query the message router!"); 176 return null; 177 } 110 178 } 111 179 … … 113 181 // elements but for now, we'll just get it all 114 182 Element collection_list = (Element) GSXML.getChildByTagName(info_response, GSXML.COLLECTION_ELEM + GSXML.LIST_MODIFIER); 115 logger.debug(GSXML.xmlNodeToString(collection_list));183 //logger.debug(GSXML.xmlNodeToString(collection_list)); 116 184 if (collection_list != null) 117 185 { -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSFile.java
r30516 r30540 54 54 55 55 } 56 57 /** site config file path */ 58 static public String groupConfigFile(String site_home) 59 { 60 return site_home + File.separatorChar + "groupConfig.xml"; 61 62 } 63 64 /** site images file path */ 65 static public String imagesFilePath(String site_home) 66 { 67 return site_home + File.separatorChar + "images"; 68 69 } 56 70 57 71 /** interface config file path */ -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java
r30049 r30540 233 233 public static final String SERVICE_TYPE_RETRIEVE = "retrieve"; 234 234 public static final String SERVICE_TYPE_BROWSE = "browse"; 235 public static final String SERVICE_TYPE_GROUPINFO = "groupinfo"; 235 236 public static final String SERVICE_TYPE_APPLET = "applet"; 236 237 public static final String SERVICE_TYPE_PROCESS = "process"; … … 306 307 public static final String UTIL_NAMESPACE = "xalan://org.greenstone.gsdl3.util.XSLTUtil"; 307 308 309 //Groups configuration 310 public static final String HIERARCHY_ELEM = "hierarchy"; 311 public static final String GROUP_DESC_ELEM = "groupDescriptions"; 312 public static final String TITLE_ELEM = "title"; 313 public static final String DESCRIPTION_ELEM = "description"; 314 public static final String SHORT_DESCRIPTION_ELEM = "shortDescription"; 315 public static final String BACKGROUND_IMAGE_ELEM = "backgroundImage"; 316 public static final String POSITION_ATT = "position"; 317 308 318 /** 309 319 * takes a list of elements, and returns an array of strings of the values -
main/trunk/greenstone3/web/interfaces/default/style/core.css
r30382 r30540 286 286 } 287 287 288 #groupLinks a img{ 289 display: block; 290 float: left; 291 border: 1px solid #888; 292 margin: 0 20px 20px 0; 293 font-size: 150%; 294 color: #444; 295 text-decoration: none; 296 height:60px; 297 } 298 299 .groupLink { 300 display: block; 301 float: left; 302 border: 1px solid #888; 303 margin: 0 20px 20px 0; 304 font-size: 150%; 305 color: #444; 306 text-decoration: none; 307 min-width: 200px; 308 text-align:center; 309 } 288 310 .collectionLink { 289 311 display: block; … … 302 324 } 303 325 326 .groupLinkText { 327 padding: 15px 15px 10px; 328 } 329 304 330 /* some text should not be rendered as it is just there for search engines */ 305 331 #collectionLinks a b { 306 332 display: none; 333 } 334 335 #groupLinks a b { 336 display: none; 307 337 } 308 338 -
main/trunk/greenstone3/web/interfaces/default/transform/gslib.xsl
r30478 r30540 199 199 </input> 200 200 </form> 201 </xsl:template> 202 203 <xsl:template name="groupLinkWithImage"> 204 <xsl:variable name="desc"><xsl:value-of select="description"/></xsl:variable> 205 <xsl:variable name="group_href"><xsl:value-of select="$library_name"/>?a=p&sa=home&group=<xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value"/>/<xsl:value-of select="@name"/></xsl:variable> 206 <xsl:choose> 207 <xsl:when test="backgroundImage"> 208 <a href="{$group_href}" title="{$desc}"> 209 <img class="groupLinkImage"> 210 <xsl:attribute name="alt"><xsl:value-of select="displayItem[@name='name']"/></xsl:attribute> 211 <xsl:attribute name="src">sites/<xsl:value-of select="$site_name"/>/images/<xsl:value-of select="backgroundImage"/></xsl:attribute> 212 </img> 213 </a> 214 </xsl:when> 215 <xsl:otherwise> 216 <a href="{$group_href}" title="{$desc}"> 217 <div class="groupLink ui-corner-all"> 218 <div class="groupLinkText ui-widget-content ui-corner-top"> 219 <xsl:value-of select="title"/> 220 </div> 221 <div style="height:15px;" class="ui-state-default ui-corner-bottom"><xsl:text> </xsl:text></div> 222 </div> 223 </a> 224 </xsl:otherwise> 225 </xsl:choose> 201 226 </xsl:template> 202 227 -
main/trunk/greenstone3/web/interfaces/default/transform/pages/home.xsl
r30478 r30540 15 15 16 16 <!-- set page breadcrumbs --> 17 <xsl:template name="breadcrumbs"></xsl:template> 17 <xsl:template name="breadcrumbs"> 18 <xsl:if test="/page/pageRequest/paramList/param[@name='group']"> 19 <gslib:siteLink/> 20 </xsl:if> 21 </xsl:template> 18 22 19 23 <!-- the page content --> … … 26 30 <h2><gslib:selectACollectionTextBar/></h2> 27 31 28 <xsl:call-template name="collectionLinks"/> 29 32 <xsl:for-each select="collectionList/collection|groupList/group"> 33 <xsl:sort select="@position"/> 34 <xsl:if test="name() = 'collection'"> 35 <gslib:collectionLinkWithImage/> 36 </xsl:if> 37 <xsl:if test="name() = 'group'"> 38 <gslib:groupLinkWithImage/> 39 </xsl:if> 40 </xsl:for-each> 41 30 42 <div style="clear: both; padding-top: 4px; padding-bottom: 4px;"><hr/></div> 31 43 … … 43 55 </xsl:template> 44 56 57 <xsl:template name="groupLinks"> 58 <div id="groupLinks"> 59 <!-- <xsl:if test="count(groupList/group) = 0"> 60 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.no_collections')"/> 61 <br/> 62 </xsl:if> 63 --> 64 <xsl:for-each select="groupList/group"> 65 <gslib:groupLinkWithImage/> 66 </xsl:for-each> 67 <br class="clear"/> 68 </div> 69 </xsl:template> 70 45 71 <xsl:template name="collectionLinks"> 46 72 <div id="collectionLinks"> -
main/trunk/greenstone3/web/sites/localsite/siteConfig.xml
r28260 r30540 12 12 13 13 <serviceRack name="ArchiveIO"/> 14 <serviceRack name="CollectionGroups"/> 14 15 <serviceRack name="DocumentMaker"/> 15 16 <serviceRack name="DocXMLUtil"/>
Note:
See TracChangeset
for help on using the changeset viewer.