You can subscribe to this list here.
| 2004 |
Jan
|
Feb
(11) |
Mar
(106) |
Apr
(146) |
May
(79) |
Jun
(233) |
Jul
(218) |
Aug
(160) |
Sep
(155) |
Oct
(80) |
Nov
(176) |
Dec
(115) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(77) |
Feb
(106) |
Mar
(10) |
Apr
(54) |
May
(29) |
Jun
(29) |
Jul
(65) |
Aug
(80) |
Sep
|
Oct
(42) |
Nov
(45) |
Dec
(33) |
| 2006 |
Jan
(49) |
Feb
(52) |
Mar
(8) |
Apr
(3) |
May
(108) |
Jun
(43) |
Jul
(13) |
Aug
(1) |
Sep
(58) |
Oct
(66) |
Nov
(70) |
Dec
(115) |
| 2007 |
Jan
(26) |
Feb
(3) |
Mar
(17) |
Apr
(1) |
May
(4) |
Jun
(3) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
|
Jul
(10) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
| 2009 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Michael K. <ko...@us...> - 2006-12-07 11:51:00
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/wiki In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv5029/org/cobricks/portal/wiki Modified Files: Utility.java Log Message: Index: Utility.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/wiki/Utility.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Utility.java 2 Feb 2006 17:10:29 -0000 1.6 +++ Utility.java 7 Dec 2006 11:50:54 -0000 1.7 @@ -19,17 +19,24 @@ import java.util.Properties; import java.util.regex.Pattern; +import org.apache.log4j.Logger; + import org.cobricks.core.CoreManager; import org.cobricks.core.util.PropertiesUtil; /** * Makes some functionality available to parse the wiki pages. It translate * the wiki-tokens into HTML. + * * @author gaf...@in... + * @author mic...@ac... * @version $Date$ - * */ -public class Utility { + +public class Utility +{ + + static Logger logger = Logger.getLogger(Utility.class); //Indicate the end of line in the String private final static String ENDOFLINE = "\n"; @@ -165,44 +172,47 @@ * 5. parseShortLinks(tmpParse); * 6. parseLinks(tmpParse) * 7. insertNowikiElements(tmpParse) - * - * */ + */ - /* delete the elementes, which should not be parsed -> the elements must - * be inserted with the method insertNowikiElements(String) + /* delete the elementes, which should not be parsed -> + * the elements must be inserted with the method + * insertNowikiElements(String) */ tmpParse = deleteNowikiElements(tmpParse); - //parse the common elements + // parse the common elements tmpParse = parseSearchToken(tmpParse); - //parse the elementes which affect the whole line + // parse the elementes which affect the whole line tmpParse = parseSearchTokenWholeLine(tmpParse); - //parse the images + // parse the images tmpParse = parseImages(tmpParse); - //parse the short links + // parse the short links tmpParse = parseShortLinks(tmpParse); - //parse the links + // parse the links tmpParse = parseLinks(tmpParse); /* - * Insert the elements, which should not be parsed -> this elements must - * be deleted with the method deleteNowikiElements(String) + * Insert the elements, which should not be parsed -> + * this elements must be deleted with the method + * deleteNowikiElements(String) */ tmpParse = insertNowikiElements(tmpParse); - //Insert the pageheader and pagefooter - String pageheaderwiki = properties.getProperty("portal.pageheaderwiki"); - String pagefooterwiki = properties.getProperty("portal.pagefooterwiki"); + // Insert the pageheader and pagefooter + String pageheaderwiki = + properties.getProperty("portal.pageheaderwiki"); + String pagefooterwiki = + properties.getProperty("portal.pagefooterwiki"); - if((pageheaderwiki != null) && (!pageheaderwiki.equals(""))) + if ((pageheaderwiki != null) && (!pageheaderwiki.equals(""))) tmpParse = pageheaderwiki + ENDOFLINE + tmpParse; - if((pagefooterwiki != null) && (!pagefooterwiki.equals(""))) + if ((pagefooterwiki != null) && (!pagefooterwiki.equals(""))) tmpParse = tmpParse + pagefooterwiki + ENDOFLINE; return tmpParse; } @@ -500,7 +510,7 @@ StringBuffer tmpToParse = new StringBuffer(toParse); - //Counter that ensure the singleness of the inserted text into the Map + // Counter that ensure the singleness of the inserted text into the Map int counter = 0; int position = tmpToParse.indexOf(BEGINNOWIKITEXT); @@ -508,34 +518,61 @@ int lastExtractPosition; String notEditedText = null; - while(position > -1) { - - //The first position that will be extracted + while (position > -1) { + // The first position that will be extracted firstExtractPosition = position + BEGINNOWIKITEXT.length(); - //The last position that will be extracted + // The last position that will be extracted lastExtractPosition = tmpToParse.indexOf(ENDNOWIKITEXT, - firstExtractPosition); + firstExtractPosition); - //Substring that will be extracted + // Substring that will be extracted notEditedText = tmpToParse.substring(firstExtractPosition, - lastExtractPosition); + lastExtractPosition); - //Insert the extracted String into the Map + // Insert the extracted String into the Map noWikiTextMap.put(""+counter, notEditedText); - //Replace the text + // Replace the text tmpToParse= tmpToParse.replace(firstExtractPosition, - lastExtractPosition, ""+counter); - + lastExtractPosition, ""+counter); + counter++; position = toParse.indexOf(BEGINNOWIKITEXT, position+1); } + + // add Velocity code to nowiki elements + + position = tmpToParse.indexOf("\n#"); + while (position > -1) { + // The first position that will be extracted + firstExtractPosition = position + 1; + // The last position that will be extracted + lastExtractPosition = tmpToParse. + indexOf("\n", firstExtractPosition); + // Substring that will be extracted + if (lastExtractPosition < firstExtractPosition) { + lastExtractPosition = tmpToParse.length()+1; + } + notEditedText = + tmpToParse.substring(firstExtractPosition, + lastExtractPosition-1); + // Insert the extracted String into the Map + noWikiTextMap.put(""+counter, notEditedText); + // Replace the text + tmpToParse= tmpToParse.replace(firstExtractPosition, + lastExtractPosition-1, + "<nowiki>"+counter+"</nowiki>"); + counter++; + position = tmpToParse.indexOf("\n#", position+1); + } return tmpToParse.toString(); } + /** - * Insert all elemts that should not be edited from the map 'noWikiTextMap'. + * Insert all elements that should not be edited from the map + * 'noWikiTextMap'. * The elements which don't should be edited must be deleted with the * method deleteNowikiElements(String). * @param toParse Will be searched through @@ -555,27 +592,28 @@ String parsedCounter = null; String insertElement = null; - while(position > -1) { - //The first position that will be extracted + while (position > -1) { + // The first position that will be extracted firstExtractPosition = (position + BEGINNOWIKITEXT.length()); - //The last position that will be extracted - lastExtractPosition = tmpToParse.indexOf(ENDNOWIKITEXT, - firstExtractPosition); + // The last position that will be extracted + lastExtractPosition = + tmpToParse.indexOf(ENDNOWIKITEXT, firstExtractPosition); - //Substring that will be extracted - parsedCounter = tmpToParse.substring(firstExtractPosition, - lastExtractPosition); + // Substring that will be extracted + parsedCounter = tmpToParse. + substring(firstExtractPosition, lastExtractPosition); - //Insert the extracted String into the Map + // Insert the extracted String into the Map insertElement = (String)noWikiTextMap.get(parsedCounter); - //Replace the text - tmpToParse = tmpToParse.replace( - position, lastExtractPosition+ENDNOWIKITEXT.length(), - insertElement); + // Replace the text + tmpToParse = tmpToParse. + replace(position, lastExtractPosition+ENDNOWIKITEXT.length(), + insertElement); position = tmpToParse.indexOf(BEGINNOWIKITEXT, position+1); } + return tmpToParse.toString(); } |
|
From: Michael K. <ko...@us...> - 2006-12-07 11:51:00
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/user In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv5029/org/cobricks/user Modified Files: UserManagerImpl.java Log Message: Index: UserManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/user/UserManagerImpl.java,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- UserManagerImpl.java 24 Nov 2006 08:05:57 -0000 1.70 +++ UserManagerImpl.java 7 Dec 2006 11:50:55 -0000 1.71 @@ -54,7 +54,6 @@ import org.cobricks.user.attribute.AttributeDescriptor; import org.cobricks.user.attribute.AttributeDescriptorManager; import org.cobricks.user.attribute.UserJoin; -import org.cobricks.user.liberty.idff.LAIdffBridge; import com.sun.rsasign.i; @@ -2097,16 +2096,6 @@ } /** - * Function needed for Liberty Alliance Single Sign-On - * (org.cobricks.user.liberty.idff) to get an instance of LDIdffBridge in - * the Velocity templates. - */ - public LAIdffBridge getLAIdffBridge() { - LAIdffBridge bridge = LAIdffBridge.getSingleInstance(); - return bridge; - } - - /** * Gets the outgoing edges of the user userid directly from the database. * * @param userid |
|
From: Michael K. <ko...@us...> - 2006-12-07 11:43:06
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/user/liberty/idff In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv1725/liberty/idff Removed Files: AccountHandlerCobricks.java AuthConfirmation.java IdentityProvider.java LAIdffArgs.java LAIdffBridge.java LAIdffImpl.java LAIdffSourceIDImpl.java LibertyServlet.java ServiceProvider.java Log Message: --- ServiceProvider.java DELETED --- --- IdentityProvider.java DELETED --- --- LAIdffSourceIDImpl.java DELETED --- --- LAIdffArgs.java DELETED --- --- LAIdffBridge.java DELETED --- --- LAIdffImpl.java DELETED --- --- AccountHandlerCobricks.java DELETED --- --- LibertyServlet.java DELETED --- --- AuthConfirmation.java DELETED --- |
|
From: Michael K. <ko...@us...> - 2006-12-07 11:41:02
|
Update of /cvsroot/cobricks/cobricks2/web/WEB-INF/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv898 Removed Files: drools-base-2.1.jar drools-core-2.1.jar drools-io-2.1.jar drools-java-2.1.jar drools-smf-2.1.jar sourceid-sso.jar Log Message: --- sourceid-sso.jar DELETED --- --- drools-base-2.1.jar DELETED --- --- drools-java-2.1.jar DELETED --- --- drools-smf-2.1.jar DELETED --- --- drools-core-2.1.jar DELETED --- --- drools-io-2.1.jar DELETED --- |
|
From: Michael K. <ko...@us...> - 2006-12-07 11:38:38
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/agent In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv32510/agent Removed Files: Action.java ActionAnnotation.java ActionRating.java ActionSendMail.java ActionSendMsg.java ActionSetAttr.java Agent.java AgentManager.java AgentManagerImpl.java AgentPresenter.java AgentServlet.java Attribute.java Condition.java DRLCreator.java Rule.java properties.txt Log Message: --- AgentPresenter.java DELETED --- --- ActionSetAttr.java DELETED --- --- ActionSendMsg.java DELETED --- --- ActionRating.java DELETED --- --- AgentManager.java DELETED --- --- Condition.java DELETED --- --- DRLCreator.java DELETED --- --- Attribute.java DELETED --- --- ActionAnnotation.java DELETED --- --- AgentManagerImpl.java DELETED --- --- Action.java DELETED --- --- Rule.java DELETED --- --- ActionSendMail.java DELETED --- --- properties.txt DELETED --- --- AgentServlet.java DELETED --- --- Agent.java DELETED --- |
|
From: Michael K. <ko...@us...> - 2006-12-07 11:37:55
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/agent/db In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv32116 Removed Files: tables.txt user_rules.xml user_rulesactions.xml user_rulesconditions.xml Log Message: --- user_rules.xml DELETED --- --- tables.txt DELETED --- --- user_rulesactions.xml DELETED --- --- user_rulesconditions.xml DELETED --- |
|
From: Michael K. <ko...@us...> - 2006-12-07 06:22:23
|
Update of /cvsroot/cobricks/cobricks2/web/WEB-INF/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv4295 Added Files: wsdl4j-1.5.1.jar Log Message: --- NEW FILE: wsdl4j-1.5.1.jar --- (This appears to be a binary file; contents omitted.) |
|
From: Michael K. <ko...@us...> - 2006-12-07 06:06:01
|
Update of /cvsroot/cobricks/cobricks2 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv30151 Modified Files: build.xml Log Message: Index: build.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/build.xml,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- build.xml 24 Nov 2006 08:05:56 -0000 1.58 +++ build.xml 7 Dec 2006 06:05:58 -0000 1.59 @@ -280,6 +280,7 @@ <include name="portal/**" /> <include name="course/**" /> <include name="ADMIN/**" /> + <include name="images/**" /> <include name="notfound.html.de" /> <include name="noaccess.html.de" /> <include name="noaccess-expired.html.de" /> |
|
From: Michael K. <ko...@us...> - 2006-12-06 16:54:40
|
Update of /cvsroot/cobricks/drehscheibe-in/web/WEB-INF/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv18486 Added Files: soap.jar Log Message: --- NEW FILE: soap.jar --- (This appears to be a binary file; contents omitted.) |
|
From: Michael K. <ko...@us...> - 2006-12-06 16:52:38
|
Update of /cvsroot/cobricks/cobricks2/web/WEB-INF/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17718 Added Files: commons-codec-1.3.jar soap.jar Log Message: --- NEW FILE: soap.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: commons-codec-1.3.jar --- (This appears to be a binary file; contents omitted.) |
|
From: Michael K. <ko...@us...> - 2006-12-06 09:43:05
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv11137 Added Files: WSDLImport.java Log Message: --- NEW FILE: WSDLImport.java --- /* * Copyright (c) 2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software * License, either version 1.0 of the License, or (at your option) any * later version (see www.cobricks.org). * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. */ package org.cobricks.portal; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Vector; import javax.wsdl.Binding; import javax.wsdl.BindingInput; import javax.wsdl.BindingOperation; import javax.wsdl.BindingOutput; import javax.wsdl.Definition; import javax.wsdl.Message; import javax.wsdl.Operation; import javax.wsdl.Output; import javax.wsdl.Part; import javax.wsdl.Port; import javax.wsdl.PortType; import javax.wsdl.Service; import javax.wsdl.Types; import javax.wsdl.WSDLException; import javax.wsdl.extensions.http.HTTPAddress; import javax.wsdl.extensions.http.HTTPBinding; import javax.wsdl.extensions.http.HTTPOperation; import javax.wsdl.extensions.http.HTTPUrlEncoded; import javax.wsdl.extensions.schema.Schema; import javax.wsdl.extensions.soap.SOAPAddress; import javax.wsdl.extensions.soap.SOAPBinding; import javax.wsdl.extensions.soap.SOAPBody; import javax.wsdl.extensions.soap.SOAPOperation; import javax.wsdl.factory.WSDLFactory; import javax.wsdl.xml.WSDLReader; import javax.xml.namespace.QName; import org.apache.log4j.Logger; import org.apache.soap.Constants; import org.apache.soap.SOAPException; import org.apache.soap.rpc.Call; import org.apache.soap.rpc.Parameter; import org.apache.soap.rpc.Response; import org.cobricks.item.Item; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import com.ibm.wsdl.OperationImpl; import com.ibm.wsdl.PortImpl; import com.ibm.wsdl.PortTypeImpl; import com.ibm.wsdl.ServiceImpl; /** * @author heueu * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class WSDLImport { private static Logger logger = Logger.getLogger(WSDLImport.class); private Definition def= null; public WSDLImport() { } public WSDLImport(String URL) { try { WSDLFactory factory = WSDLFactory.newInstance(); WSDLReader reader = factory.newWSDLReader(); reader.setFeature("javax.wsdl.verbose", true); reader.setFeature("javax.wsdl.importDocuments", true); def = reader.readWSDL(null, URL); } catch (WSDLException e) { logger.error(e.getStackTrace().toString()); } } public Map createWSDLItemAttr(String URL) { Map hm = new HashMap(); hm.put("wsdl",URL); return hm; } public Item createWSDLItem(Item i,String Url) { try { URL u=new URL(Url); i.setTitle("de","WSDL-Import von "+u.getHost()); i.setTitle("en","WSDL-Import from "+u.getHost()); String result = parseWSDL(i); i.setContent(result); i.setOntologyClassName("wsdl"); } catch(MalformedURLException mf) { } return i; } public int readWSDLfromUrl(String URL) { int msg=0; try { WSDLFactory factory = WSDLFactory.newInstance(); WSDLReader reader = factory.newWSDLReader(); reader.setFeature("javax.wsdl.verbose", true); reader.setFeature("javax.wsdl.importDocuments", true); def = reader.readWSDL(null, URL); msg=0; } catch (WSDLException e) { logger.error(e.getStackTrace().toString()); msg=1; } return msg; } public String getElementAttributes(QName name) { String result = ""; Node node = null;//searchElementbyName(name); if(node!=null){ while(node.hasChildNodes()){ NodeList nl = node.getChildNodes(); int length = nl.getLength(); for (int i=0;i<length;i++){ if(nl.item(i).getLocalName() != null){ node = nl.item(i); if(node.getLocalName().compareTo("complexType")==0){ if(!node.hasChildNodes()){ result+="No Parameter needed!"; return result; } } else{ if(node.getLocalName().compareTo("sequence")==0){ if(!node.hasChildNodes()){ result+="No Parameter needed!"; return result; } } if(node.getLocalName().compareTo("element")==0){ if(node.hasAttributes()){ NamedNodeMap nnm = node.getAttributes(); int l = nl.getLength(); for(int n =0 ; n<= l; n++){ Node no = nnm.item(n); if(no.getLocalName().compareTo("name")==0){ result+="<b>"+no.getNodeValue()+": <input name="+no.getNodeValue()+"type=text size=30> Typ:</b>"; } if(no.getLocalName().compareTo("type")==0){ result+=no.getNodeValue()+" <br>"; } } } else{ result+="<b>No Parameter needed!</b>"; } } if(node.getLocalName().compareTo("all")==0){} } } } } } return result; } public String getTypebyElementName(QName name) { Types types = def.getTypes(); Node fund = null; String type=null; List elem = types.getExtensibilityElements(); Iterator i = elem.iterator(); while(i.hasNext()) { Schema schema =(Schema) i.next(); Element el = schema.getElement(); NodeList ncl = el.getChildNodes(); NodeList tmp= ncl; int length = ncl.getLength(); int lengthNL=0; for(int x=0;x<length;x++) { for (int z=x;z<length;z++) { Node node = ncl.item(z); if(node.hasAttributes()){ NamedNodeMap nl = node.getAttributes(); lengthNL = nl.getLength(); for(int n =0 ; n<lengthNL; n++){ Node no = nl.item(n); if(no.getNodeValue().compareTo(name.getLocalPart())==0 && no.getNodeName().compareTo("name")==0) { fund=node; } } } ncl = node.getChildNodes(); length=ncl.getLength(); z=0; } ncl=tmp; length = tmp.getLength(); } } if(fund!=null){ if(fund.hasAttributes()){ NamedNodeMap nl = fund.getAttributes(); int length = nl.getLength(); for(int n =0 ; n<length; n++){ Node no = nl.item(n); if(no.getNodeName().compareTo("type")==0){ type=no.getNodeValue(); } } } } return type; } public String getBindingType(String bindOpName) { String bindingTyp=""; Map bindings = def.getBindings(); Iterator i = bindings.values().iterator(); while(i.hasNext()){ Binding bind = (Binding) i.next(); String cmp = bind.getPortType().getQName().getLocalPart(); if(cmp.compareTo(bindOpName)==0){ List bList = bind.getExtensibilityElements(); Iterator i2 = bList.iterator(); while(i2.hasNext()){ Object o = i2.next(); try{ SOAPBinding sbind = (SOAPBinding) o; }catch(Exception e){bindingTyp="http";} try{ HTTPBinding hbind = (HTTPBinding) o; }catch(Exception e){bindingTyp="soap";} } } } return bindingTyp; } public SOAPBinding getSOAPBinding(String bindOpName) { String result=""; String binding=""; SOAPBinding sbind=null; Map bindings = def.getBindings(); Iterator i = bindings.values().iterator(); while(i.hasNext()){ Binding bind = (Binding) i.next(); String cmp = bind.getPortType().getQName().getLocalPart(); if(cmp.compareTo(bindOpName)==0){ List bList = bind.getExtensibilityElements(); Iterator i2 = bList.iterator(); while(i2.hasNext()){ Object o = i2.next(); try{ sbind = (SOAPBinding) o; }catch(Exception e){binding="http";} } } } return sbind; } public HTTPOperation getHTTPOperation(String bindOpName, String operation) { String result=""; String binding=""; HTTPOperation htOp =null; Map bindings = def.getBindings(); Iterator i = bindings.values().iterator(); while(i.hasNext()){ Binding bind = (Binding) i.next(); String cmp = bind.getPortType().getQName().getLocalPart(); if(cmp.compareTo(bindOpName)==0){ List l =bind.getBindingOperations(); Iterator it = l.iterator(); while(it.hasNext()){ try{ BindingOperation bop = (BindingOperation)it.next(); String opName =bop.getName(); if(operation.compareTo(opName)==0){ List bopList = bop.getExtensibilityElements(); Iterator it2 = bopList.iterator(); while(it2.hasNext()){ htOp = (HTTPOperation) it2.next(); } } }catch(Exception e){ return null;} } } } return htOp; } public String getSOAPNamespaceURI(String bindOpName) { String result=""; String binding=""; Map bindings = def.getBindings(); Iterator i = bindings.values().iterator(); while(i.hasNext()){ Binding bind = (Binding) i.next(); List l =bind.getBindingOperations(); Iterator it = l.iterator(); while(it.hasNext()){ try { BindingOperation bop = (BindingOperation)it.next(); String opNam =bop.getName(); if(opNam.compareTo(bindOpName)==0){ BindingInput in =bop.getBindingInput(); List list = in.getExtensibilityElements(); Iterator itt = list.iterator(); while(itt.hasNext()){ SOAPBody sBody = (SOAPBody) itt.next(); result=sBody.getNamespaceURI(); } } } catch(Exception e){logger.error(e.getMessage());} } } return result; } public String binding(String bindOpName) { String result=""; String binding=""; Map bindings = def.getBindings(); Iterator i = bindings.values().iterator(); while(i.hasNext()) { Binding bind = (Binding) i.next(); String cmp = bind.getPortType().getQName().getLocalPart(); if(cmp.compareTo(bindOpName)==0) { List bList = bind.getExtensibilityElements(); Iterator i2 = bList.iterator(); while(i2.hasNext()){ Object o = i2.next(); try { SOAPBinding sbind = (SOAPBinding) o; } catch(Exception e) { binding="http"; } try { HTTPBinding hbind = (HTTPBinding) o; } catch(Exception e) { binding="soap"; } } List l =bind.getBindingOperations(); if(binding.compareTo("soap")==0){ Iterator it = l.iterator(); while(it.hasNext()){ try{ BindingOperation bop = (BindingOperation)it.next(); String opNam =bop.getName(); result+="SOAP"; List bopList = bop.getExtensibilityElements(); Iterator it2 = bopList.iterator(); while(it2.hasNext()){ SOAPOperation sOp = (SOAPOperation) it2.next(); result+="SOAPAction:"+sOp.getSoapActionURI()+"<br>"; result+="SOAPStyle:"+sOp.getStyle()+"<br>"; result+="SOAPOpereation-Name:"+sOp.getElementType().getLocalPart()+"<br>"; } BindingInput in =bop.getBindingInput(); List list = in.getExtensibilityElements(); Iterator itt = list.iterator(); while(itt.hasNext()){ SOAPBody sBody = (SOAPBody) itt.next(); result+="SOAP-Use:"+sBody.getUse()+"<br>"; result+="SOAP-NamespaceUri:"+sBody.getNamespaceURI()+"<br>"; } BindingOutput out = bop.getBindingOutput(); List list2 = in.getExtensibilityElements(); Iterator itt2 = list.iterator(); while(itt2.hasNext()){ SOAPBody sBody = (SOAPBody) itt2.next(); } } catch(Exception e) { logger.error(e.getMessage()); } } } if(binding.compareTo("http")==0){ Iterator it = l.iterator(); while(it.hasNext()){ BindingOperation bop = (BindingOperation)it.next(); String opNam = bop.getName(); result+="HTTP"; List bopList = bop.getExtensibilityElements(); Iterator it2 = bopList.iterator(); while(it2.hasNext()){ HTTPOperation htOp=(HTTPOperation)it2.next(); } BindingInput in =bop.getBindingInput(); List list = in.getExtensibilityElements(); Iterator itt = list.iterator(); while(itt.hasNext()){ try{ HTTPUrlEncoded htUrl = (HTTPUrlEncoded)itt.next(); }catch(Exception e){binding="mime";} } BindingOutput out = bop.getBindingOutput(); List list2 = in.getExtensibilityElements(); Iterator itt2 = list.iterator(); while(itt2.hasNext()){ try{ HTTPUrlEncoded htUrl2 = (HTTPUrlEncoded)itt2.next(); }catch(Exception e){binding="mime";} } } } } } return result; } public String serviceKomponent() { String result="SERVICEKOMPONENT||<br>"; Map services = def.getServices(); result+="<b>Size SERVICE:</b>"+services.entrySet().size(); Iterator i = services.entrySet().iterator(); QName key = null; ServiceImpl value = null; while(i.hasNext()) { Map.Entry entry = (Map.Entry) i.next(); key = (QName) entry.getKey(); value= (ServiceImpl)entry.getValue(); Map ports = value.getPorts(); if(ports.entrySet().size()>0) { result+="<b>Size</b>"+ports.entrySet().size(); Iterator i3 = ports.entrySet().iterator(); while(i3.hasNext()) { Map.Entry e = (Map.Entry) i3.next(); try { result+="<p><b>PORTSKEY<b>|"+ e.getKey().toString() +"||</p>"; } catch(Exception err) { result+="<b>ERROR KEY</b>"; } try { PortImpl port = (PortImpl) e.getValue(); result+="<p><b>PORTSVALUE<b>|" + e.getValue().getClass().toString()+"||</p>"; } catch(Exception err) { result+="<b>ERROR VALUE</b>"; } } } else { result+="<b>LIST PORTS IS EMPTY</b>"; } List list = value.getExtensibilityElements(); result+="<b>Size</b>"+list.size(); if(list.size()>0) { Iterator i2 = list.iterator(); while(i2.hasNext()) { Element e =(Element) i.next(); result+="<p><b>NODE</b>|"+e.getNodeName()+"|</p>"; } } else { result+="LIST IS EMTPY ||"; } result+="<p><b>KEY</b>|"+key.getLocalPart()+"|<b>VALUE</b>|</p>"; } return result; } public String getServiceLocation(String portType, String typ) { String result=""; Map services = def.getServices(); Iterator i = services.values().iterator(); try{ while(i.hasNext()){ Service service =(Service)i.next(); Port port= service.getPort(portType); if(port==null){ Map ports = service.getPorts(); Iterator i2 = ports.values().iterator(); while(i2.hasNext()){ Port po = (Port) i2.next(); if(po!=null){ List portEx =po.getExtensibilityElements(); Iterator it = portEx.iterator(); while(it.hasNext()){ Object o = it.next(); if(typ.compareTo("soap")==0){ SOAPAddress soap =(SOAPAddress) o; result=soap.getLocationURI(); } else if(typ.compareTo("http")==0){ HTTPAddress http =(HTTPAddress) o; result=http.getLocationURI(); } else{ result=null; } } } } }else{ List portEx =port.getExtensibilityElements(); Iterator it = portEx.iterator(); while(it.hasNext()){ Object o = it.next(); if(typ.compareTo("soap")==0){ SOAPAddress soap =(SOAPAddress) o; result=soap.getLocationURI(); } else if(typ.compareTo("http")==0){ HTTPAddress http =(HTTPAddress) o; result=http.getLocationURI(); } else{ result=null; } } } } } catch(Exception e) { logger.error(e.getMessage()); } return result; } public String getSoapAction(String bindOpName,String operation) { String action=""; Map bindings = def.getBindings(); Iterator i = bindings.values().iterator(); while(i.hasNext()){ Binding bind = (Binding) i.next(); String cmp = bind.getPortType().getQName().getLocalPart(); if(cmp.compareTo(bindOpName)==0){ List bindOps=bind.getBindingOperations(); Iterator it = bindOps.iterator(); while(it.hasNext()){ BindingOperation bop = (BindingOperation)it.next(); String opName =bop.getName(); if(opName.compareTo(operation)==0){ List bopList = bop.getExtensibilityElements(); Iterator it2 = bopList.iterator(); while(it2.hasNext()){ SOAPOperation sOp = (SOAPOperation) it2.next(); action=sOp.getSoapActionURI(); } } } } } return action; } public String generateRequest(Map params,String portType, String operation, String typ) { String result=""; String urlString=""; String location = getServiceLocation(portType, typ); HTTPOperation ht = getHTTPOperation(portType,operation); logger.info(ht.getLocationURI()); urlString= location+ht.getLocationURI(); String paramString ="?"; Iterator i =params.entrySet().iterator(); while(i.hasNext()){ Map.Entry me =(Map.Entry)i.next(); String tmp =me.getKey().toString(); String [] strarr =(String[]) me.getValue(); if(tmp.compareTo("cmd")!=0 && tmp.compareTo("itemid")!=0 && tmp.compareTo("operation")!=0 && tmp.compareTo("porttype")!=0){ paramString+=me.getKey().toString()+"="+strarr[0]+"&"; } } urlString+=paramString; logger.info(urlString); URL url=null; try { url= new URL(urlString); }catch(Exception e) { } if(url!=null) { result= sendHTTPRequest(url); } return result; } public String sendHTTPRequest(URL url) { String result =""; URLConnection urlConn; try { // URL connection channel. urlConn = url.openConnection(); // Let the run-time system (RTS) know that we want input. urlConn.setDoInput (true); // Let the RTS know that we want to do output. urlConn.setDoOutput (true); // No caching, we want the real thing. urlConn.setUseCaches (false); BufferedReader rd = new BufferedReader(new InputStreamReader(urlConn.getInputStream())); String line; while ((line = rd.readLine()) != null) { result+=line+"<br>"; } rd.close(); }catch(Exception e){logger.info("ERROR"+e.getMessage());} return result; } public String getSoapResultFromMap( Map paraMap, String portType, String operation,String typ ) { Object oResult = null; String result =""; String action =getSoapAction(portType,operation); logger.info("SOAP-ACTION:"+action); String location = getServiceLocation(portType,typ); logger.info("SOAP-LOCATION:"+location); //SOAPBinding sbind = getSOAPBinding(portType); //logger.error("SOAP-BINDING:"); URL url= null; try{ url= new URL(location );}catch(Exception e){return "URL PARSE ERROR!";} logger.info("SOAP-URL:"+url.toString()); Vector params = new Vector(); Iterator it = paraMap.entrySet().iterator(); while(it.hasNext()){ Map.Entry mapEntry= (Map.Entry)it.next(); String tmp=mapEntry.getKey().toString(); if(tmp.compareTo("cmd")!=0 && tmp.compareTo("itemid")!=0 && tmp.compareTo("operation")!=0 && tmp.compareTo("porttype")!=0){ String [] arr= (String [])mapEntry.getValue(); String value=""; for(int i = 0 ; i<arr.length;i++){ value +=arr[i]+" "; } params.addElement( new Parameter( mapEntry.getKey().toString(), value.getClass(), value, null ) ); } } // Parameters Call call = new Call(); Response resp =null; String target = getSOAPNamespaceURI(operation); logger.info("SOAP-TARGET:"+target); call.setTargetObjectURI( target ); ;// Namespace URI logger.info("SOAP-OPERATION:"+operation); call.setMethodName( operation ); // Method Name call.setEncodingStyleURI( Constants.NS_URI_SOAP_ENC ); call.setParams( params ); try{ if(url != null){ resp = call.invoke( url, action); // Location , SOAPAction oResult =resp.getFault(); if(oResult==null) oResult =resp.getReturnValue().getValue(); } }catch(SOAPException e){ logger.error("SOAPERROR:"+oResult); return "ERROR IN INVOKE OF CALL"; } if(oResult!=null){ result = parseResult(oResult,portType,operation);} return result; } public String parseResult(Object o,String portType, String operation) { String res="Not Parsed result:" +o.toString(); String typ ="string"; if(o.getClass().isArray()){ typ="base64binary"; } if(typ!=null){ if(typ.compareTo("string")==0){ res ="<div>"+ o.toString()+"<br></div>"; } else if(typ.compareTo("base64binary")==0){ try{ byte[] base64 =(byte[]) o; BufferedReader d = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(base64))); String line=""; while ((line = d.readLine()) != null){ res+=line; } }catch(Exception e){ } } else{ res="Not Parsed result:" +o.toString(); } } return res; } public String parseWSDL(Item item) { String result=""; Map portTypes= def.getPortTypes(); Iterator i = portTypes.values().iterator(); while(i.hasNext()){ PortTypeImpl port = (PortTypeImpl)i.next(); List ops = port.getOperations(); Iterator it = ops.iterator(); while(it.hasNext()){ OperationImpl op = (OperationImpl) it.next(); result+="<b>Operation: "+op.getName()+"</b><br>"; if(op.getDocumentationElement()!=null){ result+="<b>Beschreibung: "+op.getDocumentationElement().getFirstChild().getNodeValue()+"</b><br>"; } Message mIn = op.getInput().getMessage(); Map parts = mIn.getParts(); Iterator itt = parts.values().iterator(); result+="<form name=\"servicerequest\" action=\"/ITEM\" method=\"post\"><input type=\"hidden\" name=\"cmd\" value=\"servicerequest\"/><input type=\"hidden\" name=\"itemid\" value=\""+item.getId()+"\"/><table>"; int error=0; while(itt.hasNext()){ Part p = (Part) itt.next(); String type =null; QName qn =null; try{ qn = p.getTypeName(); type =qn.getLocalPart(); }catch(Exception e){ try{ qn=p.getElementName(); type = getTypebyElementName(qn); }catch(Exception e2){logger.error(e2.getMessage());}} if(type!=null){ result+="<tr><td><b>"+p.getName()+":</b></td><td> <input name=\""+p.getName()+"\" type=text size=30> Typ:"+type+"</td></tr>"; error=0; }else{ result+="<tr><td><div class=error> Type Element kann nicht geparst werden!</div></td><td></td></tr>"; error=1; } } if(error!=1){ result+="<tr><td><input type=hidden name=operation value="+op.getName()+"><input type=hidden name=porttype value="+port.getQName().getLocalPart()+"><input type=\"submit\" value=\"Submit\"/></td><td></td></tr>"; } result+="</table></form>"; } } return result; } } |
|
From: Michael K. <ko...@us...> - 2006-12-06 09:41:38
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item/db In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10626/item/db Modified Files: item_attachment.xml Log Message: Index: item_attachment.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/db/item_attachment.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- item_attachment.xml 29 Nov 2006 15:15:59 -0000 1.5 +++ item_attachment.xml 6 Dec 2006 09:41:30 -0000 1.6 @@ -4,7 +4,7 @@ <column name="attachid" type="int" primarykey="true"/> <column name="itemid" type="int" notnull="true"/> - <column name="name" type="string(100)"/> + <column name="name" type="string(200)"/> <column name="comment" type="string(200)"/> <column name="mimetype" type="string(30)"/> <column name="asize" type="int"/> |
|
From: Michael K. <ko...@us...> - 2006-12-06 09:41:38
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/cwall/meeting In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10626/cwall/meeting Modified Files: properties.txt Log Message: Index: properties.txt =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/cwall/meeting/properties.txt,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- properties.txt 11 Jul 2006 10:27:03 -0000 1.20 +++ properties.txt 6 Dec 2006 09:41:29 -0000 1.21 @@ -24,10 +24,10 @@ cwall.view.mm.layout.view.oldSearchCircle=false cwall.view.mm.layout.query.title=Meeting Mirror -cwall.view.mm.layout.query.msg.selectall=Alle Auswählen -cwall.view.mm.layout.query.msg.clear=zurücksetzen +cwall.view.mm.layout.query.msg.selectall=Alle Auswählen +cwall.view.mm.layout.query.msg.clear=zurücksetzen cwall.view.mm.layout.query.msg.submit=Suchen -cwall.view.mm.layout.query.msg.close=Schließen +cwall.view.mm.layout.query.msg.close=SchlieÃen cwall.view.mm.layout.query.msg.person=Suche nach bestimmter Person cwall.view.mm.layout.query.msg.query11=Suche durch Interessen cwall.view.mm.layout.query.msg.query12=Suche durch Stadt |
|
From: Michael K. <ko...@us...> - 2006-12-06 09:41:35
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10626/item Modified Files: ItemAccessHandler.java ItemManagerImpl.java ItemPresenter.java ItemServlet.java itemontology.xml Log Message: Index: ItemManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemManagerImpl.java,v retrieving revision 1.77 retrieving revision 1.78 diff -u -d -r1.77 -r1.78 --- ItemManagerImpl.java 29 Nov 2006 15:15:58 -0000 1.77 +++ ItemManagerImpl.java 6 Dec 2006 09:41:29 -0000 1.78 @@ -18,7 +18,9 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; +import java.io.InputStream; import java.io.IOException; +import java.net.URL; import java.sql.Timestamp; import java.util.Comparator; import java.util.Collection; @@ -50,6 +52,7 @@ import org.cobricks.core.db.DBAccess; import org.cobricks.core.db.DBAccessImpl; import org.cobricks.core.util.DateUtil; +import org.cobricks.core.util.IOUtil; import org.cobricks.core.util.LogUtil; import org.cobricks.core.util.UUID; import org.cobricks.core.CobricksException; @@ -2425,10 +2428,16 @@ } } - StringBuffer sql = new StringBuffer("select itemid "); + StringBuffer sql = new StringBuffer("select item.itemid "); if (aname != null && !aname.equals("")) sql.append(", " + aname); - sql.append(" from item where itemid > 0 "); + if (categories!=null && categories.size()>0) { + sql.append(" from item, item_attrscategory where " + +"item.itemid = item_attrscategory.itemid " + +"and item_attrscategory.aname = 'categories' "); + } else { + sql.append(" from item where itemid > 0 "); + } if (avaluelow > 0) { sql.append(" and "); sql.append(aname); @@ -2461,12 +2470,20 @@ sql.append(")"); } if (categories!=null && categories.size()>0) { - // TBD + sql.append(" and ("); + Iterator i = categories.iterator(); + while (i.hasNext()) { + sql.append("acategoryid="); + sql.append(i.next().toString()); + if (i.hasNext()) sql.append(" or "); + } + sql.append(")"); } sql.append(" order by "); sql.append(aname); if (!sortasc) sql.append(" desc"); - List itemids = dbAccess.sqlQuery(sql.toString(), maxrows); + List itemids = + dbAccess.sqlQuery(sql.toString(), maxrows); // now get item objects List result = new ArrayList(); @@ -2612,7 +2629,6 @@ Map re = (Map) result.get(0); ba = ((byte[]) re.get("content")); //wie kommt content aus der Datenbank? - } } else { String tmps = ia.getUrl(); @@ -2626,19 +2642,27 @@ new BufferedInputStream(new FileInputStream(file)); bis.read(ba); } catch (FileNotFoundException e) { - logger.info( - "File with content of ItemAttachment with ID" + logger.warn("File \"" + file.toString() + + "\" with content of ItemAttachment with ID" + ia.getId() + " does not exist."); } catch (IOException e) { - logger.info( - "IOException while reading from file with" + logger.warn("IOException while reading from file \"" + + file.toString() + "\" with" + " content of ItemAttachment with ID " + ia.getId()); } } else { // a "normal" URL - // TBD + try { + URL url = new URL(tmps); + InputStream is = url.openStream(); + ba = IOUtil.readFully(is); + } catch (IOException e) { + logger.warn("IOException while reading from URL " + + tmps + " with content of " + +"ItemAttachment with ID " + ia.getId()); + } } } return ba; @@ -2717,12 +2741,12 @@ attrs.put("comment", ia.getComment()); String tmps = null; tmps = ia.getTitle(); - if (tmps!=null && tmps.length()>24) - tmps = tmps.substring(0,24); + if (tmps!=null && tmps.length()>99) + tmps = tmps.substring(0,99); attrs.put("name", tmps); tmps = ia.getMimeType(); - if (tmps!=null && tmps.length()>19) - tmps = tmps.substring(0,19); + if (tmps!=null && tmps.length()>29) + tmps = tmps.substring(0,29); attrs.put("mimetype", tmps); int aid = dbAccess.sqlInsert("item_attachment", attrs); ia.setId(aid); @@ -2731,6 +2755,13 @@ equals("file")) { String storageDirName = properties.getProperty("item.attachments.storage.filedir"); + // storageDirName is if migration is done on a different + // computer (so the path were items are stored is not the + // same as where items will be looked for in the future + String storageDirName2 = + properties.getProperty("item.attachments.storage.filedir2"); + if (storageDirName2 != null && storageDirName2.length()<1) + storageDirName2 = null; if (!storageDirName.startsWith("/")) { String webspaceDir = properties.getProperty("portal.webspace.dir"); @@ -2751,6 +2782,11 @@ new File(storageDir, "itema" + ia.getId() + "." + postfix); String storageFname = storageFile.getPath(); + String storageFname2 = null; + if (storageDirName2 != null) { + storageFname2 = storageDirName2 + "/" + "itema" + + ia.getId() + "." + postfix; + } try { storageFname = storageFile.getCanonicalPath(); } catch (Exception e) { } @@ -2762,6 +2798,8 @@ bos.write(content); bos.close(); ia.setUrl("clocal:"+storageFname); + if (storageFname2 != null) + ia.setUrl("clocal:"+storageFname2); ia.setFilename(fname); } catch (FileNotFoundException e) { logger.info( Index: ItemAccessHandler.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemAccessHandler.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ItemAccessHandler.java 29 Nov 2006 15:15:58 -0000 1.6 +++ ItemAccessHandler.java 6 Dec 2006 09:41:29 -0000 1.7 @@ -126,7 +126,7 @@ ItemManager itemManager = (ItemManager) componentDirectory.getManager("itemManager"); - if (attrs.get("itemid")!=null) { + if (attrs!=null && attrs.get("itemid")!=null) { try { Object o = attrs.get("itemid"); Integer itemid = null; @@ -147,7 +147,7 @@ } // special handling of roleread and roleupdatae attributes - if (action.equals("read")) { + if (attrs!=null && action.equals("read")) { String tmps = (String)attrs.get("roleread"); if (tmps!=null && tmps.length()>0) { // if user does not have role that deny access @@ -160,7 +160,7 @@ } } } - if (action.equals("update")) { + if (attrs!=null && action.equals("update")) { String tmps = (String)attrs.get("roleupdate"); if (tmps!=null && tmps.length()>0) { // if user has role than grant access Index: ItemPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemPresenter.java,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- ItemPresenter.java 30 Nov 2006 14:02:00 -0000 1.57 +++ ItemPresenter.java 6 Dec 2006 09:41:30 -0000 1.58 @@ -21,6 +21,7 @@ import java.util.Calendar; import java.util.Collection; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -58,6 +59,7 @@ import org.cobricks.core.OntologyClassAttr; import org.cobricks.core.OntologyDataType; import org.cobricks.core.OntologyHelper; +import org.cobricks.core.util.DateUtil; import org.cobricks.core.util.LogUtil; import org.cobricks.item.rss.*; import org.cobricks.portal.PortalPresenter; @@ -864,6 +866,7 @@ } } else { result += ("<textarea name=\"" + aname + "\""); + result += (" id=\"" + aname + "\""); result += (" cols=\"" + cols + "\" rows=\"" + rows + "\""); if (readonly) { @@ -1107,7 +1110,8 @@ * @param itemClassName The name of the item class * @return A Set of the attribute names (as Strings) */ - public final Set getAttributeNames(final String itemClassName) { + public final Set getAttributeNames(final String itemClassName) + { final OntologyClass oc = ontology.getClass(itemClassName); if ((oc == null) && !itemClassName.equals(DEFAULT_ITEM_CLASS)) { @@ -1228,7 +1232,8 @@ * @param cols Integer defining the width of the input field * @return The html text input field as String */ - public final String printNewAttrInput(String name, String val, int cols) { + public final String printNewAttrInput(String name, String val, int cols) + { String result = "<input name=\"" + name + "\" type=\"text\" size=\"" + cols + "\""; @@ -1240,6 +1245,7 @@ return result; } + /** * This method prints out a file input field to specify a file added as * attachment to the item. @@ -1248,7 +1254,8 @@ * @param cols Integer defining the width of the input field * @return The html file input field as String */ - public final String printNewFileInput(String name, String val, int cols){ + public final String printNewFileInput(String name, String val, int cols) + { String result="<input name=\"" + name +"\" type=\"file\" size=\"" + cols + "\""; if ((val != null) && (val.length() > 0)) { @@ -1277,7 +1284,8 @@ * String if the type String has none of the values specified above. */ public final String printRadio(String submitName, String defaultVal, - String type, boolean readonly) { + String type, boolean readonly) + { String result = "<input type=\"radio\" name=\"" + submitName + "\""; if (type.equals("subdel")) { @@ -1495,8 +1503,10 @@ * category will match * @param creator Login of item creator * @param aname optional time attribute constraining the items - * @param valuelow optional low value for time attribute constraining the items - * @param valuehigh optional high value for time attribute constraining the items + * @param valuelow optional low value for time attribute constraining + * the items + * @param valuehigh optional high value for time attribute constraining + * the items * @param sortby Name of attribute to sort items by * @param maxrows Number of rows that should be returned maximally, * if empty, any items @@ -1564,7 +1574,6 @@ String sortby, int maxrows) { - try { StringBuffer xpath = new StringBuffer(); // for item @@ -1598,13 +1607,17 @@ } if (qtext!=null && qtext.length()>0) { - xpath.append(" and /item/title=\""); + if (xpath.length()>0) + xpath.append(" and "); + xpath.append("/item/title=\""); xpath.append(qtext.trim()); xpath.append("\""); } if (creator!=null && creator.length()>0) { - xpath.append(" and /item/creator/login='"); + if (xpath.length()>0) + xpath.append(" and "); + xpath.append("/item/creator/login='"); xpath.append(creator.trim()); xpath.append("'"); } @@ -1613,7 +1626,9 @@ if (valuelow!=null && valuelow.length()>0) { valuelow = valuelow.toLowerCase(); valuelow = valuelow.replaceAll("now", "TODAY"); - xpath.append(" and /item/"); + if (xpath.length()>0) + xpath.append(" and "); + xpath.append("/item/"); xpath.append(aname); xpath.append(">="); xpath.append(valuelow); @@ -1621,7 +1636,9 @@ if (valuehigh!=null && valuehigh.length()>0) { valuehigh = valuehigh.toLowerCase(); valuehigh = valuehigh.replaceAll("now", "TODAY"); - xpath.append(" and /item/"); + if (xpath.length()>0) + xpath.append(" and "); + xpath.append("/item/"); xpath.append(aname); xpath.append("<="); xpath.append(valuehigh); @@ -1632,11 +1649,6 @@ searchItems(xpath.toString(), sortby, maxrows); return itemids; - - } catch (Exception e) { - logger.error(LogUtil.ex("failed", e)); - } - return null; } @@ -1663,19 +1675,20 @@ int x = 0; do { rssItem = (RssItem) allItems.get(x); - itemOutput = (itemOutput + - "<b>Item Nr.: </b>"+" " + (x+1) + "</br>\n" + - "<b>Titel: </b>" + rssItem.getTitle() + "</br>\n" + - "<b>Content: </b>" + rssItem.getDescription() + "</br>\n" + - "<b>Link: </b>" + rssItem.getLink() + "</br>\n"); - + itemOutput = itemOutput + + "<b>Item Nr.: </b>"+" " + (x+1) + "</br>\n" + + "<b>Titel: </b>" + rssItem.getTitle() + "</br>\n" + + "<b>Content: </b>" + rssItem.getDescription() + "</br>\n" + + "<b>Link: </b>" + rssItem.getLink() + "</br>\n"; x++; } while (x < count); - String a = ("<b>Titel: </b>" + channel.getTitle() + "</br>\n <b>Link: </b>" + channel.getLink() + - "</br>\n <b>Content: </b>" + channel.getDescription() + "</br>\n" + - "<b>Anzahl Items: </b>" + count + "</br>\n <br>" + itemOutput); - + String a = "<b>Titel: </b>" + channel.getTitle() + + "</br>\n <b>Link: </b>" + channel.getLink() + + "</br>\n <b>Content: </b>" + channel.getDescription() + + "</br>\n" + "<b>Anzahl Items: </b>" + count + + "</br>\n <br>" + itemOutput; + return a; } @@ -1786,7 +1799,7 @@ if (categoryListCache==null) categoryListCache = new HashMap(); String key = lang+";"+categoryclassname; List categories = (List)categoryListCache.get(key); - if (categories==null) { + if (categories == null) { Map attrs = new HashMap(); if (categoryclassname!=null && categoryclassname.trim().length()>0) attrs.put("categoryclass", categoryclassname); @@ -1846,6 +1859,191 @@ /** + * Returns all items of a specific itemclass + * @param itemclass + */ + public final List getItemsbyClass(String itemclass) + { + List result=null; + result = itemManager.searchItems("/item[itemclass='"+itemclass+"']"); + return result; + } + + /** + * Returns all items of a specific Date and itemclass + * @param aname attribute name + * @param itemclass + * @param date the datestring + * @param maxrows max of returned items + */ + public final List getItemsbyDate(String aname, String itemclass, + String date, int maxrows) + { + List temp = new ArrayList(); + if(itemclass == null){ + temp.add(new String("diary"));} + else{ + temp.add(new String(itemclass)); + } + List result=null; + result = searchItemsByDate(aname,temp,date,maxrows); + return result; + } + + /** + * Returns all items by a attribute of type Date/DateTime of a specific + * Month and itemclass + * @param aname attribute name + * @param itemclass + * @param date the datestring + * @param maxrows max of returned items + **/ + public List getMonthItems(String aname, String itemclass, String date, + int maxrows) + { + List temp = new ArrayList(); + if(itemclass==null){ + temp.add(new String("diary"));} + else{ + temp.add(new String(itemclass)); + } + List result= null; + if(date == null){ + date = DateUtil.date2String(new Date()); + } + result = searchItemsByMonth( aname,temp,date,maxrows); + return result; + } + + /** + * Returns all items of a specific Date and itemclass + * @param aname attribute name + * @param itemclass + * @param date the datestring + * @param maxrows max of returned items + **/ + public List searchItemsNow(String itemclass, String category) + { + List result=null; + List temp = new ArrayList(); + long now = new Date().getTime(); + if(itemclass==null) { + temp.add(new String("article")); + } else { + temp.add(new String(itemclass)); + } + try { + result = itemManager. + searchItemsByTimestamp("creationtime", 0 , now, + false, true, + temp, null, + 7); + } catch (Exception e) { + logger.error(LogUtil.ex("failed", e)); + } + return result; + } + + public List searchItemsByDate(String aname, List itemclasses, + String datestring, int maxrows) + { + List results = new ArrayList(); + if(aname==null){ + aname = "creationtime";} + Calendar cal = Calendar.getInstance(); + try{ + cal.setTime(DateUtil.string2Date(datestring,"dd.MM.yyyy")); + logger.info("DATE_BEGIN:"+cal.getTime().toString()); + long begin =cal.getTimeInMillis(); + cal.set(Calendar.HOUR_OF_DAY,23); + cal.set(Calendar.MINUTE,59); + cal.set(Calendar.SECOND,59); + logger.info("DATE_END:"+cal.getTime().toString()); + long end = cal.getTimeInMillis(); + results= itemManager. + searchItemsByTimestamp(aname, begin, end, + true, true, itemclasses, null, maxrows); + } catch(Exception e) { + logger.error("PRINT VALUE ITEMS: ERROR"); + } + return results; + } + + public List getItemsWeek(String aname, String datestring,String + itemclass, int maxrows) + { + List results = new ArrayList(); + List itemclassList = new ArrayList(); + itemclassList.add(new String(itemclass)); + long begin =0; + long end =0; + try { + Calendar cal = Calendar.getInstance(); + if(datestring == null){ + //cal.set(Calendar.DAY_OF_MONTH,1); + cal.set(Calendar.HOUR,0); + begin = cal.getTimeInMillis(); + cal.set(Calendar.DAY_OF_MONTH, + cal.get(Calendar.DAY_OF_MONTH)+7); + end= cal.getTimeInMillis(); + } else { + cal.setTime(DateUtil. + string2Date(datestring,"dd.MM.yyyy")); + //cal.set(Calendar.DAY_OF_MONTH,); + begin = cal.getTimeInMillis(); + cal.set(Calendar.DAY_OF_MONTH, + cal.get(Calendar.DAY_OF_MONTH)+7); + end= cal.getTimeInMillis(); + } + } catch(Exception e) { + logger.error ("ERROR VALUE ITEMS:"+e.getMessage()); + } + try { + results= itemManager. + searchItemsByTimestamp(aname,begin,end, + true,false,itemclassList,null,maxrows); + } catch(Exception e) { + logger.error("SEARCHERROR"); + } + return results; + } + + public List searchItemsByMonth(String aname, List itemclasses, + String datestring, int maxrows) + { + List results = new ArrayList(); + long begin =0; + long end =0; + try{ + Calendar cal = Calendar.getInstance(); + if(datestring == null){ + cal.set(Calendar.DAY_OF_MONTH,1); + cal.set(Calendar.HOUR,0); + begin = cal.getTimeInMillis(); + cal.set(Calendar.MONTH,Calendar.MONTH+1); + end= cal.getTimeInMillis(); + } else { + cal.setTime(DateUtil.string2Date(datestring,"dd.MM.yyyy")); + cal.set(Calendar.DAY_OF_MONTH,1); + begin = cal.getTimeInMillis(); + cal.set(Calendar.MONTH,cal.get(Calendar.MONTH)+1); + end= cal.getTimeInMillis(); + } + } catch(Exception e) { + logger.error ("ERROR VALUE ITEMS:"+e.getMessage()); + } + try { + results= itemManager. + searchItemsByTimestamp(aname,begin,end, + true,false,itemclasses,null,maxrows); + } catch(Exception e) { + logger.error("SEARCHERROR"); + } + return results; + } + + + /** * */ public String getContentVersion(String itemid, String lang, Index: ItemServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/ItemServlet.java,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- ItemServlet.java 24 Nov 2006 08:05:56 -0000 1.46 +++ ItemServlet.java 6 Dec 2006 09:41:30 -0000 1.47 @@ -46,6 +46,7 @@ import org.cobricks.portal.PortalRequest; import org.cobricks.portal.PortalServletAdaptor; import org.cobricks.portal.PortalUser; +import org.cobricks.portal.WSDLImport; /** * @@ -89,7 +90,7 @@ public final void init(ServletConfig config) throws ServletException { - super.init(config); + super.init(config, "item"); this.addTarget("createitem", "performCreate", "Create a new item"); this.addTarget("updateitem", "performUpdate", "Update an item"); @@ -102,6 +103,8 @@ "Remove item annotation"); this.addTarget("addattachment", "performAddAttachment", "Add item attachment"); + this.addTarget("updateattachment", "performUpdateAttachment", + "Update item attachment"); this.addTarget("removeattachment", "performRemoveAttachment", "Remove item attachment"); this.addTarget("geta", "performGetAttachment", @@ -112,6 +115,12 @@ this.addTarget("updaterssimport", "performUpdateRssImport", "Update a RSS-Import"); + this.addTarget("wsdlimport","performWSDLImport", + "Import Webservices"); + this.addTarget("servicerequest","performServiceRequest", + "Webservices Request"); + + ComponentDirectory componentDirectory = coreManager.getComponentDirectory(); itemManager = @@ -336,12 +345,15 @@ // check access rights PortalUser portalUser = prequest.getPortalUser(); + Map attrs = new HashMap(); + attrs.put("itemid", itemid); /* - if (!itemManager. - checkUpdatePermission(item, portalUser.getUserId())) { - prequest.setReturnCode(2000); - return "noaccess"; - } + if (!userManager.getAccessControl(). + checkPermission(portalUser.getUserId(), "item", + "update", attrs)) { + prequest.setReturnCode(2000); + return "noaccess"; + } */ // check if there are uploaded files and store them in @@ -536,6 +548,46 @@ } /** + * + */ + public final String performUpdateAttachment(PortalRequest prequest, + PrintWriter out) + { + logger.debug("Performing update attachment."); + + // check access rights + PortalUser portalUser = prequest.getPortalUser(); + /* + if (!userManager.getAccessControl(). + checkPermission(portalUser + .getUserId(), "item", "create", null)) { + prequest.setReturnCode(2000); + return "noaccess"; + } + */ + try { + int itemid = -1; + String itemidstring = prequest.getRequestParameter("itemid"); + itemid = Integer.parseInt(itemidstring); + Item item = itemManager.getItem(itemid); + String itemaidstring = prequest.getRequestParameter("itemaid"); + int itemaid = Integer.parseInt(itemaidstring); + ItemAttachment iatt= item.getAttachment(itemaid); + String comment = iatt.getComment(); + String newcomment = prequest.getRequestParameter("comment"); + newcomment = "<p>"+newcomment+"</p>"; + iatt.setComment(comment+newcomment); + prequest.setReturnCode(1008); + return("success"); + } catch (Exception e) { + logger.error(LogUtil.ex("Failed updating attachment.", e)); + setCobricksError(null, null, prequest, "UPDATEATTACHMENT"); + } + prequest.setReturnCode(2008); + return ("error"); + } + + /** * This method removes an annotation from an item. * * @param prequest Portal request to gather the data to create a new item @@ -1057,6 +1109,104 @@ /** * */ + public final String performWSDLImport(PortalRequest prequest, + PrintWriter out) + { + logger.debug("Performing Webservice-Import"); + + // check access rights + PortalUser portalUser = prequest.getPortalUser(); + if (!userManager.getAccessControl(). + checkPermission(portalUser.getUserId(), "item", "create", null)) { + prequest.setReturnCode(2000); + return "noaccess"; + } + String result =""; + String tmps = prequest.getRequestParameter("URL"); + if (tmps.compareTo("")!=0) { + WSDLImport ws = new WSDLImport(tmps); + int msg =ws.readWSDLfromUrl(tmps); + if(msg==0) { + Map item = ws.createWSDLItemAttr(tmps); + if (item != null) { + try{ + Item i=itemManager.createItem(item); + i= ws.createWSDLItem(i,tmps); + itemManager.updateItem(i); + }catch(Exception e){return ("error");} + return ("news/news.html"); + } else { + setCobricksError(null, "", prequest, "CREATE"); + return("error"); + } + } else { + return("error"); + } + } + return("news/wsdl.html"); + } + + public final String performServiceRequest(PortalRequest prequest, + PrintWriter out) + { + logger.debug("Performing Webservice Request"); + + // check access rights + PortalUser portalUser = prequest.getPortalUser(); + if (!userManager.getAccessControl(). + checkPermission(portalUser.getUserId(), "item", "read", null)) { + prequest.setReturnCode(2000); + return "noaccess"; + } + String result =""; + String tmps = prequest.getRequestParameter("itemid"); + String operation = prequest.getRequestParameter("operation"); + String portType =prequest.getRequestParameter("porttype"); + Map parMap =prequest.getRequestParameters(); + Item item = null; + try { + int itemId = Integer.parseInt(tmps); + item = itemManager.getItem(itemId); + String wsdl = item.getAttributeAsString("wsdl"); + if(wsdl.compareTo("")!=0){ + WSDLImport ws = new WSDLImport(wsdl); + String type =ws.getBindingType(portType); + if(type.compareTo("soap")==0){ + String res=""; + try { + res = ws.getSoapResultFromMap(parMap, portType, + operation,type); + } catch(Exception e) { + res="Error could not send Request!<br>"; + } + String content = item.getContent(); + content=res+ws.parseWSDL(item); + item.setContent(content); + itemManager.updateItem(item); + } + else if (type.compareTo("http")==0) { + String res = ws. + generateRequest(parMap,portType,operation,type); + String content = item.getContent(); + content=res+ws.parseWSDL(item); + item.setContent(content); + itemManager.updateItem(item); + } + else { + return ("error"); + } + } + } catch(Exception e) { + logger.error(LogUtil.ex("failed", e)); + return ("error"); + } + return ("news/"); + } + + + /** + * + */ public void setItemManager(ItemManager im) { this.itemManager=im; Index: itemontology.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/itemontology.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- itemontology.xml 29 Nov 2006 15:15:59 -0000 1.14 +++ itemontology.xml 6 Dec 2006 09:41:30 -0000 1.15 @@ -44,6 +44,16 @@ <attr name="categories" type="category[]"> <contextclass>ContextItemCategory</contextclass> </attr> +<attr name="allow_comments" type="int"> + <default>1</default> + <value>1</value> <!-- expired --> + <value>0</value> <!-- not published --> +</attr> +<attr name="allow_attachments" type="int"> + <default>1</default> + <value>1</value> <!-- expired --> + <value>0</value> <!-- not published --> +</attr> </class> <class name="rssimport" parent="item" javaclassname="org.cobricks.item.Item"> |
|
From: Michael K. <ko...@us...> - 2006-12-06 09:41:34
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10626/portal Modified Files: PortalCache.java PortalManager.java PortalManagerImpl.java PortalPresenter.java PortalServlet.java PortalServletAdaptor.java Log Message: Index: PortalManager.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManager.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- PortalManager.java 30 Aug 2006 10:25:57 -0000 1.22 +++ PortalManager.java 6 Dec 2006 09:41:30 -0000 1.23 @@ -94,4 +94,7 @@ public void writeLogEntry(String userlogin, String msg); + public void removeObjectFromCache(String uri); + public void removeObjectFromCache(String pagePath, String pageName); + } Index: PortalManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalManagerImpl.java,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- PortalManagerImpl.java 13 Nov 2006 16:59:18 -0000 1.92 +++ PortalManagerImpl.java 6 Dec 2006 09:41:30 -0000 1.93 @@ -856,6 +856,30 @@ /** + * remove portal page or object from cache (if it is there) + */ + public void removeObjectFromCache(String pagePath, String pageName) + { + if (pagePath == null) pagePath = "/"; + if (pageName == null) return; + PortalObject p = portalCache.getObject(pagePath, pageName); + logger.error("remove object from cache: "+p); + if (p!=null) + portalCache.removeObject(p); + return; + } + + public void removeObjectFromCache(String uri) + { + if (uri == null) return; + int pos = uri.lastIndexOf("/"); + String pagePath = uri.substring(0, pos+1); + String pageName = uri.substring(pos+1); + removeObjectFromCache(pagePath, pageName); + } + + + /** * Creates a new portal folder * * @param parentPath the path of the parent object for the new portal folder Index: PortalServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalServlet.java,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- PortalServlet.java 5 Oct 2006 15:07:45 -0000 1.50 +++ PortalServlet.java 6 Dec 2006 09:41:30 -0000 1.51 @@ -105,7 +105,7 @@ public void init(ServletConfig config) throws ServletException { - super.init(config); + super.init(config, "portal"); String tmps = null; tmps = properties.getProperty("portal.authentication.skip", "false"); Index: PortalPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalPresenter.java,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- PortalPresenter.java 24 Nov 2006 08:05:57 -0000 1.53 +++ PortalPresenter.java 6 Dec 2006 09:41:30 -0000 1.54 @@ -324,12 +324,38 @@ return DateUtil.date2String(d, format); } + public String formatDate(Date d, String format, String lang) + { + if (d == null) return ""; + return DateUtil.date2String(d, format, lang); + } + public String formatDate() { return DateUtil.date2String(new Date()); } + public String formatNow(String format, String lang) + { + return DateUtil.date2String(new Date(), format, lang); + } + + + /** + * + */ + public String formatInt(int i, int length, String leading) + { + String tmps = Integer.toString(i); + if (tmps.length()==length) return tmps; + if (tmps.length()>length) return tmps; + while (tmps.length()<length) { + tmps = leading + tmps; + } + return tmps; + } + /** * Look up the volatile notifications for the given session and return * them formatted in HTML. @@ -693,7 +719,8 @@ boolean readonly) { StringBuffer result = - new StringBuffer("<input type=\"radio\" name=\"" + submitName + "\""); + new StringBuffer("<input type=\"radio\" name=\"" + + submitName + "\""); result.append(" value=\"true\""); if ((defaultVal != null) && defaultVal.equals("true")) { result.append(" checked=\"checked\""); @@ -742,7 +769,8 @@ while ((st.hasMoreTokens())&&(stext.hasMoreTokens())) { StringBuffer sresult = - new StringBuffer("<input type=\"radio\" name=\"" + submitName + "\""); + new StringBuffer("<input type=\"radio\" name=\"" + + submitName + "\""); String value = st.nextToken(); String textValue = stext.nextToken(); sresult.append(" value=\""+value+"\""); @@ -770,7 +798,8 @@ public final String printCheckbox(String submitName, String val) { StringBuffer result = - new StringBuffer("<input type=\"checkbox\" name=\"" + submitName + "\""); + new StringBuffer("<input type=\"checkbox\" name=\"" + + submitName + "\""); result.append(" value=\"1\""); if (val!=null && val.trim().length()>0) result.append(" checked=\"checked\""); @@ -1046,7 +1075,8 @@ /** * */ - public void setCookie(PortalRequest portalRequest, String name, String value) + public void setCookie(PortalRequest portalRequest, String name, + String value) { HttpServletResponse response = portalRequest.getHttpServletResponse(); Cookie cookie = new Cookie(name, value); Index: PortalCache.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalCache.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- PortalCache.java 10 Feb 2006 11:36:15 -0000 1.1 +++ PortalCache.java 6 Dec 2006 09:41:30 -0000 1.2 @@ -101,6 +101,13 @@ itemidCache.remove(new Integer(itemid)); } + public void removeObject(PortalObject p) + { + if (!active) return; + String key = p.getPagePath()+"/"+p.getPageName(); + pathCache.remove(key); + // TBD: itemidCache.remove(new Integer(itemid)); + } /** * Clear the cache @@ -112,6 +119,3 @@ } } - - - Index: PortalServletAdaptor.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/PortalServletAdaptor.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- PortalServletAdaptor.java 24 Nov 2006 08:05:57 -0000 1.24 +++ PortalServletAdaptor.java 6 Dec 2006 09:41:30 -0000 1.25 @@ -48,6 +48,8 @@ static Logger logger = Logger.getLogger(PortalServletAdaptor.class); + String componentName = null; + protected CoreManager coreManager = null; protected UserManager userManager = null; protected PortalManager portalManager = null; @@ -61,18 +63,22 @@ static boolean platformInitialized = false; // servlet targets (cmds) - protected Map targets; + protected Map targets = new HashMap(); /** * */ - public void init(ServletConfig config) + public void init(ServletConfig config, String compName) throws ServletException { super.init(config); + this.componentName = compName; logger.info("Initializing servlet"); + // initialize targets list + targets = new HashMap(); + // get configuration information from InitServlet ServletContext servletContext = config.getServletContext(); properties = (Properties) @@ -110,8 +116,6 @@ itemManager = (ItemManager) componentDirectory.getManager("itemManager"); - // initialize targets list - targets = new HashMap(); } public void destroy() @@ -214,6 +218,8 @@ PortalRequest portalRequest = new PortalRequest(request, response, portalUser, portalManager.getVelocityRootContext()); + portalRequest.setContextObject("returnComponentName", + getComponentName()); // check content type of request String contenttype = request.getContentType(); @@ -529,4 +535,11 @@ return s; } + + public String getComponentName() + { + if (componentName == null) return "core"; + return componentName; + } + } |
|
From: Michael K. <ko...@us...> - 2006-12-06 09:41:34
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/util/migration In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10626/util/migration Modified Files: ItemMigration.java Log Message: Index: ItemMigration.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/util/migration/ItemMigration.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- ItemMigration.java 30 Nov 2006 14:02:00 -0000 1.13 +++ ItemMigration.java 6 Dec 2006 09:41:30 -0000 1.14 @@ -148,6 +148,7 @@ if (newCatId == null) { logger.warn("did not find category for "+catId); } else { + if (newCatId.equals("0")) continue; Integer itmp = null; if (newCatId instanceof Integer) { itmp = (Integer)newCatId; @@ -232,23 +233,30 @@ origin = (Object)fromMap.get("origin"); published = (Object)fromMap.get("published"); - if((title_de!=null) && (((String)title_de).trim().length()>0)) { + if ((title_de!=null) && (((String)title_de).trim().length()>0)) { toMap.put("title_de",title_de); } - if((title_en!=null) && (((String)title_en).trim().length()>0)) { + if ((title_en!=null) && (((String)title_en).trim().length()>0)) { toMap.put("title_en",title_en); } - if((description_de!=null) && (((String)description_de).trim().length()>0)) { + if ((description_de!=null) && + (((String)description_de).trim().length()>0)) { toMap.put("content_de",description_de); } - if((description_en!=null) && (((String)description_en).trim().length()>0)) { + if ((description_en!=null) && + (((String)description_en).trim().length()>0)) { toMap.put("content_en",description_en); } - if(keywords_de!=null) {toMap.put("keywords_de",keywords_de); } - if(keywords_en!=null) { toMap.put("keywords_en",keywords_en); } - if(location!=null) { toMap.put("location",location); } - - if(typeid!=null) { + if (keywords_de!=null) { toMap.put("keywords_de",keywords_de); } + if (keywords_en!=null) { toMap.put("keywords_en",keywords_en); } + if (location!=null) { toMap.put("location",location); } + + if (title_de == null) + title_de = ""; + if (((String)title_de).startsWith("Pressespiegel")) { + typeid = "16"; + } + if (typeid!=null) { if (typeid.equals("1")) toMap.put("itemclass", "tummsg"); if (typeid.equals("2")) { if (startdate!=null) @@ -272,9 +280,21 @@ if (typeid.equals("11")) toMap.put("itemclass", "job"); if (typeid.equals("12")) toMap.put("itemclass", "fww"); if (typeid.equals("13")) toMap.put("itemclass", "vwm"); - if (typeid.equals("14")) toMap.put("itemclass", "item"); - if (typeid.equals("15")) toMap.put("itemclass", "item"); - if (typeid.equals("16")) toMap.put("itemclass", "item"); + if (typeid.equals("14")) { + toMap.put("itemclass", "fipro"); + toMap.put("roleread", "professor"); + toMap.put("rolewrite", "professor"); + } + if (typeid.equals("15")) { + toMap.put("itemclass", "fipra"); + toMap.put("roleread", "professor"); + toMap.put("rolewrite", "professor"); + } + if (typeid.equals("16")) { + toMap.put("itemclass", "fidoc"); + toMap.put("roleread", "professor"); + toMap.put("rolewrite", "professor"); + } } String itemclass = (String)toMap.get("itemclass"); @@ -289,30 +309,35 @@ } } - if(author!=null) { toMap.put("author",author); } - if(url!=null) { toMap.put("url",url); } - if(imageurl!=null) { toMap.put("imageurl",imageurl); } - if(publisheddate!=null) { toMap.put("creationtime",publisheddate); } - if(expirationdate!=null) { toMap.put("expirationtime",expirationdate); } - if(startdate!=null) { + if (author!=null) { toMap.put("author",author); } + if (url!=null) { toMap.put("url",url); } + if (imageurl!=null) { toMap.put("imageurl",imageurl); } + if (publisheddate!=null) { + toMap.put("creationtime",publisheddate); + } + if (expirationdate!=null) { + toMap.put("expirationtime",expirationdate); + } + if (startdate!=null) { toMap.put("starttime",startdate); if (expirationdate != null) { toMap.put("endtime", expirationdate); } } - if(lastupdated!=null) { toMap.put("updatetime",lastupdated); } - if(origin!=null) { toMap.put("origin",origin); } - if(published!=null) { toMap.put("state",published); } - if(updaterlogin!=null) { + if (lastupdated!=null) { toMap.put("updatetime",lastupdated); } + if (origin!=null) { toMap.put("origin",origin); } + if (published!=null) { toMap.put("state",published); } + if (updaterlogin!=null) { if(updaterlogin.endsWith("@localhost")) { //cuts the "@localhost" from the logins - updaterlogin = updaterlogin.substring(0,updaterlogin.indexOf("@localhost")); + updaterlogin = updaterlogin. + substring(0,updaterlogin.indexOf("@localhost")); } tmpUpdater = userManager. getUser(userManager.getUserIdForUserLogin(updaterlogin)); toMap.put("updater",tmpUpdater); } - if(publisherlogin!=null) { + if (publisherlogin!=null) { if(publisherlogin.endsWith("@localhost")) { //cuts the "@localhost" from the logins publisherlogin = publisherlogin. @@ -334,7 +359,7 @@ +itemid+" has no valid categories related."); } - if(xml != null) { + if (xml != null) { Map tmpMap = null; try { tmpMap = ItemMigration.convertXML2Map(xml); @@ -347,11 +372,17 @@ String key = (String) i.next(); String value = (String) tmpMap.get(key); if (key.equals("restrictedaccess")) { - key = "roleread"; - if (value.equals("no")) - value = ""; - else - value = "mitarbeiter"; + if (typeid.equals("14") || + typeid.equals("15") || + typeid.equals("16")) { + continue; + } else { + key = "roleread"; + if (value.equals("no")) + value = ""; + else + value = "mitarbeiter"; + } } toMap.put(key,value); } @@ -478,8 +509,6 @@ itemManager.storeItemAttachment(newAttach, data, title); - /*itemManager.addItemAttachment(tmpItem, - newAttach);*/ } } catch(Exception e) { logger.error("Failed adding Attachment to Item ",e); @@ -638,7 +667,7 @@ return date; } - private static Map convertXML2Map(String xmlStr) throws ArrayIndexOutOfBoundsException { // @todo Verbesserungsbedürftig + private static Map convertXML2Map(String xmlStr) throws ArrayIndexOutOfBoundsException { // @todo Verbesserungsbedürftig String xml = xmlStr; HashMap resultMap = new HashMap(); String propName = null; |
|
From: Michael K. <ko...@us...> - 2006-12-06 09:41:34
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/user In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10626/user Modified Files: UserPresenter.java UserServlet.java Log Message: Index: UserPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/user/UserPresenter.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- UserPresenter.java 24 Nov 2006 08:05:58 -0000 1.41 +++ UserPresenter.java 6 Dec 2006 09:41:30 -0000 1.42 @@ -12,12 +12,22 @@ package org.cobricks.user; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.StringTokenizer; import org.apache.log4j.Logger; import org.apache.velocity.VelocityContext; +import org.cobricks.category.Category; import org.cobricks.category.CategoryManager; +import org.cobricks.category.Community; import org.cobricks.core.CobricksException; import org.cobricks.core.ComponentDirectory; import org.cobricks.core.CoreManager; @@ -852,8 +862,8 @@ * @param lang * @return */ - - public List getUserPaths(int startuserid, int enduserid) { + public List getUserPaths(int startuserid, int enduserid) + { try { return this.userManager.getUserPaths(startuserid, enduserid); } catch (Exception e) { @@ -862,7 +872,57 @@ return new ArrayList(); } + + /** + * + */ + public String printUsersbyCommunities() + { + String result=""; + Map m = new HashMap(); + m.put(new String("categoryclass"),new String("community")); + List tmp = null; + tmp = categoryManager.searchCategories(m); + if(tmp != null){ + Iterator i = tmp.iterator(); + while(i.hasNext()){ + Category c = (Category) i.next(); + result+="<b>"+c.getTitle()+":</b><br>"; + int id = c.getLocalId(); + List users = getUsersbyCommunity(id); + if(users != null){ + Iterator it = users.iterator(); + while(it.hasNext()){ + User u = (User) it.next(); + result+="Name:"+u.getAttribute("name")+"<br>"; + } + } + result+="<br>"; + } + } else { + result="<p>No Community found! No grouped Users found!</p>"; + } + return result; + } + + public List getUsersbyCommunity(int id) + { + List result = null; + Community com = null; + com = new Community(id); + try{ + String classs = com.getCategoryClass(); + result = com.getMembers(id); + } catch(Exception e) { + logger.error("IN COMMUNITY-CAST:"+e.getMessage()); + } + return result; + } + + /** + * + */ public String getUserLogin(int userid) { User user = userManager.getUser(userid); Index: UserServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/user/UserServlet.java,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- UserServlet.java 24 Nov 2006 08:06:00 -0000 1.45 +++ UserServlet.java 6 Dec 2006 09:41:30 -0000 1.46 @@ -112,7 +112,7 @@ public void init(ServletConfig config) throws ServletException { - super.init(config); + super.init(config, "user"); this.addTarget("register", "performRegister", "", false); this.addTarget("registerd", "performRegisterDirect", "", false); @@ -751,6 +751,11 @@ if (!anames.contains("basic.personal.imageuri")) anames.add("basic.personal.imageuri"); avalues.put("basic.personal.imageuri", uri); + if (uri.startsWith("/")) { + // remove image from web object cache to + // allow a propper reload + portalManager.removeObjectFromCache(uri); + } } } |
|
From: Michael K. <ko...@us...> - 2006-12-06 09:41:34
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/core/util In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10626/core/util Modified Files: DateUtil.java Log Message: Index: DateUtil.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/core/util/DateUtil.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- DateUtil.java 18 Oct 2006 16:47:49 -0000 1.6 +++ DateUtil.java 6 Dec 2006 09:41:29 -0000 1.7 @@ -19,6 +19,7 @@ import java.util.Date; import java.util.Enumeration; import java.util.Hashtable; +import java.util.Locale; import java.util.StringTokenizer; import java.util.TimeZone; import java.util.Vector; @@ -49,14 +50,25 @@ public static String date2String(Date d, String format) { + return date2String(d, format, null); + } + + public static String date2String(Date d, String format, String lang) + { if (d == null) d = new Date(); + if (lang == null) lang = ""; if (dateFormatter == null) dateFormatter = new Hashtable(); - DateFormat dateformatter = (DateFormat)dateFormatter.get(format); + DateFormat dateformatter = (DateFormat) + dateFormatter.get(lang+"-"+format); if (dateformatter == null) { - dateformatter = new SimpleDateFormat(format); - dateFormatter.put(format, dateformatter); + if (lang.equals("en")) { + dateformatter = + new SimpleDateFormat(format, Locale.ENGLISH); + } else { + dateformatter = new SimpleDateFormat(format); + } + dateFormatter.put(lang+"-"+format, dateformatter); dateformatter.setTimeZone(TimeZone.getTimeZone("ECT")); - //dateformatter.setTimeZone(TimeZone.getDefault()); } return dateformatter.format(d); } |
|
From: Michael K. <ko...@us...> - 2006-12-06 09:41:34
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course/db In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10626/course/db Added Files: course_subprog.xml course_subprogrel.xml Log Message: --- NEW FILE: course_subprogrel.xml --- <tabledescriptor tablename="course_subprogrel"> <table version="1"> <tablelayout> <column name="cspid" type="int"/> <column name="cmid" type="int"/> <column name="csppos" type="varchar(20)"/> <column name="cspcomment" type="text"/> <column name="cspcomment_en" type="text"/> </tablelayout> </table> </tabledescriptor> --- NEW FILE: course_subprog.xml --- <tabledescriptor tablename="course_subprog"> <table version="1"> <tablelayout> <column name="cspid" type="int" primarykey="true"/> <column name="csplabel" type="varchar(40)"/> <column name="cpid" type="int"/> <column name="cptag" type="varchar(50)"/> <column name="cspname" type="varchar(200)"/> <column name="cspname_en" type="varchar(200)"/> <column name="cspcomment" type="varchar(250)"/> <column name="cspcomment_en" type="varchar(250)"/> </tablelayout> </table> </tabledescriptor> |
|
From: Michael K. <ko...@us...> - 2006-12-06 09:41:34
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/context In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10626/context Modified Files: ContextServlet.java Log Message: Index: ContextServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/context/ContextServlet.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ContextServlet.java 6 Oct 2006 13:03:06 -0000 1.5 +++ ContextServlet.java 6 Dec 2006 09:41:29 -0000 1.6 @@ -50,7 +50,7 @@ public void init(ServletConfig config) throws ServletException { - super.init (config); + super.init (config, "context"); this.addTarget("create", "performCreate", "", true); this.addTarget("delete", "performDelete", "", true); |
|
From: Michael K. <ko...@us...> - 2006-12-06 09:41:34
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10626/course Added Files: CourseModuleSubProgramRel.java Log Message: --- NEW FILE: CourseModuleSubProgramRel.java --- /* * Copyright (c) 2006-2007 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software * License, either version 1.0 of the License, or (at your option) any * later version (see www.cobricks.de). * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. */ package org.cobricks.course; import java.util.Map; import org.apache.log4j.Logger; /** * * @author mic...@ac... * @version $Date: 2006/12/06 09:41:29 $ */ public class CourseModuleSubProgramRel { static Logger logger = Logger.getLogger(CourseModuleSubProgramRel.class); int cspid; int cmid; String csppos; String cspcomment; String cspcomment_en; CourseModule cm; CourseSubProgram csp; /** * */ public CourseModuleSubProgramRel() { } public int getModuleId() { return cmid; } public int getSubProgramId() { return cspid; } public String getPos() { return csppos; } public String getComment() { return cspcomment; } public String getCommentEn() { return cspcomment_en; } public CourseModule getModule() { return cm; } public CourseSubProgram getSubProgram() { return csp; } /** * Load course attributes from a Map object - e.g. one retrieved * from a database */ public void loadFromMap(Map map, CourseManager courseManager) { loadFromMap(map, courseManager, null); } public void loadFromMap(Map map, CourseManager courseManager, CourseModule cm) { Integer tmpi = (Integer)map.get("cmid"); if (tmpi!=null) cmid = tmpi.intValue(); if (cm == null) { try { this.cm = courseManager.getCourseModule(cmid); } catch (Exception e) { } } else { this.cm = cm; } tmpi = (Integer)map.get("cspid"); if (tmpi!=null) cspid = tmpi.intValue(); try { csp = courseManager.getSubProgram(cspid); } catch (Exception e) { } csppos = (String)map.get("csppos"); cspcomment = (String)map.get("cspcomment"); cspcomment_en = (String)map.get("cspcomment_en"); } } |
|
From: Michael K. <ko...@us...> - 2006-12-06 09:41:32
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/category In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10626/category Modified Files: CategoryPresenter.java CategoryServlet.java Log Message: Index: CategoryPresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/category/CategoryPresenter.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- CategoryPresenter.java 24 Nov 2006 08:05:56 -0000 1.22 +++ CategoryPresenter.java 6 Dec 2006 09:41:29 -0000 1.23 @@ -213,7 +213,9 @@ if (classname.trim().length()>0) attrs.put("categoryclass", classname); - result = categoryManager.searchCategories(attrs); + List tmpResult = categoryManager.searchCategories(attrs); + result = sortCategories(tmpResult); + return result; } @@ -246,23 +248,10 @@ if (title!=null && title.trim().length()>0) attrs.put("title", title); - List tmpResult = categoryManager.getCategories(classname, parentid,title, attrs); - List tmpSort = new ArrayList(); // strings: name;id - ListIterator i = tmpResult.listIterator(); - while (i.hasNext()) { - Category c = (Category)i.next(); - String key2 = c.getTitle(lang)+";"+Integer.toString(c.getId()); - tmpSort.add(key2); - } - Collections.sort(tmpSort); - result = new ArrayList(); - i = tmpSort.listIterator(); - while (i.hasNext()) { - String tmps = (String)i.next(); - int cid = Integer. - parseInt(tmps.substring(tmps.lastIndexOf(";")+1)); - result.add(categoryManager.getCategory(cid)); - } + List tmpResult = categoryManager. + getCategories(classname, parentid,title, attrs); + result = sortCategories(tmpResult); + categoryListCache.put(key, result); return result; } @@ -988,7 +977,7 @@ result += " value=\"" + element + "\">"; if(element.equals("Guestbook") && lang.equals("de")){ - result += "Gästebuch"; + result += "Gästebuch"; }else { result += element; } @@ -1130,5 +1119,48 @@ return sb.toString(); } + public List sortCategories(Set tmpResult) + { + List tmpSort = new ArrayList(); // strings: name;id + Iterator i = tmpResult.iterator(); + while (i.hasNext()) { + Category c = (Category)i.next(); + String key2 = c.getTitle()+";"+Integer.toString(c.getId()); + tmpSort.add(key2); + } + Collections.sort(tmpSort); + List result = new ArrayList(); + i = tmpSort.listIterator(); + while (i.hasNext()) { + String tmps = (String)i.next(); + int cid = Integer. + parseInt(tmps.substring(tmps.lastIndexOf(";")+1)); + result.add(categoryManager.getCategory(cid)); + } + return result; + } + + public List sortCategories(List tmpResult) + { + List tmpSort = new ArrayList(); // strings: name;id + ListIterator i = tmpResult.listIterator(); + while (i.hasNext()) { + Category c = (Category)i.next(); + String key2 = c.getTitle()+";"+Integer.toString(c.getId()); + tmpSort.add(key2); + } + Collections.sort(tmpSort); + List result = new ArrayList(); + i = tmpSort.listIterator(); + while (i.hasNext()) { + String tmps = (String)i.next(); + int cid = Integer. + parseInt(tmps.substring(tmps.lastIndexOf(";")+1)); + result.add(categoryManager.getCategory(cid)); + } + return result; + } + + } Index: CategoryServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/category/CategoryServlet.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- CategoryServlet.java 24 Nov 2006 08:05:56 -0000 1.19 +++ CategoryServlet.java 6 Dec 2006 09:41:29 -0000 1.20 @@ -57,7 +57,7 @@ public void init(ServletConfig config) throws ServletException { - super.init(config); + super.init(config, "category"); this.addTarget("create", "performCreate", "", true); this.addTarget("delete", "performDelete", "", true); |
|
From: Michael K. <ko...@us...> - 2006-12-06 09:39:23
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course/db In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv9776/db Modified Files: course_lecturer.xml Log Message: Index: course_lecturer.xml =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/db/course_lecturer.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- course_lecturer.xml 18 Oct 2006 16:47:50 -0000 1.6 +++ course_lecturer.xml 6 Dec 2006 09:39:19 -0000 1.7 @@ -6,12 +6,16 @@ <column name="globalid" type="varchar(64)"/> <column name="ltyp" type="char(1)"/> + <column name="lgender" type="char(1)"/> + <column name="ltitlepost" type="varchar(50)"/> + <column name="ltitlepre" type="varchar(50)"/> <column name="lfirstname" type="varchar(20)"/> <column name="llastname" type="varchar(20)"/> <column name="lurl" type="varchar(200)"/> <column name="limageurl" type="varchar(200)"/> <column name="lextid" type="varchar(40)"/> <column name="lgroup" type="varchar(40)"/> + <column name="linfo" type="varchar(40)"/> <column name="lhidden" type="int"/> |
|
From: Michael K. <ko...@us...> - 2006-12-06 09:39:23
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv9776 Modified Files: CourseLecturer.java CourseManagerImpl.java CoursePresenter.java CourseProgram.java CourseServlet.java Added Files: CourseSubProgram.java Log Message: --- NEW FILE: CourseSubProgram.java --- /* * Copyright (c) 2006-2007 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software * License, either version 1.0 of the License, or (at your option) any * later version (see www.cobricks.de). * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. */ package org.cobricks.course; import java.util.*; import org.apache.log4j.Logger; /** * A Class which represents a study sub program in cobricks's course component * * @author mic...@ac... * @version $Date: 2006/12/06 09:39:18 $ */ public class CourseSubProgram extends org.cobricks.core.DataObject implements java.io.Serializable { static Logger logger = Logger.getLogger(CourseSubProgram.class); int cspid; String csplabel; int cpid; String cptag; String cspname; String cspname_en; String cspcomment; String cspcomment_en; /** * */ public CourseSubProgram() { } public int getId() { return cspid; } public int getProgramId() { return cpid; } public String getName() { return cspname; } public String getNameEn() { if (cspname!=null && cspname_en.length()>0) return cspname_en; return cspname; } public String getLabel() { return csplabel; } public String getTag() { return cptag; } public String getComment() { return cspcomment; } public String getCommentEn() { return cspcomment_en; } public void loadFromMap(Map map, CourseManager courseManager) { Integer tmpi = (Integer)map.get("cspid"); cspid = tmpi.intValue(); tmpi = (Integer)map.get("cpid"); cpid = tmpi.intValue(); csplabel = (String)map.get("csplabel"); cptag = (String)map.get("cptag"); cspname = (String)map.get("cspname"); cspname_en = (String)map.get("cspname_en"); cspcomment = (String)map.get("cspcomment"); cspcomment_en = (String)map.get("cspcomment_en"); } /** * @see org.cobricks.core.DataObject#getObjectClass() */ public String getObjectClass() { return this.getClass().toString(); } /** * @see org.cobricks.core.DataObject#getObjectUri() */ public String getObjectUri() { // TODO Auto-generated method stub return null; } } Index: CoursePresenter.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CoursePresenter.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- CoursePresenter.java 30 Nov 2006 14:01:59 -0000 1.25 +++ CoursePresenter.java 6 Dec 2006 09:39:18 -0000 1.26 @@ -243,7 +243,8 @@ { logger.debug("Search Course Modules: "+query); try { - return courseManager.searchCourseModules(parseQuery(query), sortby); + return courseManager. + searchCourseModules(parseQuery(query), sortby); } catch (Exception e) { logger.error(LogUtil.ex("Failed searching course modules.", e)); } @@ -673,5 +674,25 @@ sb.append(tmps); return sb.toString(); } + + public String formatFloat(Float f, int digits) + { + if (f == null) return ""; + String tmps = f.toString(); + try { + int pos = tmps.indexOf("."); + if (pos < 1) return tmps; + if (tmps.length() > 2+digits) { + if (digits == 0) { + tmps = tmps.substring(0, pos); + } else { + tmps = tmps.substring(0, pos+1+digits); + } + } + } catch (Exception e) { + logger.error(LogUtil.ex("failed", e)); + } + return tmps; + } } Index: CourseServlet.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseServlet.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- CourseServlet.java 30 Nov 2006 14:01:59 -0000 1.25 +++ CourseServlet.java 6 Dec 2006 09:39:18 -0000 1.26 @@ -58,7 +58,7 @@ public void init(ServletConfig config) throws ServletException { - super.init (config); + super.init(config, "course"); this.addTarget("createcourse", "performCreateCourse", "", true); this.addTarget("updatecourse", "performUpdateCourse", "", true); @@ -94,7 +94,7 @@ this.addTarget("removecoursett", "performRemoveCourseTT", "", true); ComponentDirectory componentDirectory = - coreManager.getComponentDirectory (); + coreManager.getComponentDirectory(); courseManager = (CourseManager) componentDirectory.getManager("courseManager"); if (courseManager == null) { @@ -808,8 +808,12 @@ } catch (Exception e) { } } attrs.put("ltyp", prequest.getRequestParameter("ltyp")); + attrs.put("lgender", prequest.getRequestParameter("lgender")); + attrs.put("ltitlepre", prequest.getRequestParameter("ltitlepre")); attrs.put("lfirstname", prequest.getRequestParameter("lfirstname")); attrs.put("llastname", prequest.getRequestParameter("llastname")); + attrs.put("ltitlepost", prequest.getRequestParameter("ltitlepost")); + attrs.put("linfo", prequest.getRequestParameter("linfo")); attrs.put("lurl", prequest.getRequestParameter("lurl")); attrs.put("limageurl", prequest.getRequestParameter("limageurl")); attrs.put("lgroup", prequest.getRequestParameter("lgroup")); @@ -1094,7 +1098,8 @@ attrs.put("cpname", prequest.getRequestParameter("cpname")); attrs.put("cpname_en", prequest.getRequestParameter("cpname_en")); attrs.put("cplabel", prequest.getRequestParameter("cplabel")); - attrs.put("cpcomment", prequest.getRequestParameter("cpcomment")); + attrs.put("cpcomment", prequest.getRequestParameter("cpcomment")); + attrs.put("cpcomment_en", prequest.getRequestParameter("cpcomment_en")); return attrs; } Index: CourseManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseManagerImpl.java,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- CourseManagerImpl.java 30 Nov 2006 14:01:59 -0000 1.59 +++ CourseManagerImpl.java 6 Dec 2006 09:39:18 -0000 1.60 @@ -1343,8 +1343,12 @@ // copy attributes Map sqlAttrs = new HashMap(); copyAttr("ltyp", attrs, sqlAttrs); + copyAttr("lgender", attrs, sqlAttrs); + copyAttr("ltitlepre", attrs, sqlAttrs); copyAttr("lfirstname", attrs, sqlAttrs); copyAttr("llastname", attrs, sqlAttrs); + copyAttr("ltitlepost", attrs, sqlAttrs); + copyAttr("linfo", attrs, sqlAttrs); copyAttr("lurl", attrs, sqlAttrs); copyAttr("limageurl", attrs, sqlAttrs); copyAttr("lextid", attrs, sqlAttrs); @@ -1372,8 +1376,12 @@ // copy attributes Map sqlAttrs = new HashMap(); copyAttr("ltyp", attrs, sqlAttrs); + copyAttr("lgender", attrs, sqlAttrs); + copyAttr("ltitlepre", attrs, sqlAttrs); copyAttr("lfirstname", attrs, sqlAttrs); copyAttr("llastname", attrs, sqlAttrs); + copyAttr("ltitlepost", attrs, sqlAttrs); + copyAttr("linfo", attrs, sqlAttrs); copyAttr("lurl", attrs, sqlAttrs); copyAttr("limageurl", attrs, sqlAttrs); copyAttr("lextid", attrs, sqlAttrs); @@ -1511,6 +1519,7 @@ copyAttr("cplabel", attrs, sqlAttrs); copyAttr("cpsubproglabel", attrs, sqlAttrs); copyAttr("cpcomment", attrs, sqlAttrs); + copyAttr("cpcomment_en", attrs, sqlAttrs); try { cpid = dbAccess.sqlInsert("course_prog", sqlAttrs); @@ -1535,6 +1544,7 @@ copyAttr("cplabel", attrs, sqlAttrs); copyAttr("cpsubproglabel", attrs, sqlAttrs); copyAttr("cpcomment", attrs, sqlAttrs); + copyAttr("cpcomment_en", attrs, sqlAttrs); try { dbAccess.sqlUpdate("course_prog", sqlAttrs, cpid); @@ -2195,7 +2205,8 @@ public List getCourses(String cterm, String llastname, String lfirstname, - String cplabel) { + String cplabel) + { ArrayList result = new ArrayList(); String sql = "select course.cid from course, course_lecturer, " + "course_lecturerrel, course_prog, course_progrel where " Index: CourseLecturer.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseLecturer.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- CourseLecturer.java 18 Oct 2006 16:47:50 -0000 1.9 +++ CourseLecturer.java 6 Dec 2006 09:39:18 -0000 1.10 @@ -17,19 +17,25 @@ import org.apache.log4j.Logger; /** -* A Class which represents a lecturer in cobricks's course component -* -* @author il...@sa... -* @version $Date$ + * A Class which represents a lecturer in cobricks's course component + * + * @author il...@sa... + * @author mic...@ac... + * @version $Date$ */ -public class CourseLecturer extends org.cobricks.core.DataObject implements java.io.Serializable +public class CourseLecturer extends org.cobricks.core.DataObject + implements java.io.Serializable { int lid; String ltyp; + String lgender; + String ltitlepre; String lfirstname; String llastname; + String ltitlepost; + String linfo; String lurl; String limageurl; String lgroup; @@ -73,6 +79,21 @@ return llastname; } + public String getTitlePre() + { + return ltitlepre; + } + + public String getTitlePost() + { + return ltitlepost; + } + + public String getInfo() + { + return linfo; + } + public String getUrl() { return lurl; @@ -98,6 +119,11 @@ return ltyp; } + public String getGender() + { + return lgender; + } + public int getHidden() { return lhidden; @@ -134,8 +160,12 @@ if (tmpi != null) lid = tmpi.intValue(); ltyp = (String)map.get("ltyp"); + lgender = (String)map.get("lgender"); + ltitlepre = (String)map.get("ltitlepre"); lfirstname = (String)map.get("lfirstname"); llastname = (String)map.get("llastname"); + ltitlepost = (String)map.get("ltitlepost"); + linfo = (String)map.get("linfo"); lurl = (String)map.get("lurl"); limageurl = (String)map.get("limageurl"); lextid = (String)map.get("lextid"); Index: CourseProgram.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/course/CourseProgram.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- CourseProgram.java 30 May 2006 14:32:00 -0000 1.4 +++ CourseProgram.java 6 Dec 2006 09:39:18 -0000 1.5 @@ -36,6 +36,7 @@ String cpname_en; String cplabel; String cpcomment; + String cpcomment_en; /** * Used for all xml encoding declarations @@ -76,6 +77,11 @@ return cpcomment; } + public String getCommentEn() + { + return cpcomment_en; + } + public String toXML() { StringBuffer xml = new StringBuffer(); @@ -99,6 +105,7 @@ cpname_en = (String)map.get("cpname_en"); cplabel = (String)map.get("cplabel"); cpcomment = (String)map.get("cpcomment"); + cpcomment_en = (String)map.get("cpcomment_en"); } /** |
|
From: Michael K. <ko...@us...> - 2006-11-30 14:02:14
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/util/migration In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv25691/org/cobricks/util/migration Modified Files: CourseMigration.java ItemMigration.java Log Message: Index: CourseMigration.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/util/migration/CourseMigration.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CourseMigration.java 24 Nov 2006 08:06:00 -0000 1.2 +++ CourseMigration.java 30 Nov 2006 14:02:00 -0000 1.3 @@ -94,7 +94,8 @@ List result = fromDBAccess. sqlQuery("SELECT * FROM veranstaltung, veranstklasse " +"WHERE veranstaltung.klid = veranstklasse.klid " - +"AND vajahr = 2006 AND vasem='WS'"); + +"AND ((vajahr = 2006 AND vasem='WS') OR " + +"(vajahr = 2007 AND vasem='SS'))"); Iterator resIter = result.iterator(); while(resIter.hasNext()) { Map fromMap = (Map)resIter.next(); Index: ItemMigration.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/util/migration/ItemMigration.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ItemMigration.java 24 Nov 2006 12:53:29 -0000 1.12 +++ ItemMigration.java 30 Nov 2006 14:02:00 -0000 1.13 @@ -114,7 +114,7 @@ +"itemid = "+id.toString()); toDBAccess.sqlExecute("DELETE FROM item_title where " +"itemid = "+id.toString()); - } + } logger.info(">>>>>>>>>>> Finished emptying item tables <<<<<<<<<<<"); } @@ -164,9 +164,11 @@ private void migrateItemsMainTable() { itemcnt = 0; - itemcnto = 0; + itemcnto = 0; + List result = fromDBAccess.sqlQuery("SELECT * FROM items;"); Iterator resIter = result.iterator(); + Item tmpItem = null; Object title_de; Object title_en; @@ -195,7 +197,8 @@ ItemAnnotation tmpAnnotation; Map attrs = new HashMap(); Map attachmentMap; - Map annotationMap; + Map annotationMap; + while(resIter.hasNext()) { tmpItem = null; itemcnto++; @@ -244,6 +247,7 @@ if(keywords_de!=null) {toMap.put("keywords_de",keywords_de); } if(keywords_en!=null) { toMap.put("keywords_en",keywords_en); } if(location!=null) { toMap.put("location",location); } + if(typeid!=null) { if (typeid.equals("1")) toMap.put("itemclass", "tummsg"); if (typeid.equals("2")) { @@ -272,6 +276,19 @@ if (typeid.equals("15")) toMap.put("itemclass", "item"); if (typeid.equals("16")) toMap.put("itemclass", "item"); } + + String itemclass = (String)toMap.get("itemclass"); + if (!(itemclass.equals("fww") || + itemclass.equals("odate"))) { + Date d1 = (Date)publisheddate; + if (d1 != null) { + Date now = new Date(); + if (now.getTime()-d1.getTime() > 1000L*60L*60L*24L*200L) { + continue; + } + } + } + if(author!=null) { toMap.put("author",author); } if(url!=null) { toMap.put("url",url); } if(imageurl!=null) { toMap.put("imageurl",imageurl); } |